@g1cloud/entity-modeler-next 5.0.0-alpha.11 → 5.0.0-alpha.13
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/core/propagation.d.ts +22 -0
- package/dist/editor/controller.d.ts +19 -0
- package/dist/entity-modeler-next.css +1 -1
- package/dist/entity-modeler.js +8496 -8430
- package/dist/entity-modeler.umd.cjs +15 -15
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`).trim()}const Yu=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function at(e){return e.replace(Yu,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Re(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function jl(e){return`<text ${[`x="${Re(e.x)}"`,`y="${Re(e.y)}"`,`fill="${at(e.fill)}"`,`font-size="${Re(e.fontSize)}"`,e.fontFamily?`font-family="${at(e.fontFamily)}"`:"",e.fontWeight!=null?`font-weight="${at(String(e.fontWeight))}"`:"",e.fontStyle&&e.fontStyle!=="normal"?`font-style="${at(e.fontStyle)}"`:"",e.anchor&&e.anchor!=="start"?`text-anchor="${e.anchor}"`:"",'dominant-baseline="central"'].filter(Boolean).join(" ")}>${at(e.text)}</text>`}function Wu(e){return`<line x1="${Re(e.x1)}" y1="${Re(e.y)}" x2="${Re(e.x2)}" y2="${Re(e.y)}" stroke="${at(e.stroke)}" stroke-width="${Re(e.strokeWidth??1)}" />`}function Ku(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 qu(e,t,o,i,a){return[`M${Re(e+a.tl)},${Re(t)}`,`L${Re(e+o-a.tr)},${Re(t)}`,a.tr?`Q${Re(e+o)},${Re(t)} ${Re(e+o)},${Re(t+a.tr)}`:"",`L${Re(e+o)},${Re(t+i-a.br)}`,a.br?`Q${Re(e+o)},${Re(t+i)} ${Re(e+o-a.br)},${Re(t+i)}`:"",`L${Re(e+a.bl)},${Re(t+i)}`,a.bl?`Q${Re(e)},${Re(t+i)} ${Re(e)},${Re(t+i-a.bl)}`:"",`L${Re(e)},${Re(t+a.tl)}`,a.tl?`Q${Re(e)},${Re(t)} ${Re(e+a.tl)},${Re(t)}`:"","Z"].filter(Boolean).join(" ")}function sa(e){const t=Ku(e.radius),o=t.tl||t.tr||t.br||t.bl,i=[`fill="${at(e.fill)}"`,`stroke="${at(e.stroke)}"`,`stroke-width="${Re(e.strokeWidth??1)}"`,e.strokeDasharray?`stroke-dasharray="${at(e.strokeDasharray)}"`:"",e.opacity!=null?`opacity="${Re(e.opacity)}"`:""].filter(Boolean),l=[o?`<path d="${qu(e.x,e.y,e.w,e.h,t)}" ${i.join(" ")} />`:`<rect x="${Re(e.x)}" y="${Re(e.y)}" width="${Re(e.w)}" height="${Re(e.h)}" ${i.join(" ")} />`];for(const r of e.lines??[])l.push(Wu(r));for(const r of e.texts)l.push(jl(r));for(const r of e.icons??[])l.push(r);return`<g>${l.join("")}</g>`}function Xu(e){const o=[`<path ${[`d="${at(e.d)}"`,'fill="none"',`stroke="${at(e.stroke)}"`,`stroke-width="${Re(e.strokeWidth)}"`,e.strokeDasharray?`stroke-dasharray="${at(e.strokeDasharray)}"`:""].filter(Boolean).join(" ")} />`];for(const i of e.markers??[])o.push(i);for(const i of e.labels)o.push(jl(i));return`<g>${o.join("")}</g>`}function Zl(e){const{x:t,y:o,w:i,h:a}=e.viewBox,l=[];e.background&&l.push(`<rect x="${Re(t)}" y="${Re(o)}" width="${Re(i)}" height="${Re(a)}" fill="${at(e.background)}" />`);for(const r of e.groups)l.push(sa(r));for(const r of e.edges)l.push(Xu(r));for(const r of e.entities)l.push(sa(r));for(const r of e.notes)l.push(sa(r));return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${Re(t)} ${Re(o)} ${Re(i)} ${Re(a)}" width="${Re(i)}" height="${Re(a)}">`+l.join("")+"</svg>"}const ju=["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"],Zu=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"]),Ju=ju.filter(e=>!Zu.has(e)),Qu={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function ca(e){return Qu[e]??e}const ef=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),Lo=new Set(["NUMERIC","DECIMAL"]);function Jl(e,t=Ju){const o=[...t];return e&&!o.includes(e)?[e,...o]:o}const Ot="CustomType",Yn="GroupCodeEnum",da="String",ua=[{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:"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:Yn,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:Ot,label:"CustomType"}],tf=new Map(ua.map(e=>[e.value,e.label]));function vn(e){return tf.get(e)??e}const nf=new Set([Yn,"CustomMoneyType"]),Ql=ua.filter(e=>!nf.has(e.value)).map(e=>e.value===Ot?{...e,label:"CustomType (사용자정의)"}:e);function er(e,t=[]){const o=t.map(a=>{var r,s;const l=((r=a.label)==null?void 0:r.ko)??((s=a.label)==null?void 0:s.en);return{value:a.type,label:l?`${a.type} (${l})`:a.type}}),i=[...Ql,...o];return e&&!i.some(a=>a.value===e)?[{value:e,label:vn(e)},...i]:i}function of(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function tr(e,t){var a;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!=="EXACTLY_ONE_INSTANCE")return((a=i.jpa)==null?void 0:a.collectionType)??"LIST"}function fa(e,t,o){var i;return t.attrType==="DIVIDER"||e==="LOGICAL"?"":o&&t.attrType.startsWith("EMBED")?`${o==="SET"?"Set":"List"}<${vn(t.type)}>`:of(t)?vn(t.type):e==="CLASS"?t.type===Ot&&t.customType||vn(t.type):ca(((i=t.dbAttrs[0])==null?void 0:i.dataType)??"")}function Wn(e){const t=new Map;for(const o of e)t.set(o.modelId,o);return t}function Po(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 ma=63;function zo(e){if(!e)return null;const t=e.length;return t<=ma?null:`물리명이 ${ma}자를 초과했습니다 (${t}자) — 일부 DB에서 잘릴 수 있습니다`}function nr(e){return e.dataType?e.length==null?e.dataType:e.scale==null?`${e.dataType}(${e.length})`:`${e.dataType}(${e.length},${e.scale})`:"(미지정)"}function ct(e){return!e||e.trim()===""}function Kn(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function af(e){const t=new Map;for(const u of e.associations){if(u.identifying!==!0||u.end1.entityRef===u.end2.entityRef)continue;const f=t.get(u.end1.entityRef)??[];f.push(u.end2.entityRef),t.set(u.end1.entityRef,f)}const o=0,i=1,a=2,l=new Map,r=[],s=[],c=new Set,d=u=>{l.set(u,i),r.push(u);for(const f of t.get(u)??[]){const p=l.get(f)??o;if(p===o)d(f);else if(p===i){const m=r.slice(r.indexOf(f)),h=[...m].sort().join(" ");c.has(h)||(c.add(h),s.push(m))}}r.pop(),l.set(u,a)};for(const u of e.entities)(l.get(u.modelId)??o)===o&&d(u.modelId);return s}function lf(e,t,o,i,a){var l,r,s,c,d;if(!ct(t.physicalName))return t.physicalName;if(e.attrType==="EMBED_PREDEF")return((s=(r=(l=a==null?void 0:a.embeddableCatalog)==null?void 0:l.find(u=>u.type===e.type))==null?void 0:r.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 f=(d=i.entities.find(p=>p.modelId===u))==null?void 0:d.attributes.flatMap(p=>p.dbAttrs)[o];return(f==null?void 0:f.physicalName)??""}return t.physicalName??""}function pa(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 or(e,t){var l,r,s;const o=[];for(const c of pa(e.entities,d=>d.name))o.push({ruleId:"CHK-NAME-3",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:`엔티티 이름이 중복됩니다: "${c.name}"`});for(const c of e.entities){const d=c.attributes.filter(h=>h.attrType!=="DIVIDER");if(ct(c.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"entity",targetRef:c.modelId,message:"엔티티 이름이 비어 있습니다"}),c.stereotype==="JPA_ENTITY"&&!c.abstractClass&&(d.some(h=>h.identifier)||o.push({ruleId:"CHK-JPA-1",severity:"error",targetKind:"entity",targetRef:c.modelId,message:"JPA 엔티티에 식별자(PK) 속성이 없습니다"}),ct((l=c.table)==null?void 0:l.physicalName)&&o.push({ruleId:"CHK-JPA-8",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:"JPA 엔티티에 테이블 물리명이 설정되지 않았습니다"})),c.stereotype==="JPA_EMBEDDABLE")for(const h of d.filter(b=>b.identifier))o.push({ruleId:"CHK-JPA-2",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`임베더블 타입은 식별자 속성을 가질 수 없습니다: "${h.name}"`});for(const h of d.filter(b=>b.identifier&&b.transient))o.push({ruleId:"CHK-JPA-12",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`식별자(@Id) 속성은 transient(@Transient)일 수 없습니다: "${h.name}"`});for(const h of d)if(!h.identifier)for(const b of h.dbAttrs)!b.autoIncrement&&ct(b.sequenceName)||o.push({ruleId:"CHK-JPA-13",severity:"error",targetKind:"column",targetRef:b.modelId,contextRef:c.modelId,message:`채번(${b.autoIncrement?"auto increment":`시퀀스 "${b.sequenceName}"`})은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "${h.name}"에 설정되어 있습니다`});for(const h of d.filter(b=>b.naturalId&&b.identifier))o.push({ruleId:"CHK-JPA-15",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`식별자(@Id) 속성은 자연키(@NaturalId)일 수 없습니다 — 자연키는 PK와 별개의 비즈니스 키입니다: "${h.name}"`});for(const h of d.filter(b=>b.naturalId&&b.transient))o.push({ruleId:"CHK-JPA-16",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`자연키(@NaturalId) 속성은 transient(@Transient)일 수 없습니다: "${h.name}"`});for(const h of d.filter(b=>b.naturalId&&!b.notNull&&!b.identifier&&!b.transient))o.push({ruleId:"CHK-JPA-17",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`자연키(@NaturalId) 속성은 not null이 권장됩니다(비즈니스 키는 non-null이 원칙): "${h.name}"`});!c.abstractClass&&d.length===0&&o.push({ruleId:"CHK-DSN-2",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:"속성이 하나도 없는 엔티티입니다"}),(t==null?void 0:t.largeEntityThreshold)!=null&&d.length>t.largeEntityThreshold&&o.push({ruleId:"CHK-DSN-4",severity:"info",targetKind:"entity",targetRef:c.modelId,message:`속성이 ${d.length}개로 많습니다 (임계치 ${t.largeEntityThreshold} 초과) — 분해를 검토하세요`});for(const h of pa(d,b=>b.name))o.push({ruleId:"CHK-NAME-1",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`속성 이름이 중복됩니다: "${h.name}"`});for(const h of d)ct(h.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:"속성 이름이 비어 있습니다"});const u=d.flatMap(h=>h.dbAttrs).filter(h=>h.sharedColumnRef==null),f=d.flatMap(h=>h.dbAttrs.map((b,g)=>({col:b,name:lf(h,b,g,e,t)})).filter(b=>b.col.sharedColumnRef==null));for(const h of pa(f,b=>b.name))o.push({ruleId:"CHK-NAME-2",severity:"error",targetKind:"column",targetRef:h.col.modelId,contextRef:c.modelId,message:`컬럼 물리명이 중복됩니다: "${h.name}"`});for(const h of u){const b=zo(h.physicalName);b&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:b}),t!=null&&t.reservedWords&&!ct(h.physicalName)&&t.reservedWords.has(h.physicalName.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`컬럼 물리명이 SQL 예약어입니다: "${h.physicalName}"`}),t!=null&&t.selectableDataTypes&&!ct(h.dataType)&&!t.selectableDataTypes.has(h.dataType)&&o.push({ruleId:"CHK-TYPE-1",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`타겟 DB가 지원하지 않는 컬럼 타입입니다: "${h.dataType}"`}),!ct(h.dataType)&&ef.has(h.dataType)&&!h.length&&o.push({ruleId:"CHK-TYPE-2",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`${h.dataType} 타입에 length가 지정되지 않았습니다`})}if((r=t==null?void 0:t.embeddableCatalog)!=null&&r.length){const h=Wn(d.flatMap(b=>b.dbAttrs));for(const b of d){if(b.attrType!=="EMBED_PREDEF")continue;const g=t.embeddableCatalog.find(_=>_.type===b.type);g&&b.dbAttrs.forEach((_,N)=>{if(_.sharedColumnRef==null)return;const y=g.fields[N],$=h.get(_.sharedColumnRef);if(!y||!$)return;($.dataType!==y.dataType||($.length??null)!==(y.length??null)||($.scale??null)!==(y.scale??null))&&o.push({ruleId:"CHK-TYPE-3",severity:"warning",targetKind:"column",targetRef:_.modelId,contextRef:c.modelId,message:`공유 대상 컬럼의 타입(${nr($)})이 ${y.name??"컬럼"} 정의(${nr(y)})와 다릅니다`})})}}for(const h of d){const b=h.dbAttrs[0];if(!(b!=null&&b.multiValue))continue;h.type===Yn&&b.dataType==="VARCHAR"||o.push({ruleId:"CHK-TYPE-4",severity:"warning",targetKind:"column",targetRef:b.modelId,contextRef:c.modelId,message:`다중값(Multi-Value) 속성은 GroupCodeEnum + VARCHAR 조합에서만 컨버터가 자동 생성됩니다 — 현재(${h.type||"타입 미지정"} / ${b.dataType||"dataType 미지정"})에서는 Set<…> 필드만 생성되어 매핑이 불완전할 수 있습니다`})}const p=(s=c.table)==null?void 0:s.physicalName,m=zo(p);m&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:m}),t!=null&&t.reservedWords&&!ct(p)&&t.reservedWords.has(p.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:`테이블 물리명이 SQL 예약어입니다: "${p}"`});for(const h of c.indexes??[]){const b=zo(h.name);b&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:c.modelId,message:b}),t!=null&&t.reservedWords&&!ct(h.name)&&t.reservedWords.has(h.name.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:c.modelId,message:`인덱스 이름이 SQL 예약어입니다: "${h.name}"`})}}const i=new Map;for(const c of e.entities)for(const d of c.attributes)d.attrType==="EMBED_OWN"&&d.embedded&&i.set(d.embedded.associationRef,d);for(const c of e.associations){Kn(c.end1.multiplicity)&&Kn(c.end2.multiplicity)&&o.push({ruleId:"CHK-DSN-1",severity:"info",targetKind:"association",targetRef:c.modelId,message:"both-many(M:N) 관계를 조인 엔티티 없이 직접 연결했습니다 — 연관 엔티티 도입을 검토하세요"}),i.has(c.modelId)&&c.identifying&&o.push({ruleId:"CHK-JPA-11",severity:"error",targetKind:"association",targetRef:c.modelId,message:"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 — 임베더블은 독립 식별자가 없습니다"});for(const d of["end1","end2"]){const u=c[d].jpa;if(!u)continue;const f=u.cascadeTypes??[],p=f.includes("ALL"),m=f.includes("REMOVE");p&&f.length>1&&o.push({ruleId:"CHK-JPA-5",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)`}),u.orphanRemoval&&(m||p)&&o.push({ruleId:"CHK-JPA-6",severity:"info",targetKind:"association",targetRef:c.modelId,message:`${d}: orphanRemoval이 cascade ${p?"ALL":"REMOVE"}와 의미가 겹칩니다`}),Kn(c[d].multiplicity)&&u.fetchType==="EAGER"&&o.push({ruleId:"CHK-JPA-7",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: 컬렉션(to-many) 연관에 EAGER 페치는 성능 위험이 있습니다`}),u.orphanRemoval&&Kn(c[d==="end1"?"end2":"end1"].multiplicity)&&o.push({ruleId:"CHK-JPA-14",severity:"error",targetKind:"association",targetRef:c.modelId,message:`${d}: orphanRemoval은 @ManyToOne/@ManyToMany(반대편이 컬렉션) 연관에는 적용할 수 없습니다 — @OneToOne·@OneToMany에서만 유효합니다`}),!Kn(c[d].multiplicity)&&(u.collectionType||u.collectionTable||u.orderColumn)&&o.push({ruleId:"CHK-JPA-9",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: 단일(to-one) 연관에 컬렉션 메타(collectionType/collectionTable/orderColumn)는 무의미합니다 — @ElementCollection은 컬렉션에서만 적용됩니다`}),u.collectionType==="SET"&&u.orderColumn&&o.push({ruleId:"CHK-JPA-10",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: SET 컬렉션은 순서를 보존하지 않아 orderColumn(@OrderColumn)이 무의미합니다`})}}const a=new Map(e.entities.map(c=>[c.modelId,c.name||c.modelId]));for(const c of af(e)){const d=[...c,c[0]].map(u=>a.get(u)??u).join(" → ");for(const u of c)o.push({ruleId:"CHK-JPA-4",severity:"warning",targetKind:"entity",targetRef:u,message:`식별 관계 사이클입니다 (PK 무한 의존): ${d}`})}if(t!=null&&t.flagEntitiesWithoutRelations){const c=new Set;for(const u of e.associations)c.add(u.end1.entityRef),c.add(u.end2.entityRef);const d=new Map(e.entities.map(u=>[u.name,u.modelId]));for(const u of e.entities){for(const f of u.attributes)f.embedded&&(c.add(u.modelId),c.add(f.embedded.embeddableRef));if(!ct(u.superClass)){c.add(u.modelId);const f=d.get(u.superClass);f&&c.add(f)}}for(const u of e.entities)c.has(u.modelId)||o.push({ruleId:"CHK-DSN-3",severity:"info",targetKind:"entity",targetRef:u.modelId,message:"모델링된 관계가 없습니다 (연관·상속·임베딩 미참여 — 의도적 생략이면 무시)"})}return o}function Te(){return crypto.randomUUID()}const rf="CustomMoneyType",sf="Money";function cf(e){return!(e.type!==rf||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function df(e){const t=e.dbAttrs[0]??{modelId:Te(),physicalName:"",dataType:""},o={modelId:Te(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:sf,attrType:"EMBED_PREDEF",dbAttrs:[t,o]}}function uf(e){let t=!1;const o=e.entities.map(i=>{let a=!1;const l=i.attributes.map(r=>cf(r)?(a=!0,t=!0,df(r)):r);return a?{...i,attributes:l}:i});return t?{...e,entities:o}:e}function ha(e){if(!("rev"in e))return e;const{rev:t,...o}=e;return o}function kn(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)=>kn(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(!kn(e[i],t[i]))return!1;return!0}return!1}function Jt(e,t,o){const i={},a=new Set([...Object.keys(e),...Object.keys(t)]);for(const l of a)o.has(l)||kn(e[l],t[l])||(i[l]=t[l]===void 0?null:t[l]);return Object.keys(i).length?i:null}function Qt(e,t,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(t.map(d=>[o(d),d])),l=[],r=[],s=[];for(const[d,u]of a){const f=i.get(d);f?s.push({cur:f,tgt:u}):l.push(u)}for(const[d,u]of i)a.has(d)||r.push(u);const c=(d,u)=>o(d)<o(u)?-1:o(d)>o(u)?1:0;return l.sort(c),r.sort(c),s.sort((d,u)=>c(d.tgt,u.tgt)),{added:l,removed:r,common:s}}function ff(e,t){const o=new Set(e),i=new Set(t),a=t.filter(r=>!o.has(r)).sort(),l=e.filter(r=>!i.has(r)).sort();return{added:a,removed:l}}const mf=new Set(["attributes","operations","indexes","rev"]),pf=new Set(["end1","end2","rev"]),hf=new Set(["memberEntityRefs","rev"]),ir=new Set(["modelId"]),yf=new Set(["modelId","columns"]),gf=new Set([]);function bf(e,t,o,i){const a=Qt(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=Jt(s,c,ir);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const l=Qt(t.operations??[],o.operations??[],s=>s.modelId);for(const s of l.removed)i.push({kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId});for(const s of l.added)i.push({kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of l.common){const d=Jt(s,c,ir);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const r=Qt(t.indexes??[],o.indexes??[],s=>s.modelId);for(const s of r.removed)i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId});for(const s of r.added)i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of r.common){if(!kn(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=Jt(s,c,yf);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function _f(e,t,o){const i=Qt(e.entities??[],t.entities??[],r=>r.modelId);for(const r of i.removed)o.push({kind:"entity.remove",casUnit:"logical",entityRef:r.modelId});for(const r of i.added)o.push({kind:"entity.add",casUnit:"logical",entityRef:r.modelId,value:ha(r)});for(const{cur:r,tgt:s}of i.common){const c=Jt(r,s,mf);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:r.modelId,entityRef:r.modelId,patch:c}),bf(r.modelId,r,s,o)}const a=Qt(e.associations??[],t.associations??[],r=>r.modelId);for(const r of a.removed)o.push({kind:"association.remove",casUnit:"logical",associationRef:r.modelId});for(const r of a.added)o.push({kind:"association.add",casUnit:"logical",associationRef:r.modelId,value:ha(r)});for(const{cur:r,tgt:s}of a.common){const c=Jt(r,s,pf);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:r.modelId,associationRef:r.modelId,patch:c});for(const d of["end1","end2"]){const u=Jt(r[d]??{},s[d]??{},gf);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:r.modelId,associationRef:r.modelId,end:d,patch:u})}}const l=Qt(e.groups??[],t.groups??[],r=>r.modelId);for(const r of l.removed)o.push({kind:"group.remove",casUnit:"logical",groupRef:r.modelId});for(const r of l.added)o.push({kind:"group.add",casUnit:"logical",groupRef:r.modelId,value:ha(r)});for(const{cur:r,tgt:s}of l.common){const c=Jt(r,s,hf);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,patch:c});const d=ff(r.memberEntityRefs??[],s.memberEntityRefs??[]);for(const u of d.removed)o.push({kind:"group.removeMember",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,entityRef:u});for(const u of d.added)o.push({kind:"group.addMember",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,entityRef:u})}}function Uo(e,t,o,i,a,l,r){const s=Qt(e,t,o);for(const c of s.removed)r.push({kind:a,casUnit:"layout",[l]:o(c),value:void 0});for(const c of s.added)r.push({kind:i,casUnit:"layout",[l]:o(c),value:c});for(const{cur:c,tgt:d}of s.common)kn(c,d)||(r.push({kind:a,casUnit:"layout",[l]:o(c),value:void 0}),r.push({kind:i,casUnit:"layout",[l]:o(d),value:d}))}function wf(e,t,o){Uo(e.entityLayouts??[],t.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),Uo(e.associationLayouts??[],t.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),Uo(e.groupLayouts??[],t.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),Uo(e.notes??[],t.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function vf(e,t){const o=[];return _f(e.logical,t.logical,o),wf(e.layout,t.layout,o),o}function kf(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 Ef={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 Nf{constructor(t){Fe(this,"out",[]);Fe(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({...qn(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({...qn(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({...qn(t),field:a,value:void 0,removed:!0});continue}this.out.push({...qn(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({...qn(t),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function qn(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 yt(e,t,o,i){if(o==null||typeof o!="object")return;const a=Ef[i];for(const[l,r]of Object.entries(o))a.has(l)||e.set(t,l,r)}function en(e,t,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(t,i,a)}function ya(e,t){if(Array.isArray(e))return e.find(o=>o.modelId===t)}function Lt(e,t){var l,r,s,c,d,u,f,p;const o=kf(t),i=new Nf(t.field),a=[...e].sort((m,h)=>m.seq-h.seq);for(const m of a)for(const h of m.ops)switch(o){case"entity":if(h.entityRef!==t.entityRef)break;h.kind==="entity.add"?yt(i,m,h.value,"entity"):h.kind==="entity.update"?en(i,m,h.patch):h.kind==="entity.remove"&&i.remove(m);break;case"attribute":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const b=ya((l=h.value)==null?void 0:l.attributes,t.attributeRef);b&&yt(i,m,b,"attribute")}else h.kind==="attribute.add"&&((r=h.value)==null?void 0:r.modelId)===t.attributeRef?yt(i,m,h.value,"attribute"):h.kind==="attribute.update"&&h.attributeRef===t.attributeRef?en(i,m,h.patch):(h.kind==="attribute.remove"&&h.attributeRef===t.attributeRef||h.kind==="entity.remove")&&i.remove(m);break;case"operation":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const b=ya((s=h.value)==null?void 0:s.operations,t.operationRef);b&&yt(i,m,b,"operation")}else h.kind==="operation.add"&&((c=h.value)==null?void 0:c.modelId)===t.operationRef?yt(i,m,h.value,"operation"):h.kind==="operation.update"&&h.operationRef===t.operationRef?en(i,m,h.patch):(h.kind==="operation.remove"&&h.operationRef===t.operationRef||h.kind==="entity.remove")&&i.remove(m);break;case"index":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const b=ya((d=h.value)==null?void 0:d.indexes,t.indexRef);b&&yt(i,m,b,"index")}else h.kind==="index.add"&&((u=h.value)==null?void 0:u.modelId)===t.indexRef?yt(i,m,h.value,"index"):h.kind==="index.update"&&h.indexRef===t.indexRef?en(i,m,h.patch):(h.kind==="index.remove"&&h.indexRef===t.indexRef||h.kind==="entity.remove")&&i.remove(m);break;case"association":if(h.associationRef!==t.associationRef)break;h.kind==="association.add"?yt(i,m,h.value,"association"):h.kind==="association.update"?en(i,m,h.patch):h.kind==="association.remove"&&i.remove(m);break;case"associationEnd":if(h.associationRef!==t.associationRef)break;if(h.kind==="association.add"){const b=(f=h.value)==null?void 0:f[t.end];yt(i,m,b,"associationEnd")}else h.kind==="associationEnd.update"&&h.end===t.end?en(i,m,h.patch):h.kind==="association.remove"&&i.remove(m);break;case"group":if(h.groupRef!==t.groupRef)break;if(h.kind==="group.add"){yt(i,m,h.value,"group");const b=(p=h.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(b))for(const g of b)i.member(m,g,!1)}else h.kind==="group.update"?en(i,m,h.patch):h.kind==="group.remove"?i.remove(m):h.kind==="group.addMember"&&h.entityRef!=null?i.member(m,h.entityRef,!1):h.kind==="group.removeMember"&&h.entityRef!=null&&i.member(m,h.entityRef,!0);break}return i.result()}function $f(e,t){const o=e;return o.entityRef===t||o.containerRef===t}function En(e,t){if(Array.isArray(e))for(const o of e)typeof o.modelId=="string"&&t.add(o.modelId)}function xf(e,t){const o=new Set,i=new Set,a=new Set;for(const l of e)for(const r of l.ops){const s=r;if(r.kind==="entity.add"&&s.entityRef===t){const c=s.value;En(c==null?void 0:c.attributes,o),En(c==null?void 0:c.operations,i),En(c==null?void 0:c.indexes,a);continue}s.containerRef!==t&&s.entityRef!==t||(r.kind==="attribute.add"?En([s.value],o):r.kind==="attribute.update"||r.kind==="attribute.remove"?typeof s.attributeRef=="string"&&o.add(s.attributeRef):r.kind==="operation.add"?En([s.value],i):r.kind==="operation.update"||r.kind==="operation.remove"?typeof s.operationRef=="string"&&i.add(s.operationRef):r.kind==="index.add"?En([s.value],a):(r.kind==="index.update"||r.kind==="index.remove")&&typeof s.indexRef=="string"&&a.add(s.indexRef))}return{attributes:o,operations:i,indexes:a}}function Ho(e,t){return e.map(o=>({...o,subject:t}))}function ar(e,t){const o=e.filter(s=>s.ops.some(c=>$f(c,t))),{attributes:i,operations:a,indexes:l}=xf(o,t),r=[...Ho(Lt(o,{entityRef:t}),{kind:"entity",ref:t})];for(const s of i)r.push(...Ho(Lt(o,{entityRef:t,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)r.push(...Ho(Lt(o,{entityRef:t,operationRef:s}),{kind:"operation",ref:s}));for(const s of l)r.push(...Ho(Lt(o,{entityRef:t,indexRef:s}),{kind:"index",ref:s}));return r.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 lr(e){return`${e.kind}:${e.ref}:${e.end??""}`}function If(e){var i,a,l;const t=new Set,o=(r,s)=>{typeof s=="string"&&t.add(`${r}:${s}:`)};for(const r of e)for(const s of r.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",(l=c.value)==null?void 0:l.modelId);break;case"association.add":o("association",c.associationRef);break;case"group.add":o("group",c.groupRef);break}}return t}function Sf(e){const t=new Set,o=new Set,i=new Set;for(const a of e)for(const l of a.ops){const r=l,s=l.kind;if(s.startsWith("entity."))typeof r.entityRef=="string"&&t.add(r.entityRef);else if(s.startsWith("attribute.")||s.startsWith("operation.")||s.startsWith("index.")){const c=r.containerRef??r.entityRef;typeof c=="string"&&t.add(c)}else s.startsWith("associationEnd.")||s.startsWith("association.")?typeof r.associationRef=="string"&&o.add(r.associationRef):s.startsWith("group.")&&typeof r.groupRef=="string"&&i.add(r.groupRef)}return{entities:t,associations:o,groups:i}}function Cf(e){const{entities:t,associations:o,groups:i}=Sf(e),a=[];for(const l of t)for(const r of ar(e,l))a.push({...r,subject:{...r.subject,entityRef:l}});for(const l of o){for(const r of Lt(e,{associationRef:l}))a.push({...r,subject:{kind:"association",ref:l}});for(const r of["end1","end2"])for(const s of Lt(e,{associationRef:l,end:r}))a.push({...s,subject:{kind:"associationEnd",ref:l,end:r}})}for(const l of i)for(const r of Lt(e,{groupRef:l}))a.push({...r,subject:{kind:"group",ref:l}});return a}function rr(e){const t=Cf(e),o=If(e),i=new Map;for(const r of t){const s=lr(r.subject),c=i.get(s);(c===void 0||r.seq<c)&&i.set(s,r.seq)}const a=new Map;for(const r of t){let s=a.get(r.seq);s||(s={meta:r,subjects:new Map},a.set(r.seq,s));const c=lr(r.subject);let d=s.subjects.get(c);if(!d){const u=r.removed?"remove":i.get(c)===r.seq&&o.has(c)?"add":"update";d={subject:r.subject,verb:u,fields:[]},s.subjects.set(c,d)}r.removed?d.verb="remove":d.fields.push({field:r.field,value:r.value,...r.oldValue!==void 0?{oldValue:r.oldValue}:{}})}const l=[];for(const[r,s]of a){const c=s.meta;l.push({seq:r,...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 l.sort((r,s)=>s.seq-r.seq)}class ga{constructor(t){Fe(this,"undoStack",[]);Fe(this,"redoStack",[]);Fe(this,"savePoint",null);Fe(this,"listeners",new Set);Fe(this,"commandListeners",new Set);Fe(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 sr(e,t){return e.logical.entities.findIndex(o=>o.modelId===t)}function Ke(e,t){return e.layout.entityLayouts.findIndex(o=>o.entityRef===t)}function dt(e,t){return e.layout.associationLayouts.find(o=>o.associationRef===t)}function Pe(e,t){const o=e.logical.entities.find(i=>i.modelId===t);if(!o)throw new Error(`엔티티 없음: ${t}`);return o}function xt(e,t,o){var i,a;return(a=(i=e.layout.notes.find(l=>l.modelId===t))==null?void 0:i.connections)==null?void 0:a.find(l=>l.targetRef===o)}function ba(e,t){return{label:`엔티티 추가: ${e.name}`,apply(o){o.logical.entities.push(e),o.layout.entityLayouts.push({entityRef:e.modelId,geo:t})},invert(o){const i=sr(o,e.modelId);i>=0&&o.logical.entities.splice(i,1);const a=Ke(o,e.modelId);a>=0&&o.layout.entityLayouts.splice(a,1)},emitOps(){const o={kind:"entity.add",casUnit:"logical",entityRef:e.modelId,value:e},i={kind:"entityLayout.add",casUnit:"layout",entityRef:e.modelId,value:{entityRef:e.modelId,geo:t},incidental:!0};return{forward:[o,i],invert:[{kind:"entityLayout.remove",casUnit:"layout",entityRef:e.modelId,incidental:!0},{kind:"entity.remove",casUnit:"logical",entityRef:e.modelId}]}}}}function _a(e){let t=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=sr(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const l=Ke(i,e),r=[];i.logical.associations.forEach((u,f)=>{o(u)&&r.push({item:u,index:f})});const s=new Set(r.map(u=>u.item.modelId)),c=[];i.layout.associationLayouts.forEach((u,f)=>{s.has(u.associationRef)&&c.push({item:u,index:f})});const d=[];i.logical.groups.forEach(u=>{const f=u.memberEntityRefs.indexOf(e);f>=0&&d.push({groupId:u.modelId,index:f})}),t={entity:{item:i.logical.entities[a],index:a},entityLayout:l>=0?{item:i.layout.entityLayouts[l],index:l}:void 0,assocs:r,assocLayouts:c,groupMemberships:d},[...c].sort((u,f)=>f.index-u.index).forEach(u=>i.layout.associationLayouts.splice(u.index,1)),[...r].sort((u,f)=>f.index-u.index).forEach(u=>i.logical.associations.splice(u.index,1));for(const u of d){const f=i.logical.groups.find(p=>p.modelId===u.groupId);f==null||f.memberEntityRefs.splice(u.index,1)}l>=0&&i.layout.entityLayouts.splice(l,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,l)=>a.index-l.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...t.assocLayouts].sort((a,l)=>a.index-l.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of t.groupMemberships){const l=i.logical.groups.find(r=>r.modelId===a.groupId);l==null||l.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!t)return{forward:[],invert:[]};const i=[],a=[];for(const l of t.assocs)i.push({kind:"association.remove",casUnit:"logical",associationRef:l.item.modelId}),a.push({kind:"association.add",casUnit:"logical",associationRef:l.item.modelId,value:l.item});for(const l of t.assocLayouts)i.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:l.item.associationRef,incidental:!0}),a.push({kind:"associationLayout.add",casUnit:"layout",associationRef:l.item.associationRef,value:l.item,incidental:!0});for(const l of t.groupMemberships)i.push({kind:"group.removeMember",casUnit:"logical",containerRef:l.groupId,groupRef:l.groupId,entityRef:e}),a.push({kind:"group.addMember",casUnit:"logical",containerRef:l.groupId,groupRef:l.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 cr(e,t){const o={};return{label:"엔티티 수정",apply(i){const a=Pe(i,e);for(const l of Object.keys(t))o[l]=a[l];Object.assign(a,t)},invert(i){Object.assign(Pe(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 dr(e,t){let o="";return{label:`엔티티 이름 변경: ${t}`,apply(i){const a=Pe(i,e);o=a.name,a.name=t},invert(i){Pe(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 Nn(e,t){let o=null;return{label:"엔티티 이동",apply(i){const a=Ke(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a].geo;o={...l.location},l.location={...t}},invert(i){const a=Ke(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 ur(e,t){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=Ke(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a].geo;o={...l.size},l.size={...t}},invert(i){const a=Ke(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 Xn(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 fr(e,t){let o;return{label:"엔티티 색상 변경",apply(i){const a=Ke(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.style,l.style=Xn(l.style,t)},invert(i){const a=Ke(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=Ke(i,e),l=a>=0?i.layout.entityLayouts[a].style:void 0,r=s=>({kind:"entityLayout.setStyle",casUnit:"layout",entityRef:e,value:{style:s}});return{forward:[r(l)],invert:[r(o)]}}}}function mr(e,t){let o;return{label:t?"엔티티 접기":"엔티티 펼치기",apply(i){const a=Ke(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.collapsed,l.collapsed=t},invert(i){const a=Ke(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 pr(e,t){let o;return{label:t?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=Ke(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.locked,l.locked=t},invert(i){const a=Ke(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 wa(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((l,r)=>{i.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:l.entityRef,value:{collapsed:e}}),a.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:l.entityRef,value:{collapsed:t[r]}})}),{forward:i,invert:a}}}}function Fo(e,t,o){let i;return{label:"속성 색상 변경",apply(a){const l=Ke(a,e);if(l<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=a.layout.entityLayouts[l];i=r.attributeStyles;const s={...r.attributeStyles},c=Xn(s[t],o);c?s[t]=c:delete s[t],r.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const l=Ke(a,e);l>=0&&(a.layout.entityLayouts[l].attributeStyles=i)},emitOps(a){const l=Ke(a,e),r=l>=0?a.layout.entityLayouts[l].attributeStyles:void 0,s=c=>({kind:"entityLayout.setAttrStyle",casUnit:"layout",entityRef:e,value:{attributeStyles:c}});return{forward:[s(r)],invert:[s(i)]}}}}function va(e,t){return{label:"그룹 추가",apply(o){o.logical.groups.push(e),o.layout.groupLayouts.push({groupRef:e.modelId,geo:t})},invert(o){const i=o.logical.groups.findIndex(l=>l.modelId===e.modelId);i>=0&&o.logical.groups.splice(i,1);const a=o.layout.groupLayouts.findIndex(l=>l.groupRef===e.modelId);a>=0&&o.layout.groupLayouts.splice(a,1)},emitOps(){const o={kind:"group.add",casUnit:"logical",groupRef:e.modelId,value:e},i={kind:"groupLayout.add",casUnit:"layout",groupRef:e.modelId,value:{groupRef:e.modelId,geo:t},incidental:!0};return{forward:[o,i],invert:[{kind:"groupLayout.remove",casUnit:"layout",groupRef:e.modelId,incidental:!0},{kind:"group.remove",casUnit:"logical",groupRef:e.modelId}]}}}}function hr(e,t){const o={},i=a=>{const l=a.logical.groups.find(r=>r.modelId===e);if(!l)throw new Error(`그룹 없음: ${e}`);return l};return{label:"그룹 수정",apply(a){const l=i(a);for(const r of Object.keys(t))o[r]=l[r];Object.assign(l,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 ka(e){let t=null;return{label:"그룹 해제",apply(o){const i=o.logical.groups.findIndex(l=>l.modelId===e);if(i<0)throw new Error(`그룹 없음: ${e}`);const a=o.layout.groupLayouts.findIndex(l=>l.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 yr(e,t){let o=!1;const i=a=>a.logical.groups.find(l=>l.modelId===e);return{label:"그룹에 편입",apply(a){const l=i(a);l&&!l.memberEntityRefs.includes(t)&&(l.memberEntityRefs.push(t),o=!0)},invert(a){if(!o)return;const l=i(a),r=(l==null?void 0:l.memberEntityRefs.indexOf(t))??-1;r>=0&&l.memberEntityRefs.splice(r,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 Go(e,t){let o=-1;const i=a=>a.logical.groups.find(l=>l.modelId===e);return{label:"그룹에서 제외",apply(a){const l=i(a);o=(l==null?void 0:l.memberEntityRefs.indexOf(t))??-1,o>=0&&l.memberEntityRefs.splice(o,1)},invert(a){var l;o<0||(l=i(a))==null||l.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 gr(e,t){let o=null;return{label:"그룹 이동",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.location},a.geo.location={...t}},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 br(e,t){let o=null;return{label:"그룹 크기 변경",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.size},a.geo.size={...t}},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 _r(e,t){let o;return{label:"그룹 색상 변경",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.style,a.style=Xn(a.style,t)},invert(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);a&&(a.style=o)},emitOps(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e),l=r=>({kind:"groupLayout.setStyle",casUnit:"layout",groupRef:e,value:{style:r}});return{forward:[l(a==null?void 0:a.style)],invert:[l(o)]}}}}function wr(e,t){let o;return{label:t?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=t},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 It(e,t){return{label:`속성 추가: ${t.name}`,apply(o){Pe(o,e).attributes.push(t)},invert(o){const i=Pe(o,e),a=i.attributes.findIndex(l=>l.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 tn(e,t,o){const i={},a=l=>{const r=Pe(l,e).attributes.find(s=>s.modelId===t);if(!r)throw new Error(`속성 없음: ${t}`);return r};return{label:"속성 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Pt(e,t){let o=null;return{label:"속성 삭제",apply(i){const a=Pe(i,e),l=a.attributes.findIndex(r=>r.modelId===t);if(l<0)throw new Error(`속성 없음: ${t}`);o={item:a.attributes[l],index:l},a.attributes.splice(l,1)},invert(i){o&&Pe(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 Ea(e,t,o){let i=null;return{label:"속성 재정렬",apply(a){const l=Pe(a,e);i=l.attributes.map(f=>({...f}));const r=new Set(t),s=l.attributes.filter(f=>r.has(f.modelId)),c=l.attributes.filter(f=>!r.has(f.modelId)),d=Math.max(0,Math.min(o,c.length)),u=[...c.slice(0,d),...s,...c.slice(d)];l.attributes.splice(0,l.attributes.length,...u),l.attributes.forEach((f,p)=>f.order=p)},invert(a){i&&Pe(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const l=Pe(a,e).attributes.map(r=>({...r}));return{forward:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:l}],invert:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function vr(e,t){let o=!1;return{label:`메서드 추가: ${t.name}`,apply(i){const a=Pe(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(t)},invert(i){var r;const a=Pe(i,e),l=((r=a.operations)==null?void 0:r.findIndex(s=>s.modelId===t.modelId))??-1;l>=0&&a.operations.splice(l,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 kr(e,t,o){const i={},a=l=>{var s;const r=(s=Pe(l,e).operations)==null?void 0:s.find(c=>c.modelId===t);if(!r)throw new Error(`메서드 없음: ${t}`);return r};return{label:"메서드 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Er(e,t){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=Pe(i,e),l=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===t))??-1;if(l<0)throw new Error(`메서드 없음: ${t}`);const r=a.operations.length===1;o={item:a.operations[l],index:l,wasSole:r},a.operations.splice(l,1),r&&(a.operations=void 0)},invert(i){if(!o)return;const a=Pe(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 Nr(e,t,o){let i=null;return{label:"메서드 재정렬",apply(a){const l=Pe(a,e),r=l.operations??[];i=r.map(p=>({...p}));const s=new Set(t),c=r.filter(p=>s.has(p.modelId)),d=r.filter(p=>!s.has(p.modelId)),u=Math.max(0,Math.min(o,d.length)),f=[...d.slice(0,u),...c,...d.slice(u)];r.splice(0,r.length,...f),r.forEach((p,m)=>p.order=m),l.operations=r},invert(a){if(!i)return;const l=Pe(a,e);l.operations&&l.operations.splice(0,1/0,...i)},emitOps(a){const l=(Pe(a,e).operations??[]).map(r=>({...r}));return{forward:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:l}],invert:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function $r(e,t,o){let i;return{label:"메서드 색상 변경",apply(a){const l=Ke(a,e);if(l<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=a.layout.entityLayouts[l];i=r.operationStyles;const s={...r.operationStyles},c=Xn(s[t],o);c?s[t]=c:delete s[t],r.operationStyles=Object.keys(s).length?s:void 0},invert(a){const l=Ke(a,e);l>=0&&(a.layout.entityLayouts[l].operationStyles=i)},emitOps(a){const l=Ke(a,e),r=l>=0?a.layout.entityLayouts[l].operationStyles:void 0,s=c=>({kind:"entityLayout.setOpStyle",casUnit:"layout",entityRef:e,value:{operationStyles:c}});return{forward:[s(r)],invert:[s(i)]}}}}function Na(e,t){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(t)},invert(o){const i=o.logical.associations.findIndex(l=>l.modelId===e.modelId);i>=0&&o.logical.associations.splice(i,1);const a=o.layout.associationLayouts.findIndex(l=>l.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 $a(e){let t=null;return{label:"관계 삭제",apply(o){const i=o.logical.associations.findIndex(l=>l.modelId===e);if(i<0)throw new Error(`관계 없음: ${e}`);const a=o.layout.associationLayouts.findIndex(l=>l.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 Yo(e,t){const o={},i=a=>{const l=a.logical.associations.find(r=>r.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l};return{label:"관계 수정",apply(a){const l=i(a);for(const r of Object.keys(t))o[r]=l[r];Object.assign(l,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 $n(e,t,o){const i={},a=l=>{const r=l.logical.associations.find(s=>s.modelId===e);if(!r)throw new Error(`관계 없음: ${e}`);return r[t]};return{label:"관계 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 xr(e,t){return{label:"인덱스 추가",apply(o){const i=Pe(o,e);(i.indexes??(i.indexes=[])).push(t)},invert(o){var l;const i=Pe(o,e),a=((l=i.indexes)==null?void 0:l.findIndex(r=>r.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 Ir(e,t,o){const i={},a=l=>{var s;const r=(s=Pe(l,e).indexes)==null?void 0:s.find(c=>c.modelId===t);if(!r)throw new Error(`인덱스 없음: ${t}`);return r};return{label:"인덱스 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Sr(e,t){let o=null;return{label:"인덱스 삭제",apply(i){var r;const a=Pe(i,e),l=((r=a.indexes)==null?void 0:r.findIndex(s=>s.modelId===t))??-1;if(l<0)throw new Error(`인덱스 없음: ${t}`);o={item:a.indexes[l],index:l},a.indexes.splice(l,1)},invert(i){o&&Pe(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 gt=(e,t)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:t}}),jn=(e,t)=>{var o;return((o=dt(e,t))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function Cr(e,t,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const l=dt(a,e);if(!l||!l.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);i={...l.waypoints[t]},l.waypoints.splice(t,1,{...o})},invert(a){const l=dt(a,e);l&&i&&l.waypoints.splice(t,1,i)},emitOps(a){const l=jn(a,e),r=l.map((s,c)=>c===t&&i?{...i}:s);return{forward:[gt(e,l)],invert:[gt(e,r)]}}}}function Rr(e,t){let o=null;return{label:"waypoint 제거",apply(i){const a=dt(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=dt(i,e);a&&o&&a.waypoints.splice(t,0,o)},emitOps(i){const a=jn(i,e),l=a.slice();return o&&l.splice(t,0,{...o}),{forward:[gt(e,a)],invert:[gt(e,l)]}}}}function Vr(e,t,o){let i=null;return{label:"waypoint 평행이동",apply(a){const l=dt(a,e);if(!l)throw new Error(`관계 레이아웃 없음: ${e}`);i=l.waypoints.map(r=>({...r})),l.waypoints=i.map(r=>({x:r.x+t,y:r.y+o}))},invert(a){const l=dt(a,e);l&&i&&(l.waypoints=i)},emitOps(a){return{forward:[gt(e,jn(a,e))],invert:[gt(e,i??[])]}}}}function Ar(e){let t=null;return{label:"꺾은선 풀기",apply(o){const i=dt(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);t=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=dt(o,e);i&&t&&(i.waypoints=t)},emitOps(o){return{forward:[gt(e,jn(o,e))],invert:[gt(e,t??[])]}}}}function Tr(e,t,o){return{label:"waypoint 추가",apply(i){const a=dt(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(t,0,{...o})},invert(i){const a=dt(i,e);a==null||a.waypoints.splice(t,1)},emitOps(i){const a=jn(i,e),l=a.slice();return l.splice(t,1),{forward:[gt(e,a)],invert:[gt(e,l)]}}}}function Mr(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 xa(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 Zn(e,t){let o=null;return{label:"노트 이동",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.location},a.geo.location={...t}},invert(i){const a=i.layout.notes.find(l=>l.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 Br(e,t){let o=null;return{label:"노트 크기 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.size},a.geo.size={...t}},invert(i){const a=i.layout.notes.find(l=>l.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 Dr(e,t){let o="";return{label:"노트 내용 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.memo,a.memo=t},invert(i){const a=i.layout.notes.find(l=>l.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 Or(e,t){let o;return{label:"노트 색상 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.style,a.style=Xn(a.style,t)},invert(i){const a=i.layout.notes.find(l=>l.modelId===e);a&&(a.style=o)},emitOps(i){const a=i.layout.notes.find(r=>r.modelId===e),l=r=>({kind:"note.setStyle",casUnit:"layout",noteRef:e,value:{style:r}});return{forward:[l(a==null?void 0:a.style)],invert:[l(o)]}}}}function Lr(e,t){let o=!1,i=!1;const a=l=>l.layout.groupLayouts.find(r=>r.groupRef===e);return{label:"그룹에 노트 편입",apply(l){const r=a(l);r&&(r.memberNoteRefs||(r.memberNoteRefs=[],i=!0),!r.memberNoteRefs.includes(t)&&(r.memberNoteRefs.push(t),o=!0))},invert(l){if(!o)return;const r=a(l);if(!(r!=null&&r.memberNoteRefs))return;const s=r.memberNoteRefs.indexOf(t);s>=0&&r.memberNoteRefs.splice(s,1),i&&delete r.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 Pr(e,t){let o=-1;const i=a=>a.layout.groupLayouts.find(l=>l.groupRef===e);return{label:"그룹에서 노트 제외",apply(a){var r;const l=i(a);o=((r=l==null?void 0:l.memberNoteRefs)==null?void 0:r.indexOf(t))??-1,o>=0&&l.memberNoteRefs.splice(o,1)},invert(a){if(o<0)return;const l=i(a);l&&(l.memberNoteRefs||(l.memberNoteRefs=[]),l.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 zt=(e,t,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:t,value:{waypoints:o}}),Wo=(e,t,o)=>{var i;return((i=xt(e,t,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function zr(e,t){let o=!1,i=!1;return{label:"노트 연결 추가",apply(a){const l=a.layout.notes.find(r=>r.modelId===e);if(!l)throw new Error(`노트 없음: ${e}`);if(l.connections||(l.connections=[],i=!0),l.connections.some(r=>r.targetRef===t)){o=!1;return}l.connections.push({targetRef:t,waypoints:[]}),o=!0},invert(a){if(!o)return;const l=a.layout.notes.find(s=>s.modelId===e);if(!(l!=null&&l.connections))return;const r=l.connections.findIndex(s=>s.targetRef===t);r>=0&&l.connections.splice(r,1),i&&delete l.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 Ur(e,t){let o=null;return{label:"노트 연결 삭제",apply(i){var r;const a=i.layout.notes.find(s=>s.modelId===e),l=((r=a==null?void 0:a.connections)==null?void 0:r.findIndex(s=>s.targetRef===t))??-1;if(!(a!=null&&a.connections)||l<0)throw new Error(`노트 연결 없음: ${e}→${t}`);o={item:a.connections[l],index:l},a.connections.splice(l,1)},invert(i){if(!o)return;const a=i.layout.notes.find(l=>l.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 Hr(e,t,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${t}`,apply(l){const r=xt(l,e,t);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);a={...r.waypoints[o]},r.waypoints.splice(o,1,{...i})},invert(l){const r=xt(l,e,t);r&&a&&r.waypoints.splice(o,1,a)},emitOps(l){const r=Wo(l,e,t),s=r.map((c,d)=>d===o&&a?{...a}:c);return{forward:[zt(e,t,r)],invert:[zt(e,t,s)]}}}}function Fr(e,t,o,i){return{label:"waypoint 추가",apply(a){const l=xt(a,e,t);if(!l)throw new Error(`노트 연결 없음: ${e}→${t}`);l.waypoints.splice(o,0,{...i})},invert(a){const l=xt(a,e,t);l==null||l.waypoints.splice(o,1)},emitOps(a){const l=Wo(a,e,t),r=l.slice();return r.splice(o,1),{forward:[zt(e,t,l)],invert:[zt(e,t,r)]}}}}function Gr(e,t,o){let i=null;return{label:"waypoint 제거",apply(a){const l=xt(a,e,t);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);i={...l.waypoints[o]},l.waypoints.splice(o,1)},invert(a){const l=xt(a,e,t);l&&i&&l.waypoints.splice(o,0,i)},emitOps(a){const l=Wo(a,e,t),r=l.slice();return i&&r.splice(o,0,{...i}),{forward:[zt(e,t,l)],invert:[zt(e,t,r)]}}}}function Yr(e,t){let o=null;return{label:"꺾은선 풀기",apply(i){const a=xt(i,e,t);if(!a)throw new Error(`노트 연결 없음: ${e}→${t}`);o=a.waypoints.map(l=>({...l})),a.waypoints=[]},invert(i){const a=xt(i,e,t);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[zt(e,t,Wo(i,e,t))],invert:[zt(e,t,o??[])]}}}}function ze(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(l=>{if(!l.emitOps)throw new Error(`emitOps 미구현 command가 composite에 포함됨: ${l.label}`);return l.emitOps(i)});return{forward:a.flatMap(l=>l.forward),invert:a.slice().reverse().flatMap(l=>l.invert)}}}}const Rf=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Na,addAttribute:It,addEntity:ba,addEntityToGroup:yr,addGroup:va,addIndex:xr,addNote:Mr,addNoteConnection:zr,addNoteConnectionWaypoint:Fr,addNoteToGroup:Lr,addOperation:vr,addWaypoint:Tr,clearNoteConnectionWaypoints:Yr,clearWaypoints:Ar,composite:ze,moveEntity:Nn,moveGroup:gr,moveNote:Zn,moveNoteConnectionWaypoint:Hr,moveWaypoint:Cr,removeAssociation:$a,removeAttribute:Pt,removeEntity:_a,removeEntityFromGroup:Go,removeGroup:ka,removeIndex:Sr,removeNote:xa,removeNoteConnection:Ur,removeNoteConnectionWaypoint:Gr,removeNoteFromGroup:Pr,removeOperation:Er,removeWaypoint:Rr,renameEntity:dr,reorderAttributes:Ea,reorderOperations:Nr,resizeEntity:ur,resizeGroup:br,resizeNote:Br,setAllEntitiesCollapsed:wa,setAttributeSwatch:Fo,setEntityCollapsed:mr,setEntityLocked:pr,setEntitySwatch:fr,setGroupLocked:wr,setGroupSwatch:_r,setNoteMemo:Dr,setNoteSwatch:Or,setOperationSwatch:$r,translateWaypoints:Vr,updateAssociation:Yo,updateAssociationEnd:$n,updateAttribute:tn,updateEntity:cr,updateGroup:hr,updateIndex:Ir,updateOperation:kr},Symbol.toStringTag,{value:"Module"}));class Wr{constructor(){Fe(this,"revs",new Map);Fe(this,"layoutVersion",0);Fe(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 Kr{constructor(t){Fe(this,"cache",new Wr);Fe(this,"newClientOpId");Fe(this,"debounceMs");Fe(this,"emissions",new WeakMap);Fe(this,"open",null);Fe(this,"debounceHandle",null);Fe(this,"queue",[]);Fe(this,"sending",!1);Fe(this,"_frozen",!1);Fe(this,"stack",null);Fe(this,"settledWaiters",[]);this.opts=t,this.newClientOpId=t.newClientOpId??Te,this.debounceMs=t.debounceMs??300}seed(t){this.cache.seed(t)}attach(t){this.stack=t;const o=t.onCommand((i,a,l)=>this.handle(i,a,l));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 r;if(this._frozen)return;let a;if(o==="do"){const s=(r=t.emitOps)==null?void 0:r.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 l=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===t.coalesceKey){this.open.fwd=l,this.emissions.set(t,{forward:l,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:l,inv:a.invert},this.startDebounce();return}l.length&&this.enqueue(this.buildBatch(l))}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,l=!1;for(const r of t)if(r.casUnit==="logical")if(a=!0,r.containerRef)i.add(r.containerRef);else{const s=r.entityRef??r.associationRef??r.groupRef;s&&(r.kind.endsWith(".add")?this.cache.setRev(s,0):r.kind.endsWith(".remove")&&this.cache.deleteRev(s))}else r.incidental||(l=!0);if(i.size){o.revs={};for(const r of i){const s=this.cache.rev(r);o.revs[r]=s,this.cache.setRev(r,s+1)}}return l&&(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(l){this.sending=!1,console.error("[op-sync] op 전송 실패 → 하드 프리즈(kind:missing):",l),(a=(i=this.opts).onError)==null||a.call(i,l),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 qr=["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"],Xr=()=>crypto.randomUUID(),Vf=e=>e.add.length===0&&e.update.length===0&&e.remove.length===0,Af=e=>e&&e[0].toLowerCase()+e.slice(1),Tf=e=>e&&e[0].toUpperCase()+e.slice(1),Mf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase();function Bf(e,t){return Af(e)+Tf(t)}function Df(e,t){const o=e.entities.find(r=>r.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(r=>r.identifier&&(r.attrType==="NORMAL"||r.attrType==="RELATION_OWN")).sort((r,s)=>r.order-s.order).map(r=>{const s=Bf(o.name,r.name);return{associationRef:t.modelId,sourceAttributeRef:r.modelId,name:s,type:r.type,identifier:a,notNull:a,dbAttrs:r.dbAttrs.map(c=>({physicalName:Mf(s),logicalName:c.logicalName,dataType:c.dataType,length:c.length,scale:c.scale}))}})}const Ko=(e,t)=>`${e}::${t}`,qo=e=>e??void 0;function Of(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((l,r)=>{const s=e.dbAttrs[r];return!s||s.dataType!==l.dataType||qo(s.length)!==qo(l.length)||qo(s.scale)!==qo(l.scale)}))&&(i.dbAttrs=t.dbAttrs.map((l,r)=>{const s=e.dbAttrs[r];return{modelId:(s==null?void 0:s.modelId)??o(),physicalName:(s==null?void 0:s.physicalName)??l.physicalName,logicalName:(s==null?void 0:s.logicalName)??l.logicalName,dataType:l.dataType,length:l.length,scale:l.scale}})),Object.keys(i).length?i:null}function Lf(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 Jn(e,t,o=Xr){const i={add:[],update:[],remove:[]},a=e.entities.find(f=>f.modelId===t);if(!a)return i;const l=e.associations.filter(f=>f.end2.entityRef===t),r=a.stereotype==="JPA_EMBEDDABLE"?[]:l.flatMap(f=>Df(e,f)),s=new Map(r.map(f=>[Ko(f.associationRef,f.sourceAttributeRef),f])),c=a.attributes.filter(f=>f.derivedFrom),d=new Map(c.map(f=>[Ko(f.derivedFrom.associationRef,f.derivedFrom.sourceAttributeRef),f]));for(const f of c){const p=Ko(f.derivedFrom.associationRef,f.derivedFrom.sourceAttributeRef);s.has(p)||i.remove.push(f.modelId)}let u=a.attributes.reduce((f,p)=>Math.max(f,p.order),-1)+1;for(const f of r){const p=Ko(f.associationRef,f.sourceAttributeRef),m=d.get(p);if(!m)i.add.push(Lf(f,u++,o));else{const h=Of(m,f,o);h&&i.update.push({attributeId:m.modelId,patch:h})}}return i}function Pf(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 zf(e){return{...e,entities:e.entities.map(t=>({...t,attributes:t.attributes.map(o=>({...o}))}))}}function Uf(e,t,o=Xr){const i=new Map,a=zf(e),l=new Set,r=[t];for(;r.length;){const s=r.shift();if(l.has(s))continue;l.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=Jn(a,d,o);if(Vf(u))continue;i.has(d)||i.set(d,u);const f=a.entities.find(p=>p.modelId===d);f&&Pf(f,u),l.has(d)||r.push(d)}}return i}function Hf(e,t){const o=()=>e.entities.filter(l=>{var r;return((r=l.table)==null?void 0:r.physicalName)===t.ref}),i=()=>e.entities.filter(l=>l.name===t.ref);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function Ff(e,t){const o=()=>e.attributes.filter(l=>l.name===t.ref),i=()=>e.attributes.filter(l=>l.dbAttrs.some(r=>r.physicalName===t.ref));if(t.by==="name")return o();if(t.by==="physicalName")return i();const a=o();return a.length?a:i()}function jr(e,t,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(t)&&a.includes(o)})}function tt(e,t){const o=Hf(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 Gf(e,t){const o=Ff(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 Yf(e,t){const o=()=>e.attributes.flatMap(l=>l.dbAttrs).filter(l=>l.physicalName===t.ref),i=()=>e.attributes.filter(l=>l.name===t.ref).flatMap(l=>l.dbAttrs);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function Zr(e,t){const o=Yf(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 Wf(e,t){return(e.indexes??[]).filter(o=>o.name===t.ref)}function Kf(e,t){return(e.operations??[]).filter(o=>o.name===t.ref)}function qf(e,t){const o=Wf(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 Xf(e,t){const o=Kf(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 Jr(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 Qr(e,t,o,i,a,l,r,s){const c=s(),d=new Map((e.embeddableOverrides??[]).map(p=>[p.field,p])),u=[];let f=!1;for(const p of t.fields){const m=d.get(p.name);if(m!=null&&m.sharedColumnPhysicalName){const h={ref:m.sharedColumnPhysicalName,by:"physicalName"},b=Zr(i,h);if(!b.ok){r.push(b.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:a,entity:l,handle:h}:{code:"shared-column-target-ambiguous",opIndex:a,entity:l,handle:h,matches:b.matches}),f=!0;continue}u.push({modelId:s(),physicalName:"",dataType:"",sharedColumnRef:b.value.modelId});continue}u.push({modelId:s(),physicalName:(m==null?void 0:m.physicalName)??"",dataType:"",...m!=null&&m.length?{length:m.length}:{},...m!=null&&m.scale?{scale:m.scale}:{},...(m==null?void 0:m.insertable)!=null?{insertable:m.insertable}:{},...(m==null?void 0:m.updatable)!=null?{updatable:m.updatable}:{}})}return f?null:{modelId:c,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:u}}function es(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 ts(e,t,o,i,a,l){const r=[];let s=!1;for(const c of t.columns){const d=Zr(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}r.push({columnRef:d.value.modelId,descending:c.descending??!1})}return s?null:{modelId:l(),name:t.name,unique:t.unique??!1,columns:r,...t.description?{description:t.description}:{},...t.parameters?{parameters:t.parameters}:{}}}function jf(e,t,o={}){const i=o.mkId??Te,a=o.embeddableCatalog??[],l=f=>a.find(p=>p.type===f),r=[],s=[],c=new Map,d=new Map,u=new Set;for(const f of t)f.kind==="entity.add"&&(u.add(f.spec.name),f.spec.physicalName&&u.add(f.spec.physicalName));return t.forEach((f,p)=>{var m,h,b;switch(f.kind){case"entity.add":{const g=i(),_={modelId:g,name:f.spec.name,stereotype:f.spec.stereotype??"JPA_ENTITY",attributes:[],...f.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...f.spec.physicalName?{table:{physicalName:f.spec.physicalName}}:{}},N={ref:f.spec.name};let y=!1;for(const[F,q]of(f.spec.attributes??[]).entries()){if(q.type==="GroupCodeEnum"&&!q.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:N,handle:{ref:q.name}}),y=!0;continue}const G=l(q.type);if(G){const X=Qr(q,G,F,_,p,N,s,i);X?_.attributes.push(X):y=!0}else(m=q.embeddableOverrides)!=null&&m.length?(s.push({code:"embeddable-type-unresolved",opIndex:p,entity:N,handle:{ref:q.name}}),y=!0):_.attributes.push(Jr(q,F,i))}const $=(f.spec.operations??[]).map((F,q)=>es(F,q,i));$.length&&(_.operations=$);const K=[];for(const F of f.spec.indexes??[]){const q=ts(_,F,p,N,s,i);q?K.push(q):y=!0}if(K.length&&(_.indexes=K),y)break;r.push({kind:"entity.add",casUnit:"logical",entityRef:g,value:_});break}case"entity.update":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}r.push({kind:"entity.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,patch:f.patch});break}case"entity.remove":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}r.push({kind:"entity.remove",casUnit:"logical",entityRef:g.value.modelId});break}case"attribute.add":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}if(f.spec.type==="GroupCodeEnum"&&!f.spec.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:f.entity,handle:{ref:f.spec.name}});break}const _=c.get(g.value.modelId)??g.value.attributes.length;c.set(g.value.modelId,_+1);const N=l(f.spec.type);let y;if(N)y=Qr(f.spec,N,_,g.value,p,f.entity,s,i);else if((h=f.spec.embeddableOverrides)!=null&&h.length){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:f.entity,handle:{ref:f.spec.name}});break}else y=Jr(f.spec,_,i);if(!y)break;r.push({kind:"attribute.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,value:y});break}case"attribute.update":case"attribute.remove":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}const _=Gf(g.value,f.attribute);if(!_.ok){s.push(_.reason==="not-found"?{code:"attribute-not-found",opIndex:p,entity:f.entity,handle:f.attribute}:{code:"attribute-ambiguous",opIndex:p,entity:f.entity,handle:f.attribute,matches:_.matches});break}f.kind==="attribute.update"?r.push({kind:"attribute.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:_.value.modelId,patch:f.patch}):r.push({kind:"attribute.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:_.value.modelId});break}case"association.add":{const g=tt(e,f.spec.from),_=tt(e,f.spec.to);if(g.ok||s.push(nt(g.reason,p,f.spec.from,g.matches,u)),_.ok||s.push(nt(_.reason,p,f.spec.to,_.matches,u)),!g.ok||!_.ok)break;if(f.spec.identifying&&g.value.modelId===_.value.modelId){s.push({code:"self-identifying",opIndex:p,handle:{from:f.spec.from,to:f.spec.to}});break}const N=i(),y={modelId:N,...f.spec.identifying!=null?{identifying:f.spec.identifying}:{},end1:{entityRef:g.value.modelId,multiplicity:f.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1},end2:{entityRef:_.value.modelId,multiplicity:f.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:f.spec.composition??!1}},$={...e,associations:[...e.associations,y]},K=Jn($,_.value.modelId,i);K.add[0]&&(y.end2.attributeRef=K.add[0].modelId),r.push({kind:"association.add",casUnit:"logical",associationRef:N,value:y});for(const F of K.add)r.push({kind:"attribute.add",casUnit:"logical",containerRef:_.value.modelId,entityRef:_.value.modelId,value:F});break}case"association.remove":{const g=tt(e,f.association.from),_=tt(e,f.association.to);if(g.ok||s.push(nt(g.reason,p,f.association.from,g.matches,u)),_.ok||s.push(nt(_.reason,p,f.association.to,_.matches,u)),!g.ok||!_.ok)break;const N=jr(e,g.value.modelId,_.value.modelId);if(N.length!==1){s.push(N.length===0?{code:"association-not-found",opIndex:p,handle:f.association}:{code:"association-ambiguous",opIndex:p,handle:f.association,matches:N.map(y=>y.modelId)});break}r.push({kind:"association.remove",casUnit:"logical",associationRef:N[0].modelId});break}case"association.update":{const g=ns(e,f.association,p,s,u);if(!g)break;r.push({kind:"association.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,patch:f.patch});break}case"associationEnd.update":{const g=ns(e,f.association,p,s,u);if(!g)break;const _=f.end==="from"?"end1":"end2";r.push({kind:"associationEnd.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,end:_,patch:f.patch});break}case"index.add":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}const _=ts(g.value,f.spec,p,f.entity,s,i);if(!_)break;r.push({kind:"index.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:_.modelId,value:_});break}case"index.update":case"index.remove":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}const _=qf(g.value,f.index);if(!_.ok){s.push(_.reason==="not-found"?{code:"index-not-found",opIndex:p,entity:f.entity,handle:f.index}:{code:"index-ambiguous",opIndex:p,entity:f.entity,handle:f.index,matches:_.matches});break}if(f.kind==="index.update"){if("columns"in f.patch){s.push({code:"index-columns-patch-unsupported",opIndex:p,entity:f.entity,handle:f.index});break}r.push({kind:"index.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:_.value.modelId,patch:f.patch})}else r.push({kind:"index.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:_.value.modelId});break}case"operation.add":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}const _=d.get(g.value.modelId)??((b=g.value.operations)==null?void 0:b.length)??0;d.set(g.value.modelId,_+1);const N=es(f.spec,_,i);r.push({kind:"operation.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:N.modelId,value:N});break}case"operation.update":case"operation.remove":{const g=tt(e,f.entity);if(!g.ok){s.push(nt(g.reason,p,f.entity,g.matches,u));break}const _=Xf(g.value,f.operation);if(!_.ok){s.push(_.reason==="not-found"?{code:"operation-not-found",opIndex:p,entity:f.entity,handle:f.operation}:{code:"operation-ambiguous",opIndex:p,entity:f.entity,handle:f.operation,matches:_.matches});break}f.kind==="operation.update"?r.push({kind:"operation.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:_.value.modelId,patch:f.patch}):r.push({kind:"operation.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:_.value.modelId});break}case"group.add":{const g=[];let _=!1;for(const $ of f.spec.members){const K=tt(e,$);if(!K.ok){s.push(nt(K.reason,p,$,K.matches,u)),_=!0;continue}g.push(K.value.modelId)}if(_)break;const N=i(),y={modelId:N,excludeDDLGeneration:f.spec.excludeDDLGeneration??!1,memberEntityRefs:g,...f.spec.name?{name:f.spec.name}:{},...f.spec.packageName?{packageName:f.spec.packageName}:{},...f.spec.description?{description:f.spec.description}:{}};r.push({kind:"group.add",casUnit:"logical",groupRef:N,value:y});break}}}),s.length?{ok:!1,errors:s}:{ok:!0,ops:r}}function nt(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 ns(e,t,o,i,a){const l=tt(e,t.from),r=tt(e,t.to);if(l.ok||i.push(nt(l.reason,o,t.from,l.matches,a)),r.ok||i.push(nt(r.reason,o,t.to,r.matches,a)),!l.ok||!r.ok)return null;const s=jr(e,l.value.modelId,r.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 os={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명."},by:{type:"string",enum:["physicalName","name"],description:"매칭 키 고정(미지정 시 대상별 기본 순서)."}},required:["ref"],additionalProperties:!1},Zf={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},Jf={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},Xo={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},Qf={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:{...Xo,description:"속성 설명(다국어)."},columnLogicalName:{...Xo,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(type이 카탈로그 엔트리일 때만). field=카탈로그 필드명으로 매칭 (@AttributeOverride 대응). 미설정 서브컬럼은 카탈로그 기본 상속. 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 — 같은 엔터티 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}}},required:["name","type"],additionalProperties:!1},is={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},em={type:"object",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...is,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...is,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},tm={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...os,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},nm={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...Xo,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},om={type:"object",properties:{name:{...Xo,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},im={type:"object",description:"부분 patch(임의 키). 값 품질 검증은 별도 엔진."};function Ze(e,t){return{type:"object",properties:{kind:{const:e},...t.properties},required:["kind",...t.required],additionalProperties:!1}}const am={"entity.add":Ze("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":Ze("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","patch"]}),"entity.remove":Ze("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":Ze("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":Ze("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","attribute","patch"]}),"attribute.remove":Ze("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":Ze("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":Ze("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":Ze("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/patch"}},required:["association","patch"]}),"associationEnd.update":Ze("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":Ze("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":Ze("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","index","patch"]}),"index.remove":Ze("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"}},required:["entity","index"]}),"operation.add":Ze("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":Ze("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","operation","patch"]}),"operation.remove":Ze("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"}},required:["entity","operation"]}),"group.add":Ze("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]})},as={anyOf:qr.map(e=>am[e])},lm={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:os,assocHandle:Zf,entitySpec:Jf,attrSpec:Qf,assocSpec:em,indexSpec:tm,operationSpec:nm,groupSpec:om,patch:im,symbolicOp:as}};function rm(e,t,o,i={}){const a=i.mkClientOpId??Te,l=new Set;for(const s of o)s.casUnit==="logical"&&s.containerRef&&l.add(s.containerRef);const r={};if(l.size){r.revs={};for(const s of l)r.revs[s]=t[s]??0}return{diagramId:e,ops:o,cas:r,origin:i.origin??"agent",clientOpId:a()}}const ls={location:{x:0,y:0},size:{width:220,height:140}};function rs(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 sm=/^[-=_*~\s]{3,}$/;function cm(e){return e.attrType&&e.attrType!=="NORMAL"||!sm.test(e.name??"")?!1:!(e.dbAttrs??[]).some(t=>t.physicalName||t.dataType)}function dm(e,t){return e.attrType==="DIVIDER"||cm(e)?{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??t,dbAttrs:[]}:{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??t,dbAttrs:e.dbAttrs.map(rs)}}function um(e){const{modelId:t,name:o,visibility:i,sourceCode:a,description:l,order:r,personalInfoAttributeType:s,style:c,...d}=e;return{modelId:t,name:o,visibility:i,sourceCode:a,description:l?{ko:l}:void 0,order:r??0,personalInfoAttributeType:s,legacyRaw:Object.keys(d).length?d:void 0}}function fm(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 mm(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(dm),operations:(t=e.operations)==null?void 0:t.map(um),indexes:(o=e.indexes)==null?void 0:o.map(fm),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function pm(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??{...ls},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 ss(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 Ia(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:ss(e)}}function hm(e){var i,a;const t={modelId:e.modelId,description:e.description,end1:Ia(e.end1),end2:Ia(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 cs(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function ds(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function us(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 fs(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(rs)}}function ym(e,t,o){var g,_;const i=cs(e.end1.attribute),a=cs(e.end2.attribute);if(i===a)return hm(e);const l=i?e.end1:e.end2,r=i?e.end2:e.end1,s=l.attribute,c=(_=(g=s.dbAttrs)==null?void 0:g[0])==null?void 0:_.targetModelId,d=c?o.get(c):void 0,u=t.get(r.endModel.refId),f=u?u.attributes.reduce((N,y)=>Math.max(N,y.order),-1)+1:s.order??0,p={...fs(s,f),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const m=(N,y)=>({entityRef:N.endModel.refId,multiplicity:N.multiplicity,navigable:N.navigable,composition:N.composition,attributeRef:y?d:p.modelId,legacyNavRaw:y?void 0:N.attribute,jpa:ss(N)}),h={modelId:e.modelId,description:e.description,end1:m(e.end1,i),end2:m(e.end2,a)},b={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:h.end1.attributeRef,targetColumnRef:h.end2.attributeRef,style:e.style};return{assoc:h,layout:b}}function gm(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 bm(e,t,o){var h;const i=((h=e.end1.attribute)==null?void 0:h.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,l=i?e.end2:e.end1,r=a.attribute,s=t.get(l.endModel.refId),c=s?s.attributes.reduce((b,g)=>Math.max(b,g.order),-1)+1:r.order??0,d={...fs(r,c),attrType:r.attrType??"EMBED_OWN",dbAttrs:(r.dbAttrs??[]).map(b=>gm(b,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=b=>({...Ia(b),legacyEmbedRaw:b.attribute}),f={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},p=!i,m={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:p?d.modelId:void 0,targetColumnRef:p?void 0:d.modelId,style:e.style};return{assoc:f,layout:m}}function _m(e,t){var i,a,l,r;const o=[];for(const s of t){const c=(a=(i=s.end1)==null?void 0:i.endModel)==null?void 0:a.refId,d=(r=(l=s.end2)==null?void 0:l.endModel)==null?void 0:r.refId,u=c===e?d:c;!u||u===e||o.push({targetRef:u,waypoints:s.locations??[]})}return o}function ms(e,t={x:0,y:0}){const{modelId:o,memo:i,geo:a,style:l,connections:r,ownedConnections:s,...c}=e;let d=r;if(!d&&Array.isArray(s)){const u=_m(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:l,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function wm(e){return(e.schemaVersion??1)>=2&&"logical"in e?vm(e):km(e)}function vm(e){const t=e.id??e.logical.modelId??"",o={},i=f=>{const{rev:p,...m}=f;return p!=null&&(o[f.modelId]=p),m},a=e.logical.entities.map(i),l=e.logical.associations.map(i),r=e.logical.groups.map(i),{version:s,...c}=e.layout,d={logical:{modelId:e.logical.modelId??t,packageName:e.logical.packageName,entities:a,associations:l,groups:r},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 km(e){var _,N;const t=e.id??"",o=[],i=[],a=[],l=[],r=[],s=[],c=[],d=(y,$)=>{o.push(mm(y));const K=pm(y);K.geo={location:{x:K.geo.location.x+$.x,y:K.geo.location.y+$.y},size:K.geo.size},i.push(K);for(const F of y.ownedAssociations??[])c.push(F)},u={x:0,y:0};for(const y of e.entities??[])d(y,u);const f=[];for(const y of e.groups??[]){const $=y.entities??[];r.push({modelId:y.modelId,name:y.name,description:y.description,packageName:y.packageName,excludeDDLGeneration:y.excludeDDLGeneration??!1,memberEntityRefs:$.map(F=>F.modelId)});const K=((_=y.geo)==null?void 0:_.location)??u;if(y.geo){const F=(y.notes??[]).map(q=>q.modelId);s.push({groupRef:y.modelId,geo:y.geo,style:y.style,locked:y.locked,memberNoteRefs:F.length?F:void 0})}for(const F of $)d(F,K);for(const F of y.notes??[])f.push(ms(F,K))}const p=new Map(o.map(y=>[y.modelId,y])),m=new Map,h=new Map;for(const y of o)for(const $ of y.attributes)for(const K of $.dbAttrs)m.set(K.modelId,$.modelId),h.set(K.modelId,K);for(const y of c)for(const $ of[y.end1,y.end2]){const K=$.attribute;if(K&&(((N=K.dbAttrs)==null?void 0:N.length)??0)>0)for(const F of K.dbAttrs)F.modelId&&m.set(F.modelId,K.modelId)}for(const y of c){const $=ds(y.end1.attribute),K=ds(y.end2.attribute),F=us(y.end1)||us(y.end2),{assoc:q,layout:G}=$!==K||F?bm(y,p,h):ym(y,p,m);a.push(q),l.push(G)}const b={logical:{modelId:t,packageName:e.packageName,entities:o,associations:a,groups:r},layout:{diagramId:t,logicalModelRef:t,canvasSize:e.size,entityLayouts:i,associationLayouts:l,groupLayouts:s,notes:[...(e.notes??[]).map(y=>ms(y)),...f]}},g={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:b,meta:g}}function ps(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 Em(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(ps),style:t}}function Nm(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 $m(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 Ut(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 xm(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 l;return{...ps(i),targetModelId:(l=o==null?void 0:o.dbAttrs[a])==null?void 0:l.modelId}})}}function Im(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 Sm(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 Cm(e,t){return e===t||JSON.stringify(e??null)===JSON.stringify(t??null)}function Rm(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:Cm(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 Vm(e,t,o){let i;for(const f of t.logical.entities){const p=f.attributes.find(m=>{var h;return((h=m.embedded)==null?void 0:h.associationRef)===e.modelId});if(p){i=p;break}}if(!i)return;const a=i.embedded.embeddableRef,l=t.logical.entities.find(f=>f.modelId===a);if(!l)return;const r=l.attributes.flatMap(f=>f.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((f,p)=>Rm(f,r[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:Ut(e.end1,c?s:u),end2:Ut(e.end2,c?u:s)}}function Am(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:Ut(e.end1,e.end1.legacyEmbedRaw),end2:Ut(e.end2,e.end2.legacyEmbedRaw)};const a=Vm(e,t,i);if(a)return a;const l=!!e.end1.legacyNavRaw,r=!!e.end2.legacyNavRaw;if(l!==r){const s=l?e.end1:e.end2,c=l?e.end2:e.end1,d=t.logical.entities.find(h=>h.modelId===s.entityRef),u=d==null?void 0:d.attributes.find(h=>h.modelId===s.attributeRef),f=t.logical.entities.find(h=>h.modelId===c.entityRef),p=u?xm(u,f):void 0,m=s.legacyNavRaw;return{...i,end1:Ut(e.end1,l?m:p),end2:Ut(e.end2,r?m:p)}}return{...i,end1:Ut(e.end1),end2:Ut(e.end2)}}function hs(e,t,o,i,a={x:0,y:0}){var u,f;const l=t.layout.entityLayouts.find(p=>p.entityRef===e.modelId),r=t.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>t.layout.associationLayouts.find(m=>m.associationRef===p),c=(l==null?void 0:l.geo)??{...ls},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 m;return Em(p,(m=l==null?void 0:l.attributeStyles)==null?void 0:m[p.modelId])}),operations:(u=e.operations)==null?void 0:u.map(p=>{var m;return Nm(p,(m=l==null?void 0:l.operationStyles)==null?void 0:m[p.modelId])}),ownedAssociations:r.map(p=>Am(p,t,s(p.modelId))),indexes:(f=e.indexes)==null?void 0:f.map($m),jpaAttrs:e.jpaAttrs,dbAttrs:e.table?{physicalName:e.table.physicalName,logicalName:e.table.logicalName}:void 0,geo:d,style:l==null?void 0:l.style,collapsed:l==null?void 0:l.collapsed,locked:l==null?void 0:l.locked}}function Tm(e,t,o,i){const a=t.layout.groupLayouts.find(c=>c.groupRef===e.modelId),l=e.memberEntityRefs.map(c=>t.logical.entities.find(d=>d.modelId===c)).filter(c=>!!c),r=(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=>ys(c,r));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:l.map(c=>hs(c,t,o,i,r)),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 ys(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 Mm(e,t={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=Im(e),l=Sm(e),r=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=>hs(s,e,a,l)),groups:e.logical.groups.map(s=>Tm(s,e,a,l)),notes:e.layout.notes.filter(s=>!r.has(s.modelId)).map(s=>ys(s))}}function Bm(e,t={}){var a,l,r;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:((l=t.revSeed)==null?void 0:l.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:((r=t.revSeed)==null?void 0:r.layoutVersion)??0}}}function Qn(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function St(e){return typeof e=="function"?e():n.unref(e)}const Dm=typeof window<"u"&&typeof document<"u",Om=e=>typeof e<"u",Lm=Object.prototype.toString,Pm=e=>Lm.call(e)==="[object Object]",zm=()=>{};function Um(e,t){function o(...i){return new Promise((a,l)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(a).catch(l)})}return o}const gs=e=>e();function Hm(e=gs){const t=n.ref(!0);function o(){t.value=!1}function i(){t.value=!0}const a=(...l)=>{t.value&&e(...l)};return{isActive:n.readonly(t),pause:o,resume:i,eventFilter:a}}function bs(e,t=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(t?()=>a(o):i,e)})}function Fm(e,t,o={}){const{eventFilter:i=gs,...a}=o;return n.watch(e,Um(i,t),a)}function xn(e,t,o={}){const{eventFilter:i,...a}=o,{eventFilter:l,pause:r,resume:s,isActive:c}=Hm(i);return{stop:Fm(e,t,{...a,eventFilter:l}),pause:r,resume:s,isActive:c}}function Gm(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 l;if((l=St(t.replaceRef))!=null?l:!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 Sa(e,t=!1){function o(f,{flush:p="sync",deep:m=!1,timeout:h,throwOnTimeout:b}={}){let g=null;const N=[new Promise(y=>{g=n.watch(e,$=>{f($)!==t&&(g==null||g(),y($))},{flush:p,deep:m,immediate:!0})})];return h!=null&&N.push(bs(h,b).then(()=>St(e)).finally(()=>g==null?void 0:g())),Promise.race(N)}function i(f,p){if(!n.isRef(f))return o($=>$===f,p);const{flush:m="sync",deep:h=!1,timeout:b,throwOnTimeout:g}=p??{};let _=null;const y=[new Promise($=>{_=n.watch([e,f],([K,F])=>{t!==(K===F)&&(_==null||_(),$(K))},{flush:m,deep:h,immediate:!0})})];return b!=null&&y.push(bs(b,g).then(()=>St(e)).finally(()=>(_==null||_(),St(e)))),Promise.race(y)}function a(f){return o(p=>!!p,f)}function l(f){return i(null,f)}function r(f){return i(void 0,f)}function s(f){return o(Number.isNaN,f)}function c(f,p){return o(m=>{const h=Array.from(m);return h.includes(f)||h.includes(St(f))},p)}function d(f){return u(1,f)}function u(f=1,p){let m=-1;return o(()=>(m+=1,m>=f),p)}return Array.isArray(St(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return Sa(e,!t)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:l,toBeNaN:s,toBeUndefined:r,changed:d,changedTimes:u,get not(){return Sa(e,!t)}}}function Ca(e){return Sa(e)}function Ym(e){var t;const o=St(e);return(t=o==null?void 0:o.$el)!=null?t:o}const _s=Dm?window:void 0;function ws(...e){let t,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,t=_s):[t,o,i,a]=e,!t)return zm;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const l=[],r=()=>{l.forEach(u=>u()),l.length=0},s=(u,f,p,m)=>(u.addEventListener(f,p,m),()=>u.removeEventListener(f,p,m)),c=n.watch(()=>[Ym(t),St(a)],([u,f])=>{if(r(),!u)return;const p=Pm(f)?{...f}:f;l.push(...o.flatMap(m=>i.map(h=>s(u,m,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),r()};return Qn(d),d}function Wm(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function vs(...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=_s,eventName:l="keydown",passive:r=!1,dedupe:s=!1}=i,c=Wm(t);return ws(a,l,u=>{u.repeat&&St(s)||c(u)&&o(u)},r)}function Km(e){return JSON.parse(JSON.stringify(e))}function Ra(e,t,o,i={}){var a,l,r;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:f,shouldEmit:p}=i,m=n.getCurrentInstance(),h=o||(m==null?void 0:m.emit)||((a=m==null?void 0:m.$emit)==null?void 0:a.bind(m))||((r=(l=m==null?void 0:m.proxy)==null?void 0:l.$emit)==null?void 0:r.bind(m==null?void 0:m.proxy));let b=d;t||(t="modelValue"),b=b||`update:${t.toString()}`;const g=y=>s?typeof s=="function"?s(y):Km(y):y,_=()=>Om(e[t])?g(e[t]):f,N=y=>{p?p(y)&&h(b,y):h(b,y)};if(c){const y=_(),$=n.ref(y);let K=!1;return n.watch(()=>e[t],F=>{K||(K=!0,$.value=g(F),n.nextTick(()=>K=!1))}),n.watch($,F=>{!K&&(F!==e[t]||u)&&N(F)},{deep:u}),$}else return n.computed({get(){return _()},set(y){N(y)}})}var qm={value:()=>{}};function jo(){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 Zo(o)}function Zo(e){this._=e}function Xm(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}})}Zo.prototype=jo.prototype={constructor:Zo,on:function(e,t){var o=this._,i=Xm(e+"",o),a,l=-1,r=i.length;if(arguments.length<2){for(;++l<r;)if((a=(e=i[l]).type)&&(a=jm(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<r;)if(a=(e=i[l]).type)o[a]=ks(o[a],e.name,t);else if(t==null)for(a in o)o[a]=ks(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 Zo(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,l;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[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,l=i.length;a<l;++a)i[a].value.apply(t,o)}};function jm(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function ks(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=qm,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var Va="http://www.w3.org/1999/xhtml";const Es={svg:"http://www.w3.org/2000/svg",xhtml:Va,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jo(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Es.hasOwnProperty(t)?{space:Es[t],local:e}:e}function Zm(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===Va&&t.documentElement.namespaceURI===Va?t.createElement(e):t.createElementNS(o,e)}}function Jm(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ns(e){var t=Jo(e);return(t.local?Jm:Zm)(t)}function Qm(){}function Aa(e){return e==null?Qm:function(){return this.querySelector(e)}}function ep(e){typeof e!="function"&&(e=Aa(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=new Array(r),c,d,u=0;u<r;++u)(c=l[u])&&(d=e.call(c,c.__data__,u,l))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new lt(i,this._parents)}function tp(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function np(){return[]}function $s(e){return e==null?np:function(){return this.querySelectorAll(e)}}function op(e){return function(){return tp(e.apply(this,arguments))}}function ip(e){typeof e=="function"?e=op(e):e=$s(e);for(var t=this._groups,o=t.length,i=[],a=[],l=0;l<o;++l)for(var r=t[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&(i.push(e.call(c,c.__data__,d,r)),a.push(c));return new lt(i,a)}function xs(e){return function(){return this.matches(e)}}function Is(e){return function(t){return t.matches(e)}}var ap=Array.prototype.find;function lp(e){return function(){return ap.call(this.children,e)}}function rp(){return this.firstElementChild}function sp(e){return this.select(e==null?rp:lp(typeof e=="function"?e:Is(e)))}var cp=Array.prototype.filter;function dp(){return Array.from(this.children)}function up(e){return function(){return cp.call(this.children,e)}}function fp(e){return this.selectAll(e==null?dp:up(typeof e=="function"?e:Is(e)))}function mp(e){typeof e!="function"&&(e=xs(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new lt(i,this._parents)}function Ss(e){return new Array(e.length)}function pp(){return new lt(this._enter||this._groups.map(Ss),this._parents)}function Qo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Qo.prototype={constructor:Qo,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 hp(e){return function(){return e}}function yp(e,t,o,i,a,l){for(var r=0,s,c=t.length,d=l.length;r<d;++r)(s=t[r])?(s.__data__=l[r],i[r]=s):o[r]=new Qo(e,l[r]);for(;r<c;++r)(s=t[r])&&(a[r]=s)}function gp(e,t,o,i,a,l,r){var s,c,d=new Map,u=t.length,f=l.length,p=new Array(u),m;for(s=0;s<u;++s)(c=t[s])&&(p[s]=m=r.call(c,c.__data__,s,t)+"",d.has(m)?a[s]=c:d.set(m,c));for(s=0;s<f;++s)m=r.call(e,l[s],s,l)+"",(c=d.get(m))?(i[s]=c,c.__data__=l[s],d.delete(m)):o[s]=new Qo(e,l[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function bp(e){return e.__data__}function _p(e,t){if(!arguments.length)return Array.from(this,bp);var o=t?gp:yp,i=this._parents,a=this._groups;typeof e!="function"&&(e=hp(e));for(var l=a.length,r=new Array(l),s=new Array(l),c=new Array(l),d=0;d<l;++d){var u=i[d],f=a[d],p=f.length,m=wp(e.call(u,u&&u.__data__,d,i)),h=m.length,b=s[d]=new Array(h),g=r[d]=new Array(h),_=c[d]=new Array(p);o(u,f,b,g,_,m,t);for(var N=0,y=0,$,K;N<h;++N)if($=b[N]){for(N>=y&&(y=N+1);!(K=g[y])&&++y<h;);$._next=K||null}}return r=new lt(r,i),r._enter=s,r._exit=c,r}function wp(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vp(){return new lt(this._exit||this._groups.map(Ss),this._parents)}function kp(e,t,o){var i=this.enter(),a=this,l=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?l.remove():o(l),i&&a?i.merge(a).order():a}function Ep(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._groups,a=o.length,l=i.length,r=Math.min(a,l),s=new Array(a),c=0;c<r;++c)for(var d=o[c],u=i[c],f=d.length,p=s[c]=new Array(f),m,h=0;h<f;++h)(m=d[h]||u[h])&&(p[h]=m);for(;c<a;++c)s[c]=o[c];return new lt(s,this._parents)}function Np(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],a=i.length-1,l=i[a],r;--a>=0;)(r=i[a])&&(l&&r.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(r,l),l=r);return this}function $p(e){e||(e=xp);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var o=this._groups,i=o.length,a=new Array(i),l=0;l<i;++l){for(var r=o[l],s=r.length,c=a[l]=new Array(s),d,u=0;u<s;++u)(d=r[u])&&(c[u]=d);c.sort(t)}return new lt(a,this._parents).order()}function xp(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ip(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sp(){return Array.from(this)}function Cp(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length;a<l;++a){var r=i[a];if(r)return r}return null}function Rp(){let e=0;for(const t of this)++e;return e}function Vp(){return!this.node()}function Ap(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],l=0,r=a.length,s;l<r;++l)(s=a[l])&&e.call(s,s.__data__,l,a);return this}function Tp(e){return function(){this.removeAttribute(e)}}function Mp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bp(e,t){return function(){this.setAttribute(e,t)}}function Dp(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Op(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Lp(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 Pp(e,t){var o=Jo(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?Mp:Tp:typeof t=="function"?o.local?Lp:Op:o.local?Dp:Bp)(o,t))}function Cs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zp(e){return function(){this.style.removeProperty(e)}}function Up(e,t,o){return function(){this.style.setProperty(e,t,o)}}function Hp(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function Fp(e,t,o){return arguments.length>1?this.each((t==null?zp:typeof t=="function"?Hp:Up)(e,t,o??"")):In(this.node(),e)}function In(e,t){return e.style.getPropertyValue(t)||Cs(e).getComputedStyle(e,null).getPropertyValue(t)}function Gp(e){return function(){delete this[e]}}function Yp(e,t){return function(){this[e]=t}}function Wp(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Kp(e,t){return arguments.length>1?this.each((t==null?Gp:typeof t=="function"?Wp:Yp)(e,t)):this.node()[e]}function Rs(e){return e.trim().split(/^|\s+/)}function Ta(e){return e.classList||new Vs(e)}function Vs(e){this._node=e,this._names=Rs(e.getAttribute("class")||"")}Vs.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 As(e,t){for(var o=Ta(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function Ts(e,t){for(var o=Ta(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function qp(e){return function(){As(this,e)}}function Xp(e){return function(){Ts(this,e)}}function jp(e,t){return function(){(t.apply(this,arguments)?As:Ts)(this,e)}}function Zp(e,t){var o=Rs(e+"");if(arguments.length<2){for(var i=Ta(this.node()),a=-1,l=o.length;++a<l;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?jp:t?qp:Xp)(o,t))}function Jp(){this.textContent=""}function Qp(e){return function(){this.textContent=e}}function eh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function th(e){return arguments.length?this.each(e==null?Jp:(typeof e=="function"?eh:Qp)(e)):this.node().textContent}function nh(){this.innerHTML=""}function oh(e){return function(){this.innerHTML=e}}function ih(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ah(e){return arguments.length?this.each(e==null?nh:(typeof e=="function"?ih:oh)(e)):this.node().innerHTML}function lh(){this.nextSibling&&this.parentNode.appendChild(this)}function rh(){return this.each(lh)}function sh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ch(){return this.each(sh)}function dh(e){var t=typeof e=="function"?e:Ns(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function uh(){return null}function fh(e,t){var o=typeof e=="function"?e:Ns(e),i=t==null?uh:typeof t=="function"?t:Aa(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function mh(){var e=this.parentNode;e&&e.removeChild(this)}function ph(){return this.each(mh)}function hh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gh(e){return this.select(e?yh:hh)}function bh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _h(e){return function(t){e.call(this,t,this.__data__)}}function wh(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 vh(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,l;o<a;++o)l=t[o],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function kh(e,t,o){return function(){var i=this.__on,a,l=_h(t);if(i){for(var r=0,s=i.length;r<s;++r)if((a=i[r]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=o),a.value=t;return}}this.addEventListener(e.type,l,o),a={type:e.type,name:e.name,value:t,listener:l,options:o},i?i.push(a):this.__on=[a]}}function Eh(e,t,o){var i=wh(e+""),a,l=i.length,r;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<l;++a)if((r=i[a]).type===u.type&&r.name===u.name)return u.value}return}for(s=t?kh:vh,a=0;a<l;++a)this.each(s(i[a],t,o));return this}function Ms(e,t,o){var i=Cs(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 Nh(e,t){return function(){return Ms(this,e,t)}}function $h(e,t){return function(){return Ms(this,e,t.apply(this,arguments))}}function xh(e,t){return this.each((typeof t=="function"?$h:Nh)(e,t))}function*Ih(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length,r;a<l;++a)(r=i[a])&&(yield r)}var Bs=[null];function lt(e,t){this._groups=e,this._parents=t}function eo(){return new lt([[document.documentElement]],Bs)}function Sh(){return this}lt.prototype=eo.prototype={constructor:lt,select:ep,selectAll:ip,selectChild:sp,selectChildren:fp,filter:mp,data:_p,enter:pp,exit:vp,join:kp,merge:Ep,selection:Sh,order:Np,sort:$p,call:Ip,nodes:Sp,node:Cp,size:Rp,empty:Vp,each:Ap,attr:Pp,style:Fp,property:Kp,classed:Zp,text:th,html:ah,raise:rh,lower:ch,append:dh,insert:fh,remove:ph,clone:gh,datum:bh,on:Eh,dispatch:xh,[Symbol.iterator]:Ih};function ut(e){return typeof e=="string"?new lt([[document.querySelector(e)]],[document.documentElement]):new lt([[e]],Bs)}function Ch(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bt(e,t){if(e=Ch(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 Rh={passive:!1},to={capture:!0,passive:!1};function Ma(e){e.stopImmediatePropagation()}function Sn(e){e.preventDefault(),e.stopImmediatePropagation()}function Ds(e){var t=e.document.documentElement,o=ut(e).on("dragstart.drag",Sn,to);"onselectstart"in t?o.on("selectstart.drag",Sn,to):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Os(e,t){var o=e.document.documentElement,i=ut(e).on("dragstart.drag",null);t&&(i.on("click.drag",Sn,to),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 ei=e=>()=>e;function Ba(e,{sourceEvent:t,subject:o,target:i,identifier:a,active:l,x:r,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:l,enumerable:!0,configurable:!0},x:{value:r,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}})}Ba.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Vh(e){return!e.ctrlKey&&!e.button}function Ah(){return this.parentNode}function Th(e,t){return t??{x:e.x,y:e.y}}function Mh(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bh(){var e=Vh,t=Ah,o=Th,i=Mh,a={},l=jo("start","drag","end"),r=0,s,c,d,u,f=0;function p($){$.on("mousedown.drag",m).filter(i).on("touchstart.drag",g).on("touchmove.drag",_,Rh).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m($,K){if(!(u||!e.call(this,$,K))){var F=y(this,t.call(this,$,K),$,K,"mouse");F&&(ut($.view).on("mousemove.drag",h,to).on("mouseup.drag",b,to),Ds($.view),Ma($),d=!1,s=$.clientX,c=$.clientY,F("start",$))}}function h($){if(Sn($),!d){var K=$.clientX-s,F=$.clientY-c;d=K*K+F*F>f}a.mouse("drag",$)}function b($){ut($.view).on("mousemove.drag mouseup.drag",null),Os($.view,d),Sn($),a.mouse("end",$)}function g($,K){if(e.call(this,$,K)){var F=$.changedTouches,q=t.call(this,$,K),G=F.length,X,Q;for(X=0;X<G;++X)(Q=y(this,q,$,K,F[X].identifier,F[X]))&&(Ma($),Q("start",$,F[X]))}}function _($){var K=$.changedTouches,F=K.length,q,G;for(q=0;q<F;++q)(G=a[K[q].identifier])&&(Sn($),G("drag",$,K[q]))}function N($){var K=$.changedTouches,F=K.length,q,G;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),q=0;q<F;++q)(G=a[K[q].identifier])&&(Ma($),G("end",$,K[q]))}function y($,K,F,q,G,X){var Q=l.copy(),de=bt(X||F,K),B,ee,v;if((v=o.call($,new Ba("beforestart",{sourceEvent:F,target:p,identifier:G,active:r,x:de[0],y:de[1],dx:0,dy:0,dispatch:Q}),q))!=null)return B=v.x-de[0]||0,ee=v.y-de[1]||0,function R(E,P,W){var oe=de,T;switch(E){case"start":a[G]=R,T=r++;break;case"end":delete a[G],--r;case"drag":de=bt(W||P,K),T=r;break}Q.call(E,$,new Ba(E,{sourceEvent:P,subject:v,target:p,identifier:G,active:T,x:de[0]+B,y:de[1]+ee,dx:de[0]-oe[0],dy:de[1]-oe[1],dispatch:Q}),q)}}return p.filter=function($){return arguments.length?(e=typeof $=="function"?$:ei(!!$),p):e},p.container=function($){return arguments.length?(t=typeof $=="function"?$:ei($),p):t},p.subject=function($){return arguments.length?(o=typeof $=="function"?$:ei($),p):o},p.touchable=function($){return arguments.length?(i=typeof $=="function"?$:ei(!!$),p):i},p.on=function(){var $=l.on.apply(l,arguments);return $===l?p:$},p.clickDistance=function($){return arguments.length?(f=($=+$)*$,p):Math.sqrt(f)},p}function Da(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function Ls(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function no(){}var oo=.7,ti=1/oo,Cn="\\s*([+-]?\\d+)\\s*",io="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dh=/^#([0-9a-f]{3,8})$/,Oh=new RegExp(`^rgb\\(${Cn},${Cn},${Cn}\\)$`),Lh=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Ph=new RegExp(`^rgba\\(${Cn},${Cn},${Cn},${io}\\)$`),zh=new RegExp(`^rgba\\(${_t},${_t},${_t},${io}\\)$`),Uh=new RegExp(`^hsl\\(${io},${_t},${_t}\\)$`),Hh=new RegExp(`^hsla\\(${io},${_t},${_t},${io}\\)$`),Ps={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};Da(no,nn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zs,formatHex:zs,formatHex8:Fh,formatHsl:Gh,formatRgb:Us,toString:Us});function zs(){return this.rgb().formatHex()}function Fh(){return this.rgb().formatHex8()}function Gh(){return Ws(this).formatHsl()}function Us(){return this.rgb().formatRgb()}function nn(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=Dh.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?Hs(t):o===3?new ot(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?ni(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?ni(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=Oh.exec(e))?new ot(t[1],t[2],t[3],1):(t=Lh.exec(e))?new ot(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ph.exec(e))?ni(t[1],t[2],t[3],t[4]):(t=zh.exec(e))?ni(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Uh.exec(e))?Ys(t[1],t[2]/100,t[3]/100,1):(t=Hh.exec(e))?Ys(t[1],t[2]/100,t[3]/100,t[4]):Ps.hasOwnProperty(e)?Hs(Ps[e]):e==="transparent"?new ot(NaN,NaN,NaN,0):null}function Hs(e){return new ot(e>>16&255,e>>8&255,e&255,1)}function ni(e,t,o,i){return i<=0&&(e=t=o=NaN),new ot(e,t,o,i)}function Yh(e){return e instanceof no||(e=nn(e)),e?(e=e.rgb(),new ot(e.r,e.g,e.b,e.opacity)):new ot}function Oa(e,t,o,i){return arguments.length===1?Yh(e):new ot(e,t,o,i??1)}function ot(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}Da(ot,Oa,Ls(no,{brighter(e){return e=e==null?ti:Math.pow(ti,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ot(on(this.r),on(this.g),on(this.b),oi(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:Fs,formatHex:Fs,formatHex8:Wh,formatRgb:Gs,toString:Gs}));function Fs(){return`#${an(this.r)}${an(this.g)}${an(this.b)}`}function Wh(){return`#${an(this.r)}${an(this.g)}${an(this.b)}${an((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gs(){const e=oi(this.opacity);return`${e===1?"rgb(":"rgba("}${on(this.r)}, ${on(this.g)}, ${on(this.b)}${e===1?")":`, ${e})`}`}function oi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function on(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function an(e){return e=on(e),(e<16?"0":"")+e.toString(16)}function Ys(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new ft(e,t,o,i)}function Ws(e){if(e instanceof ft)return new ft(e.h,e.s,e.l,e.opacity);if(e instanceof no||(e=nn(e)),!e)return new ft;if(e instanceof ft)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),l=Math.max(t,o,i),r=NaN,s=l-a,c=(l+a)/2;return s?(t===l?r=(o-i)/s+(o<i)*6:o===l?r=(i-t)/s+2:r=(t-o)/s+4,s/=c<.5?l+a:2-l-a,r*=60):s=c>0&&c<1?0:r,new ft(r,s,c,e.opacity)}function Kh(e,t,o,i){return arguments.length===1?Ws(e):new ft(e,t,o,i??1)}function ft(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}Da(ft,Kh,Ls(no,{brighter(e){return e=e==null?ti:Math.pow(ti,e),new ft(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new ft(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 ot(La(e>=240?e-240:e+120,a,i),La(e,a,i),La(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new ft(Ks(this.h),ii(this.s),ii(this.l),oi(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=oi(this.opacity);return`${e===1?"hsl(":"hsla("}${Ks(this.h)}, ${ii(this.s)*100}%, ${ii(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ks(e){return e=(e||0)%360,e<0?e+360:e}function ii(e){return Math.max(0,Math.min(1,e||0))}function La(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 Pa=e=>()=>e;function qh(e,t){return function(o){return e+o*t}}function Xh(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 jh(e){return(e=+e)==1?qs:function(t,o){return o-t?Xh(t,o,e):Pa(isNaN(t)?o:t)}}function qs(e,t){var o=t-e;return o?qh(e,o):Pa(isNaN(e)?t:e)}const ai=(function e(t){var o=jh(t);function i(a,l){var r=o((a=Oa(a)).r,(l=Oa(l)).r),s=o(a.g,l.g),c=o(a.b,l.b),d=qs(a.opacity,l.opacity);return function(u){return a.r=r(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function Zh(e,t){t||(t=[]);var o=e?Math.min(t.length,e.length):0,i=t.slice(),a;return function(l){for(a=0;a<o;++a)i[a]=e[a]*(1-l)+t[a]*l;return i}}function Jh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qh(e,t){var o=t?t.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),l=new Array(o),r;for(r=0;r<i;++r)a[r]=ao(e[r],t[r]);for(;r<o;++r)l[r]=t[r];return function(s){for(r=0;r<i;++r)l[r]=a[r](s);return l}}function ey(e,t){var o=new Date;return e=+e,t=+t,function(i){return o.setTime(e*(1-i)+t*i),o}}function wt(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}function ty(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]=ao(e[a],t[a]):i[a]=t[a];return function(l){for(a in o)i[a]=o[a](l);return i}}var za=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ua=new RegExp(za.source,"g");function ny(e){return function(){return e}}function oy(e){return function(t){return e(t)+""}}function Xs(e,t){var o=za.lastIndex=Ua.lastIndex=0,i,a,l,r=-1,s=[],c=[];for(e=e+"",t=t+"";(i=za.exec(e))&&(a=Ua.exec(t));)(l=a.index)>o&&(l=t.slice(o,l),s[r]?s[r]+=l:s[++r]=l),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:wt(i,a)})),o=Ua.lastIndex;return o<t.length&&(l=t.slice(o),s[r]?s[r]+=l:s[++r]=l),s.length<2?c[0]?oy(c[0].x):ny(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(d);return s.join("")})}function ao(e,t){var o=typeof t,i;return t==null||o==="boolean"?Pa(t):(o==="number"?wt:o==="string"?(i=nn(t))?(t=i,ai):Xs:t instanceof nn?ai:t instanceof Date?ey:Jh(t)?Zh:Array.isArray(t)?Qh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ty:wt)(e,t)}var js=180/Math.PI,Ha={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zs(e,t,o,i,a,l){var r,s,c;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(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,r=-r),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*js,skewX:Math.atan(c)*js,scaleX:r,scaleY:s}}var li;function iy(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ha:Zs(t.a,t.b,t.c,t.d,t.e,t.f)}function ay(e){return e==null||(li||(li=document.createElementNS("http://www.w3.org/2000/svg","g")),li.setAttribute("transform",e),!(e=li.transform.baseVal.consolidate()))?Ha:(e=e.matrix,Zs(e.a,e.b,e.c,e.d,e.e,e.f))}function Js(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function l(d,u,f,p,m,h){if(d!==f||u!==p){var b=m.push("translate(",null,t,null,o);h.push({i:b-4,x:wt(d,f)},{i:b-2,x:wt(u,p)})}else(f||p)&&m.push("translate("+f+t+p+o)}function r(d,u,f,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:f.push(a(f)+"rotate(",null,i)-2,x:wt(d,u)})):u&&f.push(a(f)+"rotate("+u+i)}function s(d,u,f,p){d!==u?p.push({i:f.push(a(f)+"skewX(",null,i)-2,x:wt(d,u)}):u&&f.push(a(f)+"skewX("+u+i)}function c(d,u,f,p,m,h){if(d!==f||u!==p){var b=m.push(a(m)+"scale(",null,",",null,")");h.push({i:b-4,x:wt(d,f)},{i:b-2,x:wt(u,p)})}else(f!==1||p!==1)&&m.push(a(m)+"scale("+f+","+p+")")}return function(d,u){var f=[],p=[];return d=e(d),u=e(u),l(d.translateX,d.translateY,u.translateX,u.translateY,f,p),r(d.rotate,u.rotate,f,p),s(d.skewX,u.skewX,f,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,f,p),d=u=null,function(m){for(var h=-1,b=p.length,g;++h<b;)f[(g=p[h]).i]=g.x(m);return f.join("")}}}var ly=Js(iy,"px, ","px)","deg)"),ry=Js(ay,", ",")",")"),sy=1e-12;function Qs(e){return((e=Math.exp(e))+1/e)/2}function cy(e){return((e=Math.exp(e))-1/e)/2}function dy(e){return((e=Math.exp(2*e))-1)/(e+1)}const ri=(function e(t,o,i){function a(l,r){var s=l[0],c=l[1],d=l[2],u=r[0],f=r[1],p=r[2],m=u-s,h=f-c,b=m*m+h*h,g,_;if(b<sy)_=Math.log(p/d)/t,g=function(q){return[s+q*m,c+q*h,d*Math.exp(t*q*_)]};else{var N=Math.sqrt(b),y=(p*p-d*d+i*b)/(2*d*o*N),$=(p*p-d*d-i*b)/(2*p*o*N),K=Math.log(Math.sqrt(y*y+1)-y),F=Math.log(Math.sqrt($*$+1)-$);_=(F-K)/t,g=function(q){var G=q*_,X=Qs(K),Q=d/(o*N)*(X*dy(t*G+K)-cy(K));return[s+Q*m,c+Q*h,d*X/Qs(t*G+K)]}}return g.duration=_*1e3*t/Math.SQRT2,g}return a.rho=function(l){var r=Math.max(.001,+l),s=r*r,c=s*s;return e(r,s,c)},a})(Math.SQRT2,2,4);var Rn=0,lo=0,ro=0,ec=1e3,si,so,ci=0,ln=0,di=0,co=typeof performance=="object"&&performance.now?performance:Date,tc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fa(){return ln||(tc(uy),ln=co.now()+di)}function uy(){ln=0}function ui(){this._call=this._time=this._next=null}ui.prototype=nc.prototype={constructor:ui,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Fa():+o)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:si=this,so=this),this._call=e,this._time=o,Ga()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ga())}};function nc(e,t,o){var i=new ui;return i.restart(e,t,o),i}function fy(){Fa(),++Rn;for(var e=si,t;e;)(t=ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Rn}function oc(){ln=(ci=co.now())+di,Rn=lo=0;try{fy()}finally{Rn=0,py(),ln=0}}function my(){var e=co.now(),t=e-ci;t>ec&&(di-=t,ci=e)}function py(){for(var e,t=si,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:si=o);so=e,Ga(i)}function Ga(e){if(!Rn){lo&&(lo=clearTimeout(lo));var t=e-ln;t>24?(e<1/0&&(lo=setTimeout(oc,e-co.now()-di)),ro&&(ro=clearInterval(ro))):(ro||(ci=co.now(),ro=setInterval(my,ec)),Rn=1,tc(oc))}}function ic(e,t,o){var i=new ui;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var hy=jo("start","end","cancel","interrupt"),yy=[],ac=0,lc=1,Ya=2,fi=3,rc=4,Wa=5,mi=6;function pi(e,t,o,i,a,l){var r=e.__transition;if(!r)e.__transition={};else if(o in r)return;gy(e,o,{name:t,index:i,group:a,on:hy,tween:yy,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:ac})}function Ka(e,t){var o=mt(e,t);if(o.state>ac)throw new Error("too late; already scheduled");return o}function vt(e,t){var o=mt(e,t);if(o.state>fi)throw new Error("too late; already running");return o}function mt(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function gy(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=nc(l,0,o.time);function l(d){o.state=lc,o.timer.restart(r,o.delay,o.time),o.delay<=d&&r(d-o.delay)}function r(d){var u,f,p,m;if(o.state!==lc)return c();for(u in i)if(m=i[u],m.name===o.name){if(m.state===fi)return ic(r);m.state===rc?(m.state=mi,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[u]):+u<t&&(m.state=mi,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete i[u])}if(ic(function(){o.state===fi&&(o.state=rc,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=Ya,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Ya){for(o.state=fi,a=new Array(p=o.tween.length),u=0,f=-1;u<p;++u)(m=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++f]=m);a.length=f+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Wa,1),f=-1,p=a.length;++f<p;)a[f].call(e,u);o.state===Wa&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=mi,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function hi(e,t){var o=e.__transition,i,a,l=!0,r;if(o){t=t==null?null:t+"";for(r in o){if((i=o[r]).name!==t){l=!1;continue}a=i.state>Ya&&i.state<Wa,i.state=mi,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[r]}l&&delete e.__transition}}function by(e){return this.each(function(){hi(this,e)})}function _y(e,t){var o,i;return function(){var a=vt(this,e),l=a.tween;if(l!==o){i=o=l;for(var r=0,s=i.length;r<s;++r)if(i[r].name===t){i=i.slice(),i.splice(r,1);break}}a.tween=i}}function wy(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var l=vt(this,e),r=l.tween;if(r!==i){a=(i=r).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)}l.tween=a}}function vy(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=mt(this.node(),o).tween,a=0,l=i.length,r;a<l;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((t==null?_y:wy)(o,e,t))}function qa(e,t,o){var i=e._id;return e.each(function(){var a=vt(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return mt(a,i).value[t]}}function sc(e,t){var o;return(typeof t=="number"?wt:t instanceof nn?ai:(o=nn(t))?(t=o,ai):Xs)(e,t)}function ky(e){return function(){this.removeAttribute(e)}}function Ey(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ny(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttribute(e);return r===a?null:r===i?l:l=t(i=r,o)}}function $y(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?l:l=t(i=r,o)}}function xy(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttribute(e):(r=this.getAttribute(e),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function Iy(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(r=this.getAttributeNS(e.space,e.local),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function Sy(e,t){var o=Jo(e),i=o==="transform"?ry:sc;return this.attrTween(e,typeof t=="function"?(o.local?Iy:xy)(o,i,qa(this,"attr."+e,t)):t==null?(o.local?Ey:ky)(o):(o.local?$y:Ny)(o,i,t))}function Cy(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function Ry(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function Vy(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&Ry(e,l)),o}return a._value=t,a}function Ay(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&Cy(e,l)),o}return a._value=t,a}function Ty(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=Jo(e);return this.tween(o,(i.local?Vy:Ay)(i,t))}function My(e,t){return function(){Ka(this,e).delay=+t.apply(this,arguments)}}function By(e,t){return t=+t,function(){Ka(this,e).delay=t}}function Dy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?My:By)(t,e)):mt(this.node(),t).delay}function Oy(e,t){return function(){vt(this,e).duration=+t.apply(this,arguments)}}function Ly(e,t){return t=+t,function(){vt(this,e).duration=t}}function Py(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Oy:Ly)(t,e)):mt(this.node(),t).duration}function zy(e,t){if(typeof t!="function")throw new Error;return function(){vt(this,e).ease=t}}function Uy(e){var t=this._id;return arguments.length?this.each(zy(t,e)):mt(this.node(),t).ease}function Hy(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;vt(this,e).ease=o}}function Fy(e){if(typeof e!="function")throw new Error;return this.each(Hy(this._id,e))}function Gy(e){typeof e!="function"&&(e=xs(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new Ct(i,this._parents,this._name,this._id)}function Yy(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,l=Math.min(i,a),r=new Array(i),s=0;s<l;++s)for(var c=t[s],d=o[s],u=c.length,f=r[s]=new Array(u),p,m=0;m<u;++m)(p=c[m]||d[m])&&(f[m]=p);for(;s<i;++s)r[s]=t[s];return new Ct(r,this._parents,this._name,this._id)}function Wy(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 Ky(e,t,o){var i,a,l=Wy(t)?Ka:vt;return function(){var r=l(this,e),s=r.on;s!==i&&(a=(i=s).copy()).on(t,o),r.on=a}}function qy(e,t){var o=this._id;return arguments.length<2?mt(this.node(),o).on.on(e):this.each(Ky(o,e,t))}function Xy(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function jy(){return this.on("end.remove",Xy(this._id))}function Zy(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Aa(e));for(var i=this._groups,a=i.length,l=new Array(a),r=0;r<a;++r)for(var s=i[r],c=s.length,d=l[r]=new Array(c),u,f,p=0;p<c;++p)(u=s[p])&&(f=e.call(u,u.__data__,p,s))&&("__data__"in u&&(f.__data__=u.__data__),d[p]=f,pi(d[p],t,o,p,d,mt(u,o)));return new Ct(l,this._parents,t,o)}function Jy(e){var t=this._name,o=this._id;typeof e!="function"&&(e=$s(e));for(var i=this._groups,a=i.length,l=[],r=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,f=0;f<d;++f)if(u=c[f]){for(var p=e.call(u,u.__data__,f,c),m,h=mt(u,o),b=0,g=p.length;b<g;++b)(m=p[b])&&pi(m,t,o,b,p,h);l.push(p),r.push(u)}return new Ct(l,r,t,o)}var Qy=eo.prototype.constructor;function eg(){return new Qy(this._groups,this._parents)}function tg(e,t){var o,i,a;return function(){var l=In(this,e),r=(this.style.removeProperty(e),In(this,e));return l===r?null:l===o&&r===i?a:a=t(o=l,i=r)}}function cc(e){return function(){this.style.removeProperty(e)}}function ng(e,t,o){var i,a=o+"",l;return function(){var r=In(this,e);return r===a?null:r===i?l:l=t(i=r,o)}}function og(e,t,o){var i,a,l;return function(){var r=In(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),In(this,e))),r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s))}}function ig(e,t){var o,i,a,l="style."+t,r="end."+l,s;return function(){var c=vt(this,e),d=c.on,u=c.value[l]==null?s||(s=cc(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(r,a=u),c.on=i}}function ag(e,t,o){var i=(e+="")=="transform"?ly:sc;return t==null?this.styleTween(e,tg(e,i)).on("end.style."+e,cc(e)):typeof t=="function"?this.styleTween(e,og(e,i,qa(this,"style."+e,t))).each(ig(this._id,e)):this.styleTween(e,ng(e,i,t),o).on("end.style."+e,null)}function lg(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function rg(e,t,o){var i,a;function l(){var r=t.apply(this,arguments);return r!==a&&(i=(a=r)&&lg(e,r,o)),i}return l._value=t,l}function sg(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,rg(e,t,o??""))}function cg(e){return function(){this.textContent=e}}function dg(e){return function(){var t=e(this);this.textContent=t??""}}function ug(e){return this.tween("text",typeof e=="function"?dg(qa(this,"text",e)):cg(e==null?"":e+""))}function fg(e){return function(t){this.textContent=e.call(this,t)}}function mg(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&fg(a)),t}return i._value=e,i}function pg(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,mg(e))}function hg(){for(var e=this._name,t=this._id,o=dc(),i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)if(c=r[d]){var u=mt(c,t);pi(c,e,o,d,r,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ct(i,this._parents,e,o)}function yg(){var e,t,o=this,i=o._id,a=o.size();return new Promise(function(l,r){var s={value:r},c={value:function(){--a===0&&l()}};o.each(function(){var d=vt(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&&l()})}var gg=0;function Ct(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function dc(){return++gg}var Rt=eo.prototype;Ct.prototype={constructor:Ct,select:Zy,selectAll:Jy,selectChild:Rt.selectChild,selectChildren:Rt.selectChildren,filter:Gy,merge:Yy,selection:eg,transition:hg,call:Rt.call,nodes:Rt.nodes,node:Rt.node,size:Rt.size,empty:Rt.empty,each:Rt.each,on:qy,attr:Sy,attrTween:Ty,style:ag,styleTween:sg,text:ug,textTween:pg,remove:jy,tween:vy,delay:Dy,duration:Py,ease:Uy,easeVarying:Fy,end:yg,[Symbol.iterator]:Rt[Symbol.iterator]};function bg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _g={time:null,delay:0,duration:250,ease:bg};function wg(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 vg(e){var t,o;e instanceof Ct?(t=e._id,e=e._name):(t=dc(),(o=_g).time=Fa(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&pi(c,e,t,d,r,o||wg(c,t));return new Ct(i,this._parents,e,t)}eo.prototype.interrupt=by,eo.prototype.transition=vg;const yi=e=>()=>e;function kg(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 Vt(e,t,o){this.k=e,this.x=t,this.y=o}Vt.prototype={constructor:Vt,scale:function(e){return e===1?this:new Vt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Vt(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 Vn=new Vt(1,0,0);Vt.prototype;function Xa(e){e.stopImmediatePropagation()}function uo(e){e.preventDefault(),e.stopImmediatePropagation()}function Eg(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ng(){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 uc(){return this.__zoom||Vn}function $g(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ig(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],l=e.invertY(t[0][1])-o[0][1],r=e.invertY(t[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),r>l?(l+r)/2:Math.min(0,l)||Math.max(0,r))}function Sg(){var e=Eg,t=Ng,o=Ig,i=$g,a=xg,l=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ri,d=jo("start","zoom","end"),u,f,p,m=500,h=150,b=0,g=10;function _(v){v.property("__zoom",uc).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",Q).filter(a).on("touchstart.zoom",de).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(v,R,E,P){var W=v.selection?v.selection():v;W.property("__zoom",uc),v!==W?K(v,R,E,P):W.interrupt().each(function(){F(this,arguments).event(P).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},_.scaleBy=function(v,R,E,P){_.scaleTo(v,function(){var W=this.__zoom.k,oe=typeof R=="function"?R.apply(this,arguments):R;return W*oe},E,P)},_.scaleTo=function(v,R,E,P){_.transform(v,function(){var W=t.apply(this,arguments),oe=this.__zoom,T=E==null?$(W):typeof E=="function"?E.apply(this,arguments):E,J=oe.invert(T),se=typeof R=="function"?R.apply(this,arguments):R;return o(y(N(oe,se),T,J),W,r)},E,P)},_.translateBy=function(v,R,E,P){_.transform(v,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),r)},null,P)},_.translateTo=function(v,R,E,P,W){_.transform(v,function(){var oe=t.apply(this,arguments),T=this.__zoom,J=P==null?$(oe):typeof P=="function"?P.apply(this,arguments):P;return o(Vn.translate(J[0],J[1]).scale(T.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof E=="function"?-E.apply(this,arguments):-E),oe,r)},P,W)};function N(v,R){return R=Math.max(l[0],Math.min(l[1],R)),R===v.k?v:new Vt(R,v.x,v.y)}function y(v,R,E){var P=R[0]-E[0]*v.k,W=R[1]-E[1]*v.k;return P===v.x&&W===v.y?v:new Vt(v.k,P,W)}function $(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function K(v,R,E,P){v.on("start.zoom",function(){F(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(P).end()}).tween("zoom",function(){var W=this,oe=arguments,T=F(W,oe).event(P),J=t.apply(W,oe),se=E==null?$(J):typeof E=="function"?E.apply(W,oe):E,he=Math.max(J[1][0]-J[0][0],J[1][1]-J[0][1]),we=W.__zoom,re=typeof R=="function"?R.apply(W,oe):R,me=c(we.invert(se).concat(he/we.k),re.invert(se).concat(he/re.k));return function(be){if(be===1)be=re;else{var xe=me(be),Ce=he/xe[2];be=new Vt(Ce,se[0]-xe[0]*Ce,se[1]-xe[1]*Ce)}T.zoom(null,be)}})}function F(v,R,E){return!E&&v.__zooming||new q(v,R)}function q(v,R){this.that=v,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,R),this.taps=0}q.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,R){return this.mouse&&v!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var R=ut(this.that).datum();d.call(v,this.that,new kg(v,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),R)}};function G(v,...R){if(!e.apply(this,arguments))return;var E=F(this,R).event(v),P=this.__zoom,W=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,i.apply(this,arguments)))),oe=bt(v);if(E.wheel)(E.mouse[0][0]!==oe[0]||E.mouse[0][1]!==oe[1])&&(E.mouse[1]=P.invert(E.mouse[0]=oe)),clearTimeout(E.wheel);else{if(P.k===W)return;E.mouse=[oe,P.invert(oe)],hi(this),E.start()}uo(v),E.wheel=setTimeout(T,h),E.zoom("mouse",o(y(N(P,W),E.mouse[0],E.mouse[1]),E.extent,r));function T(){E.wheel=null,E.end()}}function X(v,...R){if(p||!e.apply(this,arguments))return;var E=v.currentTarget,P=F(this,R,!0).event(v),W=ut(v.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),oe=bt(v,E),T=v.clientX,J=v.clientY;Ds(v.view),Xa(v),P.mouse=[oe,this.__zoom.invert(oe)],hi(this),P.start();function se(we){if(uo(we),!P.moved){var re=we.clientX-T,me=we.clientY-J;P.moved=re*re+me*me>b}P.event(we).zoom("mouse",o(y(P.that.__zoom,P.mouse[0]=bt(we,E),P.mouse[1]),P.extent,r))}function he(we){W.on("mousemove.zoom mouseup.zoom",null),Os(we.view,P.moved),uo(we),P.event(we).end()}}function Q(v,...R){if(e.apply(this,arguments)){var E=this.__zoom,P=bt(v.changedTouches?v.changedTouches[0]:v,this),W=E.invert(P),oe=E.k*(v.shiftKey?.5:2),T=o(y(N(E,oe),P,W),t.apply(this,R),r);uo(v),s>0?ut(this).transition().duration(s).call(K,T,P,v):ut(this).call(_.transform,T,P,v)}}function de(v,...R){if(e.apply(this,arguments)){var E=v.touches,P=E.length,W=F(this,R,v.changedTouches.length===P).event(v),oe,T,J,se;for(Xa(v),T=0;T<P;++T)J=E[T],se=bt(J,this),se=[se,this.__zoom.invert(se),J.identifier],W.touch0?!W.touch1&&W.touch0[2]!==se[2]&&(W.touch1=se,W.taps=0):(W.touch0=se,oe=!0,W.taps=1+!!u);u&&(u=clearTimeout(u)),oe&&(W.taps<2&&(f=se[0],u=setTimeout(function(){u=null},m)),hi(this),W.start())}}function B(v,...R){if(this.__zooming){var E=F(this,R).event(v),P=v.changedTouches,W=P.length,oe,T,J,se;for(uo(v),oe=0;oe<W;++oe)T=P[oe],J=bt(T,this),E.touch0&&E.touch0[2]===T.identifier?E.touch0[0]=J:E.touch1&&E.touch1[2]===T.identifier&&(E.touch1[0]=J);if(T=E.that.__zoom,E.touch1){var he=E.touch0[0],we=E.touch0[1],re=E.touch1[0],me=E.touch1[1],be=(be=re[0]-he[0])*be+(be=re[1]-he[1])*be,xe=(xe=me[0]-we[0])*xe+(xe=me[1]-we[1])*xe;T=N(T,Math.sqrt(be/xe)),J=[(he[0]+re[0])/2,(he[1]+re[1])/2],se=[(we[0]+me[0])/2,(we[1]+me[1])/2]}else if(E.touch0)J=E.touch0[0],se=E.touch0[1];else return;E.zoom("touch",o(y(T,J,se),E.extent,r))}}function ee(v,...R){if(this.__zooming){var E=F(this,R).event(v),P=v.changedTouches,W=P.length,oe,T;for(Xa(v),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),oe=0;oe<W;++oe)T=P[oe],E.touch0&&E.touch0[2]===T.identifier?delete E.touch0:E.touch1&&E.touch1[2]===T.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(T=bt(T,this),Math.hypot(f[0]-T[0],f[1]-T[1])<g)){var J=ut(this).on("dblclick.zoom");J&&J.apply(this,arguments)}}}return _.wheelDelta=function(v){return arguments.length?(i=typeof v=="function"?v:yi(+v),_):i},_.filter=function(v){return arguments.length?(e=typeof v=="function"?v:yi(!!v),_):e},_.touchable=function(v){return arguments.length?(a=typeof v=="function"?v:yi(!!v),_):a},_.extent=function(v){return arguments.length?(t=typeof v=="function"?v:yi([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),_):t},_.scaleExtent=function(v){return arguments.length?(l[0]=+v[0],l[1]=+v[1],_):[l[0],l[1]]},_.translateExtent=function(v){return arguments.length?(r[0][0]=+v[0][0],r[1][0]=+v[1][0],r[0][1]=+v[0][1],r[1][1]=+v[1][1],_):[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},_.constrain=function(v){return arguments.length?(o=v,_):o},_.duration=function(v){return arguments.length?(s=+v,_):s},_.interpolate=function(v){return arguments.length?(c=v,_):c},_.on=function(){var v=d.on.apply(d,arguments);return v===d?_:v},_.clickDistance=function(v){return arguments.length?(b=(v=+v)*v,_):Math.sqrt(b)},_.tapDistance=function(v){return arguments.length?(g=+v,_):g},_}var Ie=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Ie||{}),ja=(e=>(e.Partial="partial",e.Full="full",e))(ja||{}),rn=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(rn||{}),At=(e=>(e.Strict="strict",e.Loose="loose",e))(At||{}),Za=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Za||{}),fo=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(fo||{}),fc=(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))(fc||{});const Cg=["INPUT","SELECT","TEXTAREA"],Rg=typeof document<"u"?document:null;function Ja(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,l=typeof(i==null?void 0:i.closest)=="function"?i.closest(".nokey"):null;return Cg.includes(i==null?void 0:i.nodeName)||a||!!l}function Vg(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function mc(e,t,o,i){const a=t.replace("+",`
|
|
1
|
+
(function(Ee,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):(Ee=typeof globalThis<"u"?globalThis:Ee||self,n(Ee.EntityModeler={},Ee.Vue,Ee.OpenBlueseaCore))})(this,(function(Ee,n,ie){"use strict";var sS=Object.defineProperty;var cS=(Ee,n,ie)=>n in Ee?sS(Ee,n,{enumerable:!0,configurable:!0,writable:!0,value:ie}):Ee[n]=ie;var Ye=(Ee,n,ie)=>cS(Ee,typeof n!="symbol"?n+"":n,ie);const Hu={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function Fu(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 Ul(e,t,o={}){const i={...Hu,...o},a=new Map(e.entities.map(y=>[y.modelId,y])),l=new Map(e.associations.map(y=>[y.modelId,y])),r=new Map(t.entityLayouts.map(y=>[y.entityRef,y])),s=new Map(t.associationLayouts.map(y=>[y.associationRef,y])),c=t.entityLayouts.map(y=>y.entityRef).filter(y=>!a.has(y)),d=t.associationLayouts.map(y=>y.associationRef).filter(y=>!l.has(y)),u=new Map;for(const y of e.groups)for(const N of y.memberEntityRefs)u.set(N,y.modelId);const f=new Map;for(const y of t.groupLayouts)for(const N of y.memberNoteRefs??[])f.set(N,y.groupRef);let p=0;const m=e.entities.map(y=>{const N=u.get(y.modelId),q=r.get(y.modelId);if(q){const X={location:{x:q.geo.location.x,y:q.geo.location.y},size:{width:q.geo.size.width,height:q.geo.size.height}};return{entity:y,geo:X,collapsed:q.collapsed??!1,locked:q.locked??!1,groupRef:N,style:q.style,attributeStyles:q.attributeStyles,operationStyles:q.operationStyles}}const U=Fu(p++,i);return{entity:y,geo:U,collapsed:!1,locked:!1,groupRef:N}}),h=new Map(t.groupLayouts.map(y=>[y.groupRef,y])),_=e.groups.map(y=>{const N=h.get(y.modelId),q=N?{location:{x:N.geo.location.x,y:N.geo.location.y},size:{width:N.geo.size.width,height:N.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:y,geo:q,style:N==null?void 0:N.style,locked:(N==null?void 0:N.locked)??!1}}),b=e.associations.map(y=>{const N=s.get(y.modelId);return{association:y,waypoints:(N==null?void 0:N.waypoints)??[],sourceColumnRef:N==null?void 0:N.sourceColumnRef,targetColumnRef:N==null?void 0:N.targetColumnRef}}),g=t.notes.map(y=>({note:{...y,geo:{location:{x:y.geo.location.x,y:y.geo.location.y},size:{width:y.geo.size.width,height:y.geo.size.height}}},groupRef:f.get(y.modelId)})),I=[];for(const y of t.notes)for(const N of y.connections??[])a.has(N.targetRef)&&I.push({noteRef:y.modelId,targetRef:N.targetRef,waypoints:N.waypoints.map(q=>({x:q.x,y:q.y}))});return{entities:m,associations:b,groups:_,notes:g,noteConnections:I,prunedEntityRefs:c,prunedAssociationRefs:d}}function Gn(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 _n=.5;function Hl(e,t,o,i,a,l){const r=Gn(t),s=Gn(a),c={x:e.x+r.x*l,y:e.y+r.y*l},d={x:i.x+s.x*l,y:i.y+s.y*l},u=[c,...o,d],f=[];let p=e;const m=(b,g)=>{(Math.abs(b.x-p.x)>=_n||Math.abs(b.y-p.y)>=_n)&&(f.push({a:p,b,seg:g}),p=b)};m(c,0);let h=r.x!==0,_=c;for(let b=1;b<u.length;b++){const g=u[b],I=b<=o.length?b-1:o.length,y=Math.abs(g.x-_.x)<_n,N=Math.abs(g.y-_.y)<_n;y&&N||(y?(m(g,I),h=!1):N?(m(g,I),h=!0):h?(m({x:_.x,y:g.y},I),m(g,I),h=!0):(m({x:g.x,y:_.y},I),m(g,I),h=!1),_=g)}return m(i,o.length),f}function ia(e,t,o,i,a,l=20){const r=Hl(e,t,o,i,a,l);let s=`M ${tt(e.x)},${tt(e.y)}`;for(const c of r)s+=` L ${tt(c.b.x)},${tt(c.b.y)}`;return s}const Gu=14;function aa(e,t,o,i,a,l=20){return Hl(e,t,o,i,a,l).filter(r=>Math.hypot(r.b.x-r.a.x,r.b.y-r.a.y)>=Gu).map(r=>({point:{x:(r.a.x+r.b.x)/2,y:(r.a.y+r.b.y)/2},segIndex:r.seg}))}function tt(e){return Math.round(e*100)/100}const Yu=36;function Fl(e,t,o=Yu){const i=Math.max(e.x,t.x)+o;return`M ${tt(e.x)},${tt(e.y)} L ${tt(i)},${tt(e.y)} L ${tt(i)},${tt(t.y)} L ${tt(t.x)},${tt(t.y)}`}function la(e,t,o){const i=[e,...t,o];let a=`M ${tt(i[0].x)},${tt(i[0].y)}`;for(let l=1;l<i.length;l++)a+=` L ${tt(i[l].x)},${tt(i[l].y)}`;return a}function Wu(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ra(e,t){const o=Wu(e),i=e.width/2,a=e.height/2,l=t.x-o.x,r=t.y-o.y;if(Math.abs(l)<_n&&Math.abs(r)<_n)return{point:{x:e.x+e.width,y:o.y},side:"right"};const s=l!==0?i/Math.abs(l):1/0,c=r!==0?a/Math.abs(r):1/0,d=Math.min(s,c),u={x:o.x+l*d,y:o.y+r*d},f=s<=c?l>=0?"right":"left":r>=0?"bottom":"top";return{point:u,side:f}}function sa(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 ca(e,t,o){const i=[e,...t,o],a=[];for(let l=1;l<i.length;l++){const r=i[l-1],s=i[l];a.push({x:(r.x+s.x)/2,y:(r.y+s.y)/2})}return a}const Ku={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function Gl(e,t,o={}){const i={...Ku,...o},a=new Map(t.groupLayouts.map(u=>[u.groupRef,u.geo])),l=[];let r=0;for(const u of e.groups){const f=a.get(u.modelId),p=f?f.location:{x:0,y:0},m=f?f.size.width:800;f&&(r=Math.max(r,f.location.y+f.size.height));const h=Math.max(1,Math.floor((m-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((_,b)=>{const g=b%h,I=Math.floor(b/h);l.push({id:_,location:{x:p.x+i.pad+g*i.cellWidth,y:p.y+i.pad+i.headerHeight+I*i.cellHeight}})})}const s=new Set(e.groups.flatMap(u=>u.memberEntityRefs)),c=e.entities.filter(u=>!s.has(u.modelId)),d=r>0?r+40:i.pad;return c.forEach((u,f)=>{const p=f%i.ungroupedCols,m=Math.floor(f/i.ungroupedCols);l.push({id:u.modelId,location:{x:i.pad+p*i.cellWidth,y:d+m*i.cellHeight}})}),l}const Yl={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function Wl(e,t={}){const o={...Yl,...t},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function qu(e,t={}){const o={...Yl,...t},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((l,r)=>{const s=r%i,c=Wl(l.attributeCount,o),d=o.baseX+s*(o.boxWidth+o.gap),u=a[s];return a[s]=u+c+o.gap,{id:l.id,location:{x:d,y:u},size:{width:o.boxWidth,height:c}}})}function Lo(e,t,o,i){switch(e){case"CLASS":return t;case"PHYSICAL":return i||t;case"LOGICAL":return o||"(논리명)";default:return i?`${o||"(논리명)"} · ${i}`:o||"(논리명)"}}function Kl(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 ql(e){var l,r,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||(((l=c.name)==null?void 0:l.ko)??c.modelId));const a=[];for(const c of e.entities){const d=(r=c.table)!=null&&r.physicalName?` (${c.table.physicalName})`:"",u=i.get(c.modelId);a.push(`## ${c.name}${d} «${c.stereotype}»${u?` [${u}]`:""}`);const f=[...c.attributes].sort((m,h)=>m.order-h.order);for(const m of f){if(m.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${m.name?` ${m.name} ${"─".repeat(8)}`:""}`);continue}const h=m.dbAttrs[0],_=h!=null&&h.length?`(${h.length}${h.scale!=null?`,${h.scale}`:""})`:"",b=h?` → ${h.physicalName} ${h.dataType}${_}`:"",g=[m.identifier?"PK":"",m.notNull?"NOT NULL":"",h!=null&&h.unique?"UNIQUE":"",h!=null&&h.autoIncrement?"AUTO_INCREMENT":""].filter(Boolean);a.push(` - ${m.name}: ${m.type}${b}${g.length?` {${g.join(", ")}}`:""}`)}for(const m of c.indexes??[]){const h=m.columns.map(_=>`${o.get(_.columnRef)??_.columnRef}${_.descending?" DESC":""}`).join(", ");a.push(` index ${m.name}${m.unique?" UNIQUE":""}: ${h}`)}const p=[...c.operations??[]].sort((m,h)=>m.order-h.order);for(const m of p){const h=m.visibility?` {${m.visibility}}`:"",_=(s=m.description)!=null&&s.ko?` — ${m.description.ko}`:"";a.push(` method ${m.name}()${h}${_}`)}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,f=c.end2.composition||c.end1.composition?" (composition)":"";a.push(` ${d} ${Kl(c.end1.multiplicity)} —— ${Kl(c.end2.multiplicity)} ${u}${f}`)}}return a.join(`
|
|
2
|
+
`).trim()}const Xu=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function rt(e){return e.replace(Xu,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function Xl(e){return`<text ${[`x="${Ce(e.x)}"`,`y="${Ce(e.y)}"`,`fill="${rt(e.fill)}"`,`font-size="${Ce(e.fontSize)}"`,e.fontFamily?`font-family="${rt(e.fontFamily)}"`:"",e.fontWeight!=null?`font-weight="${rt(String(e.fontWeight))}"`:"",e.fontStyle&&e.fontStyle!=="normal"?`font-style="${rt(e.fontStyle)}"`:"",e.anchor&&e.anchor!=="start"?`text-anchor="${e.anchor}"`:"",'dominant-baseline="central"'].filter(Boolean).join(" ")}>${rt(e.text)}</text>`}function ju(e){return`<line x1="${Ce(e.x1)}" y1="${Ce(e.y)}" x2="${Ce(e.x2)}" y2="${Ce(e.y)}" stroke="${rt(e.stroke)}" stroke-width="${Ce(e.strokeWidth??1)}" />`}function Zu(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 Ju(e,t,o,i,a){return[`M${Ce(e+a.tl)},${Ce(t)}`,`L${Ce(e+o-a.tr)},${Ce(t)}`,a.tr?`Q${Ce(e+o)},${Ce(t)} ${Ce(e+o)},${Ce(t+a.tr)}`:"",`L${Ce(e+o)},${Ce(t+i-a.br)}`,a.br?`Q${Ce(e+o)},${Ce(t+i)} ${Ce(e+o-a.br)},${Ce(t+i)}`:"",`L${Ce(e+a.bl)},${Ce(t+i)}`,a.bl?`Q${Ce(e)},${Ce(t+i)} ${Ce(e)},${Ce(t+i-a.bl)}`:"",`L${Ce(e)},${Ce(t+a.tl)}`,a.tl?`Q${Ce(e)},${Ce(t)} ${Ce(e+a.tl)},${Ce(t)}`:"","Z"].filter(Boolean).join(" ")}function da(e){const t=Zu(e.radius),o=t.tl||t.tr||t.br||t.bl,i=[`fill="${rt(e.fill)}"`,`stroke="${rt(e.stroke)}"`,`stroke-width="${Ce(e.strokeWidth??1)}"`,e.strokeDasharray?`stroke-dasharray="${rt(e.strokeDasharray)}"`:"",e.opacity!=null?`opacity="${Ce(e.opacity)}"`:""].filter(Boolean),l=[o?`<path d="${Ju(e.x,e.y,e.w,e.h,t)}" ${i.join(" ")} />`:`<rect x="${Ce(e.x)}" y="${Ce(e.y)}" width="${Ce(e.w)}" height="${Ce(e.h)}" ${i.join(" ")} />`];for(const r of e.lines??[])l.push(ju(r));for(const r of e.texts)l.push(Xl(r));for(const r of e.icons??[])l.push(r);return`<g>${l.join("")}</g>`}function Qu(e){const o=[`<path ${[`d="${rt(e.d)}"`,'fill="none"',`stroke="${rt(e.stroke)}"`,`stroke-width="${Ce(e.strokeWidth)}"`,e.strokeDasharray?`stroke-dasharray="${rt(e.strokeDasharray)}"`:""].filter(Boolean).join(" ")} />`];for(const i of e.markers??[])o.push(i);for(const i of e.labels)o.push(Xl(i));return`<g>${o.join("")}</g>`}function jl(e){const{x:t,y:o,w:i,h:a}=e.viewBox,l=[];e.background&&l.push(`<rect x="${Ce(t)}" y="${Ce(o)}" width="${Ce(i)}" height="${Ce(a)}" fill="${rt(e.background)}" />`);for(const r of e.groups)l.push(da(r));for(const r of e.edges)l.push(Qu(r));for(const r of e.entities)l.push(da(r));for(const r of e.notes)l.push(da(r));return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${Ce(t)} ${Ce(o)} ${Ce(i)} ${Ce(a)}" width="${Ce(i)}" height="${Ce(a)}">`+l.join("")+"</svg>"}const ef=["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"],tf=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"]),nf=ef.filter(e=>!tf.has(e)),of={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function ua(e){return of[e]??e}const af=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),Po=new Set(["NUMERIC","DECIMAL"]);function Zl(e,t=nf){const o=[...t];return e&&!o.includes(e)?[e,...o]:o}const Lt="CustomType",Yn="GroupCodeEnum",fa="String",ma=[{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:"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:Yn,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:Lt,label:"CustomType"}],lf=new Map(ma.map(e=>[e.value,e.label]));function wn(e){return lf.get(e)??e}const rf=new Set([Yn,"CustomMoneyType"]),Jl=ma.filter(e=>!rf.has(e.value)).map(e=>e.value===Lt?{...e,label:"CustomType (사용자정의)"}:e);function Ql(e,t=[]){const o=t.map(a=>{var r,s;const l=((r=a.label)==null?void 0:r.ko)??((s=a.label)==null?void 0:s.en);return{value:a.type,label:l?`${a.type} (${l})`:a.type}}),i=[...Jl,...o];return e&&!i.some(a=>a.value===e)?[{value:e,label:wn(e)},...i]:i}function sf(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function er(e,t){var a;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!=="EXACTLY_ONE_INSTANCE")return((a=i.jpa)==null?void 0:a.collectionType)??"LIST"}function pa(e,t,o){var i;return t.attrType==="DIVIDER"||e==="LOGICAL"?"":o&&t.attrType.startsWith("EMBED")?`${o==="SET"?"Set":"List"}<${wn(t.type)}>`:sf(t)?wn(t.type):e==="CLASS"?t.type===Lt&&t.customType||wn(t.type):ua(((i=t.dbAttrs[0])==null?void 0:i.dataType)??"")}function Wn(e){const t=new Map;for(const o of e)t.set(o.modelId,o);return t}function zo(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 ha=63;function Uo(e){if(!e)return null;const t=e.length;return t<=ha?null:`물리명이 ${ha}자를 초과했습니다 (${t}자) — 일부 DB에서 잘릴 수 있습니다`}function tr(e){return e.dataType?e.length==null?e.dataType:e.scale==null?`${e.dataType}(${e.length})`:`${e.dataType}(${e.length},${e.scale})`:"(미지정)"}function dt(e){return!e||e.trim()===""}function Kn(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function cf(e){const t=new Map;for(const u of e.associations){if(u.identifying!==!0||u.end1.entityRef===u.end2.entityRef)continue;const f=t.get(u.end1.entityRef)??[];f.push(u.end2.entityRef),t.set(u.end1.entityRef,f)}const o=0,i=1,a=2,l=new Map,r=[],s=[],c=new Set,d=u=>{l.set(u,i),r.push(u);for(const f of t.get(u)??[]){const p=l.get(f)??o;if(p===o)d(f);else if(p===i){const m=r.slice(r.indexOf(f)),h=[...m].sort().join(" ");c.has(h)||(c.add(h),s.push(m))}}r.pop(),l.set(u,a)};for(const u of e.entities)(l.get(u.modelId)??o)===o&&d(u.modelId);return s}function df(e,t,o,i,a){var l,r,s,c,d;if(!dt(t.physicalName))return t.physicalName;if(e.attrType==="EMBED_PREDEF")return((s=(r=(l=a==null?void 0:a.embeddableCatalog)==null?void 0:l.find(u=>u.type===e.type))==null?void 0:r.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 f=(d=i.entities.find(p=>p.modelId===u))==null?void 0:d.attributes.flatMap(p=>p.dbAttrs)[o];return(f==null?void 0:f.physicalName)??""}return t.physicalName??""}function ya(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 nr(e,t){var l,r,s;const o=[];for(const c of ya(e.entities,d=>d.name))o.push({ruleId:"CHK-NAME-3",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:`엔티티 이름이 중복됩니다: "${c.name}"`});for(const c of e.entities){const d=c.attributes.filter(h=>h.attrType!=="DIVIDER");if(dt(c.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"entity",targetRef:c.modelId,message:"엔티티 이름이 비어 있습니다"}),c.stereotype==="JPA_ENTITY"&&!c.abstractClass&&(d.some(h=>h.identifier)||o.push({ruleId:"CHK-JPA-1",severity:"error",targetKind:"entity",targetRef:c.modelId,message:"JPA 엔티티에 식별자(PK) 속성이 없습니다"}),dt((l=c.table)==null?void 0:l.physicalName)&&o.push({ruleId:"CHK-JPA-8",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:"JPA 엔티티에 테이블 물리명이 설정되지 않았습니다"})),c.stereotype==="JPA_EMBEDDABLE")for(const h of d.filter(_=>_.identifier))o.push({ruleId:"CHK-JPA-2",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`임베더블 타입은 식별자 속성을 가질 수 없습니다: "${h.name}"`});for(const h of d.filter(_=>_.identifier&&_.transient))o.push({ruleId:"CHK-JPA-12",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`식별자(@Id) 속성은 transient(@Transient)일 수 없습니다: "${h.name}"`});for(const h of d)if(!h.identifier)for(const _ of h.dbAttrs)!_.autoIncrement&&dt(_.sequenceName)||o.push({ruleId:"CHK-JPA-13",severity:"error",targetKind:"column",targetRef:_.modelId,contextRef:c.modelId,message:`채번(${_.autoIncrement?"auto increment":`시퀀스 "${_.sequenceName}"`})은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "${h.name}"에 설정되어 있습니다`});for(const h of d.filter(_=>_.naturalId&&_.identifier))o.push({ruleId:"CHK-JPA-15",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`식별자(@Id) 속성은 자연키(@NaturalId)일 수 없습니다 — 자연키는 PK와 별개의 비즈니스 키입니다: "${h.name}"`});for(const h of d.filter(_=>_.naturalId&&_.transient))o.push({ruleId:"CHK-JPA-16",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`자연키(@NaturalId) 속성은 transient(@Transient)일 수 없습니다: "${h.name}"`});for(const h of d.filter(_=>_.naturalId&&!_.notNull&&!_.identifier&&!_.transient))o.push({ruleId:"CHK-JPA-17",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`자연키(@NaturalId) 속성은 not null이 권장됩니다(비즈니스 키는 non-null이 원칙): "${h.name}"`});!c.abstractClass&&d.length===0&&o.push({ruleId:"CHK-DSN-2",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:"속성이 하나도 없는 엔티티입니다"}),(t==null?void 0:t.largeEntityThreshold)!=null&&d.length>t.largeEntityThreshold&&o.push({ruleId:"CHK-DSN-4",severity:"info",targetKind:"entity",targetRef:c.modelId,message:`속성이 ${d.length}개로 많습니다 (임계치 ${t.largeEntityThreshold} 초과) — 분해를 검토하세요`});for(const h of ya(d,_=>_.name))o.push({ruleId:"CHK-NAME-1",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:`속성 이름이 중복됩니다: "${h.name}"`});for(const h of d)dt(h.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"attribute",targetRef:h.modelId,contextRef:c.modelId,message:"속성 이름이 비어 있습니다"});const u=d.flatMap(h=>h.dbAttrs).filter(h=>h.sharedColumnRef==null),f=d.flatMap(h=>h.dbAttrs.map((_,b)=>({col:_,name:df(h,_,b,e,t)})).filter(_=>_.col.sharedColumnRef==null));for(const h of ya(f,_=>_.name))o.push({ruleId:"CHK-NAME-2",severity:"error",targetKind:"column",targetRef:h.col.modelId,contextRef:c.modelId,message:`컬럼 물리명이 중복됩니다: "${h.name}"`});for(const h of u){const _=Uo(h.physicalName);_&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:_}),t!=null&&t.reservedWords&&!dt(h.physicalName)&&t.reservedWords.has(h.physicalName.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`컬럼 물리명이 SQL 예약어입니다: "${h.physicalName}"`}),t!=null&&t.selectableDataTypes&&!dt(h.dataType)&&!t.selectableDataTypes.has(h.dataType)&&o.push({ruleId:"CHK-TYPE-1",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`타겟 DB가 지원하지 않는 컬럼 타입입니다: "${h.dataType}"`}),!dt(h.dataType)&&af.has(h.dataType)&&!h.length&&o.push({ruleId:"CHK-TYPE-2",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:c.modelId,message:`${h.dataType} 타입에 length가 지정되지 않았습니다`})}if((r=t==null?void 0:t.embeddableCatalog)!=null&&r.length){const h=Wn(d.flatMap(_=>_.dbAttrs));for(const _ of d){if(_.attrType!=="EMBED_PREDEF")continue;const b=t.embeddableCatalog.find(g=>g.type===_.type);b&&_.dbAttrs.forEach((g,I)=>{if(g.sharedColumnRef==null)return;const y=b.fields[I],N=h.get(g.sharedColumnRef);if(!y||!N)return;(N.dataType!==y.dataType||(N.length??null)!==(y.length??null)||(N.scale??null)!==(y.scale??null))&&o.push({ruleId:"CHK-TYPE-3",severity:"warning",targetKind:"column",targetRef:g.modelId,contextRef:c.modelId,message:`공유 대상 컬럼의 타입(${tr(N)})이 ${y.name??"컬럼"} 정의(${tr(y)})와 다릅니다`})})}}for(const h of d){const _=h.dbAttrs[0];if(!(_!=null&&_.multiValue))continue;h.type===Yn&&_.dataType==="VARCHAR"||o.push({ruleId:"CHK-TYPE-4",severity:"warning",targetKind:"column",targetRef:_.modelId,contextRef:c.modelId,message:`다중값(Multi-Value) 속성은 GroupCodeEnum + VARCHAR 조합에서만 컨버터가 자동 생성됩니다 — 현재(${h.type||"타입 미지정"} / ${_.dataType||"dataType 미지정"})에서는 Set<…> 필드만 생성되어 매핑이 불완전할 수 있습니다`})}const p=(s=c.table)==null?void 0:s.physicalName,m=Uo(p);m&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:m}),t!=null&&t.reservedWords&&!dt(p)&&t.reservedWords.has(p.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"entity",targetRef:c.modelId,message:`테이블 물리명이 SQL 예약어입니다: "${p}"`});for(const h of c.indexes??[]){const _=Uo(h.name);_&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:c.modelId,message:_}),t!=null&&t.reservedWords&&!dt(h.name)&&t.reservedWords.has(h.name.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:c.modelId,message:`인덱스 이름이 SQL 예약어입니다: "${h.name}"`})}}const i=new Map;for(const c of e.entities)for(const d of c.attributes)d.attrType==="EMBED_OWN"&&d.embedded&&i.set(d.embedded.associationRef,d);for(const c of e.associations){Kn(c.end1.multiplicity)&&Kn(c.end2.multiplicity)&&o.push({ruleId:"CHK-DSN-1",severity:"info",targetKind:"association",targetRef:c.modelId,message:"both-many(M:N) 관계를 조인 엔티티 없이 직접 연결했습니다 — 연관 엔티티 도입을 검토하세요"}),i.has(c.modelId)&&c.identifying&&o.push({ruleId:"CHK-JPA-11",severity:"error",targetKind:"association",targetRef:c.modelId,message:"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 — 임베더블은 독립 식별자가 없습니다"});for(const d of["end1","end2"]){const u=c[d].jpa;if(!u)continue;const f=u.cascadeTypes??[],p=f.includes("ALL"),m=f.includes("REMOVE");p&&f.length>1&&o.push({ruleId:"CHK-JPA-5",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)`}),u.orphanRemoval&&(m||p)&&o.push({ruleId:"CHK-JPA-6",severity:"info",targetKind:"association",targetRef:c.modelId,message:`${d}: orphanRemoval이 cascade ${p?"ALL":"REMOVE"}와 의미가 겹칩니다`}),Kn(c[d].multiplicity)&&u.fetchType==="EAGER"&&o.push({ruleId:"CHK-JPA-7",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: 컬렉션(to-many) 연관에 EAGER 페치는 성능 위험이 있습니다`}),u.orphanRemoval&&Kn(c[d==="end1"?"end2":"end1"].multiplicity)&&o.push({ruleId:"CHK-JPA-14",severity:"error",targetKind:"association",targetRef:c.modelId,message:`${d}: orphanRemoval은 @ManyToOne/@ManyToMany(반대편이 컬렉션) 연관에는 적용할 수 없습니다 — @OneToOne·@OneToMany에서만 유효합니다`}),!Kn(c[d].multiplicity)&&(u.collectionType||u.collectionTable||u.orderColumn)&&o.push({ruleId:"CHK-JPA-9",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: 단일(to-one) 연관에 컬렉션 메타(collectionType/collectionTable/orderColumn)는 무의미합니다 — @ElementCollection은 컬렉션에서만 적용됩니다`}),u.collectionType==="SET"&&u.orderColumn&&o.push({ruleId:"CHK-JPA-10",severity:"warning",targetKind:"association",targetRef:c.modelId,message:`${d}: SET 컬렉션은 순서를 보존하지 않아 orderColumn(@OrderColumn)이 무의미합니다`})}}const a=new Map(e.entities.map(c=>[c.modelId,c.name||c.modelId]));for(const c of cf(e)){const d=[...c,c[0]].map(u=>a.get(u)??u).join(" → ");for(const u of c)o.push({ruleId:"CHK-JPA-4",severity:"warning",targetKind:"entity",targetRef:u,message:`식별 관계 사이클입니다 (PK 무한 의존): ${d}`})}if(t!=null&&t.flagEntitiesWithoutRelations){const c=new Set;for(const u of e.associations)c.add(u.end1.entityRef),c.add(u.end2.entityRef);const d=new Map(e.entities.map(u=>[u.name,u.modelId]));for(const u of e.entities){for(const f of u.attributes)f.embedded&&(c.add(u.modelId),c.add(f.embedded.embeddableRef));if(!dt(u.superClass)){c.add(u.modelId);const f=d.get(u.superClass);f&&c.add(f)}}for(const u of e.entities)c.has(u.modelId)||o.push({ruleId:"CHK-DSN-3",severity:"info",targetKind:"entity",targetRef:u.modelId,message:"모델링된 관계가 없습니다 (연관·상속·임베딩 미참여 — 의도적 생략이면 무시)"})}return o}function Me(){return crypto.randomUUID()}const uf="CustomMoneyType",ff="Money";function mf(e){return!(e.type!==uf||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function pf(e){const t=e.dbAttrs[0]??{modelId:Me(),physicalName:"",dataType:""},o={modelId:Me(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:ff,attrType:"EMBED_PREDEF",dbAttrs:[t,o]}}function hf(e){let t=!1;const o=e.entities.map(i=>{let a=!1;const l=i.attributes.map(r=>mf(r)?(a=!0,t=!0,pf(r)):r);return a?{...i,attributes:l}:i});return t?{...e,entities:o}:e}function ga(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 Zt(e,t,o){const i={},a=new Set([...Object.keys(e),...Object.keys(t)]);for(const l of a)o.has(l)||vn(e[l],t[l])||(i[l]=t[l]===void 0?null:t[l]);return Object.keys(i).length?i:null}function Jt(e,t,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(t.map(d=>[o(d),d])),l=[],r=[],s=[];for(const[d,u]of a){const f=i.get(d);f?s.push({cur:f,tgt:u}):l.push(u)}for(const[d,u]of i)a.has(d)||r.push(u);const c=(d,u)=>o(d)<o(u)?-1:o(d)>o(u)?1:0;return l.sort(c),r.sort(c),s.sort((d,u)=>c(d.tgt,u.tgt)),{added:l,removed:r,common:s}}function yf(e,t){const o=new Set(e),i=new Set(t),a=t.filter(r=>!o.has(r)).sort(),l=e.filter(r=>!i.has(r)).sort();return{added:a,removed:l}}const gf=new Set(["attributes","operations","indexes","rev"]),bf=new Set(["end1","end2","rev"]),_f=new Set(["memberEntityRefs","rev"]),or=new Set(["modelId"]),wf=new Set(["modelId","columns"]),vf=new Set([]);function kf(e,t,o,i){const a=Jt(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=Zt(s,c,or);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const l=Jt(t.operations??[],o.operations??[],s=>s.modelId);for(const s of l.removed)i.push({kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId});for(const s of l.added)i.push({kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of l.common){const d=Zt(s,c,or);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const r=Jt(t.indexes??[],o.indexes??[],s=>s.modelId);for(const s of r.removed)i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId});for(const s of r.added)i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of r.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=Zt(s,c,wf);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function Ef(e,t,o){const i=Jt(e.entities??[],t.entities??[],r=>r.modelId);for(const r of i.removed)o.push({kind:"entity.remove",casUnit:"logical",entityRef:r.modelId});for(const r of i.added)o.push({kind:"entity.add",casUnit:"logical",entityRef:r.modelId,value:ga(r)});for(const{cur:r,tgt:s}of i.common){const c=Zt(r,s,gf);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:r.modelId,entityRef:r.modelId,patch:c}),kf(r.modelId,r,s,o)}const a=Jt(e.associations??[],t.associations??[],r=>r.modelId);for(const r of a.removed)o.push({kind:"association.remove",casUnit:"logical",associationRef:r.modelId});for(const r of a.added)o.push({kind:"association.add",casUnit:"logical",associationRef:r.modelId,value:ga(r)});for(const{cur:r,tgt:s}of a.common){const c=Zt(r,s,bf);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:r.modelId,associationRef:r.modelId,patch:c});for(const d of["end1","end2"]){const u=Zt(r[d]??{},s[d]??{},vf);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:r.modelId,associationRef:r.modelId,end:d,patch:u})}}const l=Jt(e.groups??[],t.groups??[],r=>r.modelId);for(const r of l.removed)o.push({kind:"group.remove",casUnit:"logical",groupRef:r.modelId});for(const r of l.added)o.push({kind:"group.add",casUnit:"logical",groupRef:r.modelId,value:ga(r)});for(const{cur:r,tgt:s}of l.common){const c=Zt(r,s,_f);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,patch:c});const d=yf(r.memberEntityRefs??[],s.memberEntityRefs??[]);for(const u of d.removed)o.push({kind:"group.removeMember",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,entityRef:u});for(const u of d.added)o.push({kind:"group.addMember",casUnit:"logical",containerRef:r.modelId,groupRef:r.modelId,entityRef:u})}}function Ho(e,t,o,i,a,l,r){const s=Jt(e,t,o);for(const c of s.removed)r.push({kind:a,casUnit:"layout",[l]:o(c),value:void 0});for(const c of s.added)r.push({kind:i,casUnit:"layout",[l]:o(c),value:c});for(const{cur:c,tgt:d}of s.common)vn(c,d)||(r.push({kind:a,casUnit:"layout",[l]:o(c),value:void 0}),r.push({kind:i,casUnit:"layout",[l]:o(d),value:d}))}function Nf(e,t,o){Ho(e.entityLayouts??[],t.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),Ho(e.associationLayouts??[],t.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),Ho(e.groupLayouts??[],t.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),Ho(e.notes??[],t.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function $f(e,t){const o=[];return Ef(e.logical,t.logical,o),Nf(e.layout,t.layout,o),o}function xf(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 If={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 Sf{constructor(t){Ye(this,"out",[]);Ye(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({...qn(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({...qn(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({...qn(t),field:a,value:void 0,removed:!0});continue}this.out.push({...qn(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({...qn(t),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function qn(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 gt(e,t,o,i){if(o==null||typeof o!="object")return;const a=If[i];for(const[l,r]of Object.entries(o))a.has(l)||e.set(t,l,r)}function Qt(e,t,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(t,i,a)}function ba(e,t){if(Array.isArray(e))return e.find(o=>o.modelId===t)}function Pt(e,t){var l,r,s,c,d,u,f,p;const o=xf(t),i=new Sf(t.field),a=[...e].sort((m,h)=>m.seq-h.seq);for(const m of a)for(const h of m.ops)switch(o){case"entity":if(h.entityRef!==t.entityRef)break;h.kind==="entity.add"?gt(i,m,h.value,"entity"):h.kind==="entity.update"?Qt(i,m,h.patch):h.kind==="entity.remove"&&i.remove(m);break;case"attribute":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const _=ba((l=h.value)==null?void 0:l.attributes,t.attributeRef);_&>(i,m,_,"attribute")}else h.kind==="attribute.add"&&((r=h.value)==null?void 0:r.modelId)===t.attributeRef?gt(i,m,h.value,"attribute"):h.kind==="attribute.update"&&h.attributeRef===t.attributeRef?Qt(i,m,h.patch):(h.kind==="attribute.remove"&&h.attributeRef===t.attributeRef||h.kind==="entity.remove")&&i.remove(m);break;case"operation":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const _=ba((s=h.value)==null?void 0:s.operations,t.operationRef);_&>(i,m,_,"operation")}else h.kind==="operation.add"&&((c=h.value)==null?void 0:c.modelId)===t.operationRef?gt(i,m,h.value,"operation"):h.kind==="operation.update"&&h.operationRef===t.operationRef?Qt(i,m,h.patch):(h.kind==="operation.remove"&&h.operationRef===t.operationRef||h.kind==="entity.remove")&&i.remove(m);break;case"index":if(h.entityRef!==t.entityRef)break;if(h.kind==="entity.add"){const _=ba((d=h.value)==null?void 0:d.indexes,t.indexRef);_&>(i,m,_,"index")}else h.kind==="index.add"&&((u=h.value)==null?void 0:u.modelId)===t.indexRef?gt(i,m,h.value,"index"):h.kind==="index.update"&&h.indexRef===t.indexRef?Qt(i,m,h.patch):(h.kind==="index.remove"&&h.indexRef===t.indexRef||h.kind==="entity.remove")&&i.remove(m);break;case"association":if(h.associationRef!==t.associationRef)break;h.kind==="association.add"?gt(i,m,h.value,"association"):h.kind==="association.update"?Qt(i,m,h.patch):h.kind==="association.remove"&&i.remove(m);break;case"associationEnd":if(h.associationRef!==t.associationRef)break;if(h.kind==="association.add"){const _=(f=h.value)==null?void 0:f[t.end];gt(i,m,_,"associationEnd")}else h.kind==="associationEnd.update"&&h.end===t.end?Qt(i,m,h.patch):h.kind==="association.remove"&&i.remove(m);break;case"group":if(h.groupRef!==t.groupRef)break;if(h.kind==="group.add"){gt(i,m,h.value,"group");const _=(p=h.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(_))for(const b of _)i.member(m,b,!1)}else h.kind==="group.update"?Qt(i,m,h.patch):h.kind==="group.remove"?i.remove(m):h.kind==="group.addMember"&&h.entityRef!=null?i.member(m,h.entityRef,!1):h.kind==="group.removeMember"&&h.entityRef!=null&&i.member(m,h.entityRef,!0);break}return i.result()}function Cf(e,t){const o=e;return o.entityRef===t||o.containerRef===t}function kn(e,t){if(Array.isArray(e))for(const o of e)typeof o.modelId=="string"&&t.add(o.modelId)}function Rf(e,t){const o=new Set,i=new Set,a=new Set;for(const l of e)for(const r of l.ops){const s=r;if(r.kind==="entity.add"&&s.entityRef===t){const c=s.value;kn(c==null?void 0:c.attributes,o),kn(c==null?void 0:c.operations,i),kn(c==null?void 0:c.indexes,a);continue}s.containerRef!==t&&s.entityRef!==t||(r.kind==="attribute.add"?kn([s.value],o):r.kind==="attribute.update"||r.kind==="attribute.remove"?typeof s.attributeRef=="string"&&o.add(s.attributeRef):r.kind==="operation.add"?kn([s.value],i):r.kind==="operation.update"||r.kind==="operation.remove"?typeof s.operationRef=="string"&&i.add(s.operationRef):r.kind==="index.add"?kn([s.value],a):(r.kind==="index.update"||r.kind==="index.remove")&&typeof s.indexRef=="string"&&a.add(s.indexRef))}return{attributes:o,operations:i,indexes:a}}function Fo(e,t){return e.map(o=>({...o,subject:t}))}function ir(e,t){const o=e.filter(s=>s.ops.some(c=>Cf(c,t))),{attributes:i,operations:a,indexes:l}=Rf(o,t),r=[...Fo(Pt(o,{entityRef:t}),{kind:"entity",ref:t})];for(const s of i)r.push(...Fo(Pt(o,{entityRef:t,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)r.push(...Fo(Pt(o,{entityRef:t,operationRef:s}),{kind:"operation",ref:s}));for(const s of l)r.push(...Fo(Pt(o,{entityRef:t,indexRef:s}),{kind:"index",ref:s}));return r.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 ar(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Vf(e){var i,a,l;const t=new Set,o=(r,s)=>{typeof s=="string"&&t.add(`${r}:${s}:`)};for(const r of e)for(const s of r.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",(l=c.value)==null?void 0:l.modelId);break;case"association.add":o("association",c.associationRef);break;case"group.add":o("group",c.groupRef);break}}return t}function Af(e){const t=new Set,o=new Set,i=new Set;for(const a of e)for(const l of a.ops){const r=l,s=l.kind;if(s.startsWith("entity."))typeof r.entityRef=="string"&&t.add(r.entityRef);else if(s.startsWith("attribute.")||s.startsWith("operation.")||s.startsWith("index.")){const c=r.containerRef??r.entityRef;typeof c=="string"&&t.add(c)}else s.startsWith("associationEnd.")||s.startsWith("association.")?typeof r.associationRef=="string"&&o.add(r.associationRef):s.startsWith("group.")&&typeof r.groupRef=="string"&&i.add(r.groupRef)}return{entities:t,associations:o,groups:i}}function Tf(e){const{entities:t,associations:o,groups:i}=Af(e),a=[];for(const l of t)for(const r of ir(e,l))a.push({...r,subject:{...r.subject,entityRef:l}});for(const l of o){for(const r of Pt(e,{associationRef:l}))a.push({...r,subject:{kind:"association",ref:l}});for(const r of["end1","end2"])for(const s of Pt(e,{associationRef:l,end:r}))a.push({...s,subject:{kind:"associationEnd",ref:l,end:r}})}for(const l of i)for(const r of Pt(e,{groupRef:l}))a.push({...r,subject:{kind:"group",ref:l}});return a}function lr(e){const t=Tf(e),o=Vf(e),i=new Map;for(const r of t){const s=ar(r.subject),c=i.get(s);(c===void 0||r.seq<c)&&i.set(s,r.seq)}const a=new Map;for(const r of t){let s=a.get(r.seq);s||(s={meta:r,subjects:new Map},a.set(r.seq,s));const c=ar(r.subject);let d=s.subjects.get(c);if(!d){const u=r.removed?"remove":i.get(c)===r.seq&&o.has(c)?"add":"update";d={subject:r.subject,verb:u,fields:[]},s.subjects.set(c,d)}r.removed?d.verb="remove":d.fields.push({field:r.field,value:r.value,...r.oldValue!==void 0?{oldValue:r.oldValue}:{}})}const l=[];for(const[r,s]of a){const c=s.meta;l.push({seq:r,...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 l.sort((r,s)=>s.seq-r.seq)}class _a{constructor(t){Ye(this,"undoStack",[]);Ye(this,"redoStack",[]);Ye(this,"savePoint",null);Ye(this,"listeners",new Set);Ye(this,"commandListeners",new Set);Ye(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 rr(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 ut(e,t){return e.layout.associationLayouts.find(o=>o.associationRef===t)}function ze(e,t){const o=e.logical.entities.find(i=>i.modelId===t);if(!o)throw new Error(`엔티티 없음: ${t}`);return o}function It(e,t,o){var i,a;return(a=(i=e.layout.notes.find(l=>l.modelId===t))==null?void 0:i.connections)==null?void 0:a.find(l=>l.targetRef===o)}function wa(e,t){return{label:`엔티티 추가: ${e.name}`,apply(o){o.logical.entities.push(e),o.layout.entityLayouts.push({entityRef:e.modelId,geo:t})},invert(o){const i=rr(o,e.modelId);i>=0&&o.logical.entities.splice(i,1);const a=je(o,e.modelId);a>=0&&o.layout.entityLayouts.splice(a,1)},emitOps(){const o={kind:"entity.add",casUnit:"logical",entityRef:e.modelId,value:e},i={kind:"entityLayout.add",casUnit:"layout",entityRef:e.modelId,value:{entityRef:e.modelId,geo:t},incidental:!0};return{forward:[o,i],invert:[{kind:"entityLayout.remove",casUnit:"layout",entityRef:e.modelId,incidental:!0},{kind:"entity.remove",casUnit:"logical",entityRef:e.modelId}]}}}}function sr(e){let t=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=rr(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const l=je(i,e),r=[];i.logical.associations.forEach((u,f)=>{o(u)&&r.push({item:u,index:f})});const s=new Set(r.map(u=>u.item.modelId)),c=[];i.layout.associationLayouts.forEach((u,f)=>{s.has(u.associationRef)&&c.push({item:u,index:f})});const d=[];i.logical.groups.forEach(u=>{const f=u.memberEntityRefs.indexOf(e);f>=0&&d.push({groupId:u.modelId,index:f})}),t={entity:{item:i.logical.entities[a],index:a},entityLayout:l>=0?{item:i.layout.entityLayouts[l],index:l}:void 0,assocs:r,assocLayouts:c,groupMemberships:d},[...c].sort((u,f)=>f.index-u.index).forEach(u=>i.layout.associationLayouts.splice(u.index,1)),[...r].sort((u,f)=>f.index-u.index).forEach(u=>i.logical.associations.splice(u.index,1));for(const u of d){const f=i.logical.groups.find(p=>p.modelId===u.groupId);f==null||f.memberEntityRefs.splice(u.index,1)}l>=0&&i.layout.entityLayouts.splice(l,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,l)=>a.index-l.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...t.assocLayouts].sort((a,l)=>a.index-l.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of t.groupMemberships){const l=i.logical.groups.find(r=>r.modelId===a.groupId);l==null||l.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!t)return{forward:[],invert:[]};const i=[],a=[];for(const l of t.assocs)i.push({kind:"association.remove",casUnit:"logical",associationRef:l.item.modelId}),a.push({kind:"association.add",casUnit:"logical",associationRef:l.item.modelId,value:l.item});for(const l of t.assocLayouts)i.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:l.item.associationRef,incidental:!0}),a.push({kind:"associationLayout.add",casUnit:"layout",associationRef:l.item.associationRef,value:l.item,incidental:!0});for(const l of t.groupMemberships)i.push({kind:"group.removeMember",casUnit:"logical",containerRef:l.groupId,groupRef:l.groupId,entityRef:e}),a.push({kind:"group.addMember",casUnit:"logical",containerRef:l.groupId,groupRef:l.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 cr(e,t){const o={};return{label:"엔티티 수정",apply(i){const a=ze(i,e);for(const l of Object.keys(t))o[l]=a[l];Object.assign(a,t)},invert(i){Object.assign(ze(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 dr(e,t){let o="";return{label:`엔티티 이름 변경: ${t}`,apply(i){const a=ze(i,e);o=a.name,a.name=t},invert(i){ze(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 En(e,t){let o=null;return{label:"엔티티 이동",apply(i){const a=je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a].geo;o={...l.location},l.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 ur(e,t){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a].geo;o={...l.size},l.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 Xn(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 fr(e,t){let o;return{label:"엔티티 색상 변경",apply(i){const a=je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.style,l.style=Xn(l.style,t)},invert(i){const a=je(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=je(i,e),l=a>=0?i.layout.entityLayouts[a].style:void 0,r=s=>({kind:"entityLayout.setStyle",casUnit:"layout",entityRef:e,value:{style:s}});return{forward:[r(l)],invert:[r(o)]}}}}function mr(e,t){let o;return{label:t?"엔티티 접기":"엔티티 펼치기",apply(i){const a=je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.collapsed,l.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 pr(e,t){let o;return{label:t?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=i.layout.entityLayouts[a];o=l.locked,l.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 va(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((l,r)=>{i.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:l.entityRef,value:{collapsed:e}}),a.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:l.entityRef,value:{collapsed:t[r]}})}),{forward:i,invert:a}}}}function Go(e,t,o){let i;return{label:"속성 색상 변경",apply(a){const l=je(a,e);if(l<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=a.layout.entityLayouts[l];i=r.attributeStyles;const s={...r.attributeStyles},c=Xn(s[t],o);c?s[t]=c:delete s[t],r.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const l=je(a,e);l>=0&&(a.layout.entityLayouts[l].attributeStyles=i)},emitOps(a){const l=je(a,e),r=l>=0?a.layout.entityLayouts[l].attributeStyles:void 0,s=c=>({kind:"entityLayout.setAttrStyle",casUnit:"layout",entityRef:e,value:{attributeStyles:c}});return{forward:[s(r)],invert:[s(i)]}}}}function ka(e,t){return{label:"그룹 추가",apply(o){o.logical.groups.push(e),o.layout.groupLayouts.push({groupRef:e.modelId,geo:t})},invert(o){const i=o.logical.groups.findIndex(l=>l.modelId===e.modelId);i>=0&&o.logical.groups.splice(i,1);const a=o.layout.groupLayouts.findIndex(l=>l.groupRef===e.modelId);a>=0&&o.layout.groupLayouts.splice(a,1)},emitOps(){const o={kind:"group.add",casUnit:"logical",groupRef:e.modelId,value:e},i={kind:"groupLayout.add",casUnit:"layout",groupRef:e.modelId,value:{groupRef:e.modelId,geo:t},incidental:!0};return{forward:[o,i],invert:[{kind:"groupLayout.remove",casUnit:"layout",groupRef:e.modelId,incidental:!0},{kind:"group.remove",casUnit:"logical",groupRef:e.modelId}]}}}}function hr(e,t){const o={},i=a=>{const l=a.logical.groups.find(r=>r.modelId===e);if(!l)throw new Error(`그룹 없음: ${e}`);return l};return{label:"그룹 수정",apply(a){const l=i(a);for(const r of Object.keys(t))o[r]=l[r];Object.assign(l,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 yr(e){let t=null;return{label:"그룹 해제",apply(o){const i=o.logical.groups.findIndex(l=>l.modelId===e);if(i<0)throw new Error(`그룹 없음: ${e}`);const a=o.layout.groupLayouts.findIndex(l=>l.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 gr(e,t){let o=!1;const i=a=>a.logical.groups.find(l=>l.modelId===e);return{label:"그룹에 편입",apply(a){const l=i(a);l&&!l.memberEntityRefs.includes(t)&&(l.memberEntityRefs.push(t),o=!0)},invert(a){if(!o)return;const l=i(a),r=(l==null?void 0:l.memberEntityRefs.indexOf(t))??-1;r>=0&&l.memberEntityRefs.splice(r,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 Yo(e,t){let o=-1;const i=a=>a.logical.groups.find(l=>l.modelId===e);return{label:"그룹에서 제외",apply(a){const l=i(a);o=(l==null?void 0:l.memberEntityRefs.indexOf(t))??-1,o>=0&&l.memberEntityRefs.splice(o,1)},invert(a){var l;o<0||(l=i(a))==null||l.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 br(e,t){let o=null;return{label:"그룹 이동",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.location},a.geo.location={...t}},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 _r(e,t){let o=null;return{label:"그룹 크기 변경",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.size},a.geo.size={...t}},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 wr(e,t){let o;return{label:"그룹 색상 변경",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.style,a.style=Xn(a.style,t)},invert(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);a&&(a.style=o)},emitOps(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e),l=r=>({kind:"groupLayout.setStyle",casUnit:"layout",groupRef:e,value:{style:r}});return{forward:[l(a==null?void 0:a.style)],invert:[l(o)]}}}}function vr(e,t){let o;return{label:t?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=t},invert(i){const a=i.layout.groupLayouts.find(l=>l.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 St(e,t){return{label:`속성 추가: ${t.name}`,apply(o){ze(o,e).attributes.push(t)},invert(o){const i=ze(o,e),a=i.attributes.findIndex(l=>l.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 en(e,t,o){const i={},a=l=>{const r=ze(l,e).attributes.find(s=>s.modelId===t);if(!r)throw new Error(`속성 없음: ${t}`);return r};return{label:"속성 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Nn(e,t){let o=null;return{label:"속성 삭제",apply(i){const a=ze(i,e),l=a.attributes.findIndex(r=>r.modelId===t);if(l<0)throw new Error(`속성 없음: ${t}`);o={item:a.attributes[l],index:l},a.attributes.splice(l,1)},invert(i){o&&ze(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 Ea(e,t,o){let i=null;return{label:"속성 재정렬",apply(a){const l=ze(a,e);i=l.attributes.map(f=>({...f}));const r=new Set(t),s=l.attributes.filter(f=>r.has(f.modelId)),c=l.attributes.filter(f=>!r.has(f.modelId)),d=Math.max(0,Math.min(o,c.length)),u=[...c.slice(0,d),...s,...c.slice(d)];l.attributes.splice(0,l.attributes.length,...u),l.attributes.forEach((f,p)=>f.order=p)},invert(a){i&&ze(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const l=ze(a,e).attributes.map(r=>({...r}));return{forward:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:l}],invert:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function kr(e,t){let o=!1;return{label:`메서드 추가: ${t.name}`,apply(i){const a=ze(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(t)},invert(i){var r;const a=ze(i,e),l=((r=a.operations)==null?void 0:r.findIndex(s=>s.modelId===t.modelId))??-1;l>=0&&a.operations.splice(l,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 Er(e,t,o){const i={},a=l=>{var s;const r=(s=ze(l,e).operations)==null?void 0:s.find(c=>c.modelId===t);if(!r)throw new Error(`메서드 없음: ${t}`);return r};return{label:"메서드 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Nr(e,t){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=ze(i,e),l=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===t))??-1;if(l<0)throw new Error(`메서드 없음: ${t}`);const r=a.operations.length===1;o={item:a.operations[l],index:l,wasSole:r},a.operations.splice(l,1),r&&(a.operations=void 0)},invert(i){if(!o)return;const a=ze(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 $r(e,t,o){let i=null;return{label:"메서드 재정렬",apply(a){const l=ze(a,e),r=l.operations??[];i=r.map(p=>({...p}));const s=new Set(t),c=r.filter(p=>s.has(p.modelId)),d=r.filter(p=>!s.has(p.modelId)),u=Math.max(0,Math.min(o,d.length)),f=[...d.slice(0,u),...c,...d.slice(u)];r.splice(0,r.length,...f),r.forEach((p,m)=>p.order=m),l.operations=r},invert(a){if(!i)return;const l=ze(a,e);l.operations&&l.operations.splice(0,1/0,...i)},emitOps(a){const l=(ze(a,e).operations??[]).map(r=>({...r}));return{forward:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:l}],invert:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function xr(e,t,o){let i;return{label:"메서드 색상 변경",apply(a){const l=je(a,e);if(l<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=a.layout.entityLayouts[l];i=r.operationStyles;const s={...r.operationStyles},c=Xn(s[t],o);c?s[t]=c:delete s[t],r.operationStyles=Object.keys(s).length?s:void 0},invert(a){const l=je(a,e);l>=0&&(a.layout.entityLayouts[l].operationStyles=i)},emitOps(a){const l=je(a,e),r=l>=0?a.layout.entityLayouts[l].operationStyles:void 0,s=c=>({kind:"entityLayout.setOpStyle",casUnit:"layout",entityRef:e,value:{operationStyles:c}});return{forward:[s(r)],invert:[s(i)]}}}}function Na(e,t){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(t)},invert(o){const i=o.logical.associations.findIndex(l=>l.modelId===e.modelId);i>=0&&o.logical.associations.splice(i,1);const a=o.layout.associationLayouts.findIndex(l=>l.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 Ir(e){let t=null;return{label:"관계 삭제",apply(o){const i=o.logical.associations.findIndex(l=>l.modelId===e);if(i<0)throw new Error(`관계 없음: ${e}`);const a=o.layout.associationLayouts.findIndex(l=>l.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 Wo(e,t){const o={},i=a=>{const l=a.logical.associations.find(r=>r.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l};return{label:"관계 수정",apply(a){const l=i(a);for(const r of Object.keys(t))o[r]=l[r];Object.assign(l,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 $n(e,t,o){const i={},a=l=>{const r=l.logical.associations.find(s=>s.modelId===e);if(!r)throw new Error(`관계 없음: ${e}`);return r[t]};return{label:"관계 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Sr(e,t){return{label:"인덱스 추가",apply(o){const i=ze(o,e);(i.indexes??(i.indexes=[])).push(t)},invert(o){var l;const i=ze(o,e),a=((l=i.indexes)==null?void 0:l.findIndex(r=>r.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 Cr(e,t,o){const i={},a=l=>{var s;const r=(s=ze(l,e).indexes)==null?void 0:s.find(c=>c.modelId===t);if(!r)throw new Error(`인덱스 없음: ${t}`);return r};return{label:"인덱스 수정",apply(l){const r=a(l);for(const s of Object.keys(o))i[s]=r[s];Object.assign(r,o)},invert(l){Object.assign(a(l),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 Rr(e,t){let o=null;return{label:"인덱스 삭제",apply(i){var r;const a=ze(i,e),l=((r=a.indexes)==null?void 0:r.findIndex(s=>s.modelId===t))??-1;if(l<0)throw new Error(`인덱스 없음: ${t}`);o={item:a.indexes[l],index:l},a.indexes.splice(l,1)},invert(i){o&&ze(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 bt=(e,t)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:t}}),jn=(e,t)=>{var o;return((o=ut(e,t))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function Vr(e,t,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const l=ut(a,e);if(!l||!l.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);i={...l.waypoints[t]},l.waypoints.splice(t,1,{...o})},invert(a){const l=ut(a,e);l&&i&&l.waypoints.splice(t,1,i)},emitOps(a){const l=jn(a,e),r=l.map((s,c)=>c===t&&i?{...i}:s);return{forward:[bt(e,l)],invert:[bt(e,r)]}}}}function Ar(e,t){let o=null;return{label:"waypoint 제거",apply(i){const a=ut(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=ut(i,e);a&&o&&a.waypoints.splice(t,0,o)},emitOps(i){const a=jn(i,e),l=a.slice();return o&&l.splice(t,0,{...o}),{forward:[bt(e,a)],invert:[bt(e,l)]}}}}function Tr(e,t,o){let i=null;return{label:"waypoint 평행이동",apply(a){const l=ut(a,e);if(!l)throw new Error(`관계 레이아웃 없음: ${e}`);i=l.waypoints.map(r=>({...r})),l.waypoints=i.map(r=>({x:r.x+t,y:r.y+o}))},invert(a){const l=ut(a,e);l&&i&&(l.waypoints=i)},emitOps(a){return{forward:[bt(e,jn(a,e))],invert:[bt(e,i??[])]}}}}function Mr(e){let t=null;return{label:"꺾은선 풀기",apply(o){const i=ut(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);t=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=ut(o,e);i&&t&&(i.waypoints=t)},emitOps(o){return{forward:[bt(e,jn(o,e))],invert:[bt(e,t??[])]}}}}function Br(e,t,o){return{label:"waypoint 추가",apply(i){const a=ut(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(t,0,{...o})},invert(i){const a=ut(i,e);a==null||a.waypoints.splice(t,1)},emitOps(i){const a=jn(i,e),l=a.slice();return l.splice(t,1),{forward:[bt(e,a)],invert:[bt(e,l)]}}}}function Dr(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 Or(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 Zn(e,t){let o=null;return{label:"노트 이동",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.location},a.geo.location={...t}},invert(i){const a=i.layout.notes.find(l=>l.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 Lr(e,t){let o=null;return{label:"노트 크기 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.size},a.geo.size={...t}},invert(i){const a=i.layout.notes.find(l=>l.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 Pr(e,t){let o="";return{label:"노트 내용 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.memo,a.memo=t},invert(i){const a=i.layout.notes.find(l=>l.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 zr(e,t){let o;return{label:"노트 색상 변경",apply(i){const a=i.layout.notes.find(l=>l.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.style,a.style=Xn(a.style,t)},invert(i){const a=i.layout.notes.find(l=>l.modelId===e);a&&(a.style=o)},emitOps(i){const a=i.layout.notes.find(r=>r.modelId===e),l=r=>({kind:"note.setStyle",casUnit:"layout",noteRef:e,value:{style:r}});return{forward:[l(a==null?void 0:a.style)],invert:[l(o)]}}}}function Ur(e,t){let o=!1,i=!1;const a=l=>l.layout.groupLayouts.find(r=>r.groupRef===e);return{label:"그룹에 노트 편입",apply(l){const r=a(l);r&&(r.memberNoteRefs||(r.memberNoteRefs=[],i=!0),!r.memberNoteRefs.includes(t)&&(r.memberNoteRefs.push(t),o=!0))},invert(l){if(!o)return;const r=a(l);if(!(r!=null&&r.memberNoteRefs))return;const s=r.memberNoteRefs.indexOf(t);s>=0&&r.memberNoteRefs.splice(s,1),i&&delete r.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 Hr(e,t){let o=-1;const i=a=>a.layout.groupLayouts.find(l=>l.groupRef===e);return{label:"그룹에서 노트 제외",apply(a){var r;const l=i(a);o=((r=l==null?void 0:l.memberNoteRefs)==null?void 0:r.indexOf(t))??-1,o>=0&&l.memberNoteRefs.splice(o,1)},invert(a){if(o<0)return;const l=i(a);l&&(l.memberNoteRefs||(l.memberNoteRefs=[]),l.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 zt=(e,t,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:t,value:{waypoints:o}}),Ko=(e,t,o)=>{var i;return((i=It(e,t,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function Fr(e,t){let o=!1,i=!1;return{label:"노트 연결 추가",apply(a){const l=a.layout.notes.find(r=>r.modelId===e);if(!l)throw new Error(`노트 없음: ${e}`);if(l.connections||(l.connections=[],i=!0),l.connections.some(r=>r.targetRef===t)){o=!1;return}l.connections.push({targetRef:t,waypoints:[]}),o=!0},invert(a){if(!o)return;const l=a.layout.notes.find(s=>s.modelId===e);if(!(l!=null&&l.connections))return;const r=l.connections.findIndex(s=>s.targetRef===t);r>=0&&l.connections.splice(r,1),i&&delete l.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 Gr(e,t){let o=null;return{label:"노트 연결 삭제",apply(i){var r;const a=i.layout.notes.find(s=>s.modelId===e),l=((r=a==null?void 0:a.connections)==null?void 0:r.findIndex(s=>s.targetRef===t))??-1;if(!(a!=null&&a.connections)||l<0)throw new Error(`노트 연결 없음: ${e}→${t}`);o={item:a.connections[l],index:l},a.connections.splice(l,1)},invert(i){if(!o)return;const a=i.layout.notes.find(l=>l.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 Yr(e,t,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${t}`,apply(l){const r=It(l,e,t);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);a={...r.waypoints[o]},r.waypoints.splice(o,1,{...i})},invert(l){const r=It(l,e,t);r&&a&&r.waypoints.splice(o,1,a)},emitOps(l){const r=Ko(l,e,t),s=r.map((c,d)=>d===o&&a?{...a}:c);return{forward:[zt(e,t,r)],invert:[zt(e,t,s)]}}}}function Wr(e,t,o,i){return{label:"waypoint 추가",apply(a){const l=It(a,e,t);if(!l)throw new Error(`노트 연결 없음: ${e}→${t}`);l.waypoints.splice(o,0,{...i})},invert(a){const l=It(a,e,t);l==null||l.waypoints.splice(o,1)},emitOps(a){const l=Ko(a,e,t),r=l.slice();return r.splice(o,1),{forward:[zt(e,t,l)],invert:[zt(e,t,r)]}}}}function Kr(e,t,o){let i=null;return{label:"waypoint 제거",apply(a){const l=It(a,e,t);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);i={...l.waypoints[o]},l.waypoints.splice(o,1)},invert(a){const l=It(a,e,t);l&&i&&l.waypoints.splice(o,0,i)},emitOps(a){const l=Ko(a,e,t),r=l.slice();return i&&r.splice(o,0,{...i}),{forward:[zt(e,t,l)],invert:[zt(e,t,r)]}}}}function qr(e,t){let o=null;return{label:"꺾은선 풀기",apply(i){const a=It(i,e,t);if(!a)throw new Error(`노트 연결 없음: ${e}→${t}`);o=a.waypoints.map(l=>({...l})),a.waypoints=[]},invert(i){const a=It(i,e,t);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[zt(e,t,Ko(i,e,t))],invert:[zt(e,t,o??[])]}}}}function Ue(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(l=>{if(!l.emitOps)throw new Error(`emitOps 미구현 command가 composite에 포함됨: ${l.label}`);return l.emitOps(i)});return{forward:a.flatMap(l=>l.forward),invert:a.slice().reverse().flatMap(l=>l.invert)}}}}const Mf=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Na,addAttribute:St,addEntity:wa,addEntityToGroup:gr,addGroup:ka,addIndex:Sr,addNote:Dr,addNoteConnection:Fr,addNoteConnectionWaypoint:Wr,addNoteToGroup:Ur,addOperation:kr,addWaypoint:Br,clearNoteConnectionWaypoints:qr,clearWaypoints:Mr,composite:Ue,moveEntity:En,moveGroup:br,moveNote:Zn,moveNoteConnectionWaypoint:Yr,moveWaypoint:Vr,removeAssociation:Ir,removeAttribute:Nn,removeEntity:sr,removeEntityFromGroup:Yo,removeGroup:yr,removeIndex:Rr,removeNote:Or,removeNoteConnection:Gr,removeNoteConnectionWaypoint:Kr,removeNoteFromGroup:Hr,removeOperation:Nr,removeWaypoint:Ar,renameEntity:dr,reorderAttributes:Ea,reorderOperations:$r,resizeEntity:ur,resizeGroup:_r,resizeNote:Lr,setAllEntitiesCollapsed:va,setAttributeSwatch:Go,setEntityCollapsed:mr,setEntityLocked:pr,setEntitySwatch:fr,setGroupLocked:vr,setGroupSwatch:wr,setNoteMemo:Pr,setNoteSwatch:zr,setOperationSwatch:xr,translateWaypoints:Tr,updateAssociation:Wo,updateAssociationEnd:$n,updateAttribute:en,updateEntity:cr,updateGroup:hr,updateIndex:Cr,updateOperation:Er},Symbol.toStringTag,{value:"Module"}));class Xr{constructor(){Ye(this,"revs",new Map);Ye(this,"layoutVersion",0);Ye(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 jr{constructor(t){Ye(this,"cache",new Xr);Ye(this,"newClientOpId");Ye(this,"debounceMs");Ye(this,"emissions",new WeakMap);Ye(this,"open",null);Ye(this,"debounceHandle",null);Ye(this,"queue",[]);Ye(this,"sending",!1);Ye(this,"_frozen",!1);Ye(this,"stack",null);Ye(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,l)=>this.handle(i,a,l));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 r;if(this._frozen)return;let a;if(o==="do"){const s=(r=t.emitOps)==null?void 0:r.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 l=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===t.coalesceKey){this.open.fwd=l,this.emissions.set(t,{forward:l,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:l,inv:a.invert},this.startDebounce();return}l.length&&this.enqueue(this.buildBatch(l))}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,l=!1;for(const r of t)if(r.casUnit==="logical")if(a=!0,r.containerRef)i.add(r.containerRef);else{const s=r.entityRef??r.associationRef??r.groupRef;s&&(r.kind.endsWith(".add")?this.cache.setRev(s,0):r.kind.endsWith(".remove")&&this.cache.deleteRev(s))}else r.incidental||(l=!0);if(i.size){o.revs={};for(const r of i){const s=this.cache.rev(r);o.revs[r]=s,this.cache.setRev(r,s+1)}}return l&&(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(l){this.sending=!1,console.error("[op-sync] op 전송 실패 → 하드 프리즈(kind:missing):",l),(a=(i=this.opts).onError)==null||a.call(i,l),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 Zr=["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"],Jr=()=>crypto.randomUUID(),Bf=e=>e.add.length===0&&e.update.length===0&&e.remove.length===0,Df=e=>e&&e[0].toLowerCase()+e.slice(1),Of=e=>e&&e[0].toUpperCase()+e.slice(1),Lf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase();function Pf(e,t){return Df(e)+Of(t)}function zf(e,t){const o=e.entities.find(r=>r.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(r=>r.identifier&&(r.attrType==="NORMAL"||r.attrType==="RELATION_OWN")).sort((r,s)=>r.order-s.order).map(r=>{const s=Pf(o.name,r.name);return{associationRef:t.modelId,sourceAttributeRef:r.modelId,name:s,type:r.type,identifier:a,notNull:a,dbAttrs:r.dbAttrs.map(c=>({physicalName:Lf(s),logicalName:c.logicalName,dataType:c.dataType,length:c.length,scale:c.scale}))}})}const qo=(e,t)=>`${e}::${t}`,Xo=e=>e??void 0;function Uf(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((l,r)=>{const s=e.dbAttrs[r];return!s||s.dataType!==l.dataType||Xo(s.length)!==Xo(l.length)||Xo(s.scale)!==Xo(l.scale)}))&&(i.dbAttrs=t.dbAttrs.map((l,r)=>{const s=e.dbAttrs[r];return{modelId:(s==null?void 0:s.modelId)??o(),physicalName:(s==null?void 0:s.physicalName)??l.physicalName,logicalName:(s==null?void 0:s.logicalName)??l.logicalName,dataType:l.dataType,length:l.length,scale:l.scale}})),Object.keys(i).length?i:null}function Hf(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 Jn(e,t,o=Jr){const i={add:[],update:[],remove:[]},a=e.entities.find(f=>f.modelId===t);if(!a)return i;const l=e.associations.filter(f=>f.end2.entityRef===t),r=a.stereotype==="JPA_EMBEDDABLE"?[]:l.flatMap(f=>zf(e,f)),s=new Map(r.map(f=>[qo(f.associationRef,f.sourceAttributeRef),f])),c=a.attributes.filter(f=>f.derivedFrom),d=new Map(c.map(f=>[qo(f.derivedFrom.associationRef,f.derivedFrom.sourceAttributeRef),f]));for(const f of c){const p=qo(f.derivedFrom.associationRef,f.derivedFrom.sourceAttributeRef);s.has(p)||i.remove.push(f.modelId)}let u=a.attributes.reduce((f,p)=>Math.max(f,p.order),-1)+1;for(const f of r){const p=qo(f.associationRef,f.sourceAttributeRef),m=d.get(p);if(!m)i.add.push(Hf(f,u++,o));else{const h=Uf(m,f,o);h&&i.update.push({attributeId:m.modelId,patch:h})}}return i}function Ff(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 Gf(e){return{...e,entities:e.entities.map(t=>({...t,attributes:t.attributes.map(o=>({...o}))}))}}function Yf(e,t,o=Jr){const i=new Map,a=Gf(e),l=new Set,r=[t];for(;r.length;){const s=r.shift();if(l.has(s))continue;l.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=Jn(a,d,o);if(Bf(u))continue;i.has(d)||i.set(d,u);const f=a.entities.find(p=>p.modelId===d);f&&Ff(f,u),l.has(d)||r.push(d)}}return i}function jo(e,t,o){var r;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 l=(r=a.derivedFrom)==null?void 0:r.associationRef;if(l){const s=e.associations.find(c=>c.modelId===l);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 Wf(e,t){const o=()=>e.entities.filter(l=>{var r;return((r=l.table)==null?void 0:r.physicalName)===t.ref}),i=()=>e.entities.filter(l=>l.name===t.ref);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function Kf(e,t){const o=()=>e.attributes.filter(l=>l.name===t.ref),i=()=>e.attributes.filter(l=>l.dbAttrs.some(r=>r.physicalName===t.ref));if(t.by==="name")return o();if(t.by==="physicalName")return i();const a=o();return a.length?a:i()}function Qr(e,t,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(t)&&a.includes(o)})}function ot(e,t){const o=Wf(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 qf(e,t){const o=Kf(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 Xf(e,t){const o=()=>e.attributes.flatMap(l=>l.dbAttrs).filter(l=>l.physicalName===t.ref),i=()=>e.attributes.filter(l=>l.name===t.ref).flatMap(l=>l.dbAttrs);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function es(e,t){const o=Xf(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 jf(e,t){return(e.indexes??[]).filter(o=>o.name===t.ref)}function Zf(e,t){return(e.operations??[]).filter(o=>o.name===t.ref)}function Jf(e,t){const o=jf(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 Qf(e,t){const o=Zf(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 ts(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 ns(e,t,o,i,a,l,r,s){const c=s(),d=new Map((e.embeddableOverrides??[]).map(p=>[p.field,p])),u=[];let f=!1;for(const p of t.fields){const m=d.get(p.name);if(m!=null&&m.sharedColumnPhysicalName){const h={ref:m.sharedColumnPhysicalName,by:"physicalName"},_=es(i,h);if(!_.ok){r.push(_.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:a,entity:l,handle:h}:{code:"shared-column-target-ambiguous",opIndex:a,entity:l,handle:h,matches:_.matches}),f=!0;continue}u.push({modelId:s(),physicalName:"",dataType:"",sharedColumnRef:_.value.modelId});continue}u.push({modelId:s(),physicalName:(m==null?void 0:m.physicalName)??"",dataType:"",...m!=null&&m.length?{length:m.length}:{},...m!=null&&m.scale?{scale:m.scale}:{},...(m==null?void 0:m.insertable)!=null?{insertable:m.insertable}:{},...(m==null?void 0:m.updatable)!=null?{updatable:m.updatable}:{}})}return f?null:{modelId:c,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:u}}function os(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 is(e,t,o,i,a,l){const r=[];let s=!1;for(const c of t.columns){const d=es(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}r.push({columnRef:d.value.modelId,descending:c.descending??!1})}return s?null:{modelId:l(),name:t.name,unique:t.unique??!1,columns:r,...t.description?{description:t.description}:{},...t.parameters?{parameters:t.parameters}:{}}}function em(e,t,o={}){const i=o.mkId??Me,a=o.embeddableCatalog??[],l=f=>a.find(p=>p.type===f),r=[],s=[],c=new Map,d=new Map,u=new Set;for(const f of t)f.kind==="entity.add"&&(u.add(f.spec.name),f.spec.physicalName&&u.add(f.spec.physicalName));return t.forEach((f,p)=>{var m,h,_;switch(f.kind){case"entity.add":{const b=i(),g={modelId:b,name:f.spec.name,stereotype:f.spec.stereotype??"JPA_ENTITY",attributes:[],...f.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...f.spec.physicalName?{table:{physicalName:f.spec.physicalName}}:{}},I={ref:f.spec.name};let y=!1;for(const[U,X]of(f.spec.attributes??[]).entries()){if(X.type==="GroupCodeEnum"&&!X.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:I,handle:{ref:X.name}}),y=!0;continue}const K=l(X.type);if(K){const W=ns(X,K,U,g,p,I,s,i);W?g.attributes.push(W):y=!0}else(m=X.embeddableOverrides)!=null&&m.length?(s.push({code:"embeddable-type-unresolved",opIndex:p,entity:I,handle:{ref:X.name}}),y=!0):g.attributes.push(ts(X,U,i))}const N=(f.spec.operations??[]).map((U,X)=>os(U,X,i));N.length&&(g.operations=N);const q=[];for(const U of f.spec.indexes??[]){const X=is(g,U,p,I,s,i);X?q.push(X):y=!0}if(q.length&&(g.indexes=q),y)break;r.push({kind:"entity.add",casUnit:"logical",entityRef:b,value:g});break}case"entity.update":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}r.push({kind:"entity.update",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,patch:f.patch});break}case"entity.remove":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}r.push({kind:"entity.remove",casUnit:"logical",entityRef:b.value.modelId});break}case"attribute.add":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}if(f.spec.type==="GroupCodeEnum"&&!f.spec.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:f.entity,handle:{ref:f.spec.name}});break}const g=c.get(b.value.modelId)??b.value.attributes.length;c.set(b.value.modelId,g+1);const I=l(f.spec.type);let y;if(I)y=ns(f.spec,I,g,b.value,p,f.entity,s,i);else if((h=f.spec.embeddableOverrides)!=null&&h.length){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:f.entity,handle:{ref:f.spec.name}});break}else y=ts(f.spec,g,i);if(!y)break;r.push({kind:"attribute.add",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,value:y});break}case"attribute.update":case"attribute.remove":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}const g=qf(b.value,f.attribute);if(!g.ok){s.push(g.reason==="not-found"?{code:"attribute-not-found",opIndex:p,entity:f.entity,handle:f.attribute}:{code:"attribute-ambiguous",opIndex:p,entity:f.entity,handle:f.attribute,matches:g.matches});break}f.kind==="attribute.update"?r.push({kind:"attribute.update",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,attributeRef:g.value.modelId,patch:f.patch}):r.push({kind:"attribute.remove",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,attributeRef:g.value.modelId});break}case"association.add":{const b=ot(e,f.spec.from),g=ot(e,f.spec.to);if(b.ok||s.push(it(b.reason,p,f.spec.from,b.matches,u)),g.ok||s.push(it(g.reason,p,f.spec.to,g.matches,u)),!b.ok||!g.ok)break;if(f.spec.identifying&&b.value.modelId===g.value.modelId){s.push({code:"self-identifying",opIndex:p,handle:{from:f.spec.from,to:f.spec.to}});break}const I=i(),y={modelId:I,...f.spec.identifying!=null?{identifying:f.spec.identifying}:{},end1:{entityRef:b.value.modelId,multiplicity:f.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1},end2:{entityRef:g.value.modelId,multiplicity:f.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:f.spec.composition??!1}},N={...e,associations:[...e.associations,y]},q=Jn(N,g.value.modelId,i);q.add[0]&&(y.end2.attributeRef=q.add[0].modelId),r.push({kind:"association.add",casUnit:"logical",associationRef:I,value:y});for(const U of q.add)r.push({kind:"attribute.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,value:U});break}case"association.remove":{const b=ot(e,f.association.from),g=ot(e,f.association.to);if(b.ok||s.push(it(b.reason,p,f.association.from,b.matches,u)),g.ok||s.push(it(g.reason,p,f.association.to,g.matches,u)),!b.ok||!g.ok)break;const I=Qr(e,b.value.modelId,g.value.modelId);if(I.length!==1){s.push(I.length===0?{code:"association-not-found",opIndex:p,handle:f.association}:{code:"association-ambiguous",opIndex:p,handle:f.association,matches:I.map(y=>y.modelId)});break}r.push({kind:"association.remove",casUnit:"logical",associationRef:I[0].modelId});break}case"association.update":{const b=as(e,f.association,p,s,u);if(!b)break;r.push({kind:"association.update",casUnit:"logical",containerRef:b.modelId,associationRef:b.modelId,patch:f.patch});break}case"associationEnd.update":{const b=as(e,f.association,p,s,u);if(!b)break;const g=f.end==="from"?"end1":"end2";r.push({kind:"associationEnd.update",casUnit:"logical",containerRef:b.modelId,associationRef:b.modelId,end:g,patch:f.patch});break}case"index.add":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}const g=is(b.value,f.spec,p,f.entity,s,i);if(!g)break;r.push({kind:"index.add",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,indexRef:g.modelId,value:g});break}case"index.update":case"index.remove":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}const g=Jf(b.value,f.index);if(!g.ok){s.push(g.reason==="not-found"?{code:"index-not-found",opIndex:p,entity:f.entity,handle:f.index}:{code:"index-ambiguous",opIndex:p,entity:f.entity,handle:f.index,matches:g.matches});break}if(f.kind==="index.update"){if("columns"in f.patch){s.push({code:"index-columns-patch-unsupported",opIndex:p,entity:f.entity,handle:f.index});break}r.push({kind:"index.update",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,indexRef:g.value.modelId,patch:f.patch})}else r.push({kind:"index.remove",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,indexRef:g.value.modelId});break}case"operation.add":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}const g=d.get(b.value.modelId)??((_=b.value.operations)==null?void 0:_.length)??0;d.set(b.value.modelId,g+1);const I=os(f.spec,g,i);r.push({kind:"operation.add",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,operationRef:I.modelId,value:I});break}case"operation.update":case"operation.remove":{const b=ot(e,f.entity);if(!b.ok){s.push(it(b.reason,p,f.entity,b.matches,u));break}const g=Qf(b.value,f.operation);if(!g.ok){s.push(g.reason==="not-found"?{code:"operation-not-found",opIndex:p,entity:f.entity,handle:f.operation}:{code:"operation-ambiguous",opIndex:p,entity:f.entity,handle:f.operation,matches:g.matches});break}f.kind==="operation.update"?r.push({kind:"operation.update",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,operationRef:g.value.modelId,patch:f.patch}):r.push({kind:"operation.remove",casUnit:"logical",containerRef:b.value.modelId,entityRef:b.value.modelId,operationRef:g.value.modelId});break}case"group.add":{const b=[];let g=!1;for(const N of f.spec.members){const q=ot(e,N);if(!q.ok){s.push(it(q.reason,p,N,q.matches,u)),g=!0;continue}b.push(q.value.modelId)}if(g)break;const I=i(),y={modelId:I,excludeDDLGeneration:f.spec.excludeDDLGeneration??!1,memberEntityRefs:b,...f.spec.name?{name:f.spec.name}:{},...f.spec.packageName?{packageName:f.spec.packageName}:{},...f.spec.description?{description:f.spec.description}:{}};r.push({kind:"group.add",casUnit:"logical",groupRef:I,value:y});break}}}),s.length?{ok:!1,errors:s}:{ok:!0,ops:r}}function it(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 as(e,t,o,i,a){const l=ot(e,t.from),r=ot(e,t.to);if(l.ok||i.push(it(l.reason,o,t.from,l.matches,a)),r.ok||i.push(it(r.reason,o,t.to,r.matches,a)),!l.ok||!r.ok)return null;const s=Qr(e,l.value.modelId,r.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 ls={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명."},by:{type:"string",enum:["physicalName","name"],description:"매칭 키 고정(미지정 시 대상별 기본 순서)."}},required:["ref"],additionalProperties:!1},tm={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},nm={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},Zo={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},om={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:{...Zo,description:"속성 설명(다국어)."},columnLogicalName:{...Zo,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(type이 카탈로그 엔트리일 때만). field=카탈로그 필드명으로 매칭 (@AttributeOverride 대응). 미설정 서브컬럼은 카탈로그 기본 상속. 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 — 같은 엔터티 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}}},required:["name","type"],additionalProperties:!1},rs={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},im={type:"object",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...rs,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...rs,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},am={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...ls,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},lm={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...Zo,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},rm={type:"object",properties:{name:{...Zo,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},sm={type:"object",description:"부분 patch(임의 키). 값 품질 검증은 별도 엔진."};function et(e,t){return{type:"object",properties:{kind:{const:e},...t.properties},required:["kind",...t.required],additionalProperties:!1}}const cm={"entity.add":et("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":et("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","patch"]}),"entity.remove":et("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":et("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":et("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","attribute","patch"]}),"attribute.remove":et("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":et("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":et("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":et("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/patch"}},required:["association","patch"]}),"associationEnd.update":et("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":et("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":et("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","index","patch"]}),"index.remove":et("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"}},required:["entity","index"]}),"operation.add":et("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":et("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","operation","patch"]}),"operation.remove":et("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"}},required:["entity","operation"]}),"group.add":et("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]})},ss={anyOf:Zr.map(e=>cm[e])},dm={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:ls,assocHandle:tm,entitySpec:nm,attrSpec:om,assocSpec:im,indexSpec:am,operationSpec:lm,groupSpec:rm,patch:sm,symbolicOp:ss}};function um(e,t,o,i={}){const a=i.mkClientOpId??Me,l=new Set;for(const s of o)s.casUnit==="logical"&&s.containerRef&&l.add(s.containerRef);const r={};if(l.size){r.revs={};for(const s of l)r.revs[s]=t[s]??0}return{diagramId:e,ops:o,cas:r,origin:i.origin??"agent",clientOpId:a()}}const cs={location:{x:0,y:0},size:{width:220,height:140}};function ds(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 fm=/^[-=_*~\s]{3,}$/;function mm(e){return e.attrType&&e.attrType!=="NORMAL"||!fm.test(e.name??"")?!1:!(e.dbAttrs??[]).some(t=>t.physicalName||t.dataType)}function pm(e,t){return e.attrType==="DIVIDER"||mm(e)?{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??t,dbAttrs:[]}:{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??t,dbAttrs:e.dbAttrs.map(ds)}}function hm(e){const{modelId:t,name:o,visibility:i,sourceCode:a,description:l,order:r,personalInfoAttributeType:s,style:c,...d}=e;return{modelId:t,name:o,visibility:i,sourceCode:a,description:l?{ko:l}:void 0,order:r??0,personalInfoAttributeType:s,legacyRaw:Object.keys(d).length?d:void 0}}function ym(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 gm(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(pm),operations:(t=e.operations)==null?void 0:t.map(hm),indexes:(o=e.indexes)==null?void 0:o.map(ym),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function bm(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??{...cs},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 us(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 $a(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:us(e)}}function _m(e){var i,a;const t={modelId:e.modelId,description:e.description,end1:$a(e.end1),end2:$a(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 fs(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function ms(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function ps(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 hs(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(ds)}}function wm(e,t,o){var b,g;const i=fs(e.end1.attribute),a=fs(e.end2.attribute);if(i===a)return _m(e);const l=i?e.end1:e.end2,r=i?e.end2:e.end1,s=l.attribute,c=(g=(b=s.dbAttrs)==null?void 0:b[0])==null?void 0:g.targetModelId,d=c?o.get(c):void 0,u=t.get(r.endModel.refId),f=u?u.attributes.reduce((I,y)=>Math.max(I,y.order),-1)+1:s.order??0,p={...hs(s,f),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const m=(I,y)=>({entityRef:I.endModel.refId,multiplicity:I.multiplicity,navigable:I.navigable,composition:I.composition,attributeRef:y?d:p.modelId,legacyNavRaw:y?void 0:I.attribute,jpa:us(I)}),h={modelId:e.modelId,description:e.description,end1:m(e.end1,i),end2:m(e.end2,a)},_={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:h.end1.attributeRef,targetColumnRef:h.end2.attributeRef,style:e.style};return{assoc:h,layout:_}}function vm(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 km(e,t,o){var h;const i=((h=e.end1.attribute)==null?void 0:h.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,l=i?e.end2:e.end1,r=a.attribute,s=t.get(l.endModel.refId),c=s?s.attributes.reduce((_,b)=>Math.max(_,b.order),-1)+1:r.order??0,d={...hs(r,c),attrType:r.attrType??"EMBED_OWN",dbAttrs:(r.dbAttrs??[]).map(_=>vm(_,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=_=>({...$a(_),legacyEmbedRaw:_.attribute}),f={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},p=!i,m={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:p?d.modelId:void 0,targetColumnRef:p?void 0:d.modelId,style:e.style};return{assoc:f,layout:m}}function Em(e,t){var i,a,l,r;const o=[];for(const s of t){const c=(a=(i=s.end1)==null?void 0:i.endModel)==null?void 0:a.refId,d=(r=(l=s.end2)==null?void 0:l.endModel)==null?void 0:r.refId,u=c===e?d:c;!u||u===e||o.push({targetRef:u,waypoints:s.locations??[]})}return o}function ys(e,t={x:0,y:0}){const{modelId:o,memo:i,geo:a,style:l,connections:r,ownedConnections:s,...c}=e;let d=r;if(!d&&Array.isArray(s)){const u=Em(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:l,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function Nm(e){return(e.schemaVersion??1)>=2&&"logical"in e?$m(e):xm(e)}function $m(e){const t=e.id??e.logical.modelId??"",o={},i=f=>{const{rev:p,...m}=f;return p!=null&&(o[f.modelId]=p),m},a=e.logical.entities.map(i),l=e.logical.associations.map(i),r=e.logical.groups.map(i),{version:s,...c}=e.layout,d={logical:{modelId:e.logical.modelId??t,packageName:e.logical.packageName,entities:a,associations:l,groups:r},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 xm(e){var g,I;const t=e.id??"",o=[],i=[],a=[],l=[],r=[],s=[],c=[],d=(y,N)=>{o.push(gm(y));const q=bm(y);q.geo={location:{x:q.geo.location.x+N.x,y:q.geo.location.y+N.y},size:q.geo.size},i.push(q);for(const U of y.ownedAssociations??[])c.push(U)},u={x:0,y:0};for(const y of e.entities??[])d(y,u);const f=[];for(const y of e.groups??[]){const N=y.entities??[];r.push({modelId:y.modelId,name:y.name,description:y.description,packageName:y.packageName,excludeDDLGeneration:y.excludeDDLGeneration??!1,memberEntityRefs:N.map(U=>U.modelId)});const q=((g=y.geo)==null?void 0:g.location)??u;if(y.geo){const U=(y.notes??[]).map(X=>X.modelId);s.push({groupRef:y.modelId,geo:y.geo,style:y.style,locked:y.locked,memberNoteRefs:U.length?U:void 0})}for(const U of N)d(U,q);for(const U of y.notes??[])f.push(ys(U,q))}const p=new Map(o.map(y=>[y.modelId,y])),m=new Map,h=new Map;for(const y of o)for(const N of y.attributes)for(const q of N.dbAttrs)m.set(q.modelId,N.modelId),h.set(q.modelId,q);for(const y of c)for(const N of[y.end1,y.end2]){const q=N.attribute;if(q&&(((I=q.dbAttrs)==null?void 0:I.length)??0)>0)for(const U of q.dbAttrs)U.modelId&&m.set(U.modelId,q.modelId)}for(const y of c){const N=ms(y.end1.attribute),q=ms(y.end2.attribute),U=ps(y.end1)||ps(y.end2),{assoc:X,layout:K}=N!==q||U?km(y,p,h):wm(y,p,m);a.push(X),l.push(K)}const _={logical:{modelId:t,packageName:e.packageName,entities:o,associations:a,groups:r},layout:{diagramId:t,logicalModelRef:t,canvasSize:e.size,entityLayouts:i,associationLayouts:l,groupLayouts:s,notes:[...(e.notes??[]).map(y=>ys(y)),...f]}},b={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:_,meta:b}}function gs(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 Im(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(gs),style:t}}function Sm(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 Cm(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 Ut(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 Rm(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 l;return{...gs(i),targetModelId:(l=o==null?void 0:o.dbAttrs[a])==null?void 0:l.modelId}})}}function Vm(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 Am(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 Tm(e,t){return e===t||JSON.stringify(e??null)===JSON.stringify(t??null)}function Mm(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:Tm(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 Bm(e,t,o){let i;for(const f of t.logical.entities){const p=f.attributes.find(m=>{var h;return((h=m.embedded)==null?void 0:h.associationRef)===e.modelId});if(p){i=p;break}}if(!i)return;const a=i.embedded.embeddableRef,l=t.logical.entities.find(f=>f.modelId===a);if(!l)return;const r=l.attributes.flatMap(f=>f.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((f,p)=>Mm(f,r[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:Ut(e.end1,c?s:u),end2:Ut(e.end2,c?u:s)}}function Dm(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:Ut(e.end1,e.end1.legacyEmbedRaw),end2:Ut(e.end2,e.end2.legacyEmbedRaw)};const a=Bm(e,t,i);if(a)return a;const l=!!e.end1.legacyNavRaw,r=!!e.end2.legacyNavRaw;if(l!==r){const s=l?e.end1:e.end2,c=l?e.end2:e.end1,d=t.logical.entities.find(h=>h.modelId===s.entityRef),u=d==null?void 0:d.attributes.find(h=>h.modelId===s.attributeRef),f=t.logical.entities.find(h=>h.modelId===c.entityRef),p=u?Rm(u,f):void 0,m=s.legacyNavRaw;return{...i,end1:Ut(e.end1,l?m:p),end2:Ut(e.end2,r?m:p)}}return{...i,end1:Ut(e.end1),end2:Ut(e.end2)}}function bs(e,t,o,i,a={x:0,y:0}){var u,f;const l=t.layout.entityLayouts.find(p=>p.entityRef===e.modelId),r=t.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>t.layout.associationLayouts.find(m=>m.associationRef===p),c=(l==null?void 0:l.geo)??{...cs},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 m;return Im(p,(m=l==null?void 0:l.attributeStyles)==null?void 0:m[p.modelId])}),operations:(u=e.operations)==null?void 0:u.map(p=>{var m;return Sm(p,(m=l==null?void 0:l.operationStyles)==null?void 0:m[p.modelId])}),ownedAssociations:r.map(p=>Dm(p,t,s(p.modelId))),indexes:(f=e.indexes)==null?void 0:f.map(Cm),jpaAttrs:e.jpaAttrs,dbAttrs:e.table?{physicalName:e.table.physicalName,logicalName:e.table.logicalName}:void 0,geo:d,style:l==null?void 0:l.style,collapsed:l==null?void 0:l.collapsed,locked:l==null?void 0:l.locked}}function Om(e,t,o,i){const a=t.layout.groupLayouts.find(c=>c.groupRef===e.modelId),l=e.memberEntityRefs.map(c=>t.logical.entities.find(d=>d.modelId===c)).filter(c=>!!c),r=(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=>_s(c,r));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:l.map(c=>bs(c,t,o,i,r)),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 _s(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 Lm(e,t={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=Vm(e),l=Am(e),r=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=>bs(s,e,a,l)),groups:e.logical.groups.map(s=>Om(s,e,a,l)),notes:e.layout.notes.filter(s=>!r.has(s.modelId)).map(s=>_s(s))}}function Pm(e,t={}){var a,l,r;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:((l=t.revSeed)==null?void 0:l.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:((r=t.revSeed)==null?void 0:r.layoutVersion)??0}}}function Qn(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function Ct(e){return typeof e=="function"?e():n.unref(e)}const zm=typeof window<"u"&&typeof document<"u",Um=e=>typeof e<"u",Hm=Object.prototype.toString,Fm=e=>Hm.call(e)==="[object Object]",Gm=()=>{};function Ym(e,t){function o(...i){return new Promise((a,l)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(a).catch(l)})}return o}const ws=e=>e();function Wm(e=ws){const t=n.ref(!0);function o(){t.value=!1}function i(){t.value=!0}const a=(...l)=>{t.value&&e(...l)};return{isActive:n.readonly(t),pause:o,resume:i,eventFilter:a}}function vs(e,t=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(t?()=>a(o):i,e)})}function Km(e,t,o={}){const{eventFilter:i=ws,...a}=o;return n.watch(e,Ym(i,t),a)}function xn(e,t,o={}){const{eventFilter:i,...a}=o,{eventFilter:l,pause:r,resume:s,isActive:c}=Wm(i);return{stop:Km(e,t,{...a,eventFilter:l}),pause:r,resume:s,isActive:c}}function qm(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 l;if((l=Ct(t.replaceRef))!=null?l:!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 xa(e,t=!1){function o(f,{flush:p="sync",deep:m=!1,timeout:h,throwOnTimeout:_}={}){let b=null;const I=[new Promise(y=>{b=n.watch(e,N=>{f(N)!==t&&(b==null||b(),y(N))},{flush:p,deep:m,immediate:!0})})];return h!=null&&I.push(vs(h,_).then(()=>Ct(e)).finally(()=>b==null?void 0:b())),Promise.race(I)}function i(f,p){if(!n.isRef(f))return o(N=>N===f,p);const{flush:m="sync",deep:h=!1,timeout:_,throwOnTimeout:b}=p??{};let g=null;const y=[new Promise(N=>{g=n.watch([e,f],([q,U])=>{t!==(q===U)&&(g==null||g(),N(q))},{flush:m,deep:h,immediate:!0})})];return _!=null&&y.push(vs(_,b).then(()=>Ct(e)).finally(()=>(g==null||g(),Ct(e)))),Promise.race(y)}function a(f){return o(p=>!!p,f)}function l(f){return i(null,f)}function r(f){return i(void 0,f)}function s(f){return o(Number.isNaN,f)}function c(f,p){return o(m=>{const h=Array.from(m);return h.includes(f)||h.includes(Ct(f))},p)}function d(f){return u(1,f)}function u(f=1,p){let m=-1;return o(()=>(m+=1,m>=f),p)}return Array.isArray(Ct(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return xa(e,!t)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:l,toBeNaN:s,toBeUndefined:r,changed:d,changedTimes:u,get not(){return xa(e,!t)}}}function Ia(e){return xa(e)}function Xm(e){var t;const o=Ct(e);return(t=o==null?void 0:o.$el)!=null?t:o}const ks=zm?window:void 0;function Es(...e){let t,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,t=ks):[t,o,i,a]=e,!t)return Gm;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const l=[],r=()=>{l.forEach(u=>u()),l.length=0},s=(u,f,p,m)=>(u.addEventListener(f,p,m),()=>u.removeEventListener(f,p,m)),c=n.watch(()=>[Xm(t),Ct(a)],([u,f])=>{if(r(),!u)return;const p=Fm(f)?{...f}:f;l.push(...o.flatMap(m=>i.map(h=>s(u,m,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),r()};return Qn(d),d}function jm(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ns(...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=ks,eventName:l="keydown",passive:r=!1,dedupe:s=!1}=i,c=jm(t);return Es(a,l,u=>{u.repeat&&Ct(s)||c(u)&&o(u)},r)}function Zm(e){return JSON.parse(JSON.stringify(e))}function Sa(e,t,o,i={}){var a,l,r;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:f,shouldEmit:p}=i,m=n.getCurrentInstance(),h=o||(m==null?void 0:m.emit)||((a=m==null?void 0:m.$emit)==null?void 0:a.bind(m))||((r=(l=m==null?void 0:m.proxy)==null?void 0:l.$emit)==null?void 0:r.bind(m==null?void 0:m.proxy));let _=d;t||(t="modelValue"),_=_||`update:${t.toString()}`;const b=y=>s?typeof s=="function"?s(y):Zm(y):y,g=()=>Um(e[t])?b(e[t]):f,I=y=>{p?p(y)&&h(_,y):h(_,y)};if(c){const y=g(),N=n.ref(y);let q=!1;return n.watch(()=>e[t],U=>{q||(q=!0,N.value=b(U),n.nextTick(()=>q=!1))}),n.watch(N,U=>{!q&&(U!==e[t]||u)&&I(U)},{deep:u}),N}else return n.computed({get(){return g()},set(y){I(y)}})}var Jm={value:()=>{}};function Jo(){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 Qo(o)}function Qo(e){this._=e}function Qm(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}})}Qo.prototype=Jo.prototype={constructor:Qo,on:function(e,t){var o=this._,i=Qm(e+"",o),a,l=-1,r=i.length;if(arguments.length<2){for(;++l<r;)if((a=(e=i[l]).type)&&(a=ep(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<r;)if(a=(e=i[l]).type)o[a]=$s(o[a],e.name,t);else if(t==null)for(a in o)o[a]=$s(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 Qo(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,l;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[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,l=i.length;a<l;++a)i[a].value.apply(t,o)}};function ep(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function $s(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=Jm,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var Ca="http://www.w3.org/1999/xhtml";const xs={svg:"http://www.w3.org/2000/svg",xhtml:Ca,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ei(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),xs.hasOwnProperty(t)?{space:xs[t],local:e}:e}function tp(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===Ca&&t.documentElement.namespaceURI===Ca?t.createElement(e):t.createElementNS(o,e)}}function np(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Is(e){var t=ei(e);return(t.local?np:tp)(t)}function op(){}function Ra(e){return e==null?op:function(){return this.querySelector(e)}}function ip(e){typeof e!="function"&&(e=Ra(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=new Array(r),c,d,u=0;u<r;++u)(c=l[u])&&(d=e.call(c,c.__data__,u,l))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new st(i,this._parents)}function ap(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function lp(){return[]}function Ss(e){return e==null?lp:function(){return this.querySelectorAll(e)}}function rp(e){return function(){return ap(e.apply(this,arguments))}}function sp(e){typeof e=="function"?e=rp(e):e=Ss(e);for(var t=this._groups,o=t.length,i=[],a=[],l=0;l<o;++l)for(var r=t[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&(i.push(e.call(c,c.__data__,d,r)),a.push(c));return new st(i,a)}function Cs(e){return function(){return this.matches(e)}}function Rs(e){return function(t){return t.matches(e)}}var cp=Array.prototype.find;function dp(e){return function(){return cp.call(this.children,e)}}function up(){return this.firstElementChild}function fp(e){return this.select(e==null?up:dp(typeof e=="function"?e:Rs(e)))}var mp=Array.prototype.filter;function pp(){return Array.from(this.children)}function hp(e){return function(){return mp.call(this.children,e)}}function yp(e){return this.selectAll(e==null?pp:hp(typeof e=="function"?e:Rs(e)))}function gp(e){typeof e!="function"&&(e=Cs(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new st(i,this._parents)}function Vs(e){return new Array(e.length)}function bp(){return new st(this._enter||this._groups.map(Vs),this._parents)}function ti(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ti.prototype={constructor:ti,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 _p(e){return function(){return e}}function wp(e,t,o,i,a,l){for(var r=0,s,c=t.length,d=l.length;r<d;++r)(s=t[r])?(s.__data__=l[r],i[r]=s):o[r]=new ti(e,l[r]);for(;r<c;++r)(s=t[r])&&(a[r]=s)}function vp(e,t,o,i,a,l,r){var s,c,d=new Map,u=t.length,f=l.length,p=new Array(u),m;for(s=0;s<u;++s)(c=t[s])&&(p[s]=m=r.call(c,c.__data__,s,t)+"",d.has(m)?a[s]=c:d.set(m,c));for(s=0;s<f;++s)m=r.call(e,l[s],s,l)+"",(c=d.get(m))?(i[s]=c,c.__data__=l[s],d.delete(m)):o[s]=new ti(e,l[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function kp(e){return e.__data__}function Ep(e,t){if(!arguments.length)return Array.from(this,kp);var o=t?vp:wp,i=this._parents,a=this._groups;typeof e!="function"&&(e=_p(e));for(var l=a.length,r=new Array(l),s=new Array(l),c=new Array(l),d=0;d<l;++d){var u=i[d],f=a[d],p=f.length,m=Np(e.call(u,u&&u.__data__,d,i)),h=m.length,_=s[d]=new Array(h),b=r[d]=new Array(h),g=c[d]=new Array(p);o(u,f,_,b,g,m,t);for(var I=0,y=0,N,q;I<h;++I)if(N=_[I]){for(I>=y&&(y=I+1);!(q=b[y])&&++y<h;);N._next=q||null}}return r=new st(r,i),r._enter=s,r._exit=c,r}function Np(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $p(){return new st(this._exit||this._groups.map(Vs),this._parents)}function xp(e,t,o){var i=this.enter(),a=this,l=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?l.remove():o(l),i&&a?i.merge(a).order():a}function Ip(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._groups,a=o.length,l=i.length,r=Math.min(a,l),s=new Array(a),c=0;c<r;++c)for(var d=o[c],u=i[c],f=d.length,p=s[c]=new Array(f),m,h=0;h<f;++h)(m=d[h]||u[h])&&(p[h]=m);for(;c<a;++c)s[c]=o[c];return new st(s,this._parents)}function Sp(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],a=i.length-1,l=i[a],r;--a>=0;)(r=i[a])&&(l&&r.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(r,l),l=r);return this}function Cp(e){e||(e=Rp);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var o=this._groups,i=o.length,a=new Array(i),l=0;l<i;++l){for(var r=o[l],s=r.length,c=a[l]=new Array(s),d,u=0;u<s;++u)(d=r[u])&&(c[u]=d);c.sort(t)}return new st(a,this._parents).order()}function Rp(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Vp(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ap(){return Array.from(this)}function Tp(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length;a<l;++a){var r=i[a];if(r)return r}return null}function Mp(){let e=0;for(const t of this)++e;return e}function Bp(){return!this.node()}function Dp(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],l=0,r=a.length,s;l<r;++l)(s=a[l])&&e.call(s,s.__data__,l,a);return this}function Op(e){return function(){this.removeAttribute(e)}}function Lp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pp(e,t){return function(){this.setAttribute(e,t)}}function zp(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Up(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Hp(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 Fp(e,t){var o=ei(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?Lp:Op:typeof t=="function"?o.local?Hp:Up:o.local?zp:Pp)(o,t))}function As(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Gp(e){return function(){this.style.removeProperty(e)}}function Yp(e,t,o){return function(){this.style.setProperty(e,t,o)}}function Wp(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function Kp(e,t,o){return arguments.length>1?this.each((t==null?Gp:typeof t=="function"?Wp:Yp)(e,t,o??"")):In(this.node(),e)}function In(e,t){return e.style.getPropertyValue(t)||As(e).getComputedStyle(e,null).getPropertyValue(t)}function qp(e){return function(){delete this[e]}}function Xp(e,t){return function(){this[e]=t}}function jp(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Zp(e,t){return arguments.length>1?this.each((t==null?qp:typeof t=="function"?jp:Xp)(e,t)):this.node()[e]}function Ts(e){return e.trim().split(/^|\s+/)}function Va(e){return e.classList||new Ms(e)}function Ms(e){this._node=e,this._names=Ts(e.getAttribute("class")||"")}Ms.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 Bs(e,t){for(var o=Va(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function Ds(e,t){for(var o=Va(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function Jp(e){return function(){Bs(this,e)}}function Qp(e){return function(){Ds(this,e)}}function eh(e,t){return function(){(t.apply(this,arguments)?Bs:Ds)(this,e)}}function th(e,t){var o=Ts(e+"");if(arguments.length<2){for(var i=Va(this.node()),a=-1,l=o.length;++a<l;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?eh:t?Jp:Qp)(o,t))}function nh(){this.textContent=""}function oh(e){return function(){this.textContent=e}}function ih(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ah(e){return arguments.length?this.each(e==null?nh:(typeof e=="function"?ih:oh)(e)):this.node().textContent}function lh(){this.innerHTML=""}function rh(e){return function(){this.innerHTML=e}}function sh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ch(e){return arguments.length?this.each(e==null?lh:(typeof e=="function"?sh:rh)(e)):this.node().innerHTML}function dh(){this.nextSibling&&this.parentNode.appendChild(this)}function uh(){return this.each(dh)}function fh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mh(){return this.each(fh)}function ph(e){var t=typeof e=="function"?e:Is(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function hh(){return null}function yh(e,t){var o=typeof e=="function"?e:Is(e),i=t==null?hh:typeof t=="function"?t:Ra(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function gh(){var e=this.parentNode;e&&e.removeChild(this)}function bh(){return this.each(gh)}function _h(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vh(e){return this.select(e?wh:_h)}function kh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Eh(e){return function(t){e.call(this,t,this.__data__)}}function Nh(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 $h(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,l;o<a;++o)l=t[o],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function xh(e,t,o){return function(){var i=this.__on,a,l=Eh(t);if(i){for(var r=0,s=i.length;r<s;++r)if((a=i[r]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=o),a.value=t;return}}this.addEventListener(e.type,l,o),a={type:e.type,name:e.name,value:t,listener:l,options:o},i?i.push(a):this.__on=[a]}}function Ih(e,t,o){var i=Nh(e+""),a,l=i.length,r;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<l;++a)if((r=i[a]).type===u.type&&r.name===u.name)return u.value}return}for(s=t?xh:$h,a=0;a<l;++a)this.each(s(i[a],t,o));return this}function Os(e,t,o){var i=As(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 Sh(e,t){return function(){return Os(this,e,t)}}function Ch(e,t){return function(){return Os(this,e,t.apply(this,arguments))}}function Rh(e,t){return this.each((typeof t=="function"?Ch:Sh)(e,t))}function*Vh(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length,r;a<l;++a)(r=i[a])&&(yield r)}var Ls=[null];function st(e,t){this._groups=e,this._parents=t}function eo(){return new st([[document.documentElement]],Ls)}function Ah(){return this}st.prototype=eo.prototype={constructor:st,select:ip,selectAll:sp,selectChild:fp,selectChildren:yp,filter:gp,data:Ep,enter:bp,exit:$p,join:xp,merge:Ip,selection:Ah,order:Sp,sort:Cp,call:Vp,nodes:Ap,node:Tp,size:Mp,empty:Bp,each:Dp,attr:Fp,style:Kp,property:Zp,classed:th,text:ah,html:ch,raise:uh,lower:mh,append:ph,insert:yh,remove:bh,clone:vh,datum:kh,on:Ih,dispatch:Rh,[Symbol.iterator]:Vh};function ft(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],Ls)}function Th(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=Th(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 Mh={passive:!1},to={capture:!0,passive:!1};function Aa(e){e.stopImmediatePropagation()}function Sn(e){e.preventDefault(),e.stopImmediatePropagation()}function Ps(e){var t=e.document.documentElement,o=ft(e).on("dragstart.drag",Sn,to);"onselectstart"in t?o.on("selectstart.drag",Sn,to):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function zs(e,t){var o=e.document.documentElement,i=ft(e).on("dragstart.drag",null);t&&(i.on("click.drag",Sn,to),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 ni=e=>()=>e;function Ta(e,{sourceEvent:t,subject:o,target:i,identifier:a,active:l,x:r,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:l,enumerable:!0,configurable:!0},x:{value:r,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}})}Ta.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Bh(e){return!e.ctrlKey&&!e.button}function Dh(){return this.parentNode}function Oh(e,t){return t??{x:e.x,y:e.y}}function Lh(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ph(){var e=Bh,t=Dh,o=Oh,i=Lh,a={},l=Jo("start","drag","end"),r=0,s,c,d,u,f=0;function p(N){N.on("mousedown.drag",m).filter(i).on("touchstart.drag",b).on("touchmove.drag",g,Mh).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,q){if(!(u||!e.call(this,N,q))){var U=y(this,t.call(this,N,q),N,q,"mouse");U&&(ft(N.view).on("mousemove.drag",h,to).on("mouseup.drag",_,to),Ps(N.view),Aa(N),d=!1,s=N.clientX,c=N.clientY,U("start",N))}}function h(N){if(Sn(N),!d){var q=N.clientX-s,U=N.clientY-c;d=q*q+U*U>f}a.mouse("drag",N)}function _(N){ft(N.view).on("mousemove.drag mouseup.drag",null),zs(N.view,d),Sn(N),a.mouse("end",N)}function b(N,q){if(e.call(this,N,q)){var U=N.changedTouches,X=t.call(this,N,q),K=U.length,W,ne;for(W=0;W<K;++W)(ne=y(this,X,N,q,U[W].identifier,U[W]))&&(Aa(N),ne("start",N,U[W]))}}function g(N){var q=N.changedTouches,U=q.length,X,K;for(X=0;X<U;++X)(K=a[q[X].identifier])&&(Sn(N),K("drag",N,q[X]))}function I(N){var q=N.changedTouches,U=q.length,X,K;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),X=0;X<U;++X)(K=a[q[X].identifier])&&(Aa(N),K("end",N,q[X]))}function y(N,q,U,X,K,W){var ne=l.copy(),re=_t(W||U,q),L,Q,v;if((v=o.call(N,new Ta("beforestart",{sourceEvent:U,target:p,identifier:K,active:r,x:re[0],y:re[1],dx:0,dy:0,dispatch:ne}),X))!=null)return L=v.x-re[0]||0,Q=v.y-re[1]||0,function T($,P,H){var te=re,M;switch($){case"start":a[K]=T,M=r++;break;case"end":delete a[K],--r;case"drag":re=_t(H||P,q),M=r;break}ne.call($,N,new Ta($,{sourceEvent:P,subject:v,target:p,identifier:K,active:M,x:re[0]+L,y:re[1]+Q,dx:re[0]-te[0],dy:re[1]-te[1],dispatch:ne}),X)}}return p.filter=function(N){return arguments.length?(e=typeof N=="function"?N:ni(!!N),p):e},p.container=function(N){return arguments.length?(t=typeof N=="function"?N:ni(N),p):t},p.subject=function(N){return arguments.length?(o=typeof N=="function"?N:ni(N),p):o},p.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:ni(!!N),p):i},p.on=function(){var N=l.on.apply(l,arguments);return N===l?p:N},p.clickDistance=function(N){return arguments.length?(f=(N=+N)*N,p):Math.sqrt(f)},p}function Ma(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function Us(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function no(){}var oo=.7,oi=1/oo,Cn="\\s*([+-]?\\d+)\\s*",io="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zh=/^#([0-9a-f]{3,8})$/,Uh=new RegExp(`^rgb\\(${Cn},${Cn},${Cn}\\)$`),Hh=new RegExp(`^rgb\\(${wt},${wt},${wt}\\)$`),Fh=new RegExp(`^rgba\\(${Cn},${Cn},${Cn},${io}\\)$`),Gh=new RegExp(`^rgba\\(${wt},${wt},${wt},${io}\\)$`),Yh=new RegExp(`^hsl\\(${io},${wt},${wt}\\)$`),Wh=new RegExp(`^hsla\\(${io},${wt},${wt},${io}\\)$`),Hs={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};Ma(no,tn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fs,formatHex:Fs,formatHex8:Kh,formatHsl:qh,formatRgb:Gs,toString:Gs});function Fs(){return this.rgb().formatHex()}function Kh(){return this.rgb().formatHex8()}function qh(){return Xs(this).formatHsl()}function Gs(){return this.rgb().formatRgb()}function tn(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=zh.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?Ys(t):o===3?new at(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?ii(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?ii(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=Uh.exec(e))?new at(t[1],t[2],t[3],1):(t=Hh.exec(e))?new at(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fh.exec(e))?ii(t[1],t[2],t[3],t[4]):(t=Gh.exec(e))?ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Yh.exec(e))?qs(t[1],t[2]/100,t[3]/100,1):(t=Wh.exec(e))?qs(t[1],t[2]/100,t[3]/100,t[4]):Hs.hasOwnProperty(e)?Ys(Hs[e]):e==="transparent"?new at(NaN,NaN,NaN,0):null}function Ys(e){return new at(e>>16&255,e>>8&255,e&255,1)}function ii(e,t,o,i){return i<=0&&(e=t=o=NaN),new at(e,t,o,i)}function Xh(e){return e instanceof no||(e=tn(e)),e?(e=e.rgb(),new at(e.r,e.g,e.b,e.opacity)):new at}function Ba(e,t,o,i){return arguments.length===1?Xh(e):new at(e,t,o,i??1)}function at(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}Ma(at,Ba,Us(no,{brighter(e){return e=e==null?oi:Math.pow(oi,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new at(nn(this.r),nn(this.g),nn(this.b),ai(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:Ws,formatHex:Ws,formatHex8:jh,formatRgb:Ks,toString:Ks}));function Ws(){return`#${on(this.r)}${on(this.g)}${on(this.b)}`}function jh(){return`#${on(this.r)}${on(this.g)}${on(this.b)}${on((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ks(){const e=ai(this.opacity);return`${e===1?"rgb(":"rgba("}${nn(this.r)}, ${nn(this.g)}, ${nn(this.b)}${e===1?")":`, ${e})`}`}function ai(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 on(e){return e=nn(e),(e<16?"0":"")+e.toString(16)}function qs(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new mt(e,t,o,i)}function Xs(e){if(e instanceof mt)return new mt(e.h,e.s,e.l,e.opacity);if(e instanceof no||(e=tn(e)),!e)return new mt;if(e instanceof mt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),l=Math.max(t,o,i),r=NaN,s=l-a,c=(l+a)/2;return s?(t===l?r=(o-i)/s+(o<i)*6:o===l?r=(i-t)/s+2:r=(t-o)/s+4,s/=c<.5?l+a:2-l-a,r*=60):s=c>0&&c<1?0:r,new mt(r,s,c,e.opacity)}function Zh(e,t,o,i){return arguments.length===1?Xs(e):new mt(e,t,o,i??1)}function mt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}Ma(mt,Zh,Us(no,{brighter(e){return e=e==null?oi:Math.pow(oi,e),new mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new mt(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 at(Da(e>=240?e-240:e+120,a,i),Da(e,a,i),Da(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new mt(js(this.h),li(this.s),li(this.l),ai(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=ai(this.opacity);return`${e===1?"hsl(":"hsla("}${js(this.h)}, ${li(this.s)*100}%, ${li(this.l)*100}%${e===1?")":`, ${e})`}`}}));function js(e){return e=(e||0)%360,e<0?e+360:e}function li(e){return Math.max(0,Math.min(1,e||0))}function Da(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 Oa=e=>()=>e;function Jh(e,t){return function(o){return e+o*t}}function Qh(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 ey(e){return(e=+e)==1?Zs:function(t,o){return o-t?Qh(t,o,e):Oa(isNaN(t)?o:t)}}function Zs(e,t){var o=t-e;return o?Jh(e,o):Oa(isNaN(e)?t:e)}const ri=(function e(t){var o=ey(t);function i(a,l){var r=o((a=Ba(a)).r,(l=Ba(l)).r),s=o(a.g,l.g),c=o(a.b,l.b),d=Zs(a.opacity,l.opacity);return function(u){return a.r=r(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function ty(e,t){t||(t=[]);var o=e?Math.min(t.length,e.length):0,i=t.slice(),a;return function(l){for(a=0;a<o;++a)i[a]=e[a]*(1-l)+t[a]*l;return i}}function ny(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function oy(e,t){var o=t?t.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),l=new Array(o),r;for(r=0;r<i;++r)a[r]=ao(e[r],t[r]);for(;r<o;++r)l[r]=t[r];return function(s){for(r=0;r<i;++r)l[r]=a[r](s);return l}}function iy(e,t){var o=new Date;return e=+e,t=+t,function(i){return o.setTime(e*(1-i)+t*i),o}}function vt(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}function ay(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]=ao(e[a],t[a]):i[a]=t[a];return function(l){for(a in o)i[a]=o[a](l);return i}}var La=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pa=new RegExp(La.source,"g");function ly(e){return function(){return e}}function ry(e){return function(t){return e(t)+""}}function Js(e,t){var o=La.lastIndex=Pa.lastIndex=0,i,a,l,r=-1,s=[],c=[];for(e=e+"",t=t+"";(i=La.exec(e))&&(a=Pa.exec(t));)(l=a.index)>o&&(l=t.slice(o,l),s[r]?s[r]+=l:s[++r]=l),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:vt(i,a)})),o=Pa.lastIndex;return o<t.length&&(l=t.slice(o),s[r]?s[r]+=l:s[++r]=l),s.length<2?c[0]?ry(c[0].x):ly(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(d);return s.join("")})}function ao(e,t){var o=typeof t,i;return t==null||o==="boolean"?Oa(t):(o==="number"?vt:o==="string"?(i=tn(t))?(t=i,ri):Js:t instanceof tn?ri:t instanceof Date?iy:ny(t)?ty:Array.isArray(t)?oy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ay:vt)(e,t)}var Qs=180/Math.PI,za={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ec(e,t,o,i,a,l){var r,s,c;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(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,r=-r),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Qs,skewX:Math.atan(c)*Qs,scaleX:r,scaleY:s}}var si;function sy(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?za:ec(t.a,t.b,t.c,t.d,t.e,t.f)}function cy(e){return e==null||(si||(si=document.createElementNS("http://www.w3.org/2000/svg","g")),si.setAttribute("transform",e),!(e=si.transform.baseVal.consolidate()))?za:(e=e.matrix,ec(e.a,e.b,e.c,e.d,e.e,e.f))}function tc(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function l(d,u,f,p,m,h){if(d!==f||u!==p){var _=m.push("translate(",null,t,null,o);h.push({i:_-4,x:vt(d,f)},{i:_-2,x:vt(u,p)})}else(f||p)&&m.push("translate("+f+t+p+o)}function r(d,u,f,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:f.push(a(f)+"rotate(",null,i)-2,x:vt(d,u)})):u&&f.push(a(f)+"rotate("+u+i)}function s(d,u,f,p){d!==u?p.push({i:f.push(a(f)+"skewX(",null,i)-2,x:vt(d,u)}):u&&f.push(a(f)+"skewX("+u+i)}function c(d,u,f,p,m,h){if(d!==f||u!==p){var _=m.push(a(m)+"scale(",null,",",null,")");h.push({i:_-4,x:vt(d,f)},{i:_-2,x:vt(u,p)})}else(f!==1||p!==1)&&m.push(a(m)+"scale("+f+","+p+")")}return function(d,u){var f=[],p=[];return d=e(d),u=e(u),l(d.translateX,d.translateY,u.translateX,u.translateY,f,p),r(d.rotate,u.rotate,f,p),s(d.skewX,u.skewX,f,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,f,p),d=u=null,function(m){for(var h=-1,_=p.length,b;++h<_;)f[(b=p[h]).i]=b.x(m);return f.join("")}}}var dy=tc(sy,"px, ","px)","deg)"),uy=tc(cy,", ",")",")"),fy=1e-12;function nc(e){return((e=Math.exp(e))+1/e)/2}function my(e){return((e=Math.exp(e))-1/e)/2}function py(e){return((e=Math.exp(2*e))-1)/(e+1)}const ci=(function e(t,o,i){function a(l,r){var s=l[0],c=l[1],d=l[2],u=r[0],f=r[1],p=r[2],m=u-s,h=f-c,_=m*m+h*h,b,g;if(_<fy)g=Math.log(p/d)/t,b=function(X){return[s+X*m,c+X*h,d*Math.exp(t*X*g)]};else{var I=Math.sqrt(_),y=(p*p-d*d+i*_)/(2*d*o*I),N=(p*p-d*d-i*_)/(2*p*o*I),q=Math.log(Math.sqrt(y*y+1)-y),U=Math.log(Math.sqrt(N*N+1)-N);g=(U-q)/t,b=function(X){var K=X*g,W=nc(q),ne=d/(o*I)*(W*py(t*K+q)-my(q));return[s+ne*m,c+ne*h,d*W/nc(t*K+q)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return a.rho=function(l){var r=Math.max(.001,+l),s=r*r,c=s*s;return e(r,s,c)},a})(Math.SQRT2,2,4);var Rn=0,lo=0,ro=0,oc=1e3,di,so,ui=0,an=0,fi=0,co=typeof performance=="object"&&performance.now?performance:Date,ic=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ua(){return an||(ic(hy),an=co.now()+fi)}function hy(){an=0}function mi(){this._call=this._time=this._next=null}mi.prototype=ac.prototype={constructor:mi,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Ua():+o)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:di=this,so=this),this._call=e,this._time=o,Ha()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ha())}};function ac(e,t,o){var i=new mi;return i.restart(e,t,o),i}function yy(){Ua(),++Rn;for(var e=di,t;e;)(t=an-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Rn}function lc(){an=(ui=co.now())+fi,Rn=lo=0;try{yy()}finally{Rn=0,by(),an=0}}function gy(){var e=co.now(),t=e-ui;t>oc&&(fi-=t,ui=e)}function by(){for(var e,t=di,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:di=o);so=e,Ha(i)}function Ha(e){if(!Rn){lo&&(lo=clearTimeout(lo));var t=e-an;t>24?(e<1/0&&(lo=setTimeout(lc,e-co.now()-fi)),ro&&(ro=clearInterval(ro))):(ro||(ui=co.now(),ro=setInterval(gy,oc)),Rn=1,ic(lc))}}function rc(e,t,o){var i=new mi;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var _y=Jo("start","end","cancel","interrupt"),wy=[],sc=0,cc=1,Fa=2,pi=3,dc=4,Ga=5,hi=6;function yi(e,t,o,i,a,l){var r=e.__transition;if(!r)e.__transition={};else if(o in r)return;vy(e,o,{name:t,index:i,group:a,on:_y,tween:wy,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:sc})}function Ya(e,t){var o=pt(e,t);if(o.state>sc)throw new Error("too late; already scheduled");return o}function kt(e,t){var o=pt(e,t);if(o.state>pi)throw new Error("too late; already running");return o}function pt(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function vy(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=ac(l,0,o.time);function l(d){o.state=cc,o.timer.restart(r,o.delay,o.time),o.delay<=d&&r(d-o.delay)}function r(d){var u,f,p,m;if(o.state!==cc)return c();for(u in i)if(m=i[u],m.name===o.name){if(m.state===pi)return rc(r);m.state===dc?(m.state=hi,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[u]):+u<t&&(m.state=hi,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete i[u])}if(rc(function(){o.state===pi&&(o.state=dc,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=Fa,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Fa){for(o.state=pi,a=new Array(p=o.tween.length),u=0,f=-1;u<p;++u)(m=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++f]=m);a.length=f+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Ga,1),f=-1,p=a.length;++f<p;)a[f].call(e,u);o.state===Ga&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=hi,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function gi(e,t){var o=e.__transition,i,a,l=!0,r;if(o){t=t==null?null:t+"";for(r in o){if((i=o[r]).name!==t){l=!1;continue}a=i.state>Fa&&i.state<Ga,i.state=hi,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[r]}l&&delete e.__transition}}function ky(e){return this.each(function(){gi(this,e)})}function Ey(e,t){var o,i;return function(){var a=kt(this,e),l=a.tween;if(l!==o){i=o=l;for(var r=0,s=i.length;r<s;++r)if(i[r].name===t){i=i.slice(),i.splice(r,1);break}}a.tween=i}}function Ny(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var l=kt(this,e),r=l.tween;if(r!==i){a=(i=r).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)}l.tween=a}}function $y(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=pt(this.node(),o).tween,a=0,l=i.length,r;a<l;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((t==null?Ey:Ny)(o,e,t))}function Wa(e,t,o){var i=e._id;return e.each(function(){var a=kt(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return pt(a,i).value[t]}}function uc(e,t){var o;return(typeof t=="number"?vt:t instanceof tn?ri:(o=tn(t))?(t=o,ri):Js)(e,t)}function xy(e){return function(){this.removeAttribute(e)}}function Iy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sy(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttribute(e);return r===a?null:r===i?l:l=t(i=r,o)}}function Cy(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?l:l=t(i=r,o)}}function Ry(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttribute(e):(r=this.getAttribute(e),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function Vy(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(r=this.getAttributeNS(e.space,e.local),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function Ay(e,t){var o=ei(e),i=o==="transform"?uy:uc;return this.attrTween(e,typeof t=="function"?(o.local?Vy:Ry)(o,i,Wa(this,"attr."+e,t)):t==null?(o.local?Iy:xy)(o):(o.local?Cy:Sy)(o,i,t))}function Ty(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function My(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function By(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&My(e,l)),o}return a._value=t,a}function Dy(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&Ty(e,l)),o}return a._value=t,a}function Oy(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=ei(e);return this.tween(o,(i.local?By:Dy)(i,t))}function Ly(e,t){return function(){Ya(this,e).delay=+t.apply(this,arguments)}}function Py(e,t){return t=+t,function(){Ya(this,e).delay=t}}function zy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ly:Py)(t,e)):pt(this.node(),t).delay}function Uy(e,t){return function(){kt(this,e).duration=+t.apply(this,arguments)}}function Hy(e,t){return t=+t,function(){kt(this,e).duration=t}}function Fy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Uy:Hy)(t,e)):pt(this.node(),t).duration}function Gy(e,t){if(typeof t!="function")throw new Error;return function(){kt(this,e).ease=t}}function Yy(e){var t=this._id;return arguments.length?this.each(Gy(t,e)):pt(this.node(),t).ease}function Wy(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;kt(this,e).ease=o}}function Ky(e){if(typeof e!="function")throw new Error;return this.each(Wy(this._id,e))}function qy(e){typeof e!="function"&&(e=Cs(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new Rt(i,this._parents,this._name,this._id)}function Xy(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,l=Math.min(i,a),r=new Array(i),s=0;s<l;++s)for(var c=t[s],d=o[s],u=c.length,f=r[s]=new Array(u),p,m=0;m<u;++m)(p=c[m]||d[m])&&(f[m]=p);for(;s<i;++s)r[s]=t[s];return new Rt(r,this._parents,this._name,this._id)}function jy(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 Zy(e,t,o){var i,a,l=jy(t)?Ya:kt;return function(){var r=l(this,e),s=r.on;s!==i&&(a=(i=s).copy()).on(t,o),r.on=a}}function Jy(e,t){var o=this._id;return arguments.length<2?pt(this.node(),o).on.on(e):this.each(Zy(o,e,t))}function Qy(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function eg(){return this.on("end.remove",Qy(this._id))}function tg(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Ra(e));for(var i=this._groups,a=i.length,l=new Array(a),r=0;r<a;++r)for(var s=i[r],c=s.length,d=l[r]=new Array(c),u,f,p=0;p<c;++p)(u=s[p])&&(f=e.call(u,u.__data__,p,s))&&("__data__"in u&&(f.__data__=u.__data__),d[p]=f,yi(d[p],t,o,p,d,pt(u,o)));return new Rt(l,this._parents,t,o)}function ng(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Ss(e));for(var i=this._groups,a=i.length,l=[],r=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,f=0;f<d;++f)if(u=c[f]){for(var p=e.call(u,u.__data__,f,c),m,h=pt(u,o),_=0,b=p.length;_<b;++_)(m=p[_])&&yi(m,t,o,_,p,h);l.push(p),r.push(u)}return new Rt(l,r,t,o)}var og=eo.prototype.constructor;function ig(){return new og(this._groups,this._parents)}function ag(e,t){var o,i,a;return function(){var l=In(this,e),r=(this.style.removeProperty(e),In(this,e));return l===r?null:l===o&&r===i?a:a=t(o=l,i=r)}}function fc(e){return function(){this.style.removeProperty(e)}}function lg(e,t,o){var i,a=o+"",l;return function(){var r=In(this,e);return r===a?null:r===i?l:l=t(i=r,o)}}function rg(e,t,o){var i,a,l;return function(){var r=In(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),In(this,e))),r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s))}}function sg(e,t){var o,i,a,l="style."+t,r="end."+l,s;return function(){var c=kt(this,e),d=c.on,u=c.value[l]==null?s||(s=fc(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(r,a=u),c.on=i}}function cg(e,t,o){var i=(e+="")=="transform"?dy:uc;return t==null?this.styleTween(e,ag(e,i)).on("end.style."+e,fc(e)):typeof t=="function"?this.styleTween(e,rg(e,i,Wa(this,"style."+e,t))).each(sg(this._id,e)):this.styleTween(e,lg(e,i,t),o).on("end.style."+e,null)}function dg(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function ug(e,t,o){var i,a;function l(){var r=t.apply(this,arguments);return r!==a&&(i=(a=r)&&dg(e,r,o)),i}return l._value=t,l}function fg(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,ug(e,t,o??""))}function mg(e){return function(){this.textContent=e}}function pg(e){return function(){var t=e(this);this.textContent=t??""}}function hg(e){return this.tween("text",typeof e=="function"?pg(Wa(this,"text",e)):mg(e==null?"":e+""))}function yg(e){return function(t){this.textContent=e.call(this,t)}}function gg(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&yg(a)),t}return i._value=e,i}function bg(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,gg(e))}function _g(){for(var e=this._name,t=this._id,o=mc(),i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)if(c=r[d]){var u=pt(c,t);yi(c,e,o,d,r,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Rt(i,this._parents,e,o)}function wg(){var e,t,o=this,i=o._id,a=o.size();return new Promise(function(l,r){var s={value:r},c={value:function(){--a===0&&l()}};o.each(function(){var d=kt(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&&l()})}var vg=0;function Rt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function mc(){return++vg}var Vt=eo.prototype;Rt.prototype={constructor:Rt,select:tg,selectAll:ng,selectChild:Vt.selectChild,selectChildren:Vt.selectChildren,filter:qy,merge:Xy,selection:ig,transition:_g,call:Vt.call,nodes:Vt.nodes,node:Vt.node,size:Vt.size,empty:Vt.empty,each:Vt.each,on:Jy,attr:Ay,attrTween:Oy,style:cg,styleTween:fg,text:hg,textTween:bg,remove:eg,tween:$y,delay:zy,duration:Fy,ease:Yy,easeVarying:Ky,end:wg,[Symbol.iterator]:Vt[Symbol.iterator]};function kg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Eg={time:null,delay:0,duration:250,ease:kg};function Ng(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 $g(e){var t,o;e instanceof Rt?(t=e._id,e=e._name):(t=mc(),(o=Eg).time=Ua(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&yi(c,e,t,d,r,o||Ng(c,t));return new Rt(i,this._parents,e,t)}eo.prototype.interrupt=ky,eo.prototype.transition=$g;const bi=e=>()=>e;function xg(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 At(e,t,o){this.k=e,this.x=t,this.y=o}At.prototype={constructor:At,scale:function(e){return e===1?this:new At(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new At(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 Vn=new At(1,0,0);At.prototype;function Ka(e){e.stopImmediatePropagation()}function uo(e){e.preventDefault(),e.stopImmediatePropagation()}function Ig(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Sg(){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 pc(){return this.__zoom||Vn}function Cg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Rg(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vg(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],l=e.invertY(t[0][1])-o[0][1],r=e.invertY(t[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),r>l?(l+r)/2:Math.min(0,l)||Math.max(0,r))}function Ag(){var e=Ig,t=Sg,o=Vg,i=Cg,a=Rg,l=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ci,d=Jo("start","zoom","end"),u,f,p,m=500,h=150,_=0,b=10;function g(v){v.property("__zoom",pc).on("wheel.zoom",K,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",ne).filter(a).on("touchstart.zoom",re).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(v,T,$,P){var H=v.selection?v.selection():v;H.property("__zoom",pc),v!==H?q(v,T,$,P):H.interrupt().each(function(){U(this,arguments).event(P).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},g.scaleBy=function(v,T,$,P){g.scaleTo(v,function(){var H=this.__zoom.k,te=typeof T=="function"?T.apply(this,arguments):T;return H*te},$,P)},g.scaleTo=function(v,T,$,P){g.transform(v,function(){var H=t.apply(this,arguments),te=this.__zoom,M=$==null?N(H):typeof $=="function"?$.apply(this,arguments):$,ee=te.invert(M),le=typeof T=="function"?T.apply(this,arguments):T;return o(y(I(te,le),M,ee),H,r)},$,P)},g.translateBy=function(v,T,$,P){g.transform(v,function(){return o(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),r)},null,P)},g.translateTo=function(v,T,$,P,H){g.transform(v,function(){var te=t.apply(this,arguments),M=this.__zoom,ee=P==null?N(te):typeof P=="function"?P.apply(this,arguments):P;return o(Vn.translate(ee[0],ee[1]).scale(M.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof $=="function"?-$.apply(this,arguments):-$),te,r)},P,H)};function I(v,T){return T=Math.max(l[0],Math.min(l[1],T)),T===v.k?v:new At(T,v.x,v.y)}function y(v,T,$){var P=T[0]-$[0]*v.k,H=T[1]-$[1]*v.k;return P===v.x&&H===v.y?v:new At(v.k,P,H)}function N(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function q(v,T,$,P){v.on("start.zoom",function(){U(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){U(this,arguments).event(P).end()}).tween("zoom",function(){var H=this,te=arguments,M=U(H,te).event(P),ee=t.apply(H,te),le=$==null?N(ee):typeof $=="function"?$.apply(H,te):$,me=Math.max(ee[1][0]-ee[0][0],ee[1][1]-ee[0][1]),ye=H.__zoom,ce=typeof T=="function"?T.apply(H,te):T,ue=c(ye.invert(le).concat(me/ye.k),ce.invert(le).concat(me/ce.k));return function(he){if(he===1)he=ce;else{var ve=ue(he),Se=me/ve[2];he=new At(Se,le[0]-ve[0]*Se,le[1]-ve[1]*Se)}M.zoom(null,he)}})}function U(v,T,$){return!$&&v.__zooming||new X(v,T)}function X(v,T){this.that=v,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,T),this.taps=0}X.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,T){return this.mouse&&v!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var T=ft(this.that).datum();d.call(v,this.that,new xg(v,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),T)}};function K(v,...T){if(!e.apply(this,arguments))return;var $=U(this,T).event(v),P=this.__zoom,H=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,i.apply(this,arguments)))),te=_t(v);if($.wheel)($.mouse[0][0]!==te[0]||$.mouse[0][1]!==te[1])&&($.mouse[1]=P.invert($.mouse[0]=te)),clearTimeout($.wheel);else{if(P.k===H)return;$.mouse=[te,P.invert(te)],gi(this),$.start()}uo(v),$.wheel=setTimeout(M,h),$.zoom("mouse",o(y(I(P,H),$.mouse[0],$.mouse[1]),$.extent,r));function M(){$.wheel=null,$.end()}}function W(v,...T){if(p||!e.apply(this,arguments))return;var $=v.currentTarget,P=U(this,T,!0).event(v),H=ft(v.view).on("mousemove.zoom",le,!0).on("mouseup.zoom",me,!0),te=_t(v,$),M=v.clientX,ee=v.clientY;Ps(v.view),Ka(v),P.mouse=[te,this.__zoom.invert(te)],gi(this),P.start();function le(ye){if(uo(ye),!P.moved){var ce=ye.clientX-M,ue=ye.clientY-ee;P.moved=ce*ce+ue*ue>_}P.event(ye).zoom("mouse",o(y(P.that.__zoom,P.mouse[0]=_t(ye,$),P.mouse[1]),P.extent,r))}function me(ye){H.on("mousemove.zoom mouseup.zoom",null),zs(ye.view,P.moved),uo(ye),P.event(ye).end()}}function ne(v,...T){if(e.apply(this,arguments)){var $=this.__zoom,P=_t(v.changedTouches?v.changedTouches[0]:v,this),H=$.invert(P),te=$.k*(v.shiftKey?.5:2),M=o(y(I($,te),P,H),t.apply(this,T),r);uo(v),s>0?ft(this).transition().duration(s).call(q,M,P,v):ft(this).call(g.transform,M,P,v)}}function re(v,...T){if(e.apply(this,arguments)){var $=v.touches,P=$.length,H=U(this,T,v.changedTouches.length===P).event(v),te,M,ee,le;for(Ka(v),M=0;M<P;++M)ee=$[M],le=_t(ee,this),le=[le,this.__zoom.invert(le),ee.identifier],H.touch0?!H.touch1&&H.touch0[2]!==le[2]&&(H.touch1=le,H.taps=0):(H.touch0=le,te=!0,H.taps=1+!!u);u&&(u=clearTimeout(u)),te&&(H.taps<2&&(f=le[0],u=setTimeout(function(){u=null},m)),gi(this),H.start())}}function L(v,...T){if(this.__zooming){var $=U(this,T).event(v),P=v.changedTouches,H=P.length,te,M,ee,le;for(uo(v),te=0;te<H;++te)M=P[te],ee=_t(M,this),$.touch0&&$.touch0[2]===M.identifier?$.touch0[0]=ee:$.touch1&&$.touch1[2]===M.identifier&&($.touch1[0]=ee);if(M=$.that.__zoom,$.touch1){var me=$.touch0[0],ye=$.touch0[1],ce=$.touch1[0],ue=$.touch1[1],he=(he=ce[0]-me[0])*he+(he=ce[1]-me[1])*he,ve=(ve=ue[0]-ye[0])*ve+(ve=ue[1]-ye[1])*ve;M=I(M,Math.sqrt(he/ve)),ee=[(me[0]+ce[0])/2,(me[1]+ce[1])/2],le=[(ye[0]+ue[0])/2,(ye[1]+ue[1])/2]}else if($.touch0)ee=$.touch0[0],le=$.touch0[1];else return;$.zoom("touch",o(y(M,ee,le),$.extent,r))}}function Q(v,...T){if(this.__zooming){var $=U(this,T).event(v),P=v.changedTouches,H=P.length,te,M;for(Ka(v),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),te=0;te<H;++te)M=P[te],$.touch0&&$.touch0[2]===M.identifier?delete $.touch0:$.touch1&&$.touch1[2]===M.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(M=_t(M,this),Math.hypot(f[0]-M[0],f[1]-M[1])<b)){var ee=ft(this).on("dblclick.zoom");ee&&ee.apply(this,arguments)}}}return g.wheelDelta=function(v){return arguments.length?(i=typeof v=="function"?v:bi(+v),g):i},g.filter=function(v){return arguments.length?(e=typeof v=="function"?v:bi(!!v),g):e},g.touchable=function(v){return arguments.length?(a=typeof v=="function"?v:bi(!!v),g):a},g.extent=function(v){return arguments.length?(t=typeof v=="function"?v:bi([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),g):t},g.scaleExtent=function(v){return arguments.length?(l[0]=+v[0],l[1]=+v[1],g):[l[0],l[1]]},g.translateExtent=function(v){return arguments.length?(r[0][0]=+v[0][0],r[1][0]=+v[1][0],r[0][1]=+v[0][1],r[1][1]=+v[1][1],g):[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},g.constrain=function(v){return arguments.length?(o=v,g):o},g.duration=function(v){return arguments.length?(s=+v,g):s},g.interpolate=function(v){return arguments.length?(c=v,g):c},g.on=function(){var v=d.on.apply(d,arguments);return v===d?g:v},g.clickDistance=function(v){return arguments.length?(_=(v=+v)*v,g):Math.sqrt(_)},g.tapDistance=function(v){return arguments.length?(b=+v,g):b},g}var $e=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))($e||{}),qa=(e=>(e.Partial="partial",e.Full="full",e))(qa||{}),ln=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(ln||{}),Tt=(e=>(e.Strict="strict",e.Loose="loose",e))(Tt||{}),Xa=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Xa||{}),fo=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(fo||{}),hc=(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))(hc||{});const Tg=["INPUT","SELECT","TEXTAREA"],Mg=typeof document<"u"?document:null;function ja(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,l=typeof(i==null?void 0:i.closest)=="function"?i.closest(".nokey"):null;return Tg.includes(i==null?void 0:i.nodeName)||a||!!l}function Bg(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function yc(e,t,o,i){const a=t.replace("+",`
|
|
3
3
|
`).replace(`
|
|
4
4
|
|
|
5
5
|
`,`
|
|
6
6
|
+`).split(`
|
|
7
|
-
`).map(r=>r.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===t.toLowerCase();i||o.add(e.toLowerCase());const l=a.every((r,s)=>o.has(r)&&Array.from(o.values())[s]===a[s]);return i&&o.delete(e.toLowerCase()),l}function Ag(e,t){return o=>{if(!o.code&&!o.key)return!1;const i=Tg(o.code,e);return Array.isArray(e)?e.some(a=>mc(o[i],a,t,o.type==="keyup")):mc(o[i],e,t,o.type==="keyup")}}function Tg(e,t){return t.includes(e)?"code":"key"}function mo(e,t){const o=n.computed(()=>n.toValue(t==null?void 0:t.target)??Rg),i=n.shallowRef(n.toValue(e)===!0);let a=!1;const l=new Set;let r=c(n.toValue(e));n.watch(()=>n.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),r=c(d)},{immediate:!0}),ws(["blur","contextmenu"],s),vs((...d)=>r(...d),d=>{var u,f;const p=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0,m=n.toValue(t==null?void 0:t.preventDefault)??!1;if(a=Vg(d),(!a||a&&!p)&&Ja(d))return;const b=((f=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:f[0])||d.target,g=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";!m&&(a||!g)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),vs((...d)=>r(...d),d=>{const u=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&Ja(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,l.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"?Ag(d,l):d}return i}const pc="vue-flow__node-desc",hc="vue-flow__edge-desc",Mg="vue-flow__aria-live",yc=["Enter"," ","Escape"],An={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function gi(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function bi(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 _i(e){return{width:e.offsetWidth,height:e.offsetHeight}}function sn(e,t=0,o=1){return Math.min(Math.max(e,t),o)}function gc(e,t){return{x:sn(e.x,t[0][0],t[1][0]),y:sn(e.y,t[0][1],t[1][1])}}function bc(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Ht(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function cn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Ht(e)}function po(e){return cn(e)&&"computedPosition"in e}function wi(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Bg(e){return wi(e.width)&&wi(e.height)&&wi(e.x)&&wi(e.y)}function Dg(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:Ye(e.data)?e.data:{},events:n.markRaw(Ye(e.events)?e.events:{})};return Object.assign(t??i,e,{id:e.id.toString(),parentNode:o})}function _c(e,t,o){var i,a;const l={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:Ye(e.data)?e.data:{},events:n.markRaw(Ye(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(t??l,e,{id:e.id.toString()})}function wc(e,t,o,i){const a=typeof e=="string"?e:e.id,l=new Set,r=i==="source"?"target":"source";for(const s of o)s[r]===a&&l.add(s[i]);return t.filter(s=>l.has(s.id))}function Og(...e){if(e.length===3){const[l,r,s]=e;return wc(l,r,s,"target")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(l=>Ht(l)&&l.source===i).map(l=>o.find(r=>cn(r)&&r.id===l.target))}function Lg(...e){if(e.length===3){const[l,r,s]=e;return wc(l,r,s,"source")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(l=>Ht(l)&&l.target===i).map(l=>o.find(r=>cn(r)&&r.id===l.source))}function vc({source:e,sourceHandle:t,target:o,targetHandle:i}){return`vueflow__edge-${e}${t??""}-${o}${i??""}`}function Pg(e,t){return t.some(o=>Ht(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 ho({x:e,y:t},{x:o,y:i,zoom:a}){return{x:e*a+o,y:t*a+i}}function yo({x:e,y:t},{x:o,y:i,zoom:a},l=!1,r=[1,1]){const s={x:(e-o)/a,y:(t-i)/a};return l?ki(s,r):s}function kc(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 vi({x:e,y:t,width:o,height:i}){return{x:e,y:t,x2:e+o,y2:t+i}}function Ec({x:e,y:t,x2:o,y2:i}){return{x:e,y:t,width:o-e,height:i-t}}function zg(e,t){return Ec(kc(vi(e),vi(t)))}function Qa(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=kc(t,vi({...i.computedPosition,...i.dimensions}))}return Ec(t)}function Nc(e,t,o={x:0,y:0,zoom:1},i=!1,a=!1){const l={...yo(t,o),width:t.width/o.zoom,height:t.height/o.zoom},r=[];for(const s of e){const{dimensions:c,selectable:d=!0,hidden:u=!1}=s,f=c.width??s.width??null,p=c.height??s.height??null;if(a&&!d||u)continue;const m=bi(l,gi(s)),h=f===null||p===null,b=i&&m>0,g=(f??0)*(p??0);(h||b||m>=g||s.dragging)&&r.push(s)}return r}function dn(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 Tn(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 _o(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ug(e,t,o){if(typeof e=="string"||typeof e=="number"){const i=Tn(e,o),a=Tn(e,t);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Tn(e.top??e.y??0,o),a=Tn(e.bottom??e.y??0,o),l=Tn(e.left??e.x??0,t),r=Tn(e.right??e.x??0,t);return{top:i,right:r,bottom:a,left:l,x:l+r,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Hg(e,t,o,i,a,l){const{x:r,y:s}=ho(e,{x:t,y:o,zoom:i}),{x:c,y:d}=ho({x:e.x+e.width,y:e.y+e.height},{x:t,y:o,zoom:i}),u=a-c,f=l-d;return{left:Math.floor(r),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(f)}}function $c(e,t,o,i,a,l=.1){const r=Ug(l,t,o),s=(t-r.x)/e.width,c=(o-r.y)/e.height,d=Math.min(s,c),u=sn(d,i,a),f=e.x+e.width/2,p=e.y+e.height/2,m=t/2-f*u,h=o/2-p*u,b=Hg(e,m,h,u,t,o),g={left:Math.min(b.left-r.left,0),top:Math.min(b.top-r.top,0),right:Math.min(b.right-r.right,0),bottom:Math.min(b.bottom-r.bottom,0)};return{x:m-g.left+g.right,y:h-g.top+g.bottom,zoom:u}}function Fg(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function xc(e,t){if(!e.parentNode)return!1;const o=t.get(e.parentNode);return o?o.selected?!0:xc(o,t):!1}function go(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function el(e){const t=e.ctrlKey&&bo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Ic(e,t,o){return e<t?sn(Math.abs(e-t),1,t)/t:e>o?-sn(Math.abs(e-o),1,t)/t:0}function Sc(e,t,o=15,i=40){const a=Ic(e.x,i,t.width-i)*o,l=Ic(e.y,i,t.height-i)*o;return[a,l]}function tl(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 l=Number(a.width.replace("px",""));a.width=`${l+o}px`}else a.width+=o;if(i>0)if(typeof a.height=="string"){const l=Number(a.height.replace("px",""));a.height=`${l+i}px`}else a.height+=i;if(e.position.x<0){const l=Math.abs(e.position.x);if(t.position.x=t.position.x-l,typeof a.width=="string"){const r=Number(a.width.replace("px",""));a.width=`${r+l}px`}else a.width+=l;e.position.x=0}if(e.position.y<0){const l=Math.abs(e.position.y);if(t.position.y=t.position.y-l,typeof a.height=="string"){const r=Number(a.height.replace("px",""));a.height=`${r+l}px`}else a.height+=l;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=l=>{const r=t.style;return{...r(l),...a}}:t.style={...t.style,...a}}}}function Cc(e,t){var o,i;const a=e.filter(r=>r.type==="add"||r.type==="remove");for(const r of a)if(r.type==="add")t.findIndex(c=>c.id===r.item.id)===-1&&t.push(r.item);else if(r.type==="remove"){const s=t.findIndex(c=>c.id===r.id);s!==-1&&t.splice(s,1)}const l=t.map(r=>r.id);for(const r of t)for(const s of e)if(s.id===r.id)switch(s.type){case"select":r.selected=s.selected;break;case"position":if(po(r)&&(typeof s.position<"u"&&(r.position=s.position),typeof s.dragging<"u"&&(r.dragging=s.dragging),r.expandParent&&r.parentNode)){const c=t[l.indexOf(r.parentNode)];c&&po(c)&&tl(r,c)}break;case"dimensions":if(po(r)&&(typeof s.dimensions<"u"&&(r.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(r.style={...r.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"&&(r.resizing=s.resizing),r.expandParent&&r.parentNode)){const c=t[l.indexOf(r.parentNode)];c&&po(c)&&(!!c.dimensions.width&&!!c.dimensions.height?tl(r,c):n.nextTick(()=>{tl(r,c)}))}break}return t}function Ft(e,t){return{id:e,type:"select",selected:t}}function Rc(e){return{item:e,type:"add"}}function Vc(e){return{id:e,type:"remove"}}function Ac(e,t,o,i,a){return{id:e,source:t,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function Gt(e,t=new Set,o=!1){const i=[];for(const[a,l]of e){const r=t.has(a);!(l.selected===void 0&&!r)&&l.selected!==r&&(o&&(l.selected=r),i.push(Ft(l.id,r)))}return i}const Tc=()=>{};function $e(e){const t=new Set;let o=Tc,i=()=>!1;const a=()=>t.size>0||i(),l=p=>{o=p},r=()=>{o=Tc},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{t.delete(p)};return{on:p=>{t.add(p);const m=()=>d(p);return Qn(m),{off:m}},off:d,trigger:p=>{const m=[o];return a()?m.push(...t):e&&m.push(e),Promise.allSettled(m.map(h=>h(p)))},hasListeners:a,listeners:t,setEmitter:l,removeEmitter:r,setHasEmitListeners:s,removeHasEmitListeners:c}}function Mc(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 Gg(e,t,o,i){var a,l;const r=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!xc(c,e))&&(c.draggable||t&&typeof c.draggable>"u")&&e.get(s)&&r.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-((l=c.computedPosition)==null?void 0:l.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(r.values())}function nl({id:e,dragItems:t,findNode:o}){const i=[];for(const a of t){const l=o(a.id);l&&i.push(l)}return[e?i.find(a=>a.id===e):i[0],i]}function Bc(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 Yg(e,t,o){const[i,a,l,r]=typeof e!="string"?Bc(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+r,o.computedPosition.y+i],[o.computedPosition.x+o.dimensions.width-a,o.computedPosition.y+o.dimensions.height-l]]:!1}function Wg(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 l=Yg(a,e,i);l&&(a=l)}else t(new qe(Ge.NODE_EXTENT_INVALID,e.id)),a=o;else if(Array.isArray(a)){const l=(i==null?void 0:i.computedPosition.x)||0,r=(i==null?void 0:i.computedPosition.y)||0;a=[[a[0][0]+l,a[0][1]+r],[a[1][0]+l,a[1][1]+r]]}else if(a!=="parent"&&(a!=null&&a.range)&&Array.isArray(a.range)){const[l,r,s,c]=Bc(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+l],[a.range[1][0]+d-r,a.range[1][1]+u-s]]}return a==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:a}function Kg({width:e,height:t},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(t||0)]]}function ol(e,t,o,i,a){const l=Kg(e.dimensions,Wg(e,o,i,a)),r=gc(t,l);return{position:{x:r.x-((a==null?void 0:a.computedPosition.x)||0),y:r.y-((a==null?void 0:a.computedPosition.y)||0)},computedPosition:r}}function Mn(e,t,o=Ie.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.computedPosition.x,l=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:r,height:s}=t??Zg(e);if(i)return{x:a+r/2,y:l+s/2};switch((t==null?void 0:t.position)??o){case Ie.Top:return{x:a+r/2,y:l};case Ie.Right:return{x:a+r,y:l+s/2};case Ie.Bottom:return{x:a+r/2,y:l+s};case Ie.Left:return{x:a,y:l+s/2}}}function Dc(e,t){return e&&(t?e.find(o=>o.id===t):e[0])||null}function qg({sourcePos:e,targetPos:t,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:l,width:r,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+l)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=vi({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:r/c.zoom,height:s/c.zoom}),f=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(f*p)>0}function Xg(e,t,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const l=t(e.source),r=t(e.target);return!l||!r?0:(o&&(a=i?e.zIndex:Math.max(l.computedPosition.z||0,r.computedPosition.z||0)),a)}var Ge=(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))(Ge||{});const Oc={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
|
|
7
|
+
`).map(r=>r.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===t.toLowerCase();i||o.add(e.toLowerCase());const l=a.every((r,s)=>o.has(r)&&Array.from(o.values())[s]===a[s]);return i&&o.delete(e.toLowerCase()),l}function Dg(e,t){return o=>{if(!o.code&&!o.key)return!1;const i=Og(o.code,e);return Array.isArray(e)?e.some(a=>yc(o[i],a,t,o.type==="keyup")):yc(o[i],e,t,o.type==="keyup")}}function Og(e,t){return t.includes(e)?"code":"key"}function mo(e,t){const o=n.computed(()=>n.toValue(t==null?void 0:t.target)??Mg),i=n.shallowRef(n.toValue(e)===!0);let a=!1;const l=new Set;let r=c(n.toValue(e));n.watch(()=>n.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),r=c(d)},{immediate:!0}),Es(["blur","contextmenu"],s),Ns((...d)=>r(...d),d=>{var u,f;const p=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0,m=n.toValue(t==null?void 0:t.preventDefault)??!1;if(a=Bg(d),(!a||a&&!p)&&ja(d))return;const _=((f=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:f[0])||d.target,b=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";!m&&(a||!b)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),Ns((...d)=>r(...d),d=>{const u=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&ja(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,l.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"?Dg(d,l):d}return i}const gc="vue-flow__node-desc",bc="vue-flow__edge-desc",Lg="vue-flow__aria-live",_c=["Enter"," ","Escape"],An={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function _i(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function wi(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 vi(e){return{width:e.offsetWidth,height:e.offsetHeight}}function rn(e,t=0,o=1){return Math.min(Math.max(e,t),o)}function wc(e,t){return{x:rn(e.x,t[0][0],t[1][0]),y:rn(e.y,t[0][1],t[1][1])}}function vc(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Ht(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function sn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Ht(e)}function po(e){return sn(e)&&"computedPosition"in e}function ki(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Pg(e){return ki(e.width)&&ki(e.height)&&ki(e.x)&&ki(e.y)}function zg(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:Ke(e.data)?e.data:{},events:n.markRaw(Ke(e.events)?e.events:{})};return Object.assign(t??i,e,{id:e.id.toString(),parentNode:o})}function kc(e,t,o){var i,a;const l={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:Ke(e.data)?e.data:{},events:n.markRaw(Ke(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(t??l,e,{id:e.id.toString()})}function Ec(e,t,o,i){const a=typeof e=="string"?e:e.id,l=new Set,r=i==="source"?"target":"source";for(const s of o)s[r]===a&&l.add(s[i]);return t.filter(s=>l.has(s.id))}function Ug(...e){if(e.length===3){const[l,r,s]=e;return Ec(l,r,s,"target")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(l=>Ht(l)&&l.source===i).map(l=>o.find(r=>sn(r)&&r.id===l.target))}function Hg(...e){if(e.length===3){const[l,r,s]=e;return Ec(l,r,s,"source")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(l=>Ht(l)&&l.target===i).map(l=>o.find(r=>sn(r)&&r.id===l.source))}function Nc({source:e,sourceHandle:t,target:o,targetHandle:i}){return`vueflow__edge-${e}${t??""}-${o}${i??""}`}function Fg(e,t){return t.some(o=>Ht(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 ho({x:e,y:t},{x:o,y:i,zoom:a}){return{x:e*a+o,y:t*a+i}}function yo({x:e,y:t},{x:o,y:i,zoom:a},l=!1,r=[1,1]){const s={x:(e-o)/a,y:(t-i)/a};return l?Ni(s,r):s}function $c(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 Ei({x:e,y:t,width:o,height:i}){return{x:e,y:t,x2:e+o,y2:t+i}}function xc({x:e,y:t,x2:o,y2:i}){return{x:e,y:t,width:o-e,height:i-t}}function Gg(e,t){return xc($c(Ei(e),Ei(t)))}function Za(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=$c(t,Ei({...i.computedPosition,...i.dimensions}))}return xc(t)}function Ic(e,t,o={x:0,y:0,zoom:1},i=!1,a=!1){const l={...yo(t,o),width:t.width/o.zoom,height:t.height/o.zoom},r=[];for(const s of e){const{dimensions:c,selectable:d=!0,hidden:u=!1}=s,f=c.width??s.width??null,p=c.height??s.height??null;if(a&&!d||u)continue;const m=wi(l,_i(s)),h=f===null||p===null,_=i&&m>0,b=(f??0)*(p??0);(h||_||m>=b||s.dragging)&&r.push(s)}return r}function cn(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 Tn(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 _o(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Yg(e,t,o){if(typeof e=="string"||typeof e=="number"){const i=Tn(e,o),a=Tn(e,t);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Tn(e.top??e.y??0,o),a=Tn(e.bottom??e.y??0,o),l=Tn(e.left??e.x??0,t),r=Tn(e.right??e.x??0,t);return{top:i,right:r,bottom:a,left:l,x:l+r,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Wg(e,t,o,i,a,l){const{x:r,y:s}=ho(e,{x:t,y:o,zoom:i}),{x:c,y:d}=ho({x:e.x+e.width,y:e.y+e.height},{x:t,y:o,zoom:i}),u=a-c,f=l-d;return{left:Math.floor(r),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(f)}}function Sc(e,t,o,i,a,l=.1){const r=Yg(l,t,o),s=(t-r.x)/e.width,c=(o-r.y)/e.height,d=Math.min(s,c),u=rn(d,i,a),f=e.x+e.width/2,p=e.y+e.height/2,m=t/2-f*u,h=o/2-p*u,_=Wg(e,m,h,u,t,o),b={left:Math.min(_.left-r.left,0),top:Math.min(_.top-r.top,0),right:Math.min(_.right-r.right,0),bottom:Math.min(_.bottom-r.bottom,0)};return{x:m-b.left+b.right,y:h-b.top+b.bottom,zoom:u}}function Kg(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Cc(e,t){if(!e.parentNode)return!1;const o=t.get(e.parentNode);return o?o.selected?!0:Cc(o,t):!1}function go(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function Ja(e){const t=e.ctrlKey&&bo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Rc(e,t,o){return e<t?rn(Math.abs(e-t),1,t)/t:e>o?-rn(Math.abs(e-o),1,t)/t:0}function Vc(e,t,o=15,i=40){const a=Rc(e.x,i,t.width-i)*o,l=Rc(e.y,i,t.height-i)*o;return[a,l]}function Qa(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 l=Number(a.width.replace("px",""));a.width=`${l+o}px`}else a.width+=o;if(i>0)if(typeof a.height=="string"){const l=Number(a.height.replace("px",""));a.height=`${l+i}px`}else a.height+=i;if(e.position.x<0){const l=Math.abs(e.position.x);if(t.position.x=t.position.x-l,typeof a.width=="string"){const r=Number(a.width.replace("px",""));a.width=`${r+l}px`}else a.width+=l;e.position.x=0}if(e.position.y<0){const l=Math.abs(e.position.y);if(t.position.y=t.position.y-l,typeof a.height=="string"){const r=Number(a.height.replace("px",""));a.height=`${r+l}px`}else a.height+=l;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=l=>{const r=t.style;return{...r(l),...a}}:t.style={...t.style,...a}}}}function Ac(e,t){var o,i;const a=e.filter(r=>r.type==="add"||r.type==="remove");for(const r of a)if(r.type==="add")t.findIndex(c=>c.id===r.item.id)===-1&&t.push(r.item);else if(r.type==="remove"){const s=t.findIndex(c=>c.id===r.id);s!==-1&&t.splice(s,1)}const l=t.map(r=>r.id);for(const r of t)for(const s of e)if(s.id===r.id)switch(s.type){case"select":r.selected=s.selected;break;case"position":if(po(r)&&(typeof s.position<"u"&&(r.position=s.position),typeof s.dragging<"u"&&(r.dragging=s.dragging),r.expandParent&&r.parentNode)){const c=t[l.indexOf(r.parentNode)];c&&po(c)&&Qa(r,c)}break;case"dimensions":if(po(r)&&(typeof s.dimensions<"u"&&(r.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(r.style={...r.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"&&(r.resizing=s.resizing),r.expandParent&&r.parentNode)){const c=t[l.indexOf(r.parentNode)];c&&po(c)&&(!!c.dimensions.width&&!!c.dimensions.height?Qa(r,c):n.nextTick(()=>{Qa(r,c)}))}break}return t}function Ft(e,t){return{id:e,type:"select",selected:t}}function Tc(e){return{item:e,type:"add"}}function Mc(e){return{id:e,type:"remove"}}function Bc(e,t,o,i,a){return{id:e,source:t,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function Gt(e,t=new Set,o=!1){const i=[];for(const[a,l]of e){const r=t.has(a);!(l.selected===void 0&&!r)&&l.selected!==r&&(o&&(l.selected=r),i.push(Ft(l.id,r)))}return i}const Dc=()=>{};function Ne(e){const t=new Set;let o=Dc,i=()=>!1;const a=()=>t.size>0||i(),l=p=>{o=p},r=()=>{o=Dc},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{t.delete(p)};return{on:p=>{t.add(p);const m=()=>d(p);return Qn(m),{off:m}},off:d,trigger:p=>{const m=[o];return a()?m.push(...t):e&&m.push(e),Promise.allSettled(m.map(h=>h(p)))},hasListeners:a,listeners:t,setEmitter:l,removeEmitter:r,setHasEmitListeners:s,removeHasEmitListeners:c}}function Oc(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 qg(e,t,o,i){var a,l;const r=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!Cc(c,e))&&(c.draggable||t&&typeof c.draggable>"u")&&e.get(s)&&r.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-((l=c.computedPosition)==null?void 0:l.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(r.values())}function el({id:e,dragItems:t,findNode:o}){const i=[];for(const a of t){const l=o(a.id);l&&i.push(l)}return[e?i.find(a=>a.id===e):i[0],i]}function Lc(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 Xg(e,t,o){const[i,a,l,r]=typeof e!="string"?Lc(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+r,o.computedPosition.y+i],[o.computedPosition.x+o.dimensions.width-a,o.computedPosition.y+o.dimensions.height-l]]:!1}function jg(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 l=Xg(a,e,i);l&&(a=l)}else t(new Ze(We.NODE_EXTENT_INVALID,e.id)),a=o;else if(Array.isArray(a)){const l=(i==null?void 0:i.computedPosition.x)||0,r=(i==null?void 0:i.computedPosition.y)||0;a=[[a[0][0]+l,a[0][1]+r],[a[1][0]+l,a[1][1]+r]]}else if(a!=="parent"&&(a!=null&&a.range)&&Array.isArray(a.range)){const[l,r,s,c]=Lc(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+l],[a.range[1][0]+d-r,a.range[1][1]+u-s]]}return a==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:a}function Zg({width:e,height:t},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(t||0)]]}function tl(e,t,o,i,a){const l=Zg(e.dimensions,jg(e,o,i,a)),r=wc(t,l);return{position:{x:r.x-((a==null?void 0:a.computedPosition.x)||0),y:r.y-((a==null?void 0:a.computedPosition.y)||0)},computedPosition:r}}function Mn(e,t,o=$e.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.computedPosition.x,l=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:r,height:s}=t??tb(e);if(i)return{x:a+r/2,y:l+s/2};switch((t==null?void 0:t.position)??o){case $e.Top:return{x:a+r/2,y:l};case $e.Right:return{x:a+r,y:l+s/2};case $e.Bottom:return{x:a+r/2,y:l+s};case $e.Left:return{x:a,y:l+s/2}}}function Pc(e,t){return e&&(t?e.find(o=>o.id===t):e[0])||null}function Jg({sourcePos:e,targetPos:t,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:l,width:r,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+l)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=Ei({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:r/c.zoom,height:s/c.zoom}),f=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(f*p)>0}function Qg(e,t,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const l=t(e.source),r=t(e.target);return!l||!r?0:(o&&(a=i?e.zIndex:Math.max(l.computedPosition.z||0,r.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 zc={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
|
|
8
8
|
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
9
9
|
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
10
10
|
Node: ${e}
|
|
@@ -24,18 +24,18 @@ Edge: ${e}
|
|
|
24
24
|
Source: ${t}
|
|
25
25
|
Target: ${o}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
26
26
|
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
27
|
-
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=Oc[t])==null?void 0:i.call(Oc,...o)),this.name="VueFlowError",this.code=t,this.args=o}}function il(e){return"clientX"in e}function jg(e){return"sourceEvent"in e}function kt(e,t){const o=il(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 bo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Zg(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 ki(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Jg=()=>!0;function al(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Qg(e,t,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const l of t.values())bi(a,gi(l))>0&&i.push(l);return i}const eb=250;function tb(e,t,o,i){var a,l;let r=[],s=Number.POSITIVE_INFINITY;const c=Qg(e,o,t+eb);for(const d of c){const u=[...((a=d.handleBounds)==null?void 0:a.source)??[],...((l=d.handleBounds)==null?void 0:l.target)??[]];for(const f of u){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:p,y:m}=Mn(d,f,f.position,!0),h=Math.sqrt((p-e.x)**2+(m-e.y)**2);h>t||(h<s?(r=[{...f,x:p,y:m}],s=h):h===s&&r.push({...f,x:p,y:m}))}}if(!r.length)return null;if(r.length>1){const d=i.type==="source"?"target":"source";return r.find(u=>u.type===d)??r[0]}return r[0]}function Lc(e,{handle:t,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:l,doc:r,lib:s,flowId:c,isValidConnection:d=Jg},u,f,p,m){const h=l==="target",b=t?r.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:g,y:_}=kt(e),N=r.elementFromPoint(g,_),y=N!=null&&N.classList.contains(`${s}-flow__handle`)?N:b,$={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const K=Pc(void 0,y),F=y.getAttribute("data-nodeid"),q=y.getAttribute("data-handleid"),G=y.classList.contains("connectable"),X=y.classList.contains("connectableend");if(!F||!K)return $;const Q={source:h?F:i,sourceHandle:h?q:a,target:h?i:F,targetHandle:h?a:q};$.connection=Q;const B=G&&X&&(o===At.Strict?h&&K==="source"||!h&&K==="target":F!==i||q!==a);$.isValid=B&&d(Q,{nodes:f,edges:u,sourceNode:p(Q.source),targetNode:p(Q.target)}),$.toHandle=zc(F,K,q,m,o,!0)}return $}function Pc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function nb(e,t){let o=null;return t?o="valid":e&&!t&&(o="invalid"),o}function ob(e,t){let o=null;return t?o=!0:e&&!t&&(o=!1),o}function zc(e,t,o,i,a,l=!1){var r,s,c;const d=i.get(e);if(!d)return null;const u=a===At.Strict?(r=d.handleBounds)==null?void 0:r[t]:[...((s=d.handleBounds)==null?void 0:s.source)??[],...((c=d.handleBounds)==null?void 0:c.target)??[]],f=(o?u==null?void 0:u.find(p=>p.id===o):u==null?void 0:u[0])??null;return f&&l?{...f,...Mn(d,f,f.position,!0)}:f}const ll={[Ie.Left]:Ie.Right,[Ie.Right]:Ie.Left,[Ie.Top]:Ie.Bottom,[Ie.Bottom]:Ie.Top},ib=["production","prod"];function _o(e,...t){Uc()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Uc(){return!ib.includes(process.env.NODE_ENV||"")}function Hc(e,t,o,i,a){const l=t.querySelectorAll(`.vue-flow__handle.${e}`);return l!=null&&l.length?Array.from(l).map(r=>{const s=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:e,nodeId:a,position:r.getAttribute("data-handlepos"),x:(s.left-o.left)/i,y:(s.top-o.top)/i,..._i(r)}}):null}function rl(e,t,o,i,a,l=!1,r){a.value=!1,e.selected?(l||e.selected&&t)&&(i([e]),n.nextTick(()=>{r.blur()})):o([e])}function Ye(e){return typeof n.unref(e)<"u"}function ab(e,t,o,i){if(!e||!e.source||!e.target)return o(new qe(Ge.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Ht(e)?a=e:a={...e,id:vc(e)},a=_c(a,void 0,i),Pg(a,t)?!1:a}function lb(e,t,o,i,a){if(!t.source||!t.target)return a(new qe(Ge.EDGE_INVALID,e.id)),!1;if(!o)return a(new qe(Ge.EDGE_NOT_FOUND,e.id)),!1;const{id:l,...r}=e;return{...r,id:i?vc(t):l,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Fc(e,t,o){const i={},a=[];for(let l=0;l<e.length;++l){const r=e[l];if(!cn(r)){o(new qe(Ge.NODE_INVALID,r==null?void 0:r.id)||`[ID UNKNOWN|INDEX ${l}]`);continue}const s=Dg(r,t(r.id),r.parentNode);r.parentNode&&(i[r.parentNode]=!0),a[l]=s}for(const l of a){const r=t(l.parentNode)||a.find(s=>s.id===l.parentNode);l.parentNode&&!r&&o(new qe(Ge.NODE_MISSING_PARENT,l.id,l.parentNode)),(l.parentNode||i[l.id])&&(i[l.id]&&(l.isParent=!0),r&&(r.isParent=!0))}return a}function Gc(e,t,o,i,a,l){let r=a;const s=i.get(r)||new Map;i.set(r,s.set(o,t)),r=`${a}-${e}`;const c=i.get(r)||new Map;if(i.set(r,c.set(o,t)),l){r=`${a}-${e}-${l}`;const d=i.get(r)||new Map;i.set(r,d.set(o,t))}}function sl(e,t,o){e.clear();for(const i of o){const{source:a,target:l,sourceHandle:r=null,targetHandle:s=null}=i,c={edgeId:i.id,source:a,target:l,sourceHandle:r,targetHandle:s},d=`${a}-${r}--${l}-${s}`,u=`${l}-${s}--${a}-${r}`;Gc("source",c,u,e,a,r),Gc("target",c,d,e,l,s)}}function Yc(e,t){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}function cl(e,t,o,i,a,l,r,s){const c=[];for(const d of e){const u=Ht(d)?d:ab(d,s,a,l);if(!u)continue;const f=o(u.source),p=o(u.target);if(!f||!p){a(new qe(Ge.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!f){a(new qe(Ge.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!p){a(new qe(Ge.EDGE_TARGET_MISSING,u.id,u.target));continue}if(t&&!t(u,{edges:s,nodes:r,sourceNode:f,targetNode:p})){a(new qe(Ge.EDGE_INVALID,u.id));continue}const m=i(u.id);c.push({..._c(u,m,l),sourceNode:f,targetNode:p})}return c}const Wc=Symbol("vueFlow"),Kc=Symbol("nodeId"),qc=Symbol("nodeRef"),rb=Symbol("edgeId"),sb=Symbol("edgeRef"),Ei=Symbol("slots");function Xc(e){const{vueFlowRef:t,snapToGrid:o,snapGrid:i,noDragClassName:a,nodeLookup:l,nodeExtent:r,nodeDragThreshold:s,viewport:c,autoPanOnNodeDrag:d,autoPanSpeed:u,nodesDraggable:f,panBy:p,findNode:m,multiSelectionActive:h,nodesSelectionActive:b,selectNodesOnDrag:g,removeSelectedElements:_,addSelectedNodes:N,updateNodePositions:y,emits:$}=De(),{onStart:K,onDrag:F,onStop:q,onClick:G,el:X,disabled:Q,id:de,selectable:B,dragHandle:ee}=e,v=n.shallowRef(!1);let R=[],E,P=null,W={x:void 0,y:void 0},oe={x:0,y:0},T=null,J=!1,se=!1,he=0,we=!1;const re=ub(),me=({x:Y,y:C})=>{W={x:Y,y:C};let k=!1;if(R=R.map(V=>{const H={x:Y-V.distance.x,y:C-V.distance.y},{computedPosition:te}=ol(V,o.value?ki(H,i.value):H,$.error,r.value,V.parentNode?m(V.parentNode):void 0);return k=k||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V}),se=se||k,!!k&&(y(R,!0,!0),v.value=!0,T)){const[V,H]=nl({id:de,dragItems:R,findNode:m});F({event:T,node:V,nodes:H})}},be=()=>{if(!P)return;const[Y,C]=Sc(oe,P,u.value);if(Y!==0||C!==0){const k={x:(W.x??0)-Y/c.value.zoom,y:(W.y??0)-C/c.value.zoom};p({x:Y,y:C})&&me(k)}he=requestAnimationFrame(be)},xe=(Y,C)=>{J=!0;const k=m(de);!g.value&&!h.value&&k&&(k.selected||_()),k&&n.toValue(B)&&g.value&&rl(k,h.value,N,_,b,!1,C);const V=re(Y.sourceEvent);if(W=V,R=Gg(l.value,f.value,V,de),R.length){const[H,te]=nl({id:de,dragItems:R,findNode:m});K({event:Y.sourceEvent,node:H,nodes:te})}},Ce=(Y,C)=>{var k;Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||(se=!1,s.value===0&&xe(Y,C),W=re(Y.sourceEvent),P=((k=t.value)==null?void 0:k.getBoundingClientRect())||null,oe=kt(Y.sourceEvent,P))},Se=(Y,C)=>{const k=re(Y.sourceEvent);if(!we&&J&&d.value&&(we=!0,be()),!J){const V=k.xSnapped-(W.x??0),H=k.ySnapped-(W.y??0);Math.sqrt(V*V+H*H)>s.value&&xe(Y,C)}(W.x!==k.xSnapped||W.y!==k.ySnapped)&&R.length&&J&&(T=Y.sourceEvent,oe=kt(Y.sourceEvent,P),me(k))},ye=Y=>{let C=!1;if(!J&&!v.value&&!h.value){const k=Y.sourceEvent,V=re(k),H=V.xSnapped-(W.x??0),te=V.ySnapped-(W.y??0),ne=Math.sqrt(H*H+te*te);ne!==0&&ne<=s.value&&(G==null||G(k),C=!0)}if(R.length&&!C){se&&(y(R,!1,!1),se=!1);const[k,V]=nl({id:de,dragItems:R,findNode:m});q({event:Y.sourceEvent,node:k,nodes:V})}R=[],v.value=!1,we=!1,J=!1,W={x:void 0,y:void 0},cancelAnimationFrame(he)};return n.watch([()=>n.toValue(Q),X],([Y,C],k,V)=>{if(C){const H=ut(C);Y||(E=Bh().on("start",te=>Ce(te,C)).on("drag",te=>Se(te,C)).on("end",te=>ye(te)).filter(te=>{const ne=te.target,ge=n.toValue(ee);return!te.button&&(!a.value||!Mc(ne,`.${a.value}`,C)&&(!ge||Mc(ne,ge,C)))}),H.call(E)),V(()=>{H.on(".drag",null),E&&(E.on("start",null),E.on("drag",null),E.on("end",null))})}}),v}function cb(){return{doubleClick:$e(),click:$e(),mouseEnter:$e(),mouseMove:$e(),mouseLeave:$e(),contextMenu:$e(),updateStart:$e(),update:$e(),updateEnd:$e()}}function db(e,t){const o=cb();return o.doubleClick.on(i=>{var a,l;t.edgeDoubleClick(i),(l=(a=e.events)==null?void 0:a.doubleClick)==null||l.call(a,i)}),o.click.on(i=>{var a,l;t.edgeClick(i),(l=(a=e.events)==null?void 0:a.click)==null||l.call(a,i)}),o.mouseEnter.on(i=>{var a,l;t.edgeMouseEnter(i),(l=(a=e.events)==null?void 0:a.mouseEnter)==null||l.call(a,i)}),o.mouseMove.on(i=>{var a,l;t.edgeMouseMove(i),(l=(a=e.events)==null?void 0:a.mouseMove)==null||l.call(a,i)}),o.mouseLeave.on(i=>{var a,l;t.edgeMouseLeave(i),(l=(a=e.events)==null?void 0:a.mouseLeave)==null||l.call(a,i)}),o.contextMenu.on(i=>{var a,l;t.edgeContextMenu(i),(l=(a=e.events)==null?void 0:a.contextMenu)==null||l.call(a,i)}),o.updateStart.on(i=>{var a,l;t.edgeUpdateStart(i),(l=(a=e.events)==null?void 0:a.updateStart)==null||l.call(a,i)}),o.update.on(i=>{var a,l;t.edgeUpdate(i),(l=(a=e.events)==null?void 0:a.update)==null||l.call(a,i)}),o.updateEnd.on(i=>{var a,l;t.edgeUpdateEnd(i),(l=(a=e.events)==null?void 0:a.updateEnd)==null||l.call(a,i)}),Object.entries(o).reduce((i,[a,l])=>(i.emit[a]=l.trigger,i.on[a]=l.on,i),{emit:{},on:{}})}function ub(){const{viewport:e,snapGrid:t,snapToGrid:o,vueFlowRef:i}=De();return a=>{var l;const r=((l=i.value)==null?void 0:l.getBoundingClientRect())??{left:0,top:0},s=jg(a)?a.sourceEvent:a,{x:c,y:d}=kt(s,r),u=yo({x:c,y:d},e.value),{x:f,y:p}=o.value?ki(u,t.value):u;return{xSnapped:f,ySnapped:p,...u}}}function Ni(){return!0}function jc({handleId:e,nodeId:t,type:o,isValidConnection:i,edgeUpdaterType:a,onEdgeUpdate:l,onEdgeUpdateEnd:r}){const{id:s,vueFlowRef:c,connectionMode:d,connectionRadius:u,connectOnClick:f,connectionClickStartHandle:p,nodesConnectable:m,autoPanOnConnect:h,autoPanSpeed:b,findNode:g,panBy:_,startConnection:N,updateConnection:y,endConnection:$,emits:K,viewport:F,edges:q,nodes:G,isValidConnection:X,nodeLookup:Q}=De();let de=null,B=!1,ee=null;function v(E){var P;const W=n.toValue(o)==="target",oe=il(E),T=bc(E.target),J=E.currentTarget;if(J&&(oe&&E.button===0||!oe)){let se=function(w){k=kt(w,ye),me=tb(yo(k,F.value,!1,[1,1]),u.value,Q.value,te),V||(H(),V=!0);const x=Lc(w,{handle:me,connectionMode:d.value,fromNodeId:n.toValue(t),fromHandleId:n.toValue(e),fromType:W?"target":"source",isValidConnection:re,doc:T,lib:"vue",flowId:s,nodeLookup:Q.value},q.value,G.value,g,Q.value);ee=x.handleDomNode,de=x.connection,B=ob(!!me,x.isValid);const j={...Ee,isValid:B,to:x.toHandle&&B?ho({x:x.toHandle.x,y:x.toHandle.y},F.value):k,toHandle:x.toHandle,toPosition:B&&x.toHandle?x.toHandle.position:ll[te.position],toNode:x.toHandle?Q.value.get(x.toHandle.nodeId):null};if(B&&me&&(Ee!=null&&Ee.toHandle)&&j.toHandle&&Ee.toHandle.type===j.toHandle.type&&Ee.toHandle.nodeId===j.toHandle.nodeId&&Ee.toHandle.id===j.toHandle.id&&Ee.to.x===j.to.x&&Ee.to.y===j.to.y)return;const le=me??x.toHandle;if(y(le&&B?ho({x:le.x,y:le.y},F.value):k,le,nb(!!le,B)),Ee=j,!me&&!B&&!ee)return al(C);de&&de.source!==de.target&&ee&&(al(C),C=ee,ee.classList.add("connecting","vue-flow__handle-connecting"),ee.classList.toggle("valid",!!B),ee.classList.toggle("vue-flow__handle-valid",!!B))},he=function(w){"touches"in w&&w.touches.length>0||((me||ee)&&de&&B&&(l?l(w,de):K.connect(de)),K.connectEnd(w),a&&(r==null||r(w)),al(C),cancelAnimationFrame(be),$(w),V=!1,B=!1,de=null,ee=null,T.removeEventListener("mousemove",se),T.removeEventListener("mouseup",he),T.removeEventListener("touchmove",se),T.removeEventListener("touchend",he))};const we=g(n.toValue(t));let re=n.toValue(i)||X.value||Ni;!re&&we&&(re=(W?we.isValidSourcePos:we.isValidTargetPos)||Ni);let me,be=0;const{x:xe,y:Ce}=kt(E),Se=Pc(n.toValue(a),J),ye=(P=c.value)==null?void 0:P.getBoundingClientRect();if(!ye||!Se)return;const Y=zc(n.toValue(t),Se,n.toValue(e),Q.value,d.value);if(!Y)return;let C,k=kt(E,ye),V=!1;const H=()=>{if(!h.value)return;const[w,x]=Sc(k,ye,b.value);_({x:w,y:x}),be=requestAnimationFrame(H)},te={...Y,nodeId:n.toValue(t),type:Se,position:Y.position},ne=Q.value.get(n.toValue(t)),ve={inProgress:!0,isValid:null,from:Mn(ne,te,Ie.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ne,to:k,toHandle:null,toPosition:ll[te.position],toNode:null};N({nodeId:n.toValue(t),id:n.toValue(e),type:Se,position:(J==null?void 0:J.getAttribute("data-handlepos"))||Ie.Top,...k},{x:xe-ye.left,y:Ce-ye.top}),K.connectStart({event:E,nodeId:n.toValue(t),handleId:n.toValue(e),handleType:Se});let Ee=ve;T.addEventListener("mousemove",se),T.addEventListener("mouseup",he),T.addEventListener("touchmove",se),T.addEventListener("touchend",he)}}function R(E){var P,W;if(!f.value)return;const oe=n.toValue(o)==="target";if(!p.value){K.clickConnectStart({event:E,nodeId:n.toValue(t),handleId:n.toValue(e)}),N({nodeId:n.toValue(t),type:n.toValue(o),id:n.toValue(e),position:Ie.Top,...kt(E)},void 0,!0);return}let T=n.toValue(i)||X.value||Ni;const J=g(n.toValue(t));if(!T&&J&&(T=(oe?J.isValidSourcePos:J.isValidTargetPos)||Ni),J&&(typeof J.connectable>"u"?m.value:J.connectable)===!1)return;const se=bc(E.target),he=Lc(E,{handle:{nodeId:n.toValue(t),id:n.toValue(e),type:n.toValue(o),position:Ie.Top,...kt(E)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:T,doc:se,lib:"vue",flowId:s,nodeLookup:Q.value},q.value,G.value,g,Q.value),we=((P=he.connection)==null?void 0:P.source)===((W=he.connection)==null?void 0:W.target);he.isValid&&he.connection&&!we&&K.connect(he.connection),K.clickConnectEnd(E),$(E,!0)}return{handlePointerDown:v,handleClick:R}}function fb(){return n.inject(Kc,"")}function Zc(e){const t=e??fb()??"",o=n.inject(qc,n.ref(null)),{findNode:i,edges:a,emits:l}=De(),r=i(t);return r||l.error(new qe(Ge.NODE_NOT_FOUND,t)),{id:t,nodeEl:o,node:r,parentNode:n.computed(()=>i(r.parentNode)),connectedEdges:n.computed(()=>dn([r],a.value))}}function mb(){return{doubleClick:$e(),click:$e(),mouseEnter:$e(),mouseMove:$e(),mouseLeave:$e(),contextMenu:$e(),dragStart:$e(),drag:$e(),dragStop:$e()}}function pb(e,t){const o=mb();return o.doubleClick.on(i=>{var a,l;t.nodeDoubleClick(i),(l=(a=e.events)==null?void 0:a.doubleClick)==null||l.call(a,i)}),o.click.on(i=>{var a,l;t.nodeClick(i),(l=(a=e.events)==null?void 0:a.click)==null||l.call(a,i)}),o.mouseEnter.on(i=>{var a,l;t.nodeMouseEnter(i),(l=(a=e.events)==null?void 0:a.mouseEnter)==null||l.call(a,i)}),o.mouseMove.on(i=>{var a,l;t.nodeMouseMove(i),(l=(a=e.events)==null?void 0:a.mouseMove)==null||l.call(a,i)}),o.mouseLeave.on(i=>{var a,l;t.nodeMouseLeave(i),(l=(a=e.events)==null?void 0:a.mouseLeave)==null||l.call(a,i)}),o.contextMenu.on(i=>{var a,l;t.nodeContextMenu(i),(l=(a=e.events)==null?void 0:a.contextMenu)==null||l.call(a,i)}),o.dragStart.on(i=>{var a,l;t.nodeDragStart(i),(l=(a=e.events)==null?void 0:a.dragStart)==null||l.call(a,i)}),o.drag.on(i=>{var a,l;t.nodeDrag(i),(l=(a=e.events)==null?void 0:a.drag)==null||l.call(a,i)}),o.dragStop.on(i=>{var a,l;t.nodeDragStop(i),(l=(a=e.events)==null?void 0:a.dragStop)==null||l.call(a,i)}),Object.entries(o).reduce((i,[a,l])=>(i.emit[a]=l.trigger,i.on[a]=l.on,i),{emit:{},on:{}})}function Jc(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:l,nodesDraggable:r,emits:s}=De();return(c,d=!1)=>{const u=l.value?a.value[0]:5,f=l.value?a.value[1]:5,p=d?4:1,m=c.x*u*p,h=c.y*f*p,b=[];for(const g of e.value)if(g.draggable||r&&typeof g.draggable>"u"){const _={x:g.computedPosition.x+m,y:g.computedPosition.y+h},{position:N}=ol(g,_,s.error,t.value,g.parentNode?i(g.parentNode):void 0);b.push({id:g.id,position:N,from:g.position,distance:{x:c.x,y:c.y},dimensions:g.dimensions})}o(b,!0,!1)}}const $i=.1,hb=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Yt(){return _o("Viewport not initialized yet."),Promise.resolve(!1)}const yb={zoomIn:Yt,zoomOut:Yt,zoomTo:Yt,fitView:Yt,setCenter:Yt,fitBounds:Yt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Yt,setTransform:Yt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function gb(e){function t(i,a){return new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?ao:ri).scaleBy(dl(e.d3Selection,a==null?void 0:a.duration,a==null?void 0:a.ease,()=>{l(!0)}),i):l(!1)})}function o(i,a,l,r){return new Promise(s=>{var c;const{x:d,y:u}=gc({x:-i,y:-a},e.translateExtent),f=Vn.translate(-d,-u).scale(l);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((r==null?void 0:r.interpolate)==="linear"?ao:ri).transform(dl(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),f):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,l)=>new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((l==null?void 0:l.interpolate)==="linear"?ao:ri).scaleTo(dl(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{r(!0)}),a):r(!1)}),setViewport:(a,l)=>o(a.x,a.y,a.zoom,l),setTransform:(a,l)=>o(a.x,a.y,a.zoom,l),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:$i,includeHiddenNodes:!1,duration:0})=>{var l,r;const s=[];for(const p of e.nodes)p.dimensions.width&&p.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!p.hidden)&&(!((l=a.nodes)!=null&&l.length)||(r=a.nodes)!=null&&r.length&&a.nodes.includes(p.id))&&s.push(p);if(!s.length)return Promise.resolve(!1);const c=Qa(s),{x:d,y:u,zoom:f}=$c(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??$i);return o(d,u,f,a)},setCenter:(a,l,r)=>{const s=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:e.maxZoom,c=e.dimensions.width/2-a*s,d=e.dimensions.height/2-l*s;return o(c,d,s,r)},fitBounds:(a,l={padding:$i})=>{const{x:r,y:s,zoom:c}=$c(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,l.padding??$i);return o(r,s,c,l)},project:a=>yo(a,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:a=>{if(e.vueFlowRef){const{x:l,y:r}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x-l,y:a.y-r};return yo(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:a=>{if(e.vueFlowRef){const{x:l,y:r}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x+l,y:a.y+r};return ho(s,e.viewport)}return{x:0,y:0}}}:yb)}function dl(e,t=0,o=hb,i=()=>{}){const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(o).on("end",i):e}function bb(e,t,o){const i=n.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let b,g,_=!!(o.nodes.value.length||o.edges.value.length);b=xn([e.modelValue,()=>{var N,y;return(y=(N=e.modelValue)==null?void 0:N.value)==null?void 0:y.length}],([N])=>{N&&Array.isArray(N)&&(g==null||g.pause(),o.setElements(N),!g&&!_&&N.length?_=!0:g==null||g.resume())}),g=xn([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([N,y])=>{var $;($=e.modelValue)!=null&&$.value&&Array.isArray(e.modelValue.value)&&(b==null||b.pause(),e.modelValue.value=[...N,...y],n.nextTick(()=>{b==null||b.resume()}))},{immediate:_}),n.onScopeDispose(()=>{b==null||b.stop(),g==null||g.stop()})})},l=()=>{i.run(()=>{let b,g,_=!!o.nodes.value.length;b=xn([e.nodes,()=>{var N,y;return(y=(N=e.nodes)==null?void 0:N.value)==null?void 0:y.length}],([N])=>{N&&Array.isArray(N)&&(g==null||g.pause(),o.setNodes(N),!g&&!_&&N.length?_=!0:g==null||g.resume())}),g=xn([o.nodes,()=>o.nodes.value.length],([N])=>{var y;(y=e.nodes)!=null&&y.value&&Array.isArray(e.nodes.value)&&(b==null||b.pause(),e.nodes.value=[...N],n.nextTick(()=>{b==null||b.resume()}))},{immediate:_}),n.onScopeDispose(()=>{b==null||b.stop(),g==null||g.stop()})})},r=()=>{i.run(()=>{let b,g,_=!!o.edges.value.length;b=xn([e.edges,()=>{var N,y;return(y=(N=e.edges)==null?void 0:N.value)==null?void 0:y.length}],([N])=>{N&&Array.isArray(N)&&(g==null||g.pause(),o.setEdges(N),!g&&!_&&N.length?_=!0:g==null||g.resume())}),g=xn([o.edges,()=>o.edges.value.length],([N])=>{var y;(y=e.edges)!=null&&y.value&&Array.isArray(e.edges.value)&&(b==null||b.pause(),e.edges.value=[...N],n.nextTick(()=>{b==null||b.resume()}))},{immediate:_}),n.onScopeDispose(()=>{b==null||b.stop(),g==null||g.stop()})})},s=()=>{i.run(()=>{n.watch(()=>t.maxZoom,()=>{t.maxZoom&&Ye(t.maxZoom)&&o.setMaxZoom(t.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{n.watch(()=>t.minZoom,()=>{t.minZoom&&Ye(t.minZoom)&&o.setMinZoom(t.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{n.watch(()=>t.translateExtent,()=>{t.translateExtent&&Ye(t.translateExtent)&&o.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{n.watch(()=>t.nodeExtent,()=>{t.nodeExtent&&Ye(t.nodeExtent)&&o.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{i.run(()=>{n.watch(()=>t.applyDefault,()=>{Ye(t.applyDefault)&&(o.applyDefault.value=t.applyDefault)},{immediate:!0})})},p=()=>{i.run(()=>{const b=async g=>{let _=g;typeof t.autoConnect=="function"&&(_=await t.autoConnect(g)),_!==!1&&o.addEdges([_])};n.watch(()=>t.autoConnect,()=>{Ye(t.autoConnect)&&(o.autoConnect.value=t.autoConnect)},{immediate:!0}),n.watch(o.autoConnect,(g,_,N)=>{g?o.onConnect(b):o.hooks.value.connect.off(b),N(()=>{o.hooks.value.connect.off(b)})},{immediate:!0})})},m=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const g of Object.keys(t)){const _=g;if(!b.includes(_)){const N=n.toRef(()=>t[_]),y=o[_];n.isRef(y)&&i.run(()=>{n.watch(N,$=>{Ye($)&&(y.value=$)},{immediate:!0})})}}};(()=>{a(),l(),r(),c(),s(),d(),u(),f(),p(),m()})()}),()=>i.stop()}function _b(){return{edgesChange:$e(),nodesChange:$e(),nodeDoubleClick:$e(),nodeClick:$e(),nodeMouseEnter:$e(),nodeMouseMove:$e(),nodeMouseLeave:$e(),nodeContextMenu:$e(),nodeDragStart:$e(),nodeDrag:$e(),nodeDragStop:$e(),nodesInitialized:$e(),miniMapNodeClick:$e(),miniMapNodeDoubleClick:$e(),miniMapNodeMouseEnter:$e(),miniMapNodeMouseMove:$e(),miniMapNodeMouseLeave:$e(),connect:$e(),connectStart:$e(),connectEnd:$e(),clickConnectStart:$e(),clickConnectEnd:$e(),paneReady:$e(),init:$e(),move:$e(),moveStart:$e(),moveEnd:$e(),selectionDragStart:$e(),selectionDrag:$e(),selectionDragStop:$e(),selectionContextMenu:$e(),selectionStart:$e(),selectionEnd:$e(),viewportChangeStart:$e(),viewportChange:$e(),viewportChangeEnd:$e(),paneScroll:$e(),paneClick:$e(),paneContextMenu:$e(),paneMouseEnter:$e(),paneMouseMove:$e(),paneMouseLeave:$e(),edgeContextMenu:$e(),edgeMouseEnter:$e(),edgeMouseMove:$e(),edgeMouseLeave:$e(),edgeDoubleClick:$e(),edgeClick:$e(),edgeUpdateStart:$e(),edgeUpdate:$e(),edgeUpdateEnd:$e(),updateNodeInternals:$e(),error:$e(e=>_o(e.message))}}function wb(e,t){const o=n.getCurrentInstance();n.onBeforeMount(()=>{for(const[a,l]of Object.entries(t.value)){const r=s=>{e(a,s)};l.setEmitter(r),Qn(l.removeEmitter),l.setHasEmitListeners(()=>i(a)),Qn(l.removeHasEmitListeners)}});function i(a){var l;const r=vb(a);return!!((l=o==null?void 0:o.vnode.props)==null?void 0:l[r])}}function vb(e){const[t,...o]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(a,l)=>l.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Qc(){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:ja.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:fo.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:rn.Bezier,style:{}},connectionMode:At.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:bo()?"Meta":"Control",zoomActivationKeyCode:bo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:_b(),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 kb=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Eb(e,t,o){const i=gb(e),a=k=>{const V=k??[];e.hooks.updateNodeInternals.trigger(V)},l=k=>Lg(k,e.nodes,e.edges),r=k=>Og(k,e.nodes,e.edges),s=k=>dn(k,e.edges),c=({id:k,type:V,nodeId:H})=>{var te;const ne=k?`-${V}-${k}`:`-${V}`;return Array.from(((te=e.connectionLookup.get(`${H}${ne}`))==null?void 0:te.values())??[])},d=k=>{if(k)return t.value.get(k)},u=k=>{if(k)return o.value.get(k)},f=(k,V,H)=>{var te,ne;const ge=[];for(const ve of k){const Ee={id:ve.id,type:"position",dragging:H,from:ve.from};if(V&&(Ee.position=ve.position,ve.parentNode)){const w=d(ve.parentNode);Ee.position={x:Ee.position.x-(((te=w==null?void 0:w.computedPosition)==null?void 0:te.x)??0),y:Ee.position.y-(((ne=w==null?void 0:w.computedPosition)==null?void 0:ne.y)??0)}}ge.push(Ee)}ge!=null&&ge.length&&e.hooks.nodesChange.trigger(ge)},p=k=>{if(!e.vueFlowRef)return;const V=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!V)return;const H=window.getComputedStyle(V),{m22:te}=new window.DOMMatrixReadOnly(H.transform),ne=[];for(const ge of k){const ve=ge,Ee=d(ve.id);if(Ee){const w=_i(ve.nodeElement);if(!!(w.width&&w.height&&(Ee.dimensions.width!==w.width||Ee.dimensions.height!==w.height||ve.forceUpdate))){const j=ve.nodeElement.getBoundingClientRect();Ee.dimensions=w,Ee.handleBounds.source=Hc("source",ve.nodeElement,j,te,Ee.id),Ee.handleBounds.target=Hc("target",ve.nodeElement,j,te,Ee.id),ne.push({id:Ee.id,type:"dimensions",dimensions:w})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),ne.length&&e.hooks.nodesChange.trigger(ne)},m=(k,V)=>{const H=new Set,te=new Set;for(const ve of k)cn(ve)?H.add(ve.id):Ht(ve)&&te.add(ve.id);const ne=Gt(t.value,H,!0),ge=Gt(o.value,te);if(e.multiSelectionActive){for(const ve of H)ne.push(Ft(ve,V));for(const ve of te)ge.push(Ft(ve,V))}ne.length&&e.hooks.nodesChange.trigger(ne),ge.length&&e.hooks.edgesChange.trigger(ge)},h=k=>{if(e.multiSelectionActive){const V=k.map(H=>Ft(H.id,!0));e.hooks.nodesChange.trigger(V);return}e.hooks.nodesChange.trigger(Gt(t.value,new Set(k.map(V=>V.id)),!0)),e.hooks.edgesChange.trigger(Gt(o.value))},b=k=>{if(e.multiSelectionActive){const V=k.map(H=>Ft(H.id,!0));e.hooks.edgesChange.trigger(V);return}e.hooks.edgesChange.trigger(Gt(o.value,new Set(k.map(V=>V.id)))),e.hooks.nodesChange.trigger(Gt(t.value,new Set,!0))},g=k=>{m(k,!0)},_=k=>{const H=(k||e.nodes).map(te=>(te.selected=!1,Ft(te.id,!1)));e.hooks.nodesChange.trigger(H)},N=k=>{const H=(k||e.edges).map(te=>(te.selected=!1,Ft(te.id,!1)));e.hooks.edgesChange.trigger(H)},y=k=>{if(!k||!k.length)return m([],!1);const V=k.reduce((H,te)=>{const ne=Ft(te.id,!1);return cn(te)?H.nodes.push(ne):H.edges.push(ne),H},{nodes:[],edges:[]});V.nodes.length&&e.hooks.nodesChange.trigger(V.nodes),V.edges.length&&e.hooks.edgesChange.trigger(V.edges)},$=k=>{var V;(V=e.d3Zoom)==null||V.scaleExtent([k,e.maxZoom]),e.minZoom=k},K=k=>{var V;(V=e.d3Zoom)==null||V.scaleExtent([e.minZoom,k]),e.maxZoom=k},F=k=>{var V;(V=e.d3Zoom)==null||V.translateExtent(k),e.translateExtent=k},q=k=>{e.nodeExtent=k,a()},G=k=>{var V;(V=e.d3Zoom)==null||V.clickDistance(k)},X=k=>{e.nodesDraggable=k,e.nodesConnectable=k,e.elementsSelectable=k},Q=k=>{const V=k instanceof Function?k(e.nodes):k;!e.initialized&&!V.length||(e.nodes=Fc(V,d,e.hooks.error.trigger))},de=k=>{const V=k instanceof Function?k(e.edges):k;if(!e.initialized&&!V.length)return;const H=cl(V,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);sl(e.connectionLookup,o.value,H),e.edges=H},B=k=>{const V=k instanceof Function?k([...e.nodes,...e.edges]):k;!e.initialized&&!V.length||(Q(V.filter(cn)),de(V.filter(Ht)))},ee=k=>{let V=k instanceof Function?k(e.nodes):k;V=Array.isArray(V)?V:[V];const H=Fc(V,d,e.hooks.error.trigger),te=[];for(const ne of H)te.push(Rc(ne));te.length&&e.hooks.nodesChange.trigger(te)},v=k=>{let V=k instanceof Function?k(e.edges):k;V=Array.isArray(V)?V:[V];const H=cl(V,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),te=[];for(const ne of H)te.push(Rc(ne));te.length&&e.hooks.edgesChange.trigger(te)},R=(k,V=!0,H=!1)=>{const te=k instanceof Function?k(e.nodes):k,ne=Array.isArray(te)?te:[te],ge=[],ve=[];function Ee(x){const j=s(x);for(const le of j)(!Ye(le.deletable)||le.deletable)&&ve.push(Ac(le.id,le.source,le.target,le.sourceHandle,le.targetHandle))}function w(x){const j=[];for(const le of e.nodes)le.parentNode===x&&j.push(le);if(j.length){for(const le of j)ge.push(Vc(le.id));V&&Ee(j);for(const le of j)w(le.id)}}for(const x of ne){const j=typeof x=="string"?d(x):x;j&&(Ye(j.deletable)&&!j.deletable||(ge.push(Vc(j.id)),V&&Ee([j]),H&&w(j.id)))}ve.length&&e.hooks.edgesChange.trigger(ve),ge.length&&e.hooks.nodesChange.trigger(ge)},E=k=>{const V=k instanceof Function?k(e.edges):k,H=Array.isArray(V)?V:[V],te=[];for(const ne of H){const ge=typeof ne=="string"?u(ne):ne;ge&&(Ye(ge.deletable)&&!ge.deletable||te.push(Ac(typeof ne=="string"?ne:ne.id,ge.source,ge.target,ge.sourceHandle,ge.targetHandle)))}e.hooks.edgesChange.trigger(te)},P=(k,V,H=!0)=>{const te=u(k.id);if(!te)return!1;const ne=e.edges.indexOf(te),ge=lb(k,V,te,H,e.hooks.error.trigger);if(ge){const[ve]=cl([ge],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ee,w)=>w===ne?ve:Ee),sl(e.connectionLookup,o.value,[ve]),ve}return!1},W=(k,V,H={replace:!1})=>{const te=u(k);if(!te)return;const ne=typeof V=="function"?V(te):V;te.data=H.replace?ne:{...te.data,...ne}},oe=k=>Cc(k,e.nodes),T=k=>{const V=Cc(k,e.edges);return sl(e.connectionLookup,o.value,V),V},J=(k,V,H={replace:!1})=>{const te=d(k);if(!te)return;const ne=typeof V=="function"?V(te):V;H.replace?e.nodes.splice(e.nodes.indexOf(te),1,ne):Object.assign(te,ne)},se=(k,V,H={replace:!1})=>{const te=d(k);if(!te)return;const ne=typeof V=="function"?V(te):V;te.data=H.replace?ne:{...te.data,...ne}},he=(k,V,H=!1)=>{H?e.connectionClickStartHandle=k:e.connectionStartHandle=k,e.connectionEndHandle=null,e.connectionStatus=null,V&&(e.connectionPosition=V)},we=(k,V=null,H=null)=>{e.connectionStartHandle&&(e.connectionPosition=k,e.connectionEndHandle=V,e.connectionStatus=H)},re=(k,V)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,V?e.connectionClickStartHandle=null:e.connectionStartHandle=null},me=k=>{const V=Bg(k),H=V?null:po(k)?k:d(k.id);return!V&&!H?[null,null,V]:[V?k:gi(H),H,V]},be=(k,V=!0,H=e.nodes)=>{const[te,ne,ge]=me(k);if(!te)return[];const ve=[];for(const Ee of H||e.nodes){if(!ge&&(Ee.id===ne.id||!Ee.computedPosition))continue;const w=gi(Ee),x=bi(w,te);(V&&x>0||x>=w.width*w.height||x>=Number(te.width)*Number(te.height))&&ve.push(Ee)}return ve},xe=(k,V,H=!0)=>{const[te]=me(k);if(!te)return!1;const ne=bi(te,V);return H&&ne>0||ne>=Number(te.width)*Number(te.height)},Ce=k=>{const{viewport:V,dimensions:H,d3Zoom:te,d3Selection:ne,translateExtent:ge}=e;if(!te||!ne||!k.x&&!k.y)return!1;const ve=Vn.translate(V.x+k.x,V.y+k.y).scale(V.zoom),Ee=[[0,0],[H.width,H.height]],w=te.constrain()(ve,Ee,ge),x=e.viewport.x!==w.x||e.viewport.y!==w.y||e.viewport.zoom!==w.k;return te.transform(ne,w),x},Se=k=>{const V=k instanceof Function?k(e):k,H=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ye(V.defaultEdgeOptions)&&(e.defaultEdgeOptions=V.defaultEdgeOptions);const te=V.modelValue||V.nodes||V.edges?[]:void 0;te&&(V.modelValue&&te.push(...V.modelValue),V.nodes&&te.push(...V.nodes),V.edges&&te.push(...V.edges),B(te));const ne=()=>{Ye(V.maxZoom)&&K(V.maxZoom),Ye(V.minZoom)&&$(V.minZoom),Ye(V.translateExtent)&&F(V.translateExtent)};for(const ge of Object.keys(V)){const ve=ge,Ee=V[ve];![...kb,...H].includes(ve)&&Ye(Ee)&&(e[ve]=Ee)}Ca(()=>e.d3Zoom).not.toBeNull().then(ne),e.initialized||(e.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:p,setElements:B,setNodes:Q,setEdges:de,addNodes:ee,addEdges:v,removeNodes:R,removeEdges:E,findNode:d,findEdge:u,updateEdge:P,updateEdgeData:W,updateNode:J,updateNodeData:se,applyEdgeChanges:T,applyNodeChanges:oe,addSelectedElements:g,addSelectedNodes:h,addSelectedEdges:b,setMinZoom:$,setMaxZoom:K,setTranslateExtent:F,setNodeExtent:q,setPaneClickDistance:G,removeSelectedElements:y,removeSelectedNodes:_,removeSelectedEdges:N,startConnection:he,updateConnection:we,endConnection:re,setInteractive:X,setState:Se,getIntersectingNodes:be,getIncomers:l,getOutgoers:r,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:xe,panBy:Ce,fitView:k=>i.value.fitView(k),zoomIn:k=>i.value.zoomIn(k),zoomOut:k=>i.value.zoomOut(k),zoomTo:(k,V)=>i.value.zoomTo(k,V),setViewport:(k,V)=>i.value.setViewport(k,V),setTransform:(k,V)=>i.value.setTransform(k,V),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(k,V,H)=>i.value.setCenter(k,V,H),fitBounds:(k,V)=>i.value.fitBounds(k,V),project:k=>i.value.project(k),screenToFlowCoordinate:k=>i.value.screenToFlowCoordinate(k),flowToScreenCoordinate:k=>i.value.flowToScreenCoordinate(k),toObject:()=>{const k=[],V=[];for(const H of e.nodes){const{computedPosition:te,handleBounds:ne,selected:ge,dimensions:ve,isParent:Ee,resizing:w,dragging:x,events:j,...le}=H;k.push(le)}for(const H of e.edges){const{selected:te,sourceNode:ne,targetNode:ge,events:ve,...Ee}=H;V.push(Ee)}return JSON.parse(JSON.stringify({nodes:k,edges:V,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:k=>new Promise(V=>{const{nodes:H,edges:te,position:ne,zoom:ge,viewport:ve}=k;H&&Q(H),te&&de(te);const[Ee,w]=ve!=null&&ve.x&&(ve!=null&&ve.y)?[ve.x,ve.y]:ne??[null,null];if(Ee&&w){const x=(ve==null?void 0:ve.zoom)||ge||e.viewport.zoom;return Ca(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ee,y:w,zoom:x}).then(()=>{V(!0)})})}else V(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const k=Qc();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const V=Vn.translate(k.defaultViewport.x??0,k.defaultViewport.y??0).scale(sn(k.defaultViewport.zoom??1,k.minZoom,k.maxZoom)),H=e.viewportRef.getBoundingClientRect(),te=[[0,0],[H.width,H.height]],ne=e.d3Zoom.constrain()(V,te,k.translateExtent);e.d3Zoom.transform(e.d3Selection,ne)}Se(k)},$destroy:()=>{}}}const Nb=["data-id","data-handleid","data-nodeid","data-handlepos"],$b={name:"Handle",compatConfig:{MODE:3}},un=n.defineComponent({...$b,props:{id:{default:null},type:{},position:{default:()=>Ie.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:l,connectionStartHandle:r,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:f,noPanClassName:p}=De(),{id:m,node:h,nodeEl:b,connectedEdges:g}=Zc(),_=n.ref(),N=n.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),y=n.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),$=n.toRef(()=>{var de,B,ee,v,R,E;return((de=r.value)==null?void 0:de.nodeId)===m&&((B=r.value)==null?void 0:B.id)===e.id&&((ee=r.value)==null?void 0:ee.type)===i.value||((v=c.value)==null?void 0:v.nodeId)===m&&((R=c.value)==null?void 0:R.id)===e.id&&((E=c.value)==null?void 0:E.type)===i.value}),K=n.toRef(()=>{var de,B,ee;return((de=s.value)==null?void 0:de.nodeId)===m&&((B=s.value)==null?void 0:B.id)===e.id&&((ee=s.value)==null?void 0:ee.type)===i.value}),{handlePointerDown:F,handleClick:q}=jc({nodeId:m,handleId:e.id,isValidConnection:a,type:i}),G=n.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!g.value.some(de=>{const B=de[`${i.value}Handle`];return de[i.value]!==m?!1:B?B===e.id:!0}):typeof e.connectable=="number"?g.value.filter(de=>{const B=de[`${i.value}Handle`];return de[i.value]!==m?!1:B?B===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(h,g.value):Ye(e.connectable)?e.connectable:u.value);n.onMounted(()=>{var de;if(!h.dimensions.width||!h.dimensions.height)return;const B=(de=h.handleBounds[i.value])==null?void 0:de.find(oe=>oe.id===e.id);if(!d.value||B)return;const ee=d.value.querySelector(".vue-flow__transformationpane");if(!b.value||!_.value||!ee||!e.id)return;const v=b.value.getBoundingClientRect(),R=_.value.getBoundingClientRect(),E=window.getComputedStyle(ee),{m22:P}=new window.DOMMatrixReadOnly(E.transform),W={id:e.id,position:e.position,x:(R.left-v.left)/P,y:(R.top-v.top)/P,type:i.value,nodeId:m,..._i(_.value)};h.handleBounds[i.value]=[...h.handleBounds[i.value]??[],W]});function X(de){const B=il(de);G.value&&N.value&&(B&&de.button===0||!B)&&F(de)}function Q(de){!m||!s.value&&!N.value||G.value&&q(de)}return t({handleClick:q,handlePointerDown:F,onClick:Q,onPointerDown:X}),(de,B)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"handle",ref:_,"data-id":`${n.unref(l)}-${n.unref(m)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":n.unref(m),"data-handlepos":de.position,class:n.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${de.position}`,`vue-flow__handle-${e.id}`,n.unref(f),n.unref(p),i.value,{connectable:G.value,connecting:K.value,connectablestart:N.value,connectableend:y.value,connectionindicator:G.value&&(N.value&&!$.value||y.value&&$.value)}]]),onMousedown:X,onTouchstartPassive:X,onClick:Q},[n.renderSlot(de.$slots,"default",{id:de.id})],42,Nb))}}),xi=function({sourcePosition:e=Ie.Bottom,targetPosition:t=Ie.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:l,data:r}){const s=r.label??o;return[n.h(un,{type:"target",position:t,connectable:i,isValidConnection:a}),typeof s!="string"&&s?n.h(s):n.h(n.Fragment,[s]),n.h(un,{type:"source",position:e,connectable:i,isValidConnection:l})]};xi.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],xi.inheritAttrs=!1,xi.compatConfig={MODE:3};const xb=xi,Ii=function({targetPosition:e=Ie.Top,label:t,connectable:o=!0,isValidTargetPos:i,data:a}){const l=a.label??t;return[n.h(un,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?n.h(l):n.h(n.Fragment,[l])]};Ii.props=["targetPosition","label","isValidTargetPos","connectable","data"],Ii.inheritAttrs=!1,Ii.compatConfig={MODE:3};const Ib=Ii,Si=function({sourcePosition:e=Ie.Bottom,label:t,connectable:o=!0,isValidSourcePos:i,data:a}){const l=a.label??t;return[typeof l!="string"&&l?n.h(l):n.h(n.Fragment,[l]),n.h(un,{type:"source",position:e,connectable:o,isValidConnection:i})]};Si.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Si.inheritAttrs=!1,Si.compatConfig={MODE:3};const Sb=Si,Cb=["transform"],Rb=["width","height","x","y","rx","ry"],Vb=["y"],Ab={name:"EdgeText",compatConfig:{MODE:3}},Tb=n.defineComponent({...Ab,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 l=o.value.getBBox();(l.width!==t.value.width||l.height!==t.value.height)&&(t.value=l)}return(l,r)=>(n.openBlock(),n.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[l.labelShowBg?(n.openBlock(),n.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*l.labelBgPadding[0]}px`,height:`${t.value.height+2*l.labelBgPadding[1]}px`,x:-l.labelBgPadding[0],y:-l.labelBgPadding[1],style:n.normalizeStyle(l.labelBgStyle),rx:l.labelBgBorderRadius,ry:l.labelBgBorderRadius},null,12,Rb)):n.createCommentVNode("",!0),n.createElementVNode("text",n.mergeProps(l.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:l.labelStyle}),[n.renderSlot(l.$slots,"default",{},()=>[typeof l.label!="string"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.label),{key:0})):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(l.label),1)],64))])],16,Vb)],8,Cb))}}),Mb=["id","d","marker-end","marker-start"],Bb=["d","stroke-width"],Db={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Ci=n.defineComponent({...Db,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),l=n.useAttrs();return t({pathEl:o,interactionEl:i,labelEl:a}),(r,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",n.mergeProps(n.unref(l),{id:r.id,ref_key:"pathEl",ref:o,d:r.path,class:"vue-flow__edge-path","marker-end":r.markerEnd,"marker-start":r.markerStart}),null,16,Mb),r.interactionWidth?(n.openBlock(),n.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:r.path,"stroke-width":r.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Bb)):n.createCommentVNode("",!0),r.label&&r.labelX&&r.labelY?(n.openBlock(),n.createBlock(Tb,{key:1,ref_key:"labelEl",ref:a,x:r.labelX,y:r.labelY,label:r.label,"label-show-bg":r.labelShowBg,"label-bg-style":r.labelBgStyle,"label-bg-padding":r.labelBgPadding,"label-bg-border-radius":r.labelBgBorderRadius,"label-style":r.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 ed({sourceX:e,sourceY:t,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,l=o<e?o+a:o-a,r=Math.abs(i-t)/2,s=i<t?i+r:i-r;return[l,s,a,r]}function td({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:r,targetControlY:s}){const c=e*.125+a*.375+r*.375+o*.125,d=t*.125+l*.375+s*.375+i*.125,u=Math.abs(c-e),f=Math.abs(d-t);return[c,d,u,f]}function Ri(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function nd({pos:e,x1:t,y1:o,x2:i,y2:a,c:l}){let r,s;switch(e){case Ie.Left:r=t-Ri(t-i,l),s=o;break;case Ie.Right:r=t+Ri(i-t,l),s=o;break;case Ie.Top:r=t,s=o-Ri(o-a,l);break;case Ie.Bottom:r=t,s=o+Ri(a-o,l);break}return[r,s]}function od(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ie.Bottom,targetX:a,targetY:l,targetPosition:r=Ie.Top,curvature:s=.25}=e,[c,d]=nd({pos:i,x1:t,y1:o,x2:a,y2:l,c:s}),[u,f]=nd({pos:r,x1:a,y1:l,x2:t,y2:o,c:s}),[p,m,h,b]=td({sourceX:t,sourceY:o,targetX:a,targetY:l,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:f});return[`M${t},${o} C${c},${d} ${u},${f} ${a},${l}`,p,m,h,b]}function id({pos:e,x1:t,y1:o,x2:i,y2:a}){let l,r;switch(e){case Ie.Left:case Ie.Right:l=.5*(t+i),r=o;break;case Ie.Top:case Ie.Bottom:l=t,r=.5*(o+a);break}return[l,r]}function ad(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ie.Bottom,targetX:a,targetY:l,targetPosition:r=Ie.Top}=e,[s,c]=id({pos:i,x1:t,y1:o,x2:a,y2:l}),[d,u]=id({pos:r,x1:a,y1:l,x2:t,y2:o}),[f,p,m,h]=td({sourceX:t,sourceY:o,targetX:a,targetY:l,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${t},${o} C${s},${c} ${d},${u} ${a},${l}`,f,p,m,h]}const ld={[Ie.Left]:{x:-1,y:0},[Ie.Right]:{x:1,y:0},[Ie.Top]:{x:0,y:-1},[Ie.Bottom]:{x:0,y:1}};function Ob({source:e,sourcePosition:t=Ie.Bottom,target:o}){return t===Ie.Left||t===Ie.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 rd(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Lb({source:e,sourcePosition:t=Ie.Bottom,target:o,targetPosition:i=Ie.Top,center:a,offset:l}){const r=ld[t],s=ld[i],c={x:e.x+r.x*l,y:e.y+r.y*l},d={x:o.x+s.x*l,y:o.y+s.y*l},u=Ob({source:c,sourcePosition:t,target:d}),f=u.x!==0?"x":"y",p=u[f];let m,h,b;const g={x:0,y:0},_={x:0,y:0},[N,y,$,K]=ed({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(r[f]*s[f]===-1){h=a.x??N,b=a.y??y;const q=[{x:h,y:c.y},{x:h,y:d.y}],G=[{x:c.x,y:b},{x:d.x,y:b}];r[f]===p?m=f==="x"?q:G:m=f==="x"?G:q}else{const q=[{x:c.x,y:d.y}],G=[{x:d.x,y:c.y}];if(f==="x"?m=r.x===p?G:q:m=r.y===p?q:G,t===i){const ee=Math.abs(e[f]-o[f]);if(ee<=l){const v=Math.min(l-1,l-ee);r[f]===p?g[f]=(c[f]>e[f]?-1:1)*v:_[f]=(d[f]>o[f]?-1:1)*v}}if(t!==i){const ee=f==="x"?"y":"x",v=r[f]===s[ee],R=c[ee]>d[ee],E=c[ee]<d[ee];(r[f]===1&&(!v&&R||v&&E)||r[f]!==1&&(!v&&E||v&&R))&&(m=f==="x"?q:G)}const X={x:c.x+g.x,y:c.y+g.y},Q={x:d.x+_.x,y:d.y+_.y},de=Math.max(Math.abs(X.x-m[0].x),Math.abs(Q.x-m[0].x)),B=Math.max(Math.abs(X.y-m[0].y),Math.abs(Q.y-m[0].y));de>=B?(h=(X.x+Q.x)/2,b=m[0].y):(h=m[0].x,b=(X.y+Q.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...m,{x:d.x+_.x,y:d.y+_.y},o],h,b,$,K]}function Pb(e,t,o,i){const a=Math.min(rd(e,t)/2,rd(t,o)/2,i),{x:l,y:r}=t;if(e.x===l&&l===o.x||e.y===r&&r===o.y)return`L${l} ${r}`;if(e.y===r){const d=e.x<o.x?-1:1,u=e.y<o.y?1:-1;return`L ${l+a*d},${r}Q ${l},${r} ${l},${r+a*u}`}const s=e.x<o.x?1:-1,c=e.y<o.y?-1:1;return`L ${l},${r+a*c}Q ${l},${r} ${l+a*s},${r}`}function ul(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ie.Bottom,targetX:a,targetY:l,targetPosition:r=Ie.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[f,p,m,h,b]=Lb({source:{x:t,y:o},sourcePosition:i,target:{x:a,y:l},targetPosition:r,center:{x:c,y:d},offset:u});return[f.reduce((_,N,y)=>{let $;return y>0&&y<f.length-1?$=Pb(f[y-1],N,f[y+1],s):$=`${y===0?"M":"L"}${N.x} ${N.y}`,_+=$,_},""),p,m,h,b]}function zb(e){const{sourceX:t,sourceY:o,targetX:i,targetY:a}=e,[l,r,s,c]=ed({sourceX:t,sourceY:o,targetX:i,targetY:a});return[`M ${t},${o}L ${i},${a}`,l,r,s,c]}const Ub=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]=zb(e);return n.h(Ci,{path:o,labelX:i,labelY:a,...t,...e})}}}),sd=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]=ul({...e,sourcePosition:e.sourcePosition??Ie.Bottom,targetPosition:e.targetPosition??Ie.Top});return n.h(Ci,{path:o,labelX:i,labelY:a,...t,...e})}}}),Hb=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(sd,{...e,...t,borderRadius:0})}}),Fb=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]=od({...e,sourcePosition:e.sourcePosition??Ie.Bottom,targetPosition:e.targetPosition??Ie.Top});return n.h(Ci,{path:o,labelX:i,labelY:a,...t,...e})}}}),Gb=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]=ad({...e,sourcePosition:e.sourcePosition??Ie.Bottom,targetPosition:e.targetPosition??Ie.Top});return n.h(Ci,{path:o,labelX:i,labelY:a,...t,...e})}}}),Yb={input:Sb,default:xb,output:Ib},Wb={default:Fb,straight:Ub,step:Hb,smoothstep:sd,simplebezier:Gb};function Kb(e,t,o){const i=n.computed(()=>b=>t.value.get(b)),a=n.computed(()=>b=>o.value.get(b)),l=n.computed(()=>{const b={...Wb,...e.edgeTypes},g=Object.keys(b);for(const _ of e.edges)_.type&&!g.includes(_.type)&&(b[_.type]=_.type);return b}),r=n.computed(()=>{const b={...Yb,...e.nodeTypes},g=Object.keys(b);for(const _ of e.nodes)_.type&&!g.includes(_.type)&&(b[_.type]=_.type);return b}),s=n.computed(()=>e.onlyRenderVisibleElements?Nc(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 g of e.edges){const _=t.value.get(g.source),N=t.value.get(g.target);qg({sourcePos:_.computedPosition||{x:0,y:0},targetPos:N.computedPosition||{x:0,y:0},sourceWidth:_.dimensions.width,sourceHeight:_.dimensions.height,targetWidth:N.dimensions.width,targetHeight:N.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(g)}return b}return e.edges}),d=n.computed(()=>[...s.value,...c.value]),u=n.computed(()=>{const b=[];for(const g of e.nodes)g.selected&&b.push(g);return b}),f=n.computed(()=>{const b=[];for(const g of e.edges)g.selected&&b.push(g);return b}),p=n.computed(()=>[...u.value,...f.value]),m=n.computed(()=>{const b=[];for(const g of e.nodes)g.dimensions.width&&g.dimensions.height&&g.handleBounds!==void 0&&b.push(g);return b}),h=n.computed(()=>s.value.length>0&&m.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:l,getNodeTypes:r,getEdges:c,getNodes:s,getSelectedElements:p,getSelectedNodes:u,getSelectedEdges:f,getNodesInitialized:m,areNodesInitialized:h}}class fn{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)??fn.instance;return fn.instance=i??new fn,o&&(o.config.globalProperties.$vueFlowStorage=fn.instance),fn.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=Qc(),a=n.reactive(i),l={};for(const[p,m]of Object.entries(a.hooks)){const h=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;l[h]=m.on}const r={};for(const[p,m]of Object.entries(a.hooks))r[p]=m.trigger;const s=n.computed(()=>{const p=new Map;for(const m of a.nodes)p.set(m.id,m);return p}),c=n.computed(()=>{const p=new Map;for(const m of a.edges)p.set(m.id,m);return p}),d=Kb(a,s,c),u=Eb(a,s,c);u.setState({...a,...o});const f={...l,...d,...u,...Gm(a),nodeLookup:s,edgeLookup:c,emits:r,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function De(e){const t=fn.getInstance(),o=n.getCurrentScope(),i=typeof e=="object",a=i?e:{id:e},l=a.id,r=l??(o==null?void 0:o.vueFlowId);let s;if(o){const c=n.inject(Wc,null);typeof c<"u"&&c!==null&&(!r||c.id===r)&&(s=c)}if(s||r&&(s=t.get(r)),!s||r&&s.id!==r){const c=l??t.getId(),d=t.create(c,a);s=d,(o??n.effectScope(!0)).run(()=>{n.watch(d.applyDefault,(f,p,m)=>{const h=g=>{d.applyNodeChanges(g)},b=g=>{d.applyEdgeChanges(g)};f?(d.onNodesChange(h),d.onEdgesChange(b)):(d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(b)),m(()=>{d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(b)})},{immediate:!0}),Qn(()=>{if(s){const f=t.get(s.id);f?f.$destroy():_o(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(n.provide(Wc,s),o.vueFlowId=s.id),i){const c=n.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new qe(Ge.USEVUEFLOW_OPTIONS))}return s}function qb(e){const{emits:t,dimensions:o}=De();let i;n.onMounted(()=>{const a=()=>{var l,r;if(!e.value||!(((r=(l=e.value).checkVisibility)==null?void 0:r.call(l))??!0))return;const s=_i(e.value);(s.width===0||s.height===0)&&t.error(new qe(Ge.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 Xb={name:"UserSelection",compatConfig:{MODE:3}},jb=n.defineComponent({...Xb,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))}}),Zb=["tabIndex"],Jb={name:"NodesSelection",compatConfig:{MODE:3}},Qb=n.defineComponent({...Jb,setup(e){const{emits:t,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:l,userSelectionActive:r}=De(),s=Jc(),c=n.ref(null),d=Xc({el:c,onStart(h){t.selectionDragStart(h),t.nodeDragStart(h)},onDrag(h){t.selectionDrag(h),t.nodeDrag(h)},onStop(h){t.selectionDragStop(h),t.nodeDragStop(h)}});n.onMounted(()=>{var h;l.value||(h=c.value)==null||h.focus({preventScroll:!0})});const u=n.computed(()=>Qa(i.value)),f=n.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function p(h){t.selectionContextMenu({event:h,nodes:i.value})}function m(h){l.value||An[h.key]&&(h.preventDefault(),s({x:An[h.key].x,y:An[h.key].y},h.shiftKey))}return(h,b)=>!n.unref(r)&&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(f.value),tabIndex:n.unref(l)?void 0:-1,onContextmenu:p,onKeydown:m},null,46,Zb)],6)):n.createCommentVNode("",!0)}});function e0(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const t0={name:"Pane",compatConfig:{MODE:3}},n0=n.defineComponent({...t0,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:o,viewport:i,emits:a,userSelectionActive:l,removeSelectedElements:r,userSelectionRect:s,elementsSelectable:c,nodesSelectionActive:d,getSelectedEdges:u,getSelectedNodes:f,removeNodes:p,removeEdges:m,selectionMode:h,deleteKeyCode:b,multiSelectionKeyCode:g,multiSelectionActive:_,edgeLookup:N,nodeLookup:y,connectionLookup:$,defaultEdgeOptions:K,connectionStartHandle:F,panOnDrag:q}=De(),G=n.shallowRef(null),X=n.shallowRef(new Set),Q=n.shallowRef(new Set),de=n.shallowRef(null),B=n.toRef(()=>c.value&&(e.isSelecting||l.value)),ee=n.toRef(()=>F.value!==null);let v=!1,R=!1;const E=mo(b,{actInsideInputWithModifier:!1}),P=mo(g);n.watch(E,re=>{re&&(p(f.value),m(u.value),d.value=!1)}),n.watch(P,re=>{_.value=re});function W(re,me){return be=>{be.target===me&&(re==null||re(be))}}function oe(re){if(v||ee.value){v=!1;return}a.paneClick(re),r(),d.value=!1}function T(re){var me;if(Array.isArray(q.value)&&((me=q.value)!=null&&me.includes(2))){re.preventDefault();return}a.paneContextMenu(re)}function J(re){a.paneScroll(re)}function se(re){var me,be,xe;if(de.value=((me=t.value)==null?void 0:me.getBoundingClientRect())??null,!c.value||!e.isSelecting||re.button!==0||re.target!==G.value||!de.value)return;(xe=(be=re.target)==null?void 0:be.setPointerCapture)==null||xe.call(be,re.pointerId);const{x:Ce,y:Se}=e0(re,de.value);R=!0,v=!1,r(),s.value={width:0,height:0,startX:Ce,startY:Se,x:Ce,y:Se},a.selectionStart(re)}function he(re){var me;if(!de.value||!s.value)return;v=!0;const{x:be,y:xe}=kt(re,de.value),{startX:Ce=0,startY:Se=0}=s.value,ye={startX:Ce,startY:Se,x:be<Ce?be:Ce,y:xe<Se?xe:Se,width:Math.abs(be-Ce),height:Math.abs(xe-Se)},Y=X.value,C=Q.value;X.value=new Set(Nc(o.value,ye,i.value,h.value===ja.Partial,!0).map(V=>V.id)),Q.value=new Set;const k=((me=K.value)==null?void 0:me.selectable)??!0;for(const V of X.value){const H=$.value.get(V);if(H)for(const{edgeId:te}of H.values()){const ne=N.value.get(te);ne&&(ne.selectable??k)&&Q.value.add(te)}}if(!Yc(Y,X.value)){const V=Gt(y.value,X.value,!0);a.nodesChange(V)}if(!Yc(C,Q.value)){const V=Gt(N.value,Q.value);a.edgesChange(V)}s.value=ye,l.value=!0,d.value=!1}function we(re){var me;re.button!==0||!R||((me=re.target)==null||me.releasePointerCapture(re.pointerId),!l.value&&s.value&&re.target===G.value&&oe(re),l.value=!1,s.value=null,d.value=X.value.size>0,a.selectionEnd(re),e.selectionKeyPressed&&(v=!1),R=!1)}return(re,me)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:G,class:n.normalizeClass(["vue-flow__pane vue-flow__container",{selection:re.isSelecting}]),onClick:me[0]||(me[0]=be=>B.value?void 0:W(oe,G.value)(be)),onContextmenu:me[1]||(me[1]=be=>W(T,G.value)(be)),onWheelPassive:me[2]||(me[2]=be=>W(J,G.value)(be)),onPointerenter:me[3]||(me[3]=be=>B.value?void 0:n.unref(a).paneMouseEnter(be)),onPointerdown:me[4]||(me[4]=be=>B.value?se(be):n.unref(a).paneMouseMove(be)),onPointermove:me[5]||(me[5]=be=>B.value?he(be):n.unref(a).paneMouseMove(be)),onPointerup:me[6]||(me[6]=be=>B.value?we(be):void 0),onPointerleave:me[7]||(me[7]=be=>n.unref(a).paneMouseLeave(be))},[n.renderSlot(re.$slots,"default"),n.unref(l)&&n.unref(s)?(n.openBlock(),n.createBlock(jb,{key:0,"user-selection-rect":n.unref(s)},null,8,["user-selection-rect"])):n.createCommentVNode("",!0),n.unref(d)&&n.unref(f).length?(n.openBlock(),n.createBlock(Qb,{key:1})):n.createCommentVNode("",!0)],34))}}),o0={name:"Transform",compatConfig:{MODE:3}},i0=n.defineComponent({...o0,setup(e){const{viewport:t,fitViewOnInit:o,fitViewOnInitDone:i}=De(),a=n.computed(()=>o.value?!i.value:!1),l=n.computed(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(r,s)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:n.normalizeStyle({transform:l.value,opacity:a.value?0:void 0})},[n.renderSlot(r.$slots,"default")],4))}}),a0={name:"Viewport",compatConfig:{MODE:3}},l0=n.defineComponent({...a0,setup(e){const{minZoom:t,maxZoom:o,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:l,selectionKeyCode:r,panActivationKeyCode:s,panOnScroll:c,panOnScrollMode:d,panOnScrollSpeed:u,panOnDrag:f,zoomOnDoubleClick:p,zoomOnPinch:m,zoomOnScroll:h,preventScrolling:b,noWheelClassName:g,noPanClassName:_,emits:N,connectionStartHandle:y,userSelectionActive:$,paneDragging:K,d3Zoom:F,d3Selection:q,d3ZoomHandler:G,viewport:X,viewportRef:Q,paneClickDistance:de}=De();qb(Q);const B=n.shallowRef(!1),ee=n.shallowRef(!1);let v=null,R=!1,E=0,P={x:0,y:0,zoom:0};const W=mo(s),oe=mo(r),T=mo(l),J=n.toRef(()=>(!oe.value||oe.value&&r.value===!0)&&(W.value||f.value)),se=n.toRef(()=>W.value||c.value),he=n.toRef(()=>r.value===!0&&J.value!==!0),we=n.toRef(()=>oe.value&&r.value!==!0||$.value||he.value),re=n.toRef(()=>y.value!==null);n.onMounted(()=>{if(!Q.value){_o("Viewport element is missing");return}const Se=Q.value,ye=Se.getBoundingClientRect(),Y=Sg().clickDistance(de.value).scaleExtent([t.value,o.value]).translateExtent(a.value),C=ut(Se).call(Y),k=C.on("wheel.zoom"),V=Vn.translate(i.value.x??0,i.value.y??0).scale(sn(i.value.zoom??1,t.value,o.value)),H=[[0,0],[ye.width,ye.height]],te=Y.constrain()(V,H,a.value);Y.transform(C,te),Y.wheelDelta(el),F.value=Y,q.value=C,G.value=k,X.value={x:te.x,y:te.y,zoom:te.k},Y.on("start",ne=>{var ge;if(!ne.sourceEvent)return null;E=ne.sourceEvent.button,B.value=!0;const ve=xe(ne.transform);((ge=ne.sourceEvent)==null?void 0:ge.type)==="mousedown"&&(K.value=!0),P=ve,N.viewportChangeStart(ve),N.moveStart({event:ne,flowTransform:ve})}),Y.on("end",ne=>{if(!ne.sourceEvent)return null;if(B.value=!1,K.value=!1,me(J.value,E??0)&&!R&&N.paneContextMenu(ne.sourceEvent),R=!1,be(P,ne.transform)){const ge=xe(ne.transform);P=ge,N.viewportChangeEnd(ge),N.moveEnd({event:ne,flowTransform:ge})}}),Y.filter(ne=>{var ge;const ve=T.value||h.value,Ee=m.value&&ne.ctrlKey,w=ne.button,x=ne.type==="wheel";if(w===1&&ne.type==="mousedown"&&(Ce(ne,"vue-flow__node")||Ce(ne,"vue-flow__edge")))return!0;if(!J.value&&!ve&&!se.value&&!p.value&&!m.value||$.value||re.value&&!x||!p.value&&ne.type==="dblclick"||Ce(ne,g.value)&&x||Ce(ne,_.value)&&(!x||se.value&&x&&!T.value)||!m.value&&ne.ctrlKey&&x||!ve&&!se.value&&!Ee&&x)return!1;if(!m&&ne.type==="touchstart"&&((ge=ne.touches)==null?void 0:ge.length)>1)return ne.preventDefault(),!1;if(!J.value&&(ne.type==="mousedown"||ne.type==="touchstart")||he.value&&Array.isArray(f.value)&&f.value.includes(0)&&w===0||Array.isArray(f.value)&&!f.value.includes(w)&&(ne.type==="mousedown"||ne.type==="touchstart"))return!1;const j=Array.isArray(f.value)&&f.value.includes(w)||r.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!w||w<=1;return(!ne.ctrlKey||W.value||x)&&j}),n.watch([$,J],()=>{$.value&&!B.value?Y.on("zoom",null):$.value||Y.on("zoom",ne=>{X.value={x:ne.transform.x,y:ne.transform.y,zoom:ne.transform.k};const ge=xe(ne.transform);R=me(J.value,E??0),N.viewportChange(ge),N.move({event:ne,flowTransform:ge})})},{immediate:!0}),n.watch([$,se,d,T,m,b,g],()=>{se.value&&!T.value&&!$.value?C.on("wheel.zoom",ne=>{if(Ce(ne,g.value))return!1;const ge=T.value||h.value,ve=m.value&&ne.ctrlKey;if(!(!b.value||se.value||ge||ve))return!1;ne.preventDefault(),ne.stopImmediatePropagation();const w=C.property("__zoom").k||1,x=bo();if(!W.value&&ne.ctrlKey&&m.value&&x){const U=bt(ne),M=el(ne),pe=w*2**M;Y.scaleTo(C,pe,U,ne);return}const j=ne.deltaMode===1?20:1;let le=d.value===fo.Vertical?0:ne.deltaX*j,_e=d.value===fo.Horizontal?0:ne.deltaY*j;!x&&ne.shiftKey&&d.value!==fo.Vertical&&!le&&_e&&(le=_e,_e=0),Y.translateBy(C,-(le/w)*u.value,-(_e/w)*u.value);const O=xe(C.property("__zoom"));v&&clearTimeout(v),ee.value?(N.move({event:ne,flowTransform:O}),N.viewportChange(O),v=setTimeout(()=>{N.moveEnd({event:ne,flowTransform:O}),N.viewportChangeEnd(O),ee.value=!1},150)):(ee.value=!0,N.moveStart({event:ne,flowTransform:O}),N.viewportChangeStart(O))},{passive:!1}):typeof k<"u"&&C.on("wheel.zoom",function(ne,ge){const ve=!b.value&&ne.type==="wheel"&&!ne.ctrlKey,Ee=T.value||h.value,w=m.value&&ne.ctrlKey;if(!Ee&&!c.value&&!w&&ne.type==="wheel"||ve||Ce(ne,g.value))return null;ne.preventDefault(),k.call(this,ne,ge)},{passive:!1})},{immediate:!0})});function me(Se,ye){return ye===2&&Array.isArray(Se)&&Se.includes(2)}function be(Se,ye){return Se.x!==ye.x&&!Number.isNaN(ye.x)||Se.y!==ye.y&&!Number.isNaN(ye.y)||Se.zoom!==ye.k&&!Number.isNaN(ye.k)}function xe(Se){return{x:Se.x,y:Se.y,zoom:Se.k}}function Ce(Se,ye){return Se.target.closest(`.${ye}`)}return(Se,ye)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"viewportRef",ref:Q,class:"vue-flow__viewport vue-flow__container"},[n.createVNode(n0,{"is-selecting":we.value,"selection-key-pressed":n.unref(oe),class:n.normalizeClass({connecting:re.value,dragging:n.unref(K),draggable:n.unref(f)===!0||Array.isArray(n.unref(f))&&n.unref(f).includes(0)})},{default:n.withCtx(()=>[n.createVNode(i0,null,{default:n.withCtx(()=>[n.renderSlot(Se.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),r0=["id"],s0=["id"],c0=["id"],d0={name:"A11yDescriptions",compatConfig:{MODE:3}},u0=n.defineComponent({...d0,setup(e){const{id:t,disableKeyboardA11y:o,ariaLiveMessage:i}=De();return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{id:`${n.unref(pc)}-${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,r0),n.createElementVNode("div",{id:`${n.unref(hc)}-${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,s0),n.unref(o)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,id:`${n.unref(Mg)}-${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,c0))],64))}});function f0(){const e=De();n.watch(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function m0(e,t,o){return o===Ie.Left?e-t:o===Ie.Right?e+t:e}function p0(e,t,o){return o===Ie.Top?e-t:o===Ie.Bottom?e+t:e}const fl=function({radius:e=10,centerX:t=0,centerY:o=0,position:i=Ie.Top,type:a}){return n.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:m0(t,e,i),cy:p0(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};fl.props=["radius","centerX","centerY","position","type"],fl.compatConfig={MODE:3};const cd=fl,h0=n.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:o,connectionMode:i,edgeUpdaterRadius:a,emits:l,nodesSelectionActive:r,noPanClassName:s,getEdgeTypes:c,removeSelectedEdges:d,findEdge:u,findNode:f,isValidConnection:p,multiSelectionActive:m,disableKeyboardA11y:h,elementsSelectable:b,edgesUpdatable:g,edgesFocusable:_,hooks:N}=De(),y=n.computed(()=>u(e.id)),{emit:$,on:K}=db(y.value,l),F=n.inject(Ei),q=n.getCurrentInstance(),G=n.ref(!1),X=n.ref(!1),Q=n.ref(""),de=n.ref(null),B=n.ref("source"),ee=n.ref(null),v=n.toRef(()=>typeof y.value.selectable>"u"?b.value:y.value.selectable),R=n.toRef(()=>typeof y.value.updatable>"u"?g.value:y.value.updatable),E=n.toRef(()=>typeof y.value.focusable>"u"?_.value:y.value.focusable);n.provide(rb,e.id),n.provide(sb,ee);const P=n.computed(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),W=n.computed(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),oe=n.computed(()=>{const V=y.value.type||"default",H=F==null?void 0:F[`edge-${V}`];if(H)return H;let te=y.value.template??c.value[V];if(typeof te=="string"&&q){const ne=Object.keys(q.appContext.components);ne&&ne.includes(V)&&(te=n.resolveComponent(V,!1))}return te&&typeof te!="string"?te:(l.error(new qe(Ge.EDGE_TYPE_MISSING,te)),!1)}),{handlePointerDown:T}=jc({nodeId:Q,handleId:de,type:B,isValidConnection:p,edgeUpdaterType:B,onEdgeUpdate:he,onEdgeUpdateEnd:we});return()=>{const V=f(y.value.source),H=f(y.value.target),te="pathOptions"in y.value?y.value.pathOptions:{};if(!V&&!H)return l.error(new qe(Ge.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!V)return l.error(new qe(Ge.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!H)return l.error(new qe(Ge.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||V.hidden||H.hidden)return null;let ne;i.value===At.Strict?ne=V.handleBounds.source:ne=[...V.handleBounds.source||[],...V.handleBounds.target||[]];const ge=Dc(ne,y.value.sourceHandle);let ve;i.value===At.Strict?ve=H.handleBounds.target:ve=[...H.handleBounds.target||[],...H.handleBounds.source||[]];const Ee=Dc(ve,y.value.targetHandle),w=(ge==null?void 0:ge.position)||Ie.Bottom,x=(Ee==null?void 0:Ee.position)||Ie.Top,{x:j,y:le}=Mn(V,ge,w),{x:_e,y:O}=Mn(H,Ee,x);return y.value.sourceX=j,y.value.sourceY=le,y.value.targetX=_e,y.value.targetY=O,n.h("g",{ref:ee,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${oe.value===!1?"default":y.value.type||"default"}`,s.value,P.value,{updating:G.value,selected:y.value.selected,animated:y.value.animated,inactive:!v.value&&!N.value.edgeClick.hasListeners()}],tabIndex:E.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:y.value.ariaLabel??`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":E.value?`${hc}-${t}`:void 0,"aria-roledescription":"edge",role:E.value?"group":"img",...y.value.domAttributes,onClick:me,onContextmenu:be,onDblclick:xe,onMouseenter:Ce,onMousemove:Se,onMouseleave:ye,onKeyDown:E.value?k:void 0},[X.value?null:n.h(oe.value===!1?c.value.default:oe.value,{id:e.id,sourceNode:V,targetNode:H,source:y.value.source,target:y.value.target,type:y.value.type,updatable:R.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:{...y.value.events,...K},style:W.value,markerStart:`url('#${go(y.value.markerStart,t)}')`,markerEnd:`url('#${go(y.value.markerEnd,t)}')`,sourcePosition:w,targetPosition:x,sourceX:j,sourceY:le,targetX:_e,targetY:O,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth,...te}),[R.value==="source"||R.value===!0?[n.h("g",{onMousedown:Y,onMouseenter:J,onMouseout:se},n.h(cd,{position:w,centerX:j,centerY:le,radius:a.value,type:"source","data-type":"source"}))]:null,R.value==="target"||R.value===!0?[n.h("g",{onMousedown:C,onMouseenter:J,onMouseout:se},n.h(cd,{position:x,centerX:_e,centerY:O,radius:a.value,type:"target","data-type":"target"}))]:null]])};function J(){G.value=!0}function se(){G.value=!1}function he(V,H){$.update({event:V,edge:y.value,connection:H})}function we(V){$.updateEnd({event:V,edge:y.value}),X.value=!1}function re(V,H){V.button===0&&(X.value=!0,Q.value=H?y.value.target:y.value.source,de.value=(H?y.value.targetHandle:y.value.sourceHandle)??null,B.value=H?"target":"source",$.updateStart({event:V,edge:y.value}),T(V))}function me(V){var H;const te={event:V,edge:y.value};v.value&&(r.value=!1,y.value.selected&&m.value?(d([y.value]),(H=ee.value)==null||H.blur()):o([y.value])),$.click(te)}function be(V){$.contextMenu({event:V,edge:y.value})}function xe(V){$.doubleClick({event:V,edge:y.value})}function Ce(V){$.mouseEnter({event:V,edge:y.value})}function Se(V){$.mouseMove({event:V,edge:y.value})}function ye(V){$.mouseLeave({event:V,edge:y.value})}function Y(V){re(V,!0)}function C(V){re(V,!1)}function k(V){var H;!h.value&&yc.includes(V.key)&&v.value&&(V.key==="Escape"?((H=ee.value)==null||H.blur(),d([u(e.id)])):o([u(e.id)]))}}}),y0=n.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:l,connectionLineType:r,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:f}=De(),p=(e=n.inject(Ei))==null?void 0:e["connection-line"],m=n.computed(()=>{var N;return f((N=i.value)==null?void 0:N.nodeId)}),h=n.computed(()=>{var N;return f((N=a.value)==null?void 0:N.nodeId)??null}),b=n.computed(()=>({x:(l.value.x-u.value.x)/u.value.zoom,y:(l.value.y-u.value.y)/u.value.zoom})),g=n.computed(()=>c.value.markerStart?`url(#${go(c.value.markerStart,t)})`:""),_=n.computed(()=>c.value.markerEnd?`url(#${go(c.value.markerEnd,t)})`:"");return()=>{var N,y,$;if(!m.value||!i.value)return null;const K=i.value.id,F=i.value.type,q=m.value.handleBounds;let G=(q==null?void 0:q[F])??[];if(o.value===At.Loose){const W=(q==null?void 0:q[F==="source"?"target":"source"])??[];G=[...G,...W]}if(!G)return null;const X=(K?G.find(W=>W.id===K):G[0])??null,Q=(X==null?void 0:X.position)??Ie.Top,{x:de,y:B}=Mn(m.value,X,Q);let ee=null;h.value&&(o.value===At.Strict?ee=((N=h.value.handleBounds[F==="source"?"target":"source"])==null?void 0:N.find(W=>{var oe;return W.id===((oe=a.value)==null?void 0:oe.id)}))||null:ee=((y=[...h.value.handleBounds.source??[],...h.value.handleBounds.target??[]])==null?void 0:y.find(W=>{var oe;return W.id===((oe=a.value)==null?void 0:oe.id)}))||null);const v=(($=a.value)==null?void 0:$.position)??(Q?ll[Q]:null);if(!Q||!v)return null;const R=r.value??c.value.type??rn.Bezier;let E="";const P={sourceX:de,sourceY:B,sourcePosition:Q,targetX:b.value.x,targetY:b.value.y,targetPosition:v};return R===rn.Bezier?[E]=od(P):R===rn.Step?[E]=ul({...P,borderRadius:0}):R===rn.SmoothStep?[E]=ul(P):R===rn.SimpleBezier?[E]=ad(P):E=`M${de},${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:de,sourceY:B,sourcePosition:Q,targetX:b.value.x,targetY:b.value.y,targetPosition:v,sourceNode:m.value,sourceHandle:X,targetNode:h.value,targetHandle:ee,markerEnd:_.value,markerStart:g.value,connectionStatus:d.value}):n.h("path",{d:E,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":_.value,"marker-start":g.value})))}}}),g0=["id","markerWidth","markerHeight","markerUnits","orient"],b0={name:"MarkerType",compatConfig:{MODE:3}},_0=n.defineComponent({...b0,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(Za).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(Za).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,g0))}}),w0={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},v0={name:"MarkerDefinitions",compatConfig:{MODE:3}},k0=n.defineComponent({...v0,setup(e){const{id:t,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=De(),l=n.computed(()=>{const r=new Set,s=[],c=d=>{if(d){const u=go(d,t);r.has(u)||(typeof d=="object"?s.push({...d,id:u,color:d.color||a.value}):s.push({id:u,color:a.value,type:d}),r.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(r,s)=>(n.openBlock(),n.createElementBlock("svg",w0,[n.createElementVNode("defs",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,c=>(n.openBlock(),n.createBlock(_0,{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))])]))}}),E0={name:"Edges",compatConfig:{MODE:3}},N0=n.defineComponent({...E0,setup(e){const{findNode:t,getEdges:o,elevateEdgesOnSelect:i}=De();return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(k0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),r=>(n.openBlock(),n.createElementBlock("svg",{key:r.id,class:"vue-flow__edges vue-flow__container",style:n.normalizeStyle({zIndex:n.unref(Xg)(r,n.unref(t),n.unref(i))})},[n.createVNode(n.unref(h0),{id:r.id},null,8,["id"])],4))),128)),n.createVNode(n.unref(y0))],64))}}),$0=n.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:o,selectNodesOnDrag:i,nodesSelectionActive:a,multiSelectionActive:l,emits:r,removeSelectedNodes:s,addSelectedNodes:c,updateNodeDimensions:d,onUpdateNodeInternals:u,getNodeTypes:f,nodeExtent:p,elevateNodesOnSelect:m,disableKeyboardA11y:h,ariaLiveMessage:b,snapToGrid:g,snapGrid:_,nodeDragThreshold:N,nodesDraggable:y,elementsSelectable:$,nodesConnectable:K,nodesFocusable:F,hooks:q}=De(),G=n.ref(null);n.provide(qc,G),n.provide(Kc,e.id);const X=n.inject(Ei),Q=n.getCurrentInstance(),de=Jc(),{node:B,parentNode:ee}=Zc(e.id),{emit:v,on:R}=pb(B,r),E=n.toRef(()=>typeof B.draggable>"u"?y.value:B.draggable),P=n.toRef(()=>typeof B.selectable>"u"?$.value:B.selectable),W=n.toRef(()=>typeof B.connectable>"u"?K.value:B.connectable),oe=n.toRef(()=>typeof B.focusable>"u"?F.value:B.focusable),T=n.computed(()=>P.value||E.value||q.value.nodeClick.hasListeners()||q.value.nodeDoubleClick.hasListeners()||q.value.nodeMouseEnter.hasListeners()||q.value.nodeMouseMove.hasListeners()||q.value.nodeMouseLeave.hasListeners()),J=n.toRef(()=>!!B.dimensions.width&&!!B.dimensions.height),se=n.computed(()=>{const H=B.type||"default",te=X==null?void 0:X[`node-${H}`];if(te)return te;let ne=B.template||f.value[H];if(typeof ne=="string"&&Q){const ge=Object.keys(Q.appContext.components);ge&&ge.includes(H)&&(ne=n.resolveComponent(H,!1))}return ne&&typeof ne!="string"?ne:(r.error(new qe(Ge.NODE_TYPE_MISSING,ne)),!1)}),he=Xc({id:e.id,el:G,disabled:()=>!E.value,selectable:P,dragHandle:()=>B.dragHandle,onStart(H){v.dragStart(H)},onDrag(H){v.drag(H)},onStop(H){v.dragStop(H)},onClick(H){k(H)}}),we=n.computed(()=>B.class instanceof Function?B.class(B):B.class),re=n.computed(()=>{const H=(B.style instanceof Function?B.style(B):B.style)||{},te=B.width instanceof Function?B.width(B):B.width,ne=B.height instanceof Function?B.height(B):B.height;return!H.width&&te&&(H.width=typeof te=="string"?te:`${te}px`),!H.height&&ne&&(H.height=typeof ne=="string"?ne:`${ne}px`),H}),me=n.toRef(()=>Number(B.zIndex??re.value.zIndex??0));return u(H=>{(H.includes(e.id)||!H.length)&&xe()}),n.onMounted(()=>{n.watch(()=>B.hidden,(H=!1,te,ne)=>{!H&&G.value&&(e.resizeObserver.observe(G.value),ne(()=>{G.value&&e.resizeObserver.unobserve(G.value)}))},{immediate:!0,flush:"post"})}),n.watch([()=>B.type,()=>B.sourcePosition,()=>B.targetPosition],()=>{n.nextTick(()=>{d([{id:e.id,nodeElement:G.value,forceUpdate:!0}])})}),n.watch([()=>B.position.x,()=>B.position.y,()=>{var H;return(H=ee.value)==null?void 0:H.computedPosition.x},()=>{var H;return(H=ee.value)==null?void 0:H.computedPosition.y},()=>{var H;return(H=ee.value)==null?void 0:H.computedPosition.z},me,()=>B.selected,()=>B.dimensions.height,()=>B.dimensions.width,()=>{var H;return(H=ee.value)==null?void 0:H.dimensions.height},()=>{var H;return(H=ee.value)==null?void 0:H.dimensions.width}],([H,te,ne,ge,ve,Ee])=>{const w={x:H,y:te,z:Ee+(m.value&&B.selected?1e3:0)};typeof ne<"u"&&typeof ge<"u"?B.computedPosition=Fg({x:ne,y:ge,z:ve},w):B.computedPosition=w},{flush:"post",immediate:!0}),n.watch([()=>B.extent,p],([H,te],[ne,ge])=>{(H!==ne||te!==ge)&&be()}),B.extent==="parent"||typeof B.extent=="object"&&"range"in B.extent&&B.extent.range==="parent"?Ca(()=>J).toBe(!0).then(be):be(),()=>B.hidden?null:n.h("div",{ref:G,"data-id":B.id,class:["vue-flow__node",`vue-flow__node-${se.value===!1?"default":B.type||"default"}`,{[o.value]:E.value,dragging:he==null?void 0:he.value,draggable:E.value,selected:B.selected,selectable:P.value,parent:B.isParent},we.value],style:{visibility:J.value?"visible":"hidden",zIndex:B.computedPosition.z??me.value,transform:`translate(${B.computedPosition.x}px,${B.computedPosition.y}px)`,pointerEvents:T.value?"all":"none",...re.value},tabIndex:oe.value?0:void 0,role:oe.value?"group":void 0,"aria-describedby":h.value?void 0:`${pc}-${t}`,"aria-label":B.ariaLabel,"aria-roledescription":"node",...B.domAttributes,onMouseenter:Ce,onMousemove:Se,onMouseleave:ye,onContextmenu:Y,onClick:k,onDblclick:C,onKeydown:V},[n.h(se.value===!1?f.value.default:se.value,{id:B.id,type:B.type,data:B.data,events:{...B.events,...R},selected:B.selected,resizing:B.resizing,dragging:he.value,connectable:W.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:xe})]);function be(){const H=B.computedPosition,{computedPosition:te,position:ne}=ol(B,g.value?ki(H,_.value):H,r.error,p.value,ee.value);(B.computedPosition.x!==te.x||B.computedPosition.y!==te.y)&&(B.computedPosition={...B.computedPosition,...te}),(B.position.x!==ne.x||B.position.y!==ne.y)&&(B.position=ne)}function xe(){G.value&&d([{id:e.id,nodeElement:G.value,forceUpdate:!0}])}function Ce(H){he!=null&&he.value||v.mouseEnter({event:H,node:B})}function Se(H){he!=null&&he.value||v.mouseMove({event:H,node:B})}function ye(H){he!=null&&he.value||v.mouseLeave({event:H,node:B})}function Y(H){return v.contextMenu({event:H,node:B})}function C(H){return v.doubleClick({event:H,node:B})}function k(H){P.value&&(!i.value||!E.value||N.value>0)&&rl(B,l.value,c,s,a,!1,G.value),v.click({event:H,node:B})}function V(H){if(!(Ja(H)||h.value))if(yc.includes(H.key)&&P.value){const te=H.key==="Escape";rl(B,l.value,c,s,a,te,G.value)}else E.value&&B.selected&&An[H.key]&&(H.preventDefault(),b.value=`Moved selected node ${H.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~B.position.x}, y: ${~~B.position.y}`,de({x:An[H.key].x,y:An[H.key].y},H.shiftKey))}}});function x0(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 I0={class:"vue-flow__nodes vue-flow__container"},S0={name:"Nodes",compatConfig:{MODE:3}},C0=n.defineComponent({...S0,setup(e){const{getNodes:t,updateNodeDimensions:o,emits:i}=De(),a=x0(),l=n.ref();return n.watch(a,r=>{r&&n.nextTick(()=>{i.nodesInitialized(t.value)})},{immediate:!0}),n.onMounted(()=>{l.value=new ResizeObserver(r=>{const s=r.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));n.nextTick(()=>o(s))})}),n.onBeforeUnmount(()=>{var r;return(r=l.value)==null?void 0:r.disconnect()}),(r,s)=>(n.openBlock(),n.createElementBlock("div",I0,[l.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(t),(c,d,u,f)=>{const p=[c.id];if(f&&f.key===c.id&&n.isMemoSame(f,p))return f;const m=(n.openBlock(),n.createBlock(n.unref($0),{id:c.id,key:c.id,"resize-observer":l.value},null,8,["id","resize-observer"]));return m.memo=p,m},s,0),128)):n.createCommentVNode("",!0)]))}});function R0(){const{emits:e}=De();n.onMounted(()=>{if(Uc()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new qe(Ge.MISSING_STYLES))}})}const V0=n.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),A0={name:"VueFlow",compatConfig:{MODE:3}},T0=n.defineComponent({...A0,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(),l=Ra(i,"modelValue",o),r=Ra(i,"nodes",o),s=Ra(i,"edges",o),c=De(i),d=bb({modelValue:l,nodes:r,edges:s},i,c);return wb(o,c.hooks),f0(),R0(),n.provide(Ei,a),n.onUnmounted(d),t(c),(u,f)=>(n.openBlock(),n.createElementBlock("div",{ref:n.unref(c).vueFlowRef,class:"vue-flow"},[n.createVNode(l0,null,{default:n.withCtx(()=>[n.createVNode(N0),V0,n.createVNode(C0),n.renderSlot(u.$slots,"zoom-pane")]),_:3}),n.renderSlot(u.$slots,"default"),n.createVNode(u0)],512))}}),M0={name:"Panel",compatConfig:{MODE:3}},dd=n.defineComponent({...M0,props:{position:{}},setup(e){const t=e,{userSelectionActive:o}=De(),i=n.computed(()=>`${t.position}`.split("-"));return(a,l)=>(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))}}),mn=["red","amber","green","teal","blue","indigo","violet","pink"],ud={red:"빨강",amber:"주황",green:"초록",teal:"청록",blue:"파랑",indigo:"남색",violet:"보라",pink:"분홍"};function B0(e){return typeof e=="string"&&e in ud}const D0={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},O0=.15;function L0(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,l=parseInt(o.slice(4,6),16)/255,r=Math.max(i,a,l),s=Math.min(i,a,l),c=r-s,d=(r+s)/2;let u=0,f=0;return c!==0&&(u=c/(1-Math.abs(2*d-1)),r===i?f=(a-l)/c%6:r===a?f=(l-i)/c+2:f=(i-a)/c+4,f*=60,f<0&&(f+=360)),{h:f,s:u,l:d}}function P0(e){if(typeof e!="string")return null;const t=L0(e);if(!t||t.s<O0)return null;let o=null,i=1/0;for(const a of mn){const l=Math.abs(t.h-D0[a]),r=Math.min(l,360-l);r<i&&(i=r,o=a)}return o}function Qe(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 P0((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function ml(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const z0={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)"},U0={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 fd(e,t=!1){return e?t?U0[e]:z0[e]:null}function Bn(e){return ud[e]}function Dn(e){return`var(--em-swatch-${e}-bar)`}const H0=["width","height","innerHTML"],F0=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"/>',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"/>',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"/>'};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,H0))}}),Le=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},Ve=Le(F0,[["__scopeId","data-v-5256c2f6"]]),G0={class:"em-inline-issue__msgs"},pn=Le(n.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const t=e,o={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},i=n.computed(()=>t.refId?t.controller.issuesByRef.value.get(t.refId)??[]:[]),a=n.computed(()=>{let l=null;for(const r of i.value)(l===null||o[r.severity].order<o[l].order)&&(l=r.severity);return l});return(l,r)=>a.value?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["em-inline-issue",`is-${a.value}`])},[n.createVNode(Ve,{name:o[a.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),n.createElementVNode("span",G0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,(s,c)=>(n.openBlock(),n.createElementBlock("span",{key:c},n.toDisplayString(s.message),1))),128))])],2)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-17f46a25"]]),Y0={class:"em-mlang"},W0={class:"em-mlang__tabs",role:"tablist"},K0=["aria-selected","onClick"],q0={key:0,class:"em-mlang__dot"},pl=Le(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 l=n.ref(a());n.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function r(d){var u,f;return!!((f=(u=o.modelValue)==null?void 0:u[d])!=null&&f.trim())}const s=n.computed(()=>{var d;return((d=o.modelValue)==null?void 0:d[l.value])??""});function c(d){const u={...o.modelValue};d.trim()===""?delete u[l.value]:u[l.value]=d,i("update:modelValue",u)}return(d,u)=>(n.openBlock(),n.createElementBlock("div",Y0,[n.createElementVNode("div",W0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.languages,f=>(n.openBlock(),n.createElementBlock("button",{key:f,type:"button",class:n.normalizeClass(["em-mlang__tab",{"is-active":l.value===f}]),role:"tab","aria-selected":l.value===f,onClick:p=>l.value=f},[n.createTextVNode(n.toDisplayString(f),1),r(f)?(n.openBlock(),n.createElementBlock("span",q0,"•")):n.createCommentVNode("",!0)],10,K0))),128))]),e.multiline?(n.openBlock(),n.createBlock(n.unref(ae.BSTextArea),{key:0,name:`${e.name}-${l.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(ae.BSTextInput),{key:1,name:`${e.name}-${l.value}`,width:"100%",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","placeholder","model-value"]))]))}}),[["__scopeId","data-v-274a0fe9"]]),X0=["disabled"],j0={class:"em-panel__sub-label"},Z0={class:"em-field"},J0={class:"em-field"},Q0={class:"em-field"},e1={class:"em-class"},t1={class:"em-field"},n1={class:"em-field"},o1={class:"em-field"},i1={class:"em-field"},a1={class:"em-multilang"},l1={class:"em-multilang"},r1={class:"em-jpa"},s1={class:"em-field"},c1={class:"em-field"},d1={class:"em-field"},u1={class:"em-swatch"},f1={class:"em-swatch__row"},m1=["title","onClick"],md=Le(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,l=n.computed(()=>a.state.logical.entities.find(B=>B.modelId===o.entityId)??null),r=n.computed(()=>l.value?a.state.layout.entityLayouts.find(B=>B.entityRef===l.value.modelId)??null:null),s=n.computed(()=>{var B;return Qe(((B=r.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"],f=B=>B;function p(B){return B==="inherit"?"기본(따름)":B}function m(B){l.value&&a.updateEntity(l.value.modelId,B)}function h(B,ee,v){var E;const R=((E=l.value)==null?void 0:E.table)??{physicalName:""};m(B==="physicalName"?{table:{...R,physicalName:v}}:{table:{...R,logicalName:{...R.logicalName,[ee]:v}}})}function b(B){m({description:Object.keys(B).length?B:void 0})}function g(B,ee){var v;m({jpaAttrs:{...(v=l.value)==null?void 0:v.jpaAttrs,[B]:ee}})}function _(B,ee){g(B,ee)}const N=n.computed(()=>{var B,ee;return((ee=(B=l.value)==null?void 0:B.jpaAttrs)==null?void 0:ee.discriminatorType)??"inherit"}),y=n.computed(()=>{var B,ee;return!((ee=(B=l.value)==null?void 0:B.jpaAttrs)!=null&&ee.useDiscriminator)});function $(B){g("discriminatorType",B==="inherit"?void 0:B)}function K(B){m({hasPersonalInfo:B})}function F(B){m({superClass:B.trim()||void 0})}function q(B){m({schema:B.trim()||void 0})}function G(B){m({abstractClass:B})}const X=n.computed(()=>{var B,ee;return((ee=(B=l.value)==null?void 0:B.declarationOfInterfaces)==null?void 0:ee.join(", "))??""});function Q(B){const ee=B.split(",").map(v=>v.trim()).filter(Boolean);m({declarationOfInterfaces:ee.length?ee:void 0})}function de(B){l.value&&a.setEntitySwatch(l.value.modelId,B)}return(B,ee)=>{var v,R,E;return l.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:ee[0]||(ee[0]=P=>i("toggle"))},[n.createElementVNode("span",j0,[n.createVNode(Ve,{name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"]),n.createTextVNode(" "+n.toDisplayString(e.title||l.value.name||"엔티티"),1)])])):n.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(pn,{controller:n.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),n.createElementVNode("label",Z0,[ee[13]||(ee[13]=n.createElementVNode("span",null,"이름",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-name",width:"100%","model-value":l.value.name,"onUpdate:modelValue":ee[1]||(ee[1]=P=>m({name:P}))},null,8,["model-value"])]),n.createElementVNode("label",J0,[ee[14]||(ee[14]=n.createElementVNode("span",null,"스테레오타입",-1)),n.createVNode(n.unref(ae.BSSelect),{"model-value":l.value.stereotype,items:c,"value-provider":f,"label-provider":f,"onUpdate:modelValue":ee[2]||(ee[2]=P=>m({stereotype:P}))},null,8,["model-value"])]),n.createElementVNode("label",Q0,[ee[15]||(ee[15]=n.createElementVNode("span",null,"패키지",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-package",width:"100%","model-value":l.value.packageName??"","onUpdate:modelValue":ee[3]||(ee[3]=P=>m({packageName:P}))},null,8,["model-value"])]),n.createElementVNode("fieldset",e1,[ee[18]||(ee[18]=n.createElementVNode("legend",null,"클래스",-1)),n.createElementVNode("label",t1,[ee[16]||(ee[16]=n.createElementVNode("span",null,"부모 클래스",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:"예: BaseEntity","model-value":l.value.superClass??"","onUpdate:modelValue":ee[4]||(ee[4]=P=>F(P))},null,8,["model-value"])]),n.createElementVNode("label",n1,[ee[17]||(ee[17]=n.createElementVNode("span",null,"구현 인터페이스",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:"콤마로 구분 (예: Serializable, Cloneable)","model-value":X.value,"onUpdate:modelValue":ee[5]||(ee[5]=P=>Q(P))},null,8,["model-value"])]),n.createVNode(n.unref(ae.BSCheckbox),{name:"ent-abstract",class:"em-check",label:"추상 클래스","model-value":!!l.value.abstractClass,"onUpdate:modelValue":ee[6]||(ee[6]=P=>G(P))},null,8,["model-value"])]),n.createElementVNode("label",o1,[ee[19]||(ee[19]=n.createElementVNode("span",null,"테이블(물리)",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-table",width:"100%","model-value":((v=l.value.table)==null?void 0:v.physicalName)??"","onUpdate:modelValue":ee[7]||(ee[7]=P=>h("physicalName",null,P))},null,8,["model-value"])]),n.createElementVNode("label",i1,[ee[20]||(ee[20]=n.createElementVNode("span",null,"스키마",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"ent-schema",width:"100%",placeholder:"예: sales, master","model-value":l.value.schema??"","onUpdate:modelValue":ee[8]||(ee[8]=P=>q(P))},null,8,["model-value"])]),n.createElementVNode("fieldset",a1,[ee[21]||(ee[21]=n.createElementVNode("legend",null,"테이블 논리명",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,P=>{var W,oe;return n.openBlock(),n.createElementBlock("label",{key:P,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(P),1),n.createVNode(n.unref(ae.BSTextInput),{name:`ent-logical-${P}`,width:"100%","model-value":((oe=(W=l.value.table)==null?void 0:W.logicalName)==null?void 0:oe[P])??"","onUpdate:modelValue":T=>h("logicalName",P,T)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("fieldset",l1,[ee[22]||(ee[22]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(pl,{multiline:"",name:"ent-desc",languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":l.value.description,"onUpdate:modelValue":b},null,8,["languages","default-lang","model-value"])]),n.createElementVNode("fieldset",r1,[ee[26]||(ee[26]=n.createElementVNode("legend",null,"JPA",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(d,P=>{var W;return n.createVNode(n.unref(ae.BSCheckbox),{key:P.key,name:`jpa-${P.key}`,class:"em-check",label:P.label,"model-value":!!((W=l.value.jpaAttrs)!=null&&W[P.key]),"onUpdate:modelValue":oe=>_(P.key,oe)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),n.createElementVNode("label",s1,[ee[23]||(ee[23]=n.createElementVNode("span",null,"Discriminator 컬럼명",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"disc-col",width:"100%",placeholder:"예: DTYPE",disabled:y.value,"model-value":((R=l.value.jpaAttrs)==null?void 0:R.discriminatorColumnName)??"","onUpdate:modelValue":ee[9]||(ee[9]=P=>g("discriminatorColumnName",P.trim()||void 0))},null,8,["disabled","model-value"])]),n.createElementVNode("label",c1,[ee[24]||(ee[24]=n.createElementVNode("span",null,"Discriminator 타입",-1)),n.createVNode(n.unref(ae.BSSelect),{disabled:y.value,"model-value":N.value,items:u,"value-provider":f,"label-provider":p,"onUpdate:modelValue":ee[10]||(ee[10]=P=>P&&$(P))},null,8,["disabled","model-value"])]),n.createElementVNode("label",d1,[ee[25]||(ee[25]=n.createElementVNode("span",null,"Discriminator 길이",-1)),n.createVNode(n.unref(ae.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:y.value,"model-value":(E=l.value.jpaAttrs)==null?void 0:E.discriminatorLength,"onUpdate:modelValue":ee[11]||(ee[11]=P=>g("discriminatorLength",P||void 0))},null,8,["disabled","model-value"])])]),n.createVNode(n.unref(ae.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:"개인정보 포함 (hasPersonalInfo)","model-value":!!l.value.hasPersonalInfo,"onUpdate:modelValue":K},null,8,["model-value"]),n.createElementVNode("fieldset",u1,[ee[27]||(ee[27]=n.createElementVNode("legend",null,"헤더 색상",-1)),n.createElementVNode("div",f1,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:"없음",onClick:ee[12]||(ee[12]=P=>de(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),P=>(n.openBlock(),n.createElementBlock("button",{key:P,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":s.value===P}]),style:n.normalizeStyle({background:n.unref(Dn)(P)}),title:n.unref(Bn)(P),onClick:W=>de(P)},null,14,m1))),128))])])],64)):n.createCommentVNode("",!0)],8,X0)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-c24d4686"]]),pd=["ko","en","ja","zh"];function p1(e){if(e)for(const t of pd){const o=e[t];if(o)return o}}function hl(e){const t=p1(e.label);return t?`${e.groupCode} (${t})`:e.groupCode}function h1(e,t){const o=t.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:pd.some(a=>{var l,r;return(r=(l=i.label)==null?void 0:l[a])==null?void 0:r.toLowerCase().includes(o)})):e}const y1=["aria-expanded"],g1=["aria-selected","onClick","onMouseenter"],b1={key:0,class:"gcc__opt gcc__opt--empty"},hd=Le(n.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=n.ref(),s=n.ref(""),c=n.ref(!1),d=n.ref(-1),u=n.ref({}),f=n.computed(()=>o.items.find(G=>G.groupCode===o.modelValue)),p=n.computed(()=>f.value?hl(f.value):"");n.watch(p,G=>{c.value||(s.value=G)},{immediate:!0});const m=n.computed(()=>s.value===p.value?o.items:h1(o.items,s.value));function h(){var X;const G=(X=a.value)==null?void 0:X.getBoundingClientRect();G&&(u.value={left:`${G.left}px`,top:`${G.bottom}px`,width:`${G.width}px`})}function b(){c.value=!0,h(),d.value=Math.max(0,m.value.findIndex(G=>G.groupCode===o.modelValue)),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),document.addEventListener("mousedown",q)}function g(){c.value=!1,window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h),document.removeEventListener("mousedown",q)}n.onBeforeUnmount(g);function _(){b(),n.nextTick(()=>{var G;return(G=l.value)==null?void 0:G.select()})}function N(){c.value||b(),d.value=0}function y(G){i("update:modelValue",G.groupCode),s.value=hl(G),g()}function $(){i("update:modelValue",void 0),s.value="",g()}function K(){s.value.trim()===""?$():(s.value=p.value,g())}function F(G){var X;if(G.key==="ArrowDown")c.value||b(),d.value=Math.min(d.value+1,m.value.length-1),G.preventDefault();else if(G.key==="ArrowUp")d.value=Math.max(d.value-1,0),G.preventDefault();else if(G.key==="Enter"){const Q=m.value[d.value];Q&&y(Q),G.preventDefault()}else G.key==="Escape"&&(s.value=p.value,g(),(X=l.value)==null||X.blur())}function q(G){var Q,de;const X=G.target;!((Q=a.value)!=null&&Q.contains(X))&&!((de=r.value)!=null&&de.contains(X))&&K()}return(G,X)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:a,class:"gcc"},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":X[0]||(X[0]=Q=>s.value=Q),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":c.value,placeholder:"코드그룹 검색/선택",onFocus:_,onInput:N,onKeydown:F},null,40,y1),[[n.vModelText,s.value]]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[c.value?(n.openBlock(),n.createElementBlock("ul",{key:0,ref_key:"popup",ref:r,class:"gcc__popup",style:n.normalizeStyle(u.value),role:"listbox"},[n.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:X[1]||(X[1]=n.withModifiers(()=>{},["prevent"])),onClick:$},"(없음)",32),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(Q,de)=>(n.openBlock(),n.createElementBlock("li",{key:Q.groupCode,class:n.normalizeClass(["gcc__opt",{"is-active":de===d.value,"is-selected":Q.groupCode===e.modelValue}]),role:"option","aria-selected":Q.groupCode===e.modelValue,onMousedown:X[2]||(X[2]=n.withModifiers(()=>{},["prevent"])),onClick:B=>y(Q),onMouseenter:B=>d.value=de},n.toDisplayString(n.unref(hl)(Q)),43,g1))),128)),m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",b1,"일치하는 코드그룹 없음"))],4)):n.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-3f798ab1"]]),_1=["disabled"],w1={class:"em-aw__toolbar"},v1={class:"em-aw__count"},k1={class:"em-aw__scroll"},E1={class:"em-aw__table"},N1={key:0,class:"c-code"},$1=["colspan"],x1={class:"c-del"},I1={class:"c-flag"},S1={class:"c-flag"},C1={class:"c-flag"},R1={class:"c-flag"},V1={class:"c-flag"},A1={class:"c-flag"},T1={class:"c-flag"},M1={class:"c-flag"},B1={key:0},D1={class:"c-del"},O1=["colspan"],L1={class:"c-del"},P1={class:"em-aw__embed-label"},z1={class:"em-aw__ro"},U1={class:"em-aw__ro"},H1={class:"em-aw__ro"},F1={class:"em-aw__ro"},G1={colspan:"8"},Y1=["colspan"],W1={key:0},Vi="__OWN__",K1=Le(n.defineComponent({__name:"EntityAttributesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(O=>O.modelId===t.entityId)??null),a=n.computed(()=>{var O;return((O=i.value)==null?void 0:O.stereotype)==="JPA_EMBEDDABLE"}),l=n.computed(()=>new Set(o.selectedAttrIds.value)),r=n.computed(()=>{var O;return(((O=i.value)==null?void 0:O.attributes)??[]).filter(U=>U.attrType!=="DIVIDER").length}),s=n.computed(()=>v.value.length?19:18),c=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function d(O){return O==="none"?"(없음)":O}const u=O=>O;function f(O,U){i.value&&o.updateAttribute(i.value.modelId,O.modelId,U)}function p(O,U){f(O,{naturalId:U||void 0,naturalIdMutable:U?O.naturalIdMutable:void 0})}function m(){return{naturalId:void 0,naturalIdMutable:void 0}}function h(O,U){f(O,{identifier:U,...U?m():{}})}function b(O,U){f(O,{transient:U||void 0,...U?m():{}})}function g(O){return!!O.transient}const _=O=>O.value,N=O=>O.label;function y(O,U){if(!U)return;const M=Q.value.find(pe=>pe.type===U);if(M){const pe=O.dbAttrs[0]??{modelId:O.modelId+".c",physicalName:O.name,dataType:"VARCHAR"};f(O,{type:U,customType:void 0,dbAttrs:[{...pe,dataType:M.dataType,length:M.length,scale:M.scale}]});return}f(O,U===Ot?{type:U}:{type:U,customType:void 0})}function $(O,U){f(O,{customType:U.trim()===""?void 0:U})}function K(O,U){const pe={...O.dbAttrs[0]??{modelId:O.modelId+".c",physicalName:O.name,dataType:"VARCHAR"},...U};U.dataType!==void 0&&!Lo.has(pe.dataType)&&(pe.scale=void 0),f(O,{dbAttrs:[pe]})}function F(O){var U;return Lo.has(((U=O.dbAttrs[0])==null?void 0:U.dataType)??"")}function q(O,U,M){var pe;K(O,{logicalName:{...(pe=O.dbAttrs[0])==null?void 0:pe.logicalName,[U]:M}})}function G(O){return O.personalInfoAttributeType??"none"}function X(O,U){f(O,{personalInfoAttributeType:U==="none"?void 0:U})}const Q=n.computed(()=>o.predefinedCustomTypeCatalog.value),de=n.computed(()=>o.embeddableCatalog.value);function B(O){var U,M;return((U=O.label)==null?void 0:U.ko)??((M=O.label)==null?void 0:M.en)??O.type}function ee(O){!O||!i.value||o.addPredefinedEmbed(i.value.modelId,O)}const v=n.computed(()=>o.groupCodeCatalog.value);function R(O){var U;return((U=v.value.find(M=>M.groupCode===O.groupCode))==null?void 0:U.codes)??[]}function E(O){return["none",...R(O)]}function P(O){return O==="none"?"none":O.code}function W(O){var M,pe;if(O==="none")return"(없음)";const U=((M=O.label)==null?void 0:M.ko)??((pe=O.label)==null?void 0:pe.en);return U?`${O.code} (${U})`:O.code}function oe(O,U){i.value&&o.setAttributeGroupCode(i.value.modelId,O.modelId,U)}function T(O,U){f(O,{defaultValue:U==="none"?void 0:U})}function J(O,U){f(O,{defaultValue:U.trim()===""?void 0:U})}function se(O){return O.attrType.startsWith("EMBED")&&O.dbAttrs.length>0}function he(O,U,M){const pe=O.dbAttrs.map((S,D)=>{if(D!==U)return S;const I={...S,...M};for(const L of Object.keys(M))M[L]===void 0&&delete I[L];return I});i.value&&o.setEmbedColumns(i.value.modelId,O.modelId,pe)}function we(O,U,M,pe){var S;he(O,U,{logicalName:{...(S=O.dbAttrs[U])==null?void 0:S.logicalName,[M]:pe}})}function re(O,U){var S,D,I;if(O.attrType==="EMBED_PREDEF"){const L=(S=o.embeddableCatalog.value.find(ie=>ie.type===O.type))==null?void 0:S.fields[U];return L?{name:L.name,physicalName:L.physicalName,dataType:L.dataType,length:L.length,shareable:L.shareable,logicalName:L.logicalName}:void 0}const M=(D=O.embedded)==null?void 0:D.embeddableRef;if(!M)return;const pe=(I=o.state.logical.entities.find(L=>L.modelId===M))==null?void 0:I.attributes.flatMap(L=>L.dbAttrs)[U];return pe?{physicalName:pe.physicalName,dataType:pe.dataType,length:pe.length,scale:pe.scale,logicalName:pe.logicalName}:void 0}function me(O,U){var M,pe;return((M=re(O,U))==null?void 0:M.dataType)||((pe=O.dbAttrs[U])==null?void 0:pe.dataType)||""}function be(O,U){var M,pe;return((M=re(O,U))==null?void 0:M.length)??((pe=O.dbAttrs[U])==null?void 0:pe.length)}function xe(O,U){var M,pe;return((M=re(O,U))==null?void 0:M.scale)??((pe=O.dbAttrs[U])==null?void 0:pe.scale)}const Ce=["inherit","true","false"];function Se(O){return O==="inherit"?"기본(따름)":O}function ye(O){return(O==null?void 0:O.updatable)===void 0?"inherit":O.updatable?"true":"false"}function Y(O,U,M){he(O,U,{updatable:M==="inherit"?void 0:M==="true"})}function C(O,U){K(O,{updatable:U==="inherit"?void 0:U==="true"})}const k=["inherit","true","false"];function V(O){return O==="inherit"?"기본(따름)":O}function H(O){return(O==null?void 0:O.insertable)===void 0?"inherit":O.insertable?"true":"false"}function te(O,U,M){he(O,U,{insertable:M==="inherit"?void 0:M==="true"})}function ne(O,U){K(O,{insertable:U==="inherit"?void 0:U==="true"})}const ge=n.computed(()=>{var O;return Wn(((O=i.value)==null?void 0:O.attributes.flatMap(U=>U.dbAttrs))??[])}),ve=n.computed(()=>{var O;return(((O=i.value)==null?void 0:O.attributes)??[]).filter(U=>U.attrType==="NORMAL"&&U.dbAttrs.length===1&&U.dbAttrs[0]).map(U=>({modelId:U.dbAttrs[0].modelId,label:U.dbAttrs[0].physicalName||U.name}))});function Ee(){return[Vi,...ve.value.map(O=>O.modelId)]}function w(O){if(O===Vi)return"전용 컬럼(OWN)";const U=ve.value.find(M=>M.modelId===O);return U?`↗ ${U.label} (공유)`:O}function x(O){return(O==null?void 0:O.sharedColumnRef)??Vi}function j(O,U,M){he(O,U,{sharedColumnRef:M===Vi?void 0:M})}function le(O){return(O==null?void 0:O.sharedColumnRef)!=null}function _e(O){var U;return((U=Po(O,ge.value))==null?void 0:U.physicalName)??""}return(O,U)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",w1,[n.createElementVNode("span",v1,"속성 ("+n.toDisplayString(r.value)+")",1),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:U[0]||(U[0]=M=>n.unref(o).addAttribute(i.value.modelId))}),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"구분선",onClick:U[1]||(U[1]=M=>n.unref(o).addDivider(i.value.modelId))}),de.value.length?(n.openBlock(),n.createBlock(n.unref(ae.BSSelect),{key:0,width:"140px",placeholder:"임베더블 추가","model-value":void 0,items:de.value,"value-provider":M=>M.type,"label-provider":B,"onUpdate:modelValue":ee},null,8,["items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",k1,[n.createElementVNode("table",E1,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[U[2]||(U[2]=n.createElementVNode("th",{class:"c-name"},"이름",-1)),U[3]||(U[3]=n.createElementVNode("th",{class:"c-type"},"타입",-1)),U[4]||(U[4]=n.createElementVNode("th",{class:"c-logical"},"논리명",-1)),U[5]||(U[5]=n.createElementVNode("th",{class:"c-col"},"컬럼(물리)",-1)),U[6]||(U[6]=n.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),U[7]||(U[7]=n.createElementVNode("th",{class:"c-len"},"len",-1)),U[8]||(U[8]=n.createElementVNode("th",{class:"c-scale"},"scale",-1)),U[9]||(U[9]=n.createElementVNode("th",{class:"c-flag"},"Primary Key",-1)),U[10]||(U[10]=n.createElementVNode("th",{class:"c-flag"},"Not Null",-1)),U[11]||(U[11]=n.createElementVNode("th",{class:"c-flag"},"Unique",-1)),U[12]||(U[12]=n.createElementVNode("th",{class:"c-flag"},"Auto Increment",-1)),U[13]||(U[13]=n.createElementVNode("th",{class:"c-flag"},"@Transient",-1)),U[14]||(U[14]=n.createElementVNode("th",{class:"c-flag"},"@NaturalId",-1)),U[15]||(U[15]=n.createElementVNode("th",{class:"c-flag"},"NID mutable",-1)),U[16]||(U[16]=n.createElementVNode("th",{class:"c-flag"},"Multi-Value (Set)",-1)),U[17]||(U[17]=n.createElementVNode("th",{class:"c-ins"},"insertable",-1)),U[18]||(U[18]=n.createElementVNode("th",{class:"c-upd"},"updatable",-1)),U[19]||(U[19]=n.createElementVNode("th",{class:"c-pii"},"개인정보",-1)),v.value.length?(n.openBlock(),n.createElementBlock("th",N1,"코드그룹")):n.createCommentVNode("",!0),U[20]||(U[20]=n.createElementVNode("th",{class:"c-default"},"기본값",-1)),U[21]||(U[21]=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,M=>{var pe,S,D,I,L,ie,ue,fe,A,Z,z;return n.openBlock(),n.createElementBlock(n.Fragment,{key:M.modelId},[M.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("tr",{key:0,class:n.normalizeClass(["em-aw__divider-row",{"is-focused":l.value.has(M.modelId)}])},[n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-divlabel-${M.modelId}`,width:"100%",placeholder:"구분선 라벨(선택)","model-value":M.name,"onUpdate:modelValue":ce=>f(M,{name:ce})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:s.value,class:"em-aw__divider-note"},"── 시각 구획 ──",8,$1),n.createElementVNode("td",x1,[n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ce=>n.unref(o).removeAttribute(i.value.modelId,M.modelId)},null,8,["onClick"])])],2)):se(M)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-parent",{"is-focused":l.value.has(M.modelId)}])},[n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-name-${M.modelId}`,width:"100%",placeholder:"이름","model-value":M.name,"onUpdate:modelValue":ce=>f(M,{name:ce})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-type-${M.modelId}`,width:"100%",disabled:"","model-value":M.type},null,8,["name","model-value"])]),n.createElementVNode("td",{colspan:v.value.length?18:17,class:"em-aw__embed-note"},"임베더블 — 하위 컬럼 "+n.toDisplayString(M.dbAttrs.length)+"개",9,O1),n.createElementVNode("td",L1,[n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ce=>n.unref(o).removeAttribute(i.value.modelId,M.modelId)},null,8,["onClick"])])],2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(M.dbAttrs,(ce,Ae)=>{var Ue,Oe,Me,st,Xt,jt,Zt;return n.openBlock(),n.createElementBlock("tr",{key:ce.modelId,class:"em-aw__embed-col"},[n.createElementVNode("td",P1,"↳ "+n.toDisplayString(((Ue=re(M,Ae))==null?void 0:Ue.name)??((Oe=re(M,Ae))==null?void 0:Oe.physicalName)??`컬럼 ${Ae+1}`),1),n.createElementVNode("td",null,[n.createElementVNode("span",z1,n.toDisplayString(me(M,Ae)),1)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-embed-logical-${ce.modelId}`,width:"100%",placeholder:((st=(Me=re(M,Ae))==null?void 0:Me.logicalName)==null?void 0:st.ko)??"논리명","model-value":((Xt=ce.logicalName)==null?void 0:Xt.ko)??"","onUpdate:modelValue":Xe=>we(M,Ae,"ko",Xe)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-embed-col-${ce.modelId}`,width:"100%",disabled:le(ce),placeholder:((jt=re(M,Ae))==null?void 0:jt.physicalName)??"컬럼","model-value":le(ce)?_e(ce):ce.physicalName,"onUpdate:modelValue":Xe=>he(M,Ae,{physicalName:Xe})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(pn,{controller:n.unref(o),"ref-id":ce.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createElementVNode("span",U1,n.toDisplayString(me(M,Ae)),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",H1,n.toDisplayString(be(M,Ae)??""),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",F1,n.toDisplayString(xe(M,Ae)??""),1)]),n.createElementVNode("td",G1,[(Zt=re(M,Ae))!=null&&Zt.shareable?(n.openBlock(),n.createBlock(n.unref(ae.BSSelect),{key:0,width:"100%","model-value":x(ce),items:Ee(),"value-provider":u,"label-provider":w,"onUpdate:modelValue":Xe=>Xe&&j(M,Ae,Xe)},null,8,["model-value","items","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{width:"100%",disabled:le(ce),"model-value":le(ce)?"false":H(ce),items:k,"value-provider":u,"label-provider":V,"onUpdate:modelValue":Xe=>Xe&&te(M,Ae,Xe)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{width:"100%",disabled:le(ce),"model-value":le(ce)?"false":ye(ce),items:Ce,"value-provider":u,"label-provider":Se,"onUpdate:modelValue":Xe=>Xe&&Y(M,Ae,Xe)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:v.value.length?4:3},null,8,Y1)])}),128))],64)):(n.openBlock(),n.createElementBlock("tr",{key:1,class:n.normalizeClass({"is-focused":l.value.has(M.modelId)})},[n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-name-${M.modelId}`,width:"100%",placeholder:"이름","model-value":M.name,"onUpdate:modelValue":ce=>f(M,{name:ce})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{name:`aw-type-${M.modelId}`,width:"100%",placeholder:"타입",disabled:!!M.groupCode,items:n.unref(er)(M.type,Q.value),"value-provider":_,"label-provider":N,"model-value":M.type,"onUpdate:modelValue":ce=>y(M,ce)},null,8,["name","disabled","items","model-value","onUpdate:modelValue"]),M.type===n.unref(Ot)?(n.openBlock(),n.createBlock(n.unref(ae.BSTextInput),{key:0,name:`aw-customtype-${M.modelId}`,width:"100%",placeholder:"커스텀 타입명","model-value":M.customType??"","onUpdate:modelValue":ce=>$(M,ce)},null,8,["name","model-value","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-logical-${M.modelId}`,width:"100%",placeholder:"논리명","model-value":((S=(pe=M.dbAttrs[0])==null?void 0:pe.logicalName)==null?void 0:S.ko)??"","onUpdate:modelValue":ce=>q(M,"ko",ce)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`aw-col-${M.modelId}`,width:"100%",placeholder:"컬럼",disabled:g(M),"model-value":((D=M.dbAttrs[0])==null?void 0:D.physicalName)??"","onUpdate:modelValue":ce=>K(M,{physicalName:ce})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(pn,{controller:n.unref(o),"ref-id":(I=M.dbAttrs[0])==null?void 0:I.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{name:`aw-dtype-${M.modelId}`,width:"100%",placeholder:"dataType",disabled:g(M),items:n.unref(Jl)(((L=M.dbAttrs[0])==null?void 0:L.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":u,"label-provider":n.unref(ca),"model-value":((ie=M.dbAttrs[0])==null?void 0:ie.dataType)??"","onUpdate:modelValue":ce=>ce&&K(M,{dataType:ce})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSNumberInput),{name:`aw-len-${M.modelId}`,width:"100%",placeholder:"len",disabled:g(M),"model-value":(ue=M.dbAttrs[0])==null?void 0:ue.length,"onUpdate:modelValue":ce=>K(M,{length:ce||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSNumberInput),{name:`aw-scale-${M.modelId}`,width:"100%",placeholder:"scale",disabled:g(M)||!F(M),"model-value":(fe=M.dbAttrs[0])==null?void 0:fe.scale,"onUpdate:modelValue":ce=>K(M,{scale:ce||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",I1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-pk-${M.modelId}`,"model-value":M.identifier,disabled:a.value||g(M),"onUpdate:modelValue":ce=>h(M,ce)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",S1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-nn-${M.modelId}`,"model-value":M.notNull,disabled:g(M),"onUpdate:modelValue":ce=>f(M,{notNull:ce})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",C1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-uq-${M.modelId}`,"model-value":!!((A=M.dbAttrs[0])!=null&&A.unique),disabled:g(M),"onUpdate:modelValue":ce=>K(M,{unique:ce})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",R1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-ai-${M.modelId}`,"model-value":!!((Z=M.dbAttrs[0])!=null&&Z.autoIncrement),disabled:g(M)||!M.identifier,"onUpdate:modelValue":ce=>K(M,{autoIncrement:ce})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",V1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-tr-${M.modelId}`,"model-value":!!M.transient,disabled:M.identifier,"onUpdate:modelValue":ce=>b(M,ce)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",A1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-nid-${M.modelId}`,"model-value":!!M.naturalId,disabled:M.identifier||g(M),"onUpdate:modelValue":ce=>p(M,ce)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",T1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-nidm-${M.modelId}`,"model-value":!!M.naturalIdMutable,disabled:g(M)||!M.naturalId,"onUpdate:modelValue":ce=>f(M,{naturalIdMutable:ce||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",M1,[n.createVNode(n.unref(ae.BSCheckbox),{name:`aw-mv-${M.modelId}`,"model-value":!!((z=M.dbAttrs[0])!=null&&z.multiValue),disabled:g(M),"onUpdate:modelValue":ce=>K(M,{multiValue:ce||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{name:`aw-ins-${M.modelId}`,width:"100%",disabled:g(M),"model-value":H(M.dbAttrs[0]),items:k,"value-provider":u,"label-provider":V,"onUpdate:modelValue":ce=>ce&&ne(M,ce)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{name:`aw-upd-${M.modelId}`,width:"100%",disabled:g(M),"model-value":ye(M.dbAttrs[0]),items:Ce,"value-provider":u,"label-provider":Se,"onUpdate:modelValue":ce=>ce&&C(M,ce)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{width:"100%","model-value":G(M),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":ce=>ce&&X(M,ce)},null,8,["model-value","onUpdate:modelValue"])]),v.value.length?(n.openBlock(),n.createElementBlock("td",B1,[n.createVNode(hd,{"model-value":M.groupCode,items:v.value,"onUpdate:modelValue":ce=>oe(M,ce)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("td",null,[R(M).length?(n.openBlock(),n.createBlock(n.unref(ae.BSSelect),{key:0,width:"100%","model-value":M.defaultValue??"none",items:E(M),"value-provider":P,"label-provider":W,"onUpdate:modelValue":ce=>ce&&T(M,ce)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ae.BSTextInput),{key:1,name:`aw-default-${M.modelId}`,width:"100%",placeholder:"기본값","model-value":M.defaultValue??"","onUpdate:modelValue":ce=>J(M,ce)},null,8,["name","model-value","onUpdate:modelValue"]))]),n.createElementVNode("td",D1,[n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ce=>n.unref(o).removeAttribute(i.value.modelId,M.modelId)},null,8,["onClick"])])],2))],64)}),128)),i.value.attributes.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",W1,[...U[22]||(U[22]=[n.createElementVNode("td",{colspan:"99",class:"em-aw__empty"},"속성 없음 — '추가'로 생성",-1)])]))])])])],8,_1)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-d8326b9d"]]),q1=["disabled"],X1={class:"em-idxw__list"},j1={class:"em-idxw__list-head"},Z1=["onClick"],J1={class:"em-idxw__item-name"},Q1={key:0,class:"em-idxw__badge"},e_={class:"em-idxw__item-cnt"},t_={key:0,class:"em-idxw__empty"},n_={key:0,class:"em-idxw__edit"},o_={class:"em-idxw__form"},i_={class:"em-field em-idxw__name"},a_={class:"em-field"},l_=["value"],r_={class:"em-idxw__transfer"},s_={class:"em-idxw__pane"},c_={class:"em-idxw__pane-head"},d_={class:"em-idxw__cols"},u_=["onClick"],f_={key:0,class:"em-idxw__empty"},m_={class:"em-idxw__arrows"},p_={class:"em-idxw__pane"},h_={class:"em-idxw__pane-head"},y_={class:"em-idxw__cols"},g_={class:"em-idxw__col-name"},b_={class:"em-idxw__col-ops"},__=["disabled","onClick"],w_=["disabled","onClick"],v_=["onClick"],k_={key:0,class:"em-idxw__empty"},E_={key:1,class:"em-idxw__edit em-idxw__edit--empty"},N_=Le(n.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(F=>F.modelId===t.entityId)??null),a=n.computed(()=>{var F;return((F=i.value)==null?void 0:F.indexes)??[]}),l=n.computed(()=>{var F;return((F=i.value)==null?void 0:F.attributes)??[]}),r=n.ref(null);n.watch(a,F=>{var q;F.some(G=>G.modelId===r.value)||(r.value=((q=F[0])==null?void 0:q.modelId)??null)},{immediate:!0});const s=n.computed(()=>a.value.find(F=>F.modelId===r.value)??null),c=n.computed(()=>{var F;return new Set(((F=s.value)==null?void 0:F.columns.map(q=>q.columnRef))??[])}),d=n.computed(()=>l.value.filter(F=>!c.value.has(F.modelId))),u=n.ref(new Set);n.watch(r,()=>u.value=new Set);function f(F){var G;const q=(G=F.dbAttrs[0])==null?void 0:G.physicalName;return q&&q!==F.name?`${F.name} (${q})`:F.name}function p(F){const q=l.value.find(G=>G.modelId===F);return q?f(q):F}function m(F,q){i.value&&o.updateIndex(i.value.modelId,F,q)}function h(){var q;if(!i.value)return;const F=Te();o.addIndex(i.value.modelId,{modelId:F,name:`idx_${(((q=i.value.indexes)==null?void 0:q.length)??0)+1}`,unique:!1,columns:[]}),r.value=F}function b(F){i.value&&o.removeIndex(i.value.modelId,F)}function g(F){s.value&&m(s.value.modelId,{parameters:F.trim()===""?void 0:F})}function _(F){const q=new Set(u.value);q.has(F)?q.delete(F):q.add(F),u.value=q}function N(){const F=s.value;if(!F||!u.value.size)return;const q=[...u.value].map(G=>({columnRef:G,descending:!1}));m(F.modelId,{columns:[...F.columns,...q]}),u.value=new Set}function y(F){const q=s.value;q&&m(q.modelId,{columns:q.columns.filter((G,X)=>X!==F)})}function $(F,q){const G=s.value;G&&m(G.modelId,{columns:G.columns.map((X,Q)=>Q===F?{...X,descending:q}:X)})}function K(F,q){const G=s.value;if(!G)return;const X=F+q;if(X<0||X>=G.columns.length)return;const Q=[...G.columns];[Q[F],Q[X]]=[Q[X],Q[F]],m(G.modelId,{columns:Q})}return(F,q)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!n.unref(o).editable.value},[n.createElementVNode("aside",X1,[n.createElementVNode("div",j1,[n.createElementVNode("span",null,"인덱스 ("+n.toDisplayString(a.value.length)+")",1),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:h})]),n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,G=>(n.openBlock(),n.createElementBlock("li",{key:G.modelId,class:n.normalizeClass(["em-idxw__item",{"is-active":G.modelId===r.value}]),onClick:X=>r.value=G.modelId},[n.createElementVNode("span",J1,n.toDisplayString(G.name||"(이름 없음)"),1),G.unique?(n.openBlock(),n.createElementBlock("span",Q1,"UQ")):n.createCommentVNode("",!0),n.createElementVNode("span",e_,n.toDisplayString(G.columns.length),1)],10,Z1))),128)),a.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",t_,"인덱스 없음 — '추가'로 생성"))])]),s.value?(n.openBlock(),n.createElementBlock("section",n_,[n.createElementVNode("div",o_,[n.createElementVNode("label",i_,[q[4]||(q[4]=n.createElementVNode("span",null,"인덱스명",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"idxw-name",width:"100%","model-value":s.value.name,"onUpdate:modelValue":q[0]||(q[0]=G=>m(s.value.modelId,{name:G}))},null,8,["model-value"]),n.createVNode(pn,{controller:n.unref(o),"ref-id":s.value.modelId},null,8,["controller","ref-id"])]),n.createVNode(n.unref(ae.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":s.value.unique,"onUpdate:modelValue":q[1]||(q[1]=G=>m(s.value.modelId,{unique:G}))},null,8,["model-value"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:"인덱스 삭제",onClick:q[2]||(q[2]=G=>b(s.value.modelId))})]),n.createElementVNode("label",a_,[q[5]||(q[5]=n.createElementVNode("span",null,"조건 (partial index)",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:s.value.parameters??"",rows:"2",placeholder:"예: WHERE status = 'A' AND deleted = false",onChange:q[3]||(q[3]=G=>g(G.target.value))},null,40,l_)]),n.createElementVNode("div",r_,[n.createElementVNode("div",s_,[n.createElementVNode("div",c_,"가용 컬럼 ("+n.toDisplayString(d.value.length)+")",1),n.createElementVNode("ul",d_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,G=>(n.openBlock(),n.createElementBlock("li",{key:G.modelId,class:n.normalizeClass(["em-idxw__col",{"is-sel":u.value.has(G.modelId)}]),onClick:X=>_(G.modelId)},n.toDisplayString(f(G)),11,u_))),128)),d.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",f_,"모든 컬럼 사용됨"))])]),n.createElementVNode("div",m_,[n.createVNode(n.unref(ae.BSButton),{caption:"추가 →",disabled:!u.value.size,onClick:N},null,8,["disabled"])]),n.createElementVNode("div",p_,[n.createElementVNode("div",h_,"인덱스 컬럼 ("+n.toDisplayString(s.value.columns.length)+")",1),n.createElementVNode("ul",y_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value.columns,(G,X)=>(n.openBlock(),n.createElementBlock("li",{key:X,class:"em-idxw__col em-idxw__col--idx"},[n.createElementVNode("span",g_,n.toDisplayString(p(G.columnRef)),1),n.createVNode(n.unref(ae.BSCheckbox),{name:`idxw-desc-${X}`,class:"em-check",label:"DESC","model-value":G.descending,"onUpdate:modelValue":Q=>$(X,Q)},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("span",b_,[n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:"위로",disabled:X===0,onClick:Q=>K(X,-1)},"↑",8,__),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:"아래로",disabled:X===s.value.columns.length-1,onClick:Q=>K(X,1)},"↓",8,w_),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:"제거",onClick:Q=>y(X)},"✕",8,v_)])]))),128)),s.value.columns.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",k_,"컬럼 없음 — 좌측에서 추가"))])])])])):(n.openBlock(),n.createElementBlock("section",E_,"인덱스를 선택하거나 추가하세요."))],8,q1)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-46db4ab5"]]),$_={class:"em-op-src"},x_={class:"em-op-src__actions"},yd=Le(n.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function}},setup(e){const t=e,o=ae.useModalHandle(),i=n.ref(t.sourceCode);function a(){t.onSave(i.value),o.close()}return(l,r)=>(n.openBlock(),n.createBlock(n.unref(ae.BSModalFrame),{title:`본문 — ${t.operationName}()`},{default:n.withCtx(()=>[n.createElementVNode("div",$_,[n.withDirectives(n.createElementVNode("textarea",{"onUpdate:modelValue":r[0]||(r[0]=s=>i.value=s),class:"em-op-src__area",spellcheck:"false",placeholder:"// Java 구현 코드"},null,512),[[n.vModelText,i.value]]),n.createElementVNode("div",x_,[n.createVNode(n.unref(ae.BSButton),{caption:"저장",onClick:a}),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"닫기",onClick:r[1]||(r[1]=s=>n.unref(o).close())})])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-acb84aec"]]),I_=["disabled"],S_={class:"em-ow__toolbar"},C_={class:"em-ow__count"},R_={class:"em-ow__scroll"},V_={class:"em-ow__table"},A_={class:"c-del"},T_={key:0},M_=Le(n.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ae.useModal(),a=n.computed(()=>o.state.logical.entities.find(h=>h.modelId===t.entityId)??null),l=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],r=["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(h){return h==="none"?"(없음)":h}const c=h=>h;function d(h,b){a.value&&o.updateOperation(a.value.modelId,h.modelId,b)}function u(h,b,g){d(h,{description:{...h.description,[b]:g}})}function f(h){return h.personalInfoAttributeType??"none"}function p(h,b){d(h,{personalInfoAttributeType:b==="none"?void 0:b})}function m(h){i.openModal({component:yd,bind:{operationName:h.name,sourceCode:h.sourceCode??"",onSave:b=>d(h,{sourceCode:b})}})}return(h,b)=>{var g,_;return a.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",S_,[n.createElementVNode("span",C_,"오퍼레이션 ("+n.toDisplayString(((g=a.value.operations)==null?void 0:g.length)??0)+")",1),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:b[0]||(b[0]=N=>n.unref(o).addOperation(a.value.modelId))})]),n.createElementVNode("div",R_,[n.createElementVNode("table",V_,[b[2]||(b[2]=n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",{class:"c-name"},"이름"),n.createElementVNode("th",{class:"c-vis"},"visibility"),n.createElementVNode("th",{class:"c-desc"},"설명"),n.createElementVNode("th",{class:"c-pii"},"개인정보"),n.createElementVNode("th",{class:"c-src"},"본문"),n.createElementVNode("th",{class:"c-del"})])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.operations??[],N=>{var y;return n.openBlock(),n.createElementBlock("tr",{key:N.modelId},[n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`ow-name-${N.modelId}`,width:"100%",placeholder:"오퍼레이션명","model-value":N.name,"onUpdate:modelValue":$=>d(N,{name:$})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{width:"100%","model-value":N.visibility??"PACKAGE",items:l,"value-provider":c,"label-provider":c,"onUpdate:modelValue":$=>$&&d(N,{visibility:$})},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSTextInput),{name:`ow-desc-${N.modelId}`,width:"100%",placeholder:"설명(ko)","model-value":((y=N.description)==null?void 0:y.ko)??"","onUpdate:modelValue":$=>u(N,"ko",$)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSSelect),{width:"100%","model-value":f(N),items:r,"value-provider":c,"label-provider":s,"onUpdate:modelValue":$=>$&&p(N,$)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:N.sourceCode?"본문 ●":"본문",onClick:$=>m(N)},null,8,["caption","onClick"])]),n.createElementVNode("td",A_,[n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:$=>n.unref(o).removeOperation(a.value.modelId,N.modelId)},null,8,["onClick"])])])}),128)),(_=a.value.operations)!=null&&_.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",T_,[...b[1]||(b[1]=[n.createElementVNode("td",{colspan:"6",class:"em-ow__empty"},"오퍼레이션 없음 — '추가'로 생성",-1)])]))])])])],8,I_)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a621eb69"]]),B_={class:"em-detail__tabs"},D_=["onClick"],O_=Le(n.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ae.useModalHandle(),a=n.computed(()=>o.state.logical.entities.find(s=>s.modelId===t.entityId)??null);n.watch(a,s=>{s||i.close()});const l=[{key:"basics",label:"기본"},{key:"columns",label:"속성"},{key:"indexes",label:"인덱스"},{key:"operations",label:"오퍼레이션"}],r=n.ref("basics");return(s,c)=>{var d;return n.openBlock(),n.createBlock(n.unref(ae.BSModalFrame),{title:`엔티티 — ${((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",B_,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(l,u=>n.createElementVNode("button",{key:u.key,type:"button",class:n.normalizeClass(["em-detail__tab",{"is-active":r.value===u.key}]),onClick:f=>r.value=u.key},n.toDisplayString(u.label),11,D_)),64))]),n.createElementVNode("div",{class:n.normalizeClass(["em-detail__body",{"is-readonly":!n.unref(o).editable.value}])},[r.value==="basics"?(n.openBlock(),n.createBlock(md,{key:0,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):r.value==="columns"?(n.openBlock(),n.createBlock(K1,{key:1,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):r.value==="indexes"?(n.openBlock(),n.createBlock(N_,{key:2,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):(n.openBlock(),n.createBlock(M_,{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-67239153"]]);function Ai(e,t,o){e.openModal({component:O_,bind:{controller:n.markRaw(t),entityId:o}})}function L_(e){var i;const t=JSON.parse(JSON.stringify(e));t.modelId=Te(),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 l=Te();o.set(a.modelId,l),a.modelId=l;for(const r of a.dbAttrs)r.modelId=Te()}for(const a of t.indexes??[]){a.modelId=Te();for(const l of a.columns)l.columnRef=o.get(l.columnRef)??l.columnRef}return t}const hn=Symbol("editorController");function gd(e="m1",t="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:t,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function Ti(e,t){const o=[];for(const i of t.remove)o.push(Pt(e,i));for(const i of t.update)o.push(tn(e,i.attributeId,i.patch));for(const i of t.add)o.push(It(e,i));return o}function On(e,t,o){return{...e,entities:e.entities.map(i=>i.modelId===t?{...i,attributes:o(i.attributes)}:i)}}function Ln(e,t){const o=[];for(const[i,a]of Uf(e,t,Te))o.push(...Ti(i,a));return o}function bd(e,t,o){const i=new Set(o.remove);return On(e,t,a=>[...a.filter(l=>!i.has(l.modelId)).map(l=>{const r=o.update.find(s=>s.attributeId===l.modelId);return r?{...l,...r.patch}:l}),...o.add])}function yl(e,t){const o=Jn(e,t,Te),i=Ti(t,o),a=bd(e,t,o);return i.push(...Ln(a,t)),i}function _d(e){return e.attributes.flatMap(t=>t.dbAttrs).map(t=>({...t,modelId:Te()}))}function P_(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((m,h)=>Math.max(m,h.order),-1)+1,f=new Set(o.attributes.map(m=>m.name));let p="id";for(let m=2;f.has(p);m++)p=`id${m}`;a={modelId:Te(),name:p,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:u,dbAttrs:[{modelId:Te(),physicalName:p.toLowerCase(),dataType:"BIGINT"}]},i.push(It(t,a))}const l=[];for(const u of e.entities)for(const f of u.attributes){if(((d=f.embedded)==null?void 0:d.embeddableRef)!==t)continue;const p=e.associations.find(g=>g.modelId===f.embedded.associationRef);if(!p)continue;const m=p.end1.entityRef===u.modelId,h=m?p.end1:p.end2,b=m?p.end2:p.end1;l.push({ownerId:u.modelId,dispId:f.modelId,assocId:p.modelId,end1:{entityRef:u.modelId,multiplicity:h.multiplicity,navigable:h.navigable,composition:!1},end2:{entityRef:t,multiplicity:b.multiplicity,navigable:b.navigable,composition:!1}})}const r={...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 f=new Set(l.filter(p=>p.ownerId===u.modelId).map(p=>p.dispId));return f.size?{...u,attributes:u.attributes.filter(p=>!f.has(p.modelId))}:u}),associations:e.associations.map(u=>{const f=l.find(p=>p.assocId===u.modelId);return f?{...u,end1:f.end1,end2:f.end2}:u})},s=Jn(r,t,Te);for(const u of l){const f=s.add.find(p=>{var m;return((m=p.derivedFrom)==null?void 0:m.associationRef)===u.assocId});f&&(u.end2.attributeRef=f.modelId)}for(const u of l)i.push(Pt(u.ownerId,u.dispId)),i.push(Yo(u.assocId,{end1:u.end1,end2:u.end2}));i.push(...Ti(t,s));const c=bd(r,t,s);return i.push(...Ln(c,t)),i}function z_(e,t){const o=e.entities.find(l=>l.modelId===t);if(!o)return[];const i=[],a=l=>l&&l.charAt(0).toLowerCase()+l.slice(1);for(const l of e.associations){if(l.end1.entityRef===l.end2.entityRef)continue;const r=l.end1.entityRef===t,s=l.end2.entityRef===t;if(!r&&!s)continue;const c=r?l.end2.entityRef:l.end1.entityRef,d=e.entities.find(y=>y.modelId===c);if(!d||d.attributes.some(y=>{var $;return(($=y.embedded)==null?void 0:$.associationRef)===l.modelId}))continue;const u=Te(),f=d.attributes.reduce((y,$)=>Math.max(y,$.order),-1)+1,p=new Set(d.attributes.map(y=>y.name)),m=a(o.name);let h=m;for(let y=2;p.has(h);y++)h=`${m}${y}`;const b=o.attributes.filter(y=>!y.identifier&&!y.derivedFrom).flatMap(y=>y.dbAttrs).map(y=>({...y,modelId:Te()})),g={modelId:u,name:h,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:f,dbAttrs:b,embedded:{associationRef:l.modelId,embeddableRef:t}};i.push(It(c,g));const _=r?"end2":"end1",N=r?"end1":"end2";i.push(Yo(l.modelId,{identifying:!1,[_]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Te()},[N]:{entityRef:t,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function U_(e=gd(),t={}){var ve,Ee;const o=n.reactive(e);let i=new ga(o);const a=n.ref(t.embeddableCatalog??[]),l=n.ref(t.groupCodeCatalog??[]),r=n.ref(t.predefinedCustomTypeCatalog??[]),s=n.ref(t.languages??["ko","en","ja","zh"]),c=n.ref(t.userLanguage??"ko"),d=n.ref(t.reservedWords),u=n.ref(t.selectableDataTypes),f=n.ref(t.largeEntityThreshold),p=n.ref(t.flagEntitiesWithoutRelations??!1),m=n.ref(!1),h=n.ref(!1),b=n.ref(!1),g=n.ref(0),_=n.ref(((ve=t.meta)==null?void 0:ve.schemaVersion)??1),N=n.ref(((Ee=t.meta)==null?void 0:Ee.opWriteEnabled)??!1),y=n.computed(()=>_.value>=2&&N.value),$=t.historyTransport,K=n.computed(()=>y.value&&$!==void 0),F=t.restoreTransport,q=n.ref(0),G=n.computed(()=>y.value&&Q.value&&F!==void 0);async function X(w){if(!F||!Q.value)return{ok:!1,reason:"unavailable"};const x=await F(w);return x.ok&&q.value++,x}const Q=n.ref(!(_.value>=2&&N.value===!1)),de=n.ref("LOGICAL_PHYSICAL"),B=n.ref("straight"),ee=n.ref(!0),v=n.ref(!0),R=n.ref(null),E=n.computed(()=>{var w;return((w=R.value)==null?void 0:w.kind)==="attribute"?{entityId:R.value.entityId,attrId:R.value.anchor}:null}),P=n.computed(()=>{var w;return((w=R.value)==null?void 0:w.kind)==="attribute"?R.value.ids:[]}),W=n.computed(()=>{var w,x;return((w=R.value)==null?void 0:w.kind)==="entity"?R.value.id:((x=R.value)==null?void 0:x.kind)==="attribute"?R.value.entityId:null}),oe=n.ref(null);let T=0;const J=n.ref(null),se=n.ref(null);let he=t.meta;function we(){i.onChange(()=>{m.value=i.canUndo,h.value=i.canRedo,b.value=i.isDirty,g.value++})}we();let re=null,me=null;function be(){me==null||me(),me=null,re=null}function xe(){if(be(),!y.value||!t.opTransport)return;const w=new Kr({diagramId:o.layout.diagramId,state:o,transport:t.opTransport,origin:"gui",onFreeze:x=>{Q.value=!1,se.value=x},onError:t.onOpError});w.seed((he==null?void 0:he.revSeed)??{}),me=w.attach(i),re=w}xe();const Ce=n.computed(()=>Hl(o.logical,o.layout)),Se=n.computed(()=>({reservedWords:d.value,selectableDataTypes:u.value,largeEntityThreshold:f.value,flagEntitiesWithoutRelations:p.value,embeddableCatalog:a.value})),ye=n.computed(()=>or(o.logical,Se.value)),Y=n.computed(()=>{const w=new Map;for(const x of ye.value){if(!x.targetRef)continue;const j=w.get(x.targetRef);j?j.push(x):w.set(x.targetRef,[x])}return w}),C=w=>{Q.value&&i.execute(w)},k=w=>o.layout.entityLayouts.some(x=>x.entityRef===w&&!!x.locked),V=w=>o.layout.groupLayouts.some(x=>x.groupRef===w&&!!x.locked),H=w=>{const x=o.logical.associations.find(j=>j.modelId===w);return!!x&&(k(x.end1.entityRef)||k(x.end2.entityRef))},te=(w,x,j)=>{if(k(w))return;const le=tn(w,x,j),_e=On(o.logical,w,U=>U.map(M=>M.modelId===x?{...M,...j}:M)),O=Ln(_e,w);C(O.length?ze("속성 수정",[le,...O]):le)};function ne(w){const x=w.map(pe=>o.layout.entityLayouts.find(S=>S.entityRef===pe)).filter(pe=>!!pe);if(!x.length)return{location:{x:40,y:40},size:{width:400,height:300}};let j=1/0,le=1/0,_e=-1/0,O=-1/0;for(const pe of x){const S=pe.geo.size.width||220,D=pe.geo.size.height||140;j=Math.min(j,pe.geo.location.x),le=Math.min(le,pe.geo.location.y),_e=Math.max(_e,pe.geo.location.x+S),O=Math.max(O,pe.geo.location.y+D)}const U=40,M=28;return{location:{x:j-U,y:le-U-M},size:{width:_e-j+U*2,height:O-le+U*2+M}}}function ge(w,x,j){var pe;const le=o.layout.groupLayouts.find(S=>S.groupRef===w),_e=(le==null?void 0:le.geo.location)??x,O=x.x-_e.x,U=x.y-_e.y,M=[gr(w,x),...j.map(S=>Nn(S.id,S.location))];if(O||U){const S=new Set(((pe=o.logical.groups.find(D=>D.modelId===w))==null?void 0:pe.memberEntityRefs)??[]);for(const D of o.logical.associations){if(!S.has(D.end1.entityRef)||!S.has(D.end2.entityRef))continue;const I=o.layout.associationLayouts.find(L=>L.associationRef===D.modelId);I&&I.waypoints.length&&M.push(Vr(D.modelId,O,U))}for(const D of(le==null?void 0:le.memberNoteRefs)??[]){const I=o.layout.notes.find(L=>L.modelId===D);I&&M.push(Zn(D,{x:I.geo.location.x+O,y:I.geo.location.y+U}))}}return M}return{state:o,resolved:Ce,issues:ye,issuesByRef:Y,flagEntitiesWithoutRelations:p,canUndo:m,canRedo:h,dirty:b,revision:g,editable:Q,schemaVersion:_,opWriteEnabled:N,opMode:y,opConflict:se,historyTransport:$,historyAvailable:K,restoreTransport:F,restoreAvailable:G,restoreToSeq:X,reloadRequest:q,displayMode:de,routingMode:B,showGrid:ee,showMinimap:v,selection:R,selectedAttr:E,selectedAttrIds:P,inspectedEntityId:W,focusRequest:oe,clipboard:J,embeddableCatalog:a,groupCodeCatalog:l,predefinedCustomTypeCatalog:r,languages:s,userLanguage:c,selectableDataTypes:u,setEditable(w){Q.value=w&&y.value},setEmbeddableCatalog(w){a.value=w},setGroupCodeCatalog(w){l.value=w},setPredefinedCustomTypeCatalog(w){r.value=w},selectAttribute(w,x,j="replace"){const le=R.value,_e=(le==null?void 0:le.kind)==="attribute"&&le.entityId===w;if(j==="replace"||!_e){R.value={kind:"attribute",entityId:w,ids:[x],anchor:x};return}if(j==="toggle"){const I=le.ids.includes(x),L=I?le.ids.filter(ue=>ue!==x):[...le.ids,x];if(!L.length){R.value=null;return}const ie=I&&le.anchor===x?L[L.length-1]:I?le.anchor:x;R.value={kind:"attribute",entityId:w,ids:L,anchor:ie};return}const O=o.logical.entities.find(I=>I.modelId===w),U=[...(O==null?void 0:O.attributes)??[]].sort((I,L)=>I.order-L.order).map(I=>I.modelId),M=U.indexOf(le.anchor),pe=U.indexOf(x);if(M<0||pe<0){R.value={kind:"attribute",entityId:w,ids:[x],anchor:x};return}const[S,D]=M<=pe?[M,pe]:[pe,M];R.value={kind:"attribute",entityId:w,ids:U.slice(S,D+1),anchor:le.anchor}},moveAttributeFocus(w){const x=R.value;if((x==null?void 0:x.kind)!=="attribute")return!1;const j=o.logical.entities.find(U=>U.modelId===x.entityId);if(!j||!j.attributes.length)return!1;const le=j.attributes.findIndex(U=>U.modelId===x.anchor);if(le<0)return!1;const _e=Math.min(Math.max(le+w,0),j.attributes.length-1);if(_e===le)return!0;const O=j.attributes[_e].modelId;return R.value={kind:"attribute",entityId:x.entityId,ids:[O],anchor:O},!0},nudgeSelectedAttributes(w){const x=R.value;if((x==null?void 0:x.kind)!=="attribute")return!1;const j=o.logical.entities.find(I=>I.modelId===x.entityId);if(!j)return!1;const le=j.attributes,_e=new Set(x.ids),O=le.map((I,L)=>_e.has(I.modelId)?L:-1).filter(I=>I>=0);if(!O.length)return!1;const U=Math.min(...O),M=le.filter(I=>!_e.has(I.modelId)),pe=le.slice(0,U).filter(I=>!_e.has(I.modelId)).length;let S;if(w<0){if(pe<=0)return!0;S=pe-1}else{if(M.length-pe<=0)return!0;S=pe+1}if(k(x.entityId))return!0;const D=le.filter(I=>_e.has(I.modelId)).map(I=>I.modelId);return C(Ea(x.entityId,D,S)),!0},deleteSelection(){if(!Q.value)return!1;const w=R.value;if(!w)return!1;if(w.kind==="attribute"){if(k(w.entityId))return!1;const x=w.ids;if(!x.length)return!1;x.length===1?C(Pt(w.entityId,x[0])):C(ze("속성 삭제",x.map(j=>Pt(w.entityId,j))))}else if(w.kind==="entity"){if(k(w.id))return!1;C(_a(w.id))}else if(w.kind==="note")C(xa(w.id));else if(w.kind==="group"){if(V(w.id))return!1;C(ka(w.id))}else C($a(w.id));return R.value=null,!0},nudgeNodes(w,x,j){if(!w.length||x===0&&j===0)return!1;const le=new Set(o.logical.entities.map(S=>S.modelId)),_e=new Set(o.logical.groups.map(S=>S.modelId)),O=new Set(o.layout.notes.map(S=>S.modelId)),U=new Set;for(const S of w){if(!_e.has(S))continue;const D=o.logical.groups.find(I=>I.modelId===S);for(const I of(D==null?void 0:D.memberEntityRefs)??[])U.add(I)}const M=[],pe=[];for(const S of w)if(_e.has(S)){if(V(S))continue;const D=o.layout.groupLayouts.find(ue=>ue.groupRef===S);if(!D)continue;const I=o.logical.groups.find(ue=>ue.modelId===S),L=((I==null?void 0:I.memberEntityRefs)??[]).map(ue=>{var A;const fe=((A=o.layout.entityLayouts.find(Z=>Z.entityRef===ue))==null?void 0:A.geo.location)??{x:0,y:0};return{id:ue,location:{x:fe.x+x,y:fe.y+j}}}),ie={x:D.geo.location.x+x,y:D.geo.location.y+j};M.push(ze("그룹 이동",ge(S,ie,L))),pe.push("g:"+S)}else if(le.has(S)){if(U.has(S)||k(S))continue;const D=o.layout.entityLayouts.find(I=>I.entityRef===S);if(!D)continue;M.push(Nn(S,{x:D.geo.location.x+x,y:D.geo.location.y+j})),pe.push("e:"+S)}else if(O.has(S)){const D=o.layout.notes.find(I=>I.modelId===S);if(!D)continue;M.push(Zn(S,{x:D.geo.location.x+x,y:D.geo.location.y+j})),pe.push("n:"+S)}return M.length?(C(ze("이동",M,"nudge:"+pe.sort().join(","))),!0):!1},requestFocus(w){oe.value={id:w,nonce:++T}},undo:()=>{Q.value&&i.undo()},redo:()=>{Q.value&&i.redo()},markSaved:()=>{Q.value&&(re==null||re.flush(),i.markSavePoint())},loadDiagram(w,x){be(),o.logical=w.logical,o.layout=w.layout,i=new ga(o),we(),_.value=(x==null?void 0:x.schemaVersion)??1,N.value=(x==null?void 0:x.opWriteEnabled)??!1,Q.value=!(_.value>=2&&N.value===!1),he=x,se.value=null,R.value=null,m.value=i.canUndo,h.value=i.canRedo,b.value=i.isDirty,xe()},flush(){re==null||re.flush()},whenOpsSettled(){return(re==null?void 0:re.whenSettled())??Promise.resolve()},addEntity(w="NewEntity",x={x:80,y:80}){const j=Te(),le={modelId:j,name:w,stereotype:"JPA_ENTITY",table:{physicalName:w.toLowerCase()},attributes:[{modelId:Te(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Te(),physicalName:"id",dataType:"BIGINT"}]}]};return C(ba(le,{location:{...x},size:{width:220,height:140}})),j},renameEntity(w,x){k(w)||C(dr(w,x))},updateEntity(w,x){if(k(w))return;const j=cr(w,x),le=o.logical.entities.find(U=>U.modelId===w),_e=x.stereotype==="JPA_EMBEDDABLE"&&!!le&&le.stereotype!=="JPA_EMBEDDABLE",O=!!x.stereotype&&x.stereotype!=="JPA_EMBEDDABLE"&&!!le&&le.stereotype==="JPA_EMBEDDABLE";if(_e&&le){const U=le.attributes.filter(I=>I.identifier&&!I.derivedFrom).map(I=>tn(w,I.modelId,{identifier:!1})),M=On({...o.logical,entities:o.logical.entities.map(I=>I.modelId===w?{...I,stereotype:"JPA_EMBEDDABLE"}:I)},w,I=>I.map(L=>L.identifier&&!L.derivedFrom?{...L,identifier:!1}:L)),pe=yl(M,w),S=z_(o.logical,w),D=[j,...U,...pe,...S];C(D.length>1?ze("임베더블 변환",D):j);return}if(O){const U=P_(o.logical,w),M=[j,...U];C(M.length>1?ze("엔터티 전환",M):j);return}C(j)},moveEntity(w,x){k(w)||C(Nn(w,x))},resizeEntity(w,x){k(w)||C(ur(w,x))},removeEntity(w){k(w)||C(_a(w))},setEntitySwatch(w,x){C(fr(w,x))},setEntityCollapsed(w,x){C(mr(w,x))},setEntityLocked(w,x){C(pr(w,x))},isEntityLocked(w){return k(w)},collapseAll(){C(wa(!0))},expandAll(){C(wa(!1))},setAttributeSwatch(w,x,j){C(Fo(w,x,j))},dragGroup(w,x,j){V(w)||C(ze("그룹 이동",ge(w,x,j)))},resizeGroup(w,x){V(w)||C(br(w,x))},setGroupSwatch(w,x){C(_r(w,x))},setGroupLocked(w,x){C(wr(w,x))},isGroupLocked(w){return V(w)},updateGroup(w,x){V(w)||C(hr(w,x))},createGroup(w,x){if(!w.length)return null;const j=[];for(const O of o.logical.groups)for(const U of w)O.memberEntityRefs.includes(U)&&j.push(Go(O.modelId,U));const le=Te(),_e={modelId:le,name:x?{ko:x}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...w]};return j.push(va(_e,ne(w))),C(ze("그룹 생성",j)),R.value=null,le},addEmptyGroup(w,x){const j=Te();return C(va({modelId:j,name:x?{ko:x}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...w},size:{width:360,height:260}})),j},removeGroup(w){V(w)||C(ka(w))},dropEntity(w,x,j){var O;if(k(w))return;const le=((O=o.logical.groups.find(U=>U.memberEntityRefs.includes(w)))==null?void 0:O.modelId)??null,_e=[Nn(w,x)];le!==j&&(le&&_e.push(Go(le,w)),j&&_e.push(yr(j,w))),C(ze("이동",_e))},ungroupEntity(w){const x=o.logical.groups.find(j=>j.memberEntityRefs.includes(w));x&&C(Go(x.modelId,w))},dropNote(w,x,j){var O;const le=((O=o.layout.groupLayouts.find(U=>{var M;return(M=U.memberNoteRefs)==null?void 0:M.includes(w)}))==null?void 0:O.groupRef)??null,_e=[Zn(w,x)];le!==j&&(le&&_e.push(Pr(le,w)),j&&_e.push(Lr(j,w))),C(ze("이동",_e))},addPredefinedEmbed(w,x){if(k(w))return;const j=a.value.find(pe=>pe.type===x),le=o.logical.entities.find(pe=>pe.modelId===w);if(!j||!le)return;const _e=le.attributes.reduce((pe,S)=>Math.max(pe,S.order),-1)+1,O=Te(),U=j.fields.map(()=>({modelId:Te(),physicalName:"",dataType:""})),M={modelId:O,name:j.defaultName,type:j.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:_e,dbAttrs:U};return C(It(w,M)),O},addAttribute(w,x={}){if(k(w))return x.modelId??"";const j=o.logical.entities.find(D=>D.modelId===w),le=j?j.attributes.length:0,_e=x.modelId??Te(),O=x.name??`field${le}`,U={modelId:_e,name:O,type:x.type??da,attrType:x.attrType??"NORMAL",identifier:x.identifier??!1,notNull:x.notNull??!1,order:le,dbAttrs:x.dbAttrs??[{modelId:Te(),physicalName:O,dataType:"VARCHAR",length:255}],...x},M=It(w,U),pe=On(o.logical,w,D=>[...D,U]),S=Ln(pe,w);return C(S.length?ze("속성 추가",[M,...S]):M),_e},addDivider(w){if(k(w))return"";const x=o.logical.entities.find(O=>O.modelId===w),j=x?x.attributes.length:0,le=Te();return C(It(w,{modelId:le,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:j,dbAttrs:[]})),le},updateAttribute(w,x,j){te(w,x,j)},setAttributeGroupCode(w,x,j){te(w,x,{groupCode:j,type:j?Yn:da})},setEmbedColumns(w,x,j){var pe,S;if(k(w))return;const le=tn(w,x,{dbAttrs:j}),_e=(pe=o.logical.entities.find(D=>D.modelId===w))==null?void 0:pe.attributes.find(D=>D.modelId===x),O=(S=_e==null?void 0:_e.embedded)==null?void 0:S.associationRef,U=O?o.logical.associations.find(D=>D.modelId===O):void 0,M=[];U&&O&&(U.end1.legacyEmbedRaw&&M.push($n(O,"end1",{legacyEmbedRaw:void 0})),U.end2.legacyEmbedRaw&&M.push($n(O,"end2",{legacyEmbedRaw:void 0}))),C(M.length?ze("임베드 컬럼 수정",[le,...M]):le)},removeAttribute(w,x){if(k(w))return;const j=Pt(w,x),le=On(o.logical,w,O=>O.filter(U=>U.modelId!==x)),_e=Ln(le,w);C(_e.length?ze("속성 삭제",[j,..._e]):j)},removeAttributes(w,x){var U;if(!x.length||k(w))return;const j=x.map(M=>Pt(w,M)),le=new Set(x),_e=On(o.logical,w,M=>M.filter(pe=>!le.has(pe.modelId))),O=[...j,...Ln(_e,w)];C(O.length===1?O[0]:ze("속성 삭제",O)),((U=R.value)==null?void 0:U.kind)==="attribute"&&R.value.entityId===w&&(R.value=null)},setAttributeSwatches(w,x,j){x.length&&(x.length===1?C(Fo(w,x[0],j)):C(ze("속성 색상",x.map(le=>Fo(w,le,j)))))},reorderAttributes(w,x,j){!x.length||k(w)||C(Ea(w,x,j))},addIndex(w,x){k(w)||C(xr(w,x))},updateIndex(w,x,j){k(w)||C(Ir(w,x,j))},removeIndex(w,x){k(w)||C(Sr(w,x))},addOperation(w,x={}){var U;if(k(w))return x.modelId??"";const j=o.logical.entities.find(M=>M.modelId===w),le=((U=j==null?void 0:j.operations)==null?void 0:U.length)??0,_e=x.modelId??Te(),O={modelId:_e,name:x.name??`method${le}`,visibility:x.visibility??"PACKAGE",order:le,...x};return C(vr(w,O)),_e},updateOperation(w,x,j){k(w)||C(kr(w,x,j))},removeOperation(w,x){k(w)||C(Er(w,x))},reorderOperations(w,x,j){!x.length||k(w)||C(Nr(w,x,j))},setOperationSwatch(w,x,j){C($r(w,x,j))},addAssociation(w,x,j,le){if(k(w)||k(x))return"";const _e=Te(),O={modelId:_e,end1:{entityRef:w,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:j},end2:{entityRef:x,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},U={...o.logical,associations:[...o.logical.associations,O]},M=Jn(U,x,Te),pe=M.add[0];pe&&(O.end2.attributeRef=pe.modelId);const S={associationRef:_e,waypoints:[],sourceColumnRef:j,targetColumnRef:(pe==null?void 0:pe.modelId)??le},D=Na(O,S),I=Ti(x,M);return C(I.length?ze("관계 추가",[D,...I]):D),_e},addEmbedAssociation(w,x){if(k(w))return;const j=o.logical.entities.find(A=>A.modelId===w),le=o.logical.entities.find(A=>A.modelId===x);if(!j||!le||le.stereotype!=="JPA_EMBEDDABLE")return;const _e=Te(),O=Te(),U=Te(),M=j.attributes.reduce((A,Z)=>Math.max(A,Z.order),-1)+1,pe=_d(le),S=A=>A&&A.charAt(0).toLowerCase()+A.slice(1),D=new Set(j.attributes.map(A=>A.name)),I=S(le.name);let L=I;for(let A=2;D.has(L);A++)L=`${I}${A}`;const ie={modelId:O,name:L,type:le.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:M,dbAttrs:pe,embedded:{associationRef:_e,embeddableRef:x}},ue={modelId:_e,end1:{entityRef:w,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:U},end2:{entityRef:x,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:O}},fe={associationRef:_e,waypoints:[],sourceColumnRef:O,targetColumnRef:void 0};return C(ze("임베드 추가",[It(w,ie),Na(ue,fe)])),_e},setEmbedCollectionMode(w,x){if(H(w))return;const j=o.logical.associations.find(S=>S.modelId===w);if(!j)return;let le,_e;for(const S of o.logical.entities){const D=S.attributes.find(I=>{var L;return((L=I.embedded)==null?void 0:L.associationRef)===w&&I.attrType==="EMBED_OWN"});if(D){le=S.modelId,_e=D;break}}if(!le||!_e)return;const O=_e.embedded.embeddableRef,U=j.end2.entityRef===O?"end2":"end1",M=j[U],pe=M.multiplicity!=="EXACTLY_ONE_INSTANCE";if(!(x==="COLLECTION"?pe:!pe))if(x==="COLLECTION")C(ze("임베드 컬렉션 전환",[tn(le,_e.modelId,{dbAttrs:[]}),$n(w,U,{multiplicity:"ZERO_OR_MORE_INSTANCES",jpa:{...M.jpa,collectionType:"LIST"}})]));else{const S=o.logical.entities.find(D=>D.modelId===O);if(!S)return;C(ze("임베드 단일 전환",[tn(le,_e.modelId,{dbAttrs:_d(S)}),$n(w,U,{multiplicity:"EXACTLY_ONE_INSTANCE",jpa:{...M.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(w){if(H(w))return;const x=o.logical.associations.find(U=>U.modelId===w),j=$a(w);if(!x){C(j);return}for(const U of o.logical.entities){const M=U.attributes.find(pe=>{var S;return((S=pe.embedded)==null?void 0:S.associationRef)===w});if(M){C(ze("임베드 삭제",[j,Pt(U.modelId,M.modelId)]));return}}const le=x.end2.entityRef,_e={...o.logical,associations:o.logical.associations.filter(U=>U.modelId!==w)},O=yl(_e,le);C(O.length?ze("관계 삭제",[j,...O]):j)},setAssociationIdentifying(w,x){if(H(w))return;const j=o.logical.associations.find(M=>M.modelId===w),le=Yo(w,{identifying:x});if(!j||j.identifying===x){C(le);return}const _e=j.end2.entityRef,O={...o.logical,associations:o.logical.associations.map(M=>M.modelId===w?{...M,identifying:x}:M)},U=yl(O,_e);C(U.length?ze("식별 관계 변경",[le,...U]):le)},updateAssociationEnd(w,x,j){H(w)||C($n(w,x,j))},moveWaypoint(w,x,j){C(Cr(w,x,j))},addWaypoint(w,x,j){C(Tr(w,x,j))},removeWaypoint(w,x){C(Rr(w,x))},clearWaypoints(w){C(Ar(w))},addNote(w="메모",x={x:80,y:80}){const j=Te();return C(Mr({modelId:j,memo:w,geo:{location:{...x},size:{width:200,height:120}}})),j},removeNote(w){C(xa(w))},moveNote(w,x){C(Zn(w,x))},resizeNote(w,x){C(Br(w,x))},setNoteMemo(w,x){C(Dr(w,x))},setNoteSwatch(w,x){C(Or(w,x))},addNoteConnection(w,x){C(zr(w,x))},removeNoteConnection(w,x){C(Ur(w,x))},moveNoteConnectionWaypoint(w,x,j,le){C(Hr(w,x,j,le))},addNoteConnectionWaypoint(w,x,j,le){C(Fr(w,x,j,le))},removeNoteConnectionWaypoint(w,x,j){C(Gr(w,x,j))},clearNoteConnectionWaypoints(w,x){C(Yr(w,x))},autoLayout(){const w=Yl(o.logical,o.layout);w.length&&C(ze("자동 배치",w.map(x=>Nn(x.id,x.location))))},copy(){const w=R.value;if((w==null?void 0:w.kind)==="attribute"){const O=o.logical.entities.find(M=>M.modelId===w.entityId);if(!O)return;const U=[...O.attributes].sort((M,pe)=>M.order-pe.order).filter(M=>w.ids.includes(M.modelId));if(!U.length)return;J.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:U}));return}const x=W.value;if(!x)return;const j=o.logical.entities.find(O=>O.modelId===x),le=o.layout.entityLayouts.find(O=>O.entityRef===x);if(!j)return;const _e=(le==null?void 0:le.geo)??{location:{x:80,y:80},size:{width:220,height:140}};J.value=JSON.parse(JSON.stringify({kind:"entity",entity:j,geo:_e}))},paste(){if(!Q.value)return;const w=J.value;if(!w)return;if(w.kind==="attribute"){const le=W.value;if(!le)return;const _e=o.logical.entities.find(D=>D.modelId===le);if(!_e)return;const O=new Set(_e.attributes.map(D=>D.name)),U=new Set(_e.attributes.flatMap(D=>D.dbAttrs.map(I=>I.physicalName))),M=_e.attributes.length,pe=[],S=w.attributes.map((D,I)=>{const L=JSON.parse(JSON.stringify(D));L.modelId=Te();for(const ie of L.dbAttrs)ie.modelId=Te();O.has(L.name)&&(L.name=`${L.name}_copy`);for(const ie of L.dbAttrs)ie.physicalName&&U.has(ie.physicalName)&&(ie.physicalName=`${ie.physicalName}_copy`);return L.order=M+I,pe.push(L.modelId),It(le,L)});C(S.length===1?S[0]:ze("속성 붙여넣기",S)),R.value={kind:"attribute",entityId:le,ids:pe,anchor:pe[pe.length-1]};return}const x=L_(w.entity),j={location:{x:w.geo.location.x+40,y:w.geo.location.y+40},size:{...w.geo.size}};C(ba(x,j)),R.value={kind:"entity",id:x.modelId}}}}const Mi=Symbol("groupHover"),wd=Symbol("groupDrag"),Pn=Symbol("relationHighlight"),H_={key:0,class:"em-sel","aria-hidden":"true"},F_=["title","aria-expanded","disabled"],G_={class:"em-entity__stereotype"},Y_={key:1,class:"em-entity__name"},W_=["data-attr","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],K_=["onPointerdown"],q_={key:1,class:"em-entity__divider-label"},X_=["title"],j_={class:"em-key-slot"},Z_={class:"em-key-slot"},J_={key:0,class:"em-entity__type"},Q_=["onClick"],ew={class:"em-entity__attrname"},tw={class:"em-entity__type"},nw=["data-op"],ow=["onPointerdown"],iw={class:"em-entity__op-vis","aria-hidden":"true"},aw=["title"],lw={key:4,class:"em-entity__footer"},vd=Le(n.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(hn,null),i=ae.useModal();function a(){o&&Ai(i,o,t.id)}const l=n.inject(Mi,null),r=n.inject(Pn,null),s=n.computed(()=>!!o&&o.editable.value);function c(){l&&(l.value=t.data.groupRef??null)}function d(){r==null||r.setEntityHover(t.id)}function u(){r==null||r.setEntityHover(null)}const f=n.computed(()=>!!r&&r.primaryEntityIds.value.has(t.id)),p=n.computed(()=>!!r&&r.relatedEntityIds.value.has(t.id)&&!f.value),m=n.computed(()=>{var I;return((I=o==null?void 0:o.selection.value)==null?void 0:I.kind)==="entity"&&o.selection.value.id===t.id}),h=n.computed(()=>!!t.selected&&!m.value),b=n.computed(()=>{var I;return o&&((I=o.selectedAttr.value)==null?void 0:I.entityId)===t.id?new Set(o.selectedAttrIds.value):new Set}),g=n.computed(()=>b.value.size>0);function _(I,L){const ie=L.shiftKey?"range":L.metaKey||L.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(t.id,I.modelId,ie)}const N=n.computed(()=>!!r&&r.active.value&&!r.relatedEntityIds.value.has(t.id)&&!m.value),y=n.computed(()=>t.data.entity),$=n.computed(()=>t.data.displayMode??"LOGICAL_PHYSICAL"),K=n.computed(()=>t.data.collapsed??!1),F=n.computed(()=>t.data.locked??!1);function q(){s.value&&(o==null||o.setEntityCollapsed(t.id,!K.value))}const G=n.computed(()=>$.value==="PHYSICAL"||$.value==="LOGICAL_PHYSICAL"),X=n.computed(()=>{const I=$.value==="PHYSICAL"||$.value==="LOGICAL_PHYSICAL",L={};for(const ie of y.value.attributes){const ue=ie.attrType.startsWith("RELATION")&&ie.dbAttrs.length>0;L[ie.modelId]={pk:ie.identifier,fk:ue&&I,required:ie.notNull&&!ie.identifier}}return L});function Q(I){if(!I)return"";const L=[];return I.pk&&I.fk?L.push("PFK (식별 외래키)"):I.pk?L.push("PK (기본키)"):I.fk&&L.push("FK (외래키)"),I.required&&L.push("필수 (NOT NULL)"),L.join(" · ")}const de=n.computed(()=>{const I=ml(Qe(t.data.style)),L={};return I&&(L["--em-header-bg"]=I.bar,L["--em-header-fg"]=I.barOn),L});function B(I){var L,ie;return(ie=ml(Qe((L=t.data.attributeStyles)==null?void 0:L[I.modelId])))==null?void 0:ie.text}const ee=n.computed(()=>[...y.value.operations??[]].sort((I,L)=>I.order-L.order)),v=n.computed(()=>$.value==="CLASS"&&ee.value.length>0),R={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function E(I){return I?R[I]:"~"}function P(I){var L,ie;return(ie=ml(Qe((L=t.data.operationStyles)==null?void 0:L[I.modelId])))==null?void 0:ie.text}function W(I,L,ie){switch($.value){case"CLASS":return[{text:I}];case"PHYSICAL":return[{text:ie||I}];case"LOGICAL":return[L?{text:L}:{text:"(논리명)",missing:!0}];default:{const ue=L?{text:L}:{text:"(논리명)",missing:!0};return ie?[ue,{text:` · ${ie}`}]:[ue]}}}function oe(I){var L,ie,ue;return T(I)?[{text:I.name}]:W(I.name,(ie=(L=I.dbAttrs[0])==null?void 0:L.logicalName)==null?void 0:ie.ko,((ue=I.dbAttrs[0])==null?void 0:ue.physicalName)??"")}function T(I){return I.attrType.startsWith("EMBED")&&I.dbAttrs.length>0}function J(I){return I.attrType==="DIVIDER"}function se(I){if(I.attrType!=="EMBED_PREDEF")return I.dbAttrs;const L=o==null?void 0:o.embeddableCatalog.value.find(ue=>ue.type===I.type);if(!L)return I.dbAttrs;const ie=Wn(y.value.attributes.flatMap(ue=>ue.dbAttrs));return I.dbAttrs.map((ue,fe)=>{const A=L.fields[fe],Z=Po(ue,ie);return Z?{...ue,physicalName:Z.physicalName,logicalName:ue.logicalName??(A==null?void 0:A.logicalName),dataType:ue.dataType||(A==null?void 0:A.dataType)||""}:A?{...ue,physicalName:ue.physicalName||A.physicalName,logicalName:ue.logicalName??A.logicalName,dataType:ue.dataType||A.dataType,length:ue.length??A.length}:ue})}function he(I){var L;return W(I.physicalName,(L=I.logicalName)==null?void 0:L.ko,I.physicalName)}function we(I){const L=tr(I,(o==null?void 0:o.state.logical.associations)??[]);return fa($.value,I,L)}const re=n.computed(()=>{var I,L,ie;return W(y.value.name,(L=(I=y.value.table)==null?void 0:I.logicalName)==null?void 0:L.ko,((ie=y.value.table)==null?void 0:ie.physicalName)??"")}),me=n.ref(!1),be=n.ref(""),xe=n.ref(null);async function Ce(){var I,L;s.value&&(be.value=y.value.name,me.value=!0,await n.nextTick(),(I=xe.value)==null||I.focus(),(L=xe.value)==null||L.select())}function Se(){if(!me.value)return;me.value=!1;const I=be.value.trim();I&&I!==y.value.name&&(o==null||o.renameEntity(t.id,I))}function ye(){o==null||o.addAttribute(t.id)}function Y(){o==null||o.addDivider(t.id)}const{screenToFlowCoordinate:C,findNode:k}=De(),V=n.ref(null),H=n.computed(()=>{const I=V.value??t.data.size;return I?{width:`${I.width}px`,minHeight:`${I.height}px`}:void 0});let te=null;function ne(I){var ue,fe,A;if(!s.value)return;I.stopPropagation();const L=(ue=k(t.id))==null?void 0:ue.dimensions,ie=C({x:I.clientX,y:I.clientY});te={fx:ie.x,fy:ie.y,w:(L==null?void 0:L.width)??((fe=t.data.size)==null?void 0:fe.width)??200,h:(L==null?void 0:L.height)??((A=t.data.size)==null?void 0:A.height)??120},I.target.setPointerCapture(I.pointerId)}function ge(I){if(!te)return;const L=C({x:I.clientX,y:I.clientY});V.value={width:Math.max(40,te.w+(L.x-te.fx)),height:Math.max(40,te.h+(L.y-te.fy))}}function ve(I){var L,ie,ue;if(te&&V.value&&o){const fe=(L=k(t.id))==null?void 0:L.dimensions;o.resizeEntity(t.id,{width:Math.round((fe==null?void 0:fe.width)??V.value.width),height:Math.round((fe==null?void 0:fe.height)??V.value.height)})}te=null,V.value=null,(ue=(ie=I.target).releasePointerCapture)==null||ue.call(ie,I.pointerId)}const Ee=n.ref(null),w=n.ref(null);function x(I,L){if(!s.value)return;L.stopPropagation(),L.preventDefault();const ie=b.value,ue=ie.has(I.modelId)?new Set(ie):new Set([I.modelId]);w.value={ids:ue,dropIndex:-1,lineY:0},L.target.setPointerCapture(L.pointerId)}function j(I){if(!w.value||!Ee.value)return;const L=Array.from(Ee.value.querySelectorAll(".em-entity__row"));if(!L.length)return;let ie=L.length;for(let A=0;A<L.length;A++){const Z=L[A].getBoundingClientRect();if(I.clientY<Z.top+Z.height/2){ie=A;break}}const ue=L[L.length-1],fe=ie<L.length?L[ie].offsetTop:ue.offsetTop+ue.offsetHeight;w.value={...w.value,dropIndex:ie,lineY:fe}}function le(){const I=w.value;if(w.value=null,!I||I.dropIndex<0)return;const L=y.value.attributes,ie=L.filter(z=>I.ids.has(z.modelId)).map(z=>z.modelId),ue=L.filter((z,ce)=>I.ids.has(z.modelId)&&ce<I.dropIndex).length,fe=I.dropIndex-ue,A=L.filter(z=>!I.ids.has(z.modelId)).map(z=>z.modelId);[...A.slice(0,fe),...ie,...A.slice(fe)].join(",")!==L.map(z=>z.modelId).join(",")&&(o==null||o.reorderAttributes(t.id,ie,fe))}function _e(){w.value=null}const O=n.ref(null),U=n.ref(null);function M(I,L){s.value&&(L.stopPropagation(),L.preventDefault(),U.value={id:I.modelId,dropIndex:-1,lineY:0},L.target.setPointerCapture(L.pointerId))}function pe(I){if(!U.value||!O.value)return;const L=Array.from(O.value.querySelectorAll(".em-entity__op-row"));if(!L.length)return;let ie=L.length;for(let A=0;A<L.length;A++){const Z=L[A].getBoundingClientRect();if(I.clientY<Z.top+Z.height/2){ie=A;break}}const ue=L[L.length-1],fe=ie<L.length?L[ie].offsetTop:ue.offsetTop+ue.offsetHeight;U.value={...U.value,dropIndex:ie,lineY:fe}}function S(){const I=U.value;if(U.value=null,!I||I.dropIndex<0)return;const ie=ee.value.findIndex(fe=>fe.modelId===I.id);if(ie<0)return;const ue=I.dropIndex-(ie<I.dropIndex?1:0);ue!==ie&&(o==null||o.reorderOperations(t.id,[I.id],ue))}function D(){U.value=null}return(I,L)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-entity",{"is-hover-origin":f.value,"is-related":p.value,"is-dimmed":N.value,"is-selected":m.value,"is-multi-selected":h.value,"has-focused-attr":g.value,"is-locked":F.value}]),style:n.normalizeStyle(H.value),onPointerdown:c,onMouseenter:d,onMouseleave:u,onDblclick:a},[m.value?(n.openBlock(),n.createElementBlock("div",H_,[...L[7]||(L[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(de.value),onDblclick:n.withModifiers(Ce,["stop"])},[n.createElementVNode("button",{type:"button",class:"em-entity__caret nodrag",title:K.value?"펼치기":"접기","aria-expanded":!K.value,disabled:!s.value,onClick:n.withModifiers(q,["stop"]),onPointerdown:L[0]||(L[0]=n.withModifiers(()=>{},["stop"])),onDblclick:L[1]||(L[1]=n.withModifiers(()=>{},["stop"]))},n.toDisplayString(K.value?"▸":"▾"),41,F_),n.createElementVNode("span",G_,"«"+n.toDisplayString(y.value.stereotype)+"»",1),me.value?n.withDirectives((n.openBlock(),n.createElementBlock("input",{key:0,ref_key:"inputEl",ref:xe,"onUpdate:modelValue":L[2]||(L[2]=ie=>be.value=ie),class:"em-entity__name-input nodrag",onKeyup:[n.withKeys(Se,["enter"]),L[3]||(L[3]=n.withKeys(ie=>me.value=!1,["esc"]))],onBlur:Se,onPointerdown:L[4]||(L[4]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,be.value]]):(n.openBlock(),n.createElementBlock("span",Y_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(re.value,(ie,ue)=>(n.openBlock(),n.createElementBlock("span",{key:ue,class:n.normalizeClass({"em-entity__missing":ie.missing})},n.toDisplayString(ie.text),3))),128))])),F.value?(n.openBlock(),n.createBlock(Ve,{key:2,name:"lock",size:12,class:"em-entity__lock",title:"편집 잠금"})):n.createCommentVNode("",!0)],36),K.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:Ee,class:"em-entity__attrs"},[w.value&&w.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${w.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value.attributes,ie=>{var ue,fe,A,Z;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ie.modelId},[n.createElementVNode("li",{class:n.normalizeClass(["em-entity__row",{"is-attr-selected":b.value.has(ie.modelId),"is-dragging":(ue=w.value)==null?void 0:ue.ids.has(ie.modelId),"is-embed":T(ie),"is-divider":J(ie),nodrag:J(ie)&&s.value}]),"data-attr":ie.modelId,onClick:n.withModifiers(z=>_(ie,z),["stop"]),onPointerdown:z=>J(ie)?x(ie,z):void 0,onPointermove:z=>J(ie)?j(z):void 0,onPointerup:z=>J(ie)?le():void 0,onPointercancel:z=>J(ie)?_e():void 0},[s.value&&!J(ie)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:z=>x(ie,z),onPointermove:j,onPointerup:le,onPointercancel:_e,onClick:L[5]||(L[5]=n.withModifiers(()=>{},["stop"]))},"⠿",40,K_)):n.createCommentVNode("",!0),J(ie)?(n.openBlock(),n.createElementBlock("span",q_,n.toDisplayString(ie.name),1)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createVNode(n.unref(un),{id:`l:${ie.modelId}`,type:"target",position:n.unref(Ie).Left,class:"em-handle"},null,8,["id","position"]),n.createElementVNode("span",{class:"em-entity__keys",title:Q(X.value[ie.modelId]),"aria-hidden":"true"},[n.createElementVNode("span",j_,[(fe=X.value[ie.modelId])!=null&&fe.pk?(n.openBlock(),n.createBlock(Ve,{key:0,name:"key",size:12,class:"em-key is-pk"})):(A=X.value[ie.modelId])!=null&&A.required?(n.openBlock(),n.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):n.createCommentVNode("",!0)]),n.createElementVNode("span",Z_,[T(ie)?(n.openBlock(),n.createBlock(Ve,{key:0,name:"table",size:11,class:"em-embed-glyph"})):(Z=X.value[ie.modelId])!=null&&Z.fk?(n.openBlock(),n.createBlock(Ve,{key:1,name:"key",size:12,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,X_),n.createElementVNode("span",{class:"em-entity__attrname",style:n.normalizeStyle({color:B(ie)})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(oe(ie),(z,ce)=>(n.openBlock(),n.createElementBlock("span",{key:ce,class:n.normalizeClass({"em-entity__missing":z.missing})},n.toDisplayString(z.text),3))),128))],4),we(ie)?(n.openBlock(),n.createElementBlock("span",J_,n.toDisplayString(we(ie)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(un),{id:`r:${ie.modelId}`,type:"source",position:n.unref(Ie).Right,class:"em-handle"},null,8,["id","position"])],64))],42,W_),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T(ie)&&G.value?se(ie):[],z=>(n.openBlock(),n.createElementBlock("li",{key:`${ie.modelId}:${z.modelId}`,class:n.normalizeClass(["em-entity__embed-col",{"is-group-selected":b.value.has(ie.modelId)}]),onClick:n.withModifiers(ce=>_(ie,ce),["stop"])},[L[8]||(L[8]=n.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),n.createElementVNode("span",ew,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he(z),(ce,Ae)=>(n.openBlock(),n.createElementBlock("span",{key:Ae,class:n.normalizeClass({"em-entity__missing":ce.missing})},n.toDisplayString(ce.text),3))),128))]),n.createElementVNode("span",tw,n.toDisplayString(z.dataType),1)],10,Q_))),128))],64)}),128))],512)),!K.value&&v.value?(n.openBlock(),n.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:O,class:"em-entity__ops"},[U.value&&U.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${U.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ee.value,ie=>{var ue;return n.openBlock(),n.createElementBlock("li",{key:ie.modelId,class:n.normalizeClass(["em-entity__op-row",{"is-dragging":((ue=U.value)==null?void 0:ue.id)===ie.modelId}]),"data-op":ie.modelId},[s.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:fe=>M(ie,fe),onPointermove:pe,onPointerup:S,onPointercancel:D,onClick:L[6]||(L[6]=n.withModifiers(()=>{},["stop"]))},"⠿",40,ow)):n.createCommentVNode("",!0),n.createElementVNode("span",iw,n.toDisplayString(E(ie.visibility)),1),n.createElementVNode("span",{class:"em-entity__op-name",style:n.normalizeStyle({color:P(ie)})},n.toDisplayString(ie.name)+"()",5)],10,nw)}),128))],512)):ee.value.length?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:`오퍼레이션 ${ee.value.length}개 — 클래스 표시 모드에서 펼쳐 보입니다`},[n.createVNode(Ve,{name:"method",size:12}),n.createElementVNode("span",null,"오퍼레이션 "+n.toDisplayString(ee.value.length)+"개",1)],8,aw)):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("footer",lw,[n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:ye},"+ 속성"),L[9]||(L[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:Y},"+ 구분선")])):n.createCommentVNode("",!0),s.value&&!me.value?(n.openBlock(),n.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:ne,onPointermove:ge,onPointerup:ve},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-7efbcdb3"]]),rw={key:0,class:"em-sel","aria-hidden":"true"},sw={class:"em-group__label"},cw={class:"em-group__name"},dw={key:0,class:"em-group__pkg"},uw={key:1,class:"em-group__flag"},kd=Le(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(()=>Qe(t.data.style)),l=n.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),r=n.inject(hn,null),s=n.computed(()=>!!r&&r.editable.value),c=n.computed(()=>{var X;return!!t.id&&((X=r==null?void 0:r.selection.value)==null?void 0:X.kind)==="group"&&r.selection.value.id===t.id}),d=n.computed(()=>!!t.selected&&!c.value),u=n.inject(Mi,null),f=n.computed(()=>!!t.id&&(u==null?void 0:u.value)===t.id),p=n.inject(Pn,null);function m(){t.id&&(p==null||p.setGroupHover(t.id))}function h(){p==null||p.setGroupHover(null)}const b=n.computed(()=>!!p&&p.hoverGroupId.value===t.id),g=n.computed(()=>!!p&&p.hoverGroupId.value!==null&&p.hoverGroupId.value!==t.id),{screenToFlowCoordinate:_,findNode:N}=De();let y=null,$=null;function K(X){var B;if(!t.id||!s.value)return;X.stopPropagation();const Q=((B=N(t.id))==null?void 0:B.dimensions)??{width:400,height:300},de=_({x:X.clientX,y:X.clientY});y={fx:de.x,fy:de.y,w:Q.width,h:Q.height},X.target.setPointerCapture(X.pointerId)}function F(X){if(!y||!t.id)return;const Q=_({x:X.clientX,y:X.clientY});$={width:Math.max(160,y.w+(Q.x-y.fx)),height:Math.max(120,y.h+(Q.y-y.fy))};const de=N(t.id);de&&(de.style={width:`${$.width}px`,height:`${$.height}px`})}function q(X){var Q,de;y&&$&&t.id&&r&&r.resizeGroup(t.id,$),y=null,$=null,(de=(Q=X.target).releasePointerCapture)==null||de.call(Q,X.pointerId)}const G=n.computed(()=>{const X=o.value.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)||o.value.packageName||"그룹"});return(X,Q)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-group",{"is-drop-target":f.value,"is-hover-origin":b.value,"is-dimmed":g.value,"is-selected":c.value,"is-multi-selected":d.value,"is-locked":i.value}]),style:n.normalizeStyle(l.value),onMouseenter:m,onMouseleave:h},[c.value?(n.openBlock(),n.createElementBlock("div",rw,[...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",cw,n.toDisplayString(G.value),1),o.value.packageName?(n.openBlock(),n.createElementBlock("span",dw,n.toDisplayString(o.value.packageName),1)):n.createCommentVNode("",!0),o.value.excludeDDLGeneration?(n.openBlock(),n.createElementBlock("span",uw,"DDL 제외")):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createBlock(Ve,{key:2,name:"lock",size:12,class:"em-group__lock",title:"편집 잠금"})):n.createCommentVNode("",!0)]),s.value&&!i.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:K,onPointermove:F,onPointerup:q},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-681f8dc8"]]),fw={key:0,class:"em-sel","aria-hidden":"true"},mw={key:2,class:"em-note__text"},Ed=Le(n.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(hn,null),i=n.inject(Mi,null),a=n.inject(Pn,null),l=n.computed(()=>t.data.note),r=n.computed(()=>!!o&&o.editable.value),s=n.computed(()=>Qe(l.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 f(){a==null||a.setNoteHover(null)}const p=n.computed(()=>{var v;return((v=a==null?void 0:a.source.value)==null?void 0:v.kind)==="note"&&a.source.value.id===t.id}),m=n.computed(()=>!!a&&a.relatedNoteIds.value.has(t.id)&&!p.value),h=n.computed(()=>{var v;return((v=o==null?void 0:o.selection.value)==null?void 0:v.kind)==="note"&&o.selection.value.id===t.id}),b=n.computed(()=>!!t.selected&&!h.value),g=n.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(t.id)&&!h.value),_=[{id:"n-top",pos:Ie.Top},{id:"n-right",pos:Ie.Right},{id:"n-bottom",pos:Ie.Bottom},{id:"n-left",pos:Ie.Left}],N=n.ref(!1),y=n.ref(""),$=n.ref(null);async function K(){var v;r.value&&(y.value=l.value.memo,N.value=!0,await n.nextTick(),(v=$.value)==null||v.focus())}function F(){N.value&&(N.value=!1,y.value!==l.value.memo&&(o==null||o.setNoteMemo(t.id,y.value)))}const{screenToFlowCoordinate:q,findNode:G}=De();let X=null,Q=null;function de(v){var P;if(!r.value)return;v.stopPropagation();const R=((P=G(t.id))==null?void 0:P.dimensions)??l.value.geo.size,E=q({x:v.clientX,y:v.clientY});X={fx:E.x,fy:E.y,w:R.width,h:R.height},v.target.setPointerCapture(v.pointerId)}function B(v){if(!X)return;const R=q({x:v.clientX,y:v.clientY});Q={width:Math.max(140,X.w+(R.x-X.fx)),height:Math.max(60,X.h+(R.y-X.fy))};const E=G(t.id);E&&(E.style={width:`${Q.width}px`,height:`${Q.height}px`})}function ee(v){var R,E;X&&Q&&o&&o.resizeNote(t.id,Q),X=null,Q=null,(E=(R=v.target).releasePointerCapture)==null||E.call(R,v.pointerId)}return(v,R)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":m.value,"is-dimmed":g.value,"is-selected":h.value,"is-multi-selected":b.value}]),style:n.normalizeStyle(c.value),onDblclick:K,onPointerdown:d,onMouseenter:u,onMouseleave:f},[h.value?(n.openBlock(),n.createElementBlock("div",fw,[...R[4]||(R[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:$,"onUpdate:modelValue":R[0]||(R[0]=E=>y.value=E),class:"em-note__edit nodrag",onBlur:F,onKeydown:R[1]||(R[1]=n.withKeys(E=>N.value=!1,["esc"])),onPointerdown:R[2]||(R[2]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,y.value]]):(n.openBlock(),n.createElementBlock("div",mw,n.toDisplayString(l.value.memo),1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(_,E=>n.createVNode(n.unref(un),{id:E.id,key:E.id,type:"source",position:E.pos,class:"em-note-handle",onPointerdown:R[3]||(R[3]=n.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),r.value&&!N.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:de,onPointermove:B,onPointerup:ee},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-77c75add"]]),pw=20,hw=22,yw=7,gw=22,Nd=31,$d=7,bw=20,xd=11,Id=11,_w=Nd+$d;function ww(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function vw(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Bi(e,t,o){const i=t.x-e.x,a=t.y-e.y,l=Math.hypot(i,a)||1;return{x:e.x+i*o/l,y:e.y+a*o/l}}function Sd(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function Di(e,t,o){return{x:Math.cos(o)*t+e.x,y:Math.sin(o)*t+e.y}}function Cd(e,t,o,i){const a=i/2,l=e.x===t.x&&e.y===t.y?Math.PI/2:Sd(e,t);return[Di(o,a,l-Math.PI/2),Di(o,a,l+Math.PI/2)]}function Rd(e,t,o,i){const a=t*180/Math.PI,r=(a>=0?i?a-20:a+20:i?a+20:a-20)*Math.PI/180;return{x:Math.sin(r)*o+e.x,y:Math.cos(r)*o+e.y}}function Vd(e,t,o,i){const a=[],l=[],r=[];if(e.x===t.x&&e.y===t.y)return{lines:a,circles:l,polygons:r};if(i==="db"){const c=Bi(e,t,pw),[d,u]=Cd(e,t,c,hw);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}),ww(o.multiplicity)){const f=Bi(e,t,Nd);l.push({cx:f.x,cy:f.y,r:$d})}if(vw(o.multiplicity)){const f=Bi(e,t,yw),[p,m]=Cd(e,t,f,gw);a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:m.x,y2:m.y}),a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.y})}return{lines:a,circles:l,polygons:r}}let s=e;if(o.composition){const c=Bi(e,t,bw),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Sd(e,t),f=Di(d,xd/2,u-Math.PI/2),p=Di(d,xd/2,u+Math.PI/2);r.push({points:[e,f,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(t.x-e.x,t.y-e.y),d=Rd(s,c,Id,!0),u=Rd(s,c,Id,!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:l,polygons:r}}const Ad=200,Td=120,gl=24;function Md(e){var a,l;if(!e)return{x:0,y:0,width:Ad,height:Td};const t=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Ad,i=((l=e.dimensions)==null?void 0:l.height)||Td;return{x:t.x,y:t.y,width:o,height:i}}function Bd(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Dd(e){const t=n.computed(()=>Md(e.sourceNode())),o=n.computed(()=>Md(e.targetNode())),i=n.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=n.computed(()=>{var m,h;const d=t.value,u=d.x+d.width;let f=((m=e.sourceRowY)==null?void 0:m.call(e))??d.y+d.height/3,p=((h=e.targetRowY)==null?void 0:h.call(e))??d.y+d.height*2/3;if(Math.abs(p-f)<gl){const b=(f+p)/2;f=b-gl/2,p=b+gl/2}return{source:{x:u,y:f},target:{x:u,y:p}}}),l=n.computed(()=>e.waypoints()[0]??Bd(o.value)),r=n.computed(()=>{const d=e.waypoints();return d[d.length-1]??Bd(t.value)}),s=n.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?la(t.value,d,l.value.x):aa(t.value,l.value)}),c=n.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?la(o.value,d,r.value.x):aa(o.value,r.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 bl=Symbol("waypointController"),kw=["d"],Ew=["d"],Nw=["d"],$w=["x1","y1","x2","y2"],xw=["cx","cy","r"],Iw=["x","y"],Sw=["x","y"],Cw=["cx","cy","onDblclick"],Rw=["x","y","onPointerdown","onDblclick"],Od=Le(n.defineComponent({__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=De(),i=n.inject(bl),a=n.inject(hn,null),l=n.computed(()=>!!a&&a.editable.value),r=n.inject(wd,null),s=n.inject(Pn,null),c=n.computed(()=>!!s&&s.relatedEdgeIds.value.has(t.id)),d=n.computed(()=>{var ye;return((ye=a==null?void 0:a.selection.value)==null?void 0:ye.kind)==="association"&&a.selection.value.id===t.id}),u=n.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(t.id)&&!d.value),f=n.computed(()=>{const ye=r==null?void 0:r.value;if(!ye||!a)return null;const Y=a.resolved.value.entities,C=V=>{var H;return(H=Y.find(te=>te.entity.modelId===V))==null?void 0:H.groupRef},k=t.data.association;return C(k.end1.entityRef)===ye.groupId&&C(k.end2.entityRef)===ye.groupId?{dx:ye.dx,dy:ye.dy}:null}),p=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),m=n.ref(-1),h=n.ref({x:0,y:0}),b=n.computed(()=>{const ye=f.value;return p.value.map((Y,C)=>C===m.value?h.value:ye?{x:Y.x+ye.dx,y:Y.y+ye.dy}:Y)}),g=n.computed(()=>{var ye;return!!((ye=t.sourceNode.data)!=null&&ye.collapsed)}),_=n.computed(()=>{var ye;return!!((ye=t.targetNode.data)!=null&&ye.collapsed)}),{source:N,target:y,sourceSide:$,targetSide:K,isSelf:F}=Dd({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>b.value,sourceRowY:()=>t.data.sourceColumnRef&&!g.value?t.sourceY:void 0,targetRowY:()=>t.data.targetColumnRef&&!_.value?t.targetY:void 0}),q=_w+4,G=n.computed(()=>F.value?Gl(N.value,y.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?na(N.value,$.value,b.value,y.value,K.value,q):ia(N.value,b.value,y.value)),X=n.computed(()=>F.value||!l.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?oa(N.value,$.value,b.value,y.value,K.value,q):ra(N.value,b.value,y.value).map((ye,Y)=>({point:ye,segIndex:Y}))),Q=n.computed(()=>F.value||!l.value?[]:b.value);function de(ye){switch(ye){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(ye,Y){m.value=ye,h.value={...p.value[ye]},Y.target.setPointerCapture(Y.pointerId),Y.stopPropagation()}function ee(ye){if(m.value<0)return;const Y=o({x:ye.clientX,y:ye.clientY});h.value={x:Y.x,y:Y.y}}function v(ye){var Y,C;m.value>=0&&i&&i.movePoint(t.id,m.value,{...h.value}),m.value=-1,(C=(Y=ye.target).releasePointerCapture)==null||C.call(Y,ye.pointerId)}function R(ye,Y){Y.stopPropagation(),i==null||i.removePoint(t.id,ye)}function E(ye,Y){if(!i)return;const C=o({x:Y.clientX,y:Y.clientY});i.insertPoint(t.id,ye,{x:C.x,y:C.y})}const P=n.computed(()=>de(t.data.association.end1.multiplicity)),W=n.computed(()=>de(t.data.association.end2.multiplicity)),oe=n.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),T=n.computed(()=>oe.value==="class"),J=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const ye=Gn($.value);return{x:N.value.x+ye.x*10,y:N.value.y+ye.y*10}}return b.value[0]??y.value}),se=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const Y=Gn(K.value);return{x:y.value.x+Y.x*10,y:y.value.y+Y.y*10}}const ye=b.value;return ye[ye.length-1]??N.value}),he=n.computed(()=>{const ye=t.data.association;return{multiplicity:ye.end1.multiplicity,navigable:ye.end1.navigable,composition:ye.end1.composition,otherNavigable:ye.end2.navigable}}),we=n.computed(()=>{const ye=t.data.association;return{multiplicity:ye.end2.multiplicity,navigable:ye.end2.navigable,composition:ye.end2.composition,otherNavigable:ye.end1.navigable}}),re=n.computed(()=>Vd(N.value,J.value,he.value,oe.value)),me=n.computed(()=>Vd(y.value,se.value,we.value,oe.value)),be=n.computed(()=>[...re.value.lines,...me.value.lines]),xe=n.computed(()=>[...re.value.circles,...me.value.circles]),Ce=n.computed(()=>[...re.value.polygons,...me.value.polygons].map(ye=>`M${ye.points.map(Y=>`${Y.x},${Y.y}`).join(" L")} Z`)),Se=n.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(ye,Y)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:G.value,fill:"none",class:"em-edge__hit"},null,8,kw),n.createElementVNode("path",{d:G.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,Ew),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ce.value,(C,k)=>(n.openBlock(),n.createElementBlock("path",{key:`mpoly-${k}`,d:C,class:n.normalizeClass(["em-edge__marker em-edge__marker--fill",Se.value])},null,10,Nw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(be.value,(C,k)=>(n.openBlock(),n.createElementBlock("line",{key:`mline-${k}`,x1:C.x1,y1:C.y1,x2:C.x2,y2:C.y2,class:n.normalizeClass(["em-edge__marker",Se.value])},null,10,$w))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(xe.value,(C,k)=>(n.openBlock(),n.createElementBlock("circle",{key:`mcirc-${k}`,cx:C.cx,cy:C.cy,r:C.r,class:n.normalizeClass(["em-edge__marker",Se.value])},null,10,xw))),128)),T.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(P.value),11,Iw),n.createElementVNode("text",{x:n.unref(y).x-8,y:n.unref(y).y-6,"text-anchor":"end",class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(W.value),11,Sw)],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X.value,(C,k)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${k}`,cx:C.point.x,cy:C.point.y,r:"4",class:n.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:n.withModifiers(V=>E(C.segIndex,V),["stop"])},null,42,Cw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Q.value,(C,k)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${k}`,x:C.x-5,y:C.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:V=>B(k,V),onPointermove:ee,onPointerup:v,onDblclick:V=>R(k,V)},null,42,Rw))),128))],64))}}),[["__scopeId","data-v-71d5ef34"]]);var Tt=(e=>(e.Lines="lines",e.Dots="dots",e))(Tt||{});const Ld=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]}`})},Pd=function({radius:e,color:t}){return n.h("circle",{cx:e,cy:e,r:e,fill:t})};Tt.Lines+"",Tt.Dots+"";const Vw={[Tt.Dots]:"#81818a",[Tt.Lines]:"#eee"},Aw=["id","x","y","width","height","patternTransform"],Tw={key:2,height:"100",width:"100"},Mw=["fill"],Bw=["x","y","fill"],Dw={name:"Background",compatConfig:{MODE:3}},Ow=n.defineComponent({...Dw,props:{id:{},variant:{default:()=>Tt.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 r=o.value.zoom,[s,c]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],d=[s*r||1,c*r||1],u=e.size*r,[f,p]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],m=[f*r||1+d[0]/2,p*r||1+d[1]/2];return{scaledGap:d,offset:m,size:u}}),a=n.toRef(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),l=n.toRef(()=>e.color||e.patternColor||Vw[e.variant||Tt.Dots]);return(r,s)=>(n.openBlock(),n.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:n.normalizeStyle({height:`${r.height>100?100:r.height}%`,width:`${r.width>100?100:r.width}%`})},[n.renderSlot(r.$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(r.$slots,"pattern",{},()=>[r.variant===n.unref(Tt).Lines?(n.openBlock(),n.createBlock(n.unref(Ld),{key:0,size:r.lineWidth,color:l.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):r.variant===n.unref(Tt).Dots?(n.openBlock(),n.createBlock(n.unref(Pd),{key:1,color:l.value,radius:i.value.size/2},null,8,["color","radius"])):n.createCommentVNode("",!0),r.bgColor?(n.openBlock(),n.createElementBlock("svg",Tw,[n.createElementVNode("rect",{width:"100%",height:"100%",fill:r.bgColor},null,8,Mw)])):n.createCommentVNode("",!0)])],8,Aw)]),n.createElementVNode("rect",{x:r.x,y:r.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,Bw),n.renderSlot(r.$slots,"default",{id:a.value})],4))}}),Lw={name:"ControlButton",compatConfig:{MODE:3}},Pw=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},zw={type:"button",class:"vue-flow__controls-button"};function Uw(e,t,o,i,a,l){return n.openBlock(),n.createElementBlock("button",zw,[n.renderSlot(e.$slots,"default")])}const yn=Pw(Lw,[["render",Uw]]),Hw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Fw=[n.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Gw(e,t){return n.openBlock(),n.createElementBlock("svg",Hw,Fw)}const Yw={render:Gw},Ww={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Kw=[n.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function qw(e,t){return n.openBlock(),n.createElementBlock("svg",Ww,Kw)}const Xw={render:qw},jw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Zw=[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 Jw(e,t){return n.openBlock(),n.createElementBlock("svg",jw,Zw)}const Qw={render:Jw},ev={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},tv=[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 nv(e,t){return n.openBlock(),n.createElementBlock("svg",ev,tv)}const ov={render:nv},iv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},av=[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 lv(e,t){return n.openBlock(),n.createElementBlock("svg",iv,av)}const rv={render:lv},sv={name:"Controls",compatConfig:{MODE:3}},cv=n.defineComponent({...sv,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>fc.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:l,zoomIn:r,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:f}=De(),p=n.toRef(()=>o.value||i.value||a.value),m=n.toRef(()=>d.value.zoom<=u.value),h=n.toRef(()=>d.value.zoom>=f.value);function b(){r(),t("zoomIn")}function g(){s(),t("zoomOut")}function _(){c(e.fitViewParams),t("fitView")}function N(){l(!p.value),t("interactionChange",!p.value)}return(y,$)=>(n.openBlock(),n.createBlock(n.unref(dd),{class:"vue-flow__controls",position:y.position},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"top"),y.showZoom?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.renderSlot(y.$slots,"control-zoom-in",{},()=>[n.createVNode(yn,{class:"vue-flow__controls-zoomin",disabled:h.value,onClick:b},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-zoom-in",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(Yw))))])]),_:3},8,["disabled"])]),n.renderSlot(y.$slots,"control-zoom-out",{},()=>[n.createVNode(yn,{class:"vue-flow__controls-zoomout",disabled:m.value,onClick:g},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-zoom-out",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(Xw))))])]),_:3},8,["disabled"])])],64)):n.createCommentVNode("",!0),y.showFitView?n.renderSlot(y.$slots,"control-fit-view",{key:1},()=>[n.createVNode(yn,{class:"vue-flow__controls-fitview",onClick:_},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-fit-view",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(Qw))))])]),_:3})]):n.createCommentVNode("",!0),y.showInteractive?n.renderSlot(y.$slots,"control-interactive",{key:2},()=>[y.showInteractive?(n.openBlock(),n.createBlock(yn,{key:0,class:"vue-flow__controls-interactive",onClick:N},{default:n.withCtx(()=>[p.value?n.renderSlot(y.$slots,"icon-unlock",{key:0},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(rv))))]):n.createCommentVNode("",!0),p.value?n.createCommentVNode("",!0):n.renderSlot(y.$slots,"icon-lock",{key:1},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(ov))))])]),_:3})):n.createCommentVNode("",!0)]):n.createCommentVNode("",!0),n.renderSlot(y.$slots,"default")]),_:3},8,["position"]))}});var dv={value:()=>{}};function _l(){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 Oi(o)}function Oi(e){this._=e}function uv(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}})}Oi.prototype=_l.prototype={constructor:Oi,on:function(e,t){var o=this._,i=uv(e+"",o),a,l=-1,r=i.length;if(arguments.length<2){for(;++l<r;)if((a=(e=i[l]).type)&&(a=fv(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<r;)if(a=(e=i[l]).type)o[a]=zd(o[a],e.name,t);else if(t==null)for(a in o)o[a]=zd(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 Oi(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,l;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[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,l=i.length;a<l;++a)i[a].value.apply(t,o)}};function fv(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function zd(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=dv,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var wl="http://www.w3.org/1999/xhtml";const Ud={svg:"http://www.w3.org/2000/svg",xhtml:wl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Li(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Ud.hasOwnProperty(t)?{space:Ud[t],local:e}:e}function mv(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===wl&&t.documentElement.namespaceURI===wl?t.createElement(e):t.createElementNS(o,e)}}function pv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hd(e){var t=Li(e);return(t.local?pv:mv)(t)}function hv(){}function vl(e){return e==null?hv:function(){return this.querySelector(e)}}function yv(e){typeof e!="function"&&(e=vl(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=new Array(r),c,d,u=0;u<r;++u)(c=l[u])&&(d=e.call(c,c.__data__,u,l))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new rt(i,this._parents)}function gv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bv(){return[]}function Fd(e){return e==null?bv:function(){return this.querySelectorAll(e)}}function _v(e){return function(){return gv(e.apply(this,arguments))}}function wv(e){typeof e=="function"?e=_v(e):e=Fd(e);for(var t=this._groups,o=t.length,i=[],a=[],l=0;l<o;++l)for(var r=t[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&(i.push(e.call(c,c.__data__,d,r)),a.push(c));return new rt(i,a)}function Gd(e){return function(){return this.matches(e)}}function Yd(e){return function(t){return t.matches(e)}}var vv=Array.prototype.find;function kv(e){return function(){return vv.call(this.children,e)}}function Ev(){return this.firstElementChild}function Nv(e){return this.select(e==null?Ev:kv(typeof e=="function"?e:Yd(e)))}var $v=Array.prototype.filter;function xv(){return Array.from(this.children)}function Iv(e){return function(){return $v.call(this.children,e)}}function Sv(e){return this.selectAll(e==null?xv:Iv(typeof e=="function"?e:Yd(e)))}function Cv(e){typeof e!="function"&&(e=Gd(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new rt(i,this._parents)}function Wd(e){return new Array(e.length)}function Rv(){return new rt(this._enter||this._groups.map(Wd),this._parents)}function Pi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pi.prototype={constructor:Pi,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 Vv(e){return function(){return e}}function Av(e,t,o,i,a,l){for(var r=0,s,c=t.length,d=l.length;r<d;++r)(s=t[r])?(s.__data__=l[r],i[r]=s):o[r]=new Pi(e,l[r]);for(;r<c;++r)(s=t[r])&&(a[r]=s)}function Tv(e,t,o,i,a,l,r){var s,c,d=new Map,u=t.length,f=l.length,p=new Array(u),m;for(s=0;s<u;++s)(c=t[s])&&(p[s]=m=r.call(c,c.__data__,s,t)+"",d.has(m)?a[s]=c:d.set(m,c));for(s=0;s<f;++s)m=r.call(e,l[s],s,l)+"",(c=d.get(m))?(i[s]=c,c.__data__=l[s],d.delete(m)):o[s]=new Pi(e,l[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function Mv(e){return e.__data__}function Bv(e,t){if(!arguments.length)return Array.from(this,Mv);var o=t?Tv:Av,i=this._parents,a=this._groups;typeof e!="function"&&(e=Vv(e));for(var l=a.length,r=new Array(l),s=new Array(l),c=new Array(l),d=0;d<l;++d){var u=i[d],f=a[d],p=f.length,m=Dv(e.call(u,u&&u.__data__,d,i)),h=m.length,b=s[d]=new Array(h),g=r[d]=new Array(h),_=c[d]=new Array(p);o(u,f,b,g,_,m,t);for(var N=0,y=0,$,K;N<h;++N)if($=b[N]){for(N>=y&&(y=N+1);!(K=g[y])&&++y<h;);$._next=K||null}}return r=new rt(r,i),r._enter=s,r._exit=c,r}function Dv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ov(){return new rt(this._exit||this._groups.map(Wd),this._parents)}function Lv(e,t,o){var i=this.enter(),a=this,l=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?l.remove():o(l),i&&a?i.merge(a).order():a}function Pv(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._groups,a=o.length,l=i.length,r=Math.min(a,l),s=new Array(a),c=0;c<r;++c)for(var d=o[c],u=i[c],f=d.length,p=s[c]=new Array(f),m,h=0;h<f;++h)(m=d[h]||u[h])&&(p[h]=m);for(;c<a;++c)s[c]=o[c];return new rt(s,this._parents)}function zv(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],a=i.length-1,l=i[a],r;--a>=0;)(r=i[a])&&(l&&r.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(r,l),l=r);return this}function Uv(e){e||(e=Hv);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var o=this._groups,i=o.length,a=new Array(i),l=0;l<i;++l){for(var r=o[l],s=r.length,c=a[l]=new Array(s),d,u=0;u<s;++u)(d=r[u])&&(c[u]=d);c.sort(t)}return new rt(a,this._parents).order()}function Hv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Fv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Gv(){return Array.from(this)}function Yv(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length;a<l;++a){var r=i[a];if(r)return r}return null}function Wv(){let e=0;for(const t of this)++e;return e}function Kv(){return!this.node()}function qv(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],l=0,r=a.length,s;l<r;++l)(s=a[l])&&e.call(s,s.__data__,l,a);return this}function Xv(e){return function(){this.removeAttribute(e)}}function jv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zv(e,t){return function(){this.setAttribute(e,t)}}function Jv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Qv(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function ek(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 tk(e,t){var o=Li(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?jv:Xv:typeof t=="function"?o.local?ek:Qv:o.local?Jv:Zv)(o,t))}function Kd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nk(e){return function(){this.style.removeProperty(e)}}function ok(e,t,o){return function(){this.style.setProperty(e,t,o)}}function ik(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function ak(e,t,o){return arguments.length>1?this.each((t==null?nk:typeof t=="function"?ik:ok)(e,t,o??"")):zn(this.node(),e)}function zn(e,t){return e.style.getPropertyValue(t)||Kd(e).getComputedStyle(e,null).getPropertyValue(t)}function lk(e){return function(){delete this[e]}}function rk(e,t){return function(){this[e]=t}}function sk(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function ck(e,t){return arguments.length>1?this.each((t==null?lk:typeof t=="function"?sk:rk)(e,t)):this.node()[e]}function qd(e){return e.trim().split(/^|\s+/)}function kl(e){return e.classList||new Xd(e)}function Xd(e){this._node=e,this._names=qd(e.getAttribute("class")||"")}Xd.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 jd(e,t){for(var o=kl(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function Zd(e,t){for(var o=kl(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function dk(e){return function(){jd(this,e)}}function uk(e){return function(){Zd(this,e)}}function fk(e,t){return function(){(t.apply(this,arguments)?jd:Zd)(this,e)}}function mk(e,t){var o=qd(e+"");if(arguments.length<2){for(var i=kl(this.node()),a=-1,l=o.length;++a<l;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?fk:t?dk:uk)(o,t))}function pk(){this.textContent=""}function hk(e){return function(){this.textContent=e}}function yk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function gk(e){return arguments.length?this.each(e==null?pk:(typeof e=="function"?yk:hk)(e)):this.node().textContent}function bk(){this.innerHTML=""}function _k(e){return function(){this.innerHTML=e}}function wk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function vk(e){return arguments.length?this.each(e==null?bk:(typeof e=="function"?wk:_k)(e)):this.node().innerHTML}function kk(){this.nextSibling&&this.parentNode.appendChild(this)}function Ek(){return this.each(kk)}function Nk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $k(){return this.each(Nk)}function xk(e){var t=typeof e=="function"?e:Hd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ik(){return null}function Sk(e,t){var o=typeof e=="function"?e:Hd(e),i=t==null?Ik:typeof t=="function"?t:vl(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Ck(){var e=this.parentNode;e&&e.removeChild(this)}function Rk(){return this.each(Ck)}function Vk(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ak(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tk(e){return this.select(e?Ak:Vk)}function Mk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Bk(e){return function(t){e.call(this,t,this.__data__)}}function Dk(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 Ok(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,l;o<a;++o)l=t[o],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function Lk(e,t,o){return function(){var i=this.__on,a,l=Bk(t);if(i){for(var r=0,s=i.length;r<s;++r)if((a=i[r]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=o),a.value=t;return}}this.addEventListener(e.type,l,o),a={type:e.type,name:e.name,value:t,listener:l,options:o},i?i.push(a):this.__on=[a]}}function Pk(e,t,o){var i=Dk(e+""),a,l=i.length,r;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<l;++a)if((r=i[a]).type===u.type&&r.name===u.name)return u.value}return}for(s=t?Lk:Ok,a=0;a<l;++a)this.each(s(i[a],t,o));return this}function Jd(e,t,o){var i=Kd(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 zk(e,t){return function(){return Jd(this,e,t)}}function Uk(e,t){return function(){return Jd(this,e,t.apply(this,arguments))}}function Hk(e,t){return this.each((typeof t=="function"?Uk:zk)(e,t))}function*Fk(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length,r;a<l;++a)(r=i[a])&&(yield r)}var Qd=[null];function rt(e,t){this._groups=e,this._parents=t}function wo(){return new rt([[document.documentElement]],Qd)}function Gk(){return this}rt.prototype=wo.prototype={constructor:rt,select:yv,selectAll:wv,selectChild:Nv,selectChildren:Sv,filter:Cv,data:Bv,enter:Rv,exit:Ov,join:Lv,merge:Pv,selection:Gk,order:zv,sort:Uv,call:Fv,nodes:Gv,node:Yv,size:Wv,empty:Kv,each:qv,attr:tk,style:ak,property:ck,classed:mk,text:gk,html:vk,raise:Ek,lower:$k,append:xk,insert:Sk,remove:Rk,clone:Tk,datum:Mk,on:Pk,dispatch:Hk,[Symbol.iterator]:Fk};function Wt(e){return typeof e=="string"?new rt([[document.querySelector(e)]],[document.documentElement]):new rt([[e]],Qd)}function Yk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kt(e,t){if(e=Yk(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 El={capture:!0,passive:!1};function Nl(e){e.preventDefault(),e.stopImmediatePropagation()}function Wk(e){var t=e.document.documentElement,o=Wt(e).on("dragstart.drag",Nl,El);"onselectstart"in t?o.on("selectstart.drag",Nl,El):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Kk(e,t){var o=e.document.documentElement,i=Wt(e).on("dragstart.drag",null);t&&(i.on("click.drag",Nl,El),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 $l(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function eu(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function vo(){}var ko=.7,zi=1/ko,Un="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qk=/^#([0-9a-f]{3,8})$/,Xk=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),jk=new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`),Zk=new RegExp(`^rgba\\(${Un},${Un},${Un},${Eo}\\)$`),Jk=new RegExp(`^rgba\\(${Et},${Et},${Et},${Eo}\\)$`),Qk=new RegExp(`^hsl\\(${Eo},${Et},${Et}\\)$`),eE=new RegExp(`^hsla\\(${Eo},${Et},${Et},${Eo}\\)$`),tu={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};$l(vo,No,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nu,formatHex:nu,formatHex8:tE,formatHsl:nE,formatRgb:ou,toString:ou});function nu(){return this.rgb().formatHex()}function tE(){return this.rgb().formatHex8()}function nE(){return su(this).formatHsl()}function ou(){return this.rgb().formatRgb()}function No(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=qk.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?iu(t):o===3?new it(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?Ui(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?Ui(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=Xk.exec(e))?new it(t[1],t[2],t[3],1):(t=jk.exec(e))?new it(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zk.exec(e))?Ui(t[1],t[2],t[3],t[4]):(t=Jk.exec(e))?Ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Qk.exec(e))?ru(t[1],t[2]/100,t[3]/100,1):(t=eE.exec(e))?ru(t[1],t[2]/100,t[3]/100,t[4]):tu.hasOwnProperty(e)?iu(tu[e]):e==="transparent"?new it(NaN,NaN,NaN,0):null}function iu(e){return new it(e>>16&255,e>>8&255,e&255,1)}function Ui(e,t,o,i){return i<=0&&(e=t=o=NaN),new it(e,t,o,i)}function oE(e){return e instanceof vo||(e=No(e)),e?(e=e.rgb(),new it(e.r,e.g,e.b,e.opacity)):new it}function xl(e,t,o,i){return arguments.length===1?oE(e):new it(e,t,o,i??1)}function it(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}$l(it,xl,eu(vo,{brighter(e){return e=e==null?zi:Math.pow(zi,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(gn(this.r),gn(this.g),gn(this.b),Hi(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:au,formatHex:au,formatHex8:iE,formatRgb:lu,toString:lu}));function au(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}`}function iE(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn((isNaN(this.opacity)?1:this.opacity)*255)}`}function lu(){const e=Hi(this.opacity);return`${e===1?"rgb(":"rgba("}${gn(this.r)}, ${gn(this.g)}, ${gn(this.b)}${e===1?")":`, ${e})`}`}function Hi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bn(e){return e=gn(e),(e<16?"0":"")+e.toString(16)}function ru(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new pt(e,t,o,i)}function su(e){if(e instanceof pt)return new pt(e.h,e.s,e.l,e.opacity);if(e instanceof vo||(e=No(e)),!e)return new pt;if(e instanceof pt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),l=Math.max(t,o,i),r=NaN,s=l-a,c=(l+a)/2;return s?(t===l?r=(o-i)/s+(o<i)*6:o===l?r=(i-t)/s+2:r=(t-o)/s+4,s/=c<.5?l+a:2-l-a,r*=60):s=c>0&&c<1?0:r,new pt(r,s,c,e.opacity)}function aE(e,t,o,i){return arguments.length===1?su(e):new pt(e,t,o,i??1)}function pt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}$l(pt,aE,eu(vo,{brighter(e){return e=e==null?zi:Math.pow(zi,e),new pt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new pt(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 it(Il(e>=240?e-240:e+120,a,i),Il(e,a,i),Il(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new pt(cu(this.h),Fi(this.s),Fi(this.l),Hi(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=Hi(this.opacity);return`${e===1?"hsl(":"hsla("}${cu(this.h)}, ${Fi(this.s)*100}%, ${Fi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cu(e){return e=(e||0)%360,e<0?e+360:e}function Fi(e){return Math.max(0,Math.min(1,e||0))}function Il(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 du=e=>()=>e;function lE(e,t){return function(o){return e+o*t}}function rE(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 sE(e){return(e=+e)==1?uu:function(t,o){return o-t?rE(t,o,e):du(isNaN(t)?o:t)}}function uu(e,t){var o=t-e;return o?lE(e,o):du(isNaN(e)?t:e)}const fu=(function e(t){var o=sE(t);function i(a,l){var r=o((a=xl(a)).r,(l=xl(l)).r),s=o(a.g,l.g),c=o(a.b,l.b),d=uu(a.opacity,l.opacity);return function(u){return a.r=r(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 Sl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cl=new RegExp(Sl.source,"g");function cE(e){return function(){return e}}function dE(e){return function(t){return e(t)+""}}function uE(e,t){var o=Sl.lastIndex=Cl.lastIndex=0,i,a,l,r=-1,s=[],c=[];for(e=e+"",t=t+"";(i=Sl.exec(e))&&(a=Cl.exec(t));)(l=a.index)>o&&(l=t.slice(o,l),s[r]?s[r]+=l:s[++r]=l),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:qt(i,a)})),o=Cl.lastIndex;return o<t.length&&(l=t.slice(o),s[r]?s[r]+=l:s[++r]=l),s.length<2?c[0]?dE(c[0].x):cE(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(d);return s.join("")})}var mu=180/Math.PI,Rl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pu(e,t,o,i,a,l){var r,s,c;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(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,r=-r),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*mu,skewX:Math.atan(c)*mu,scaleX:r,scaleY:s}}var Gi;function fE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rl:pu(t.a,t.b,t.c,t.d,t.e,t.f)}function mE(e){return e==null||(Gi||(Gi=document.createElementNS("http://www.w3.org/2000/svg","g")),Gi.setAttribute("transform",e),!(e=Gi.transform.baseVal.consolidate()))?Rl:(e=e.matrix,pu(e.a,e.b,e.c,e.d,e.e,e.f))}function hu(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function l(d,u,f,p,m,h){if(d!==f||u!==p){var b=m.push("translate(",null,t,null,o);h.push({i:b-4,x:qt(d,f)},{i:b-2,x:qt(u,p)})}else(f||p)&&m.push("translate("+f+t+p+o)}function r(d,u,f,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:f.push(a(f)+"rotate(",null,i)-2,x:qt(d,u)})):u&&f.push(a(f)+"rotate("+u+i)}function s(d,u,f,p){d!==u?p.push({i:f.push(a(f)+"skewX(",null,i)-2,x:qt(d,u)}):u&&f.push(a(f)+"skewX("+u+i)}function c(d,u,f,p,m,h){if(d!==f||u!==p){var b=m.push(a(m)+"scale(",null,",",null,")");h.push({i:b-4,x:qt(d,f)},{i:b-2,x:qt(u,p)})}else(f!==1||p!==1)&&m.push(a(m)+"scale("+f+","+p+")")}return function(d,u){var f=[],p=[];return d=e(d),u=e(u),l(d.translateX,d.translateY,u.translateX,u.translateY,f,p),r(d.rotate,u.rotate,f,p),s(d.skewX,u.skewX,f,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,f,p),d=u=null,function(m){for(var h=-1,b=p.length,g;++h<b;)f[(g=p[h]).i]=g.x(m);return f.join("")}}}var pE=hu(fE,"px, ","px)","deg)"),hE=hu(mE,", ",")",")"),yE=1e-12;function yu(e){return((e=Math.exp(e))+1/e)/2}function gE(e){return((e=Math.exp(e))-1/e)/2}function bE(e){return((e=Math.exp(2*e))-1)/(e+1)}const _E=(function e(t,o,i){function a(l,r){var s=l[0],c=l[1],d=l[2],u=r[0],f=r[1],p=r[2],m=u-s,h=f-c,b=m*m+h*h,g,_;if(b<yE)_=Math.log(p/d)/t,g=function(q){return[s+q*m,c+q*h,d*Math.exp(t*q*_)]};else{var N=Math.sqrt(b),y=(p*p-d*d+i*b)/(2*d*o*N),$=(p*p-d*d-i*b)/(2*p*o*N),K=Math.log(Math.sqrt(y*y+1)-y),F=Math.log(Math.sqrt($*$+1)-$);_=(F-K)/t,g=function(q){var G=q*_,X=yu(K),Q=d/(o*N)*(X*bE(t*G+K)-gE(K));return[s+Q*m,c+Q*h,d*X/yu(t*G+K)]}}return g.duration=_*1e3*t/Math.SQRT2,g}return a.rho=function(l){var r=Math.max(.001,+l),s=r*r,c=s*s;return e(r,s,c)},a})(Math.SQRT2,2,4);var Hn=0,$o=0,xo=0,gu=1e3,Yi,Io,Wi=0,_n=0,Ki=0,So=typeof performance=="object"&&performance.now?performance:Date,bu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vl(){return _n||(bu(wE),_n=So.now()+Ki)}function wE(){_n=0}function qi(){this._call=this._time=this._next=null}qi.prototype=_u.prototype={constructor:qi,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Vl():+o)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:Yi=this,Io=this),this._call=e,this._time=o,Al()},stop:function(){this._call&&(this._call=null,this._time=1/0,Al())}};function _u(e,t,o){var i=new qi;return i.restart(e,t,o),i}function vE(){Vl(),++Hn;for(var e=Yi,t;e;)(t=_n-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hn}function wu(){_n=(Wi=So.now())+Ki,Hn=$o=0;try{vE()}finally{Hn=0,EE(),_n=0}}function kE(){var e=So.now(),t=e-Wi;t>gu&&(Ki-=t,Wi=e)}function EE(){for(var e,t=Yi,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:Yi=o);Io=e,Al(i)}function Al(e){if(!Hn){$o&&($o=clearTimeout($o));var t=e-_n;t>24?(e<1/0&&($o=setTimeout(wu,e-So.now()-Ki)),xo&&(xo=clearInterval(xo))):(xo||(Wi=So.now(),xo=setInterval(kE,gu)),Hn=1,bu(wu))}}function vu(e,t,o){var i=new qi;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var NE=_l("start","end","cancel","interrupt"),$E=[],ku=0,Eu=1,Tl=2,Xi=3,Nu=4,Ml=5,ji=6;function Zi(e,t,o,i,a,l){var r=e.__transition;if(!r)e.__transition={};else if(o in r)return;xE(e,o,{name:t,index:i,group:a,on:NE,tween:$E,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:ku})}function Bl(e,t){var o=ht(e,t);if(o.state>ku)throw new Error("too late; already scheduled");return o}function Nt(e,t){var o=ht(e,t);if(o.state>Xi)throw new Error("too late; already running");return o}function ht(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function xE(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=_u(l,0,o.time);function l(d){o.state=Eu,o.timer.restart(r,o.delay,o.time),o.delay<=d&&r(d-o.delay)}function r(d){var u,f,p,m;if(o.state!==Eu)return c();for(u in i)if(m=i[u],m.name===o.name){if(m.state===Xi)return vu(r);m.state===Nu?(m.state=ji,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[u]):+u<t&&(m.state=ji,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete i[u])}if(vu(function(){o.state===Xi&&(o.state=Nu,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=Tl,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Tl){for(o.state=Xi,a=new Array(p=o.tween.length),u=0,f=-1;u<p;++u)(m=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++f]=m);a.length=f+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Ml,1),f=-1,p=a.length;++f<p;)a[f].call(e,u);o.state===Ml&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=ji,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function Ji(e,t){var o=e.__transition,i,a,l=!0,r;if(o){t=t==null?null:t+"";for(r in o){if((i=o[r]).name!==t){l=!1;continue}a=i.state>Tl&&i.state<Ml,i.state=ji,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[r]}l&&delete e.__transition}}function IE(e){return this.each(function(){Ji(this,e)})}function SE(e,t){var o,i;return function(){var a=Nt(this,e),l=a.tween;if(l!==o){i=o=l;for(var r=0,s=i.length;r<s;++r)if(i[r].name===t){i=i.slice(),i.splice(r,1);break}}a.tween=i}}function CE(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var l=Nt(this,e),r=l.tween;if(r!==i){a=(i=r).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)}l.tween=a}}function RE(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=ht(this.node(),o).tween,a=0,l=i.length,r;a<l;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((t==null?SE:CE)(o,e,t))}function Dl(e,t,o){var i=e._id;return e.each(function(){var a=Nt(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return ht(a,i).value[t]}}function $u(e,t){var o;return(typeof t=="number"?qt:t instanceof No?fu:(o=No(t))?(t=o,fu):uE)(e,t)}function VE(e){return function(){this.removeAttribute(e)}}function AE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function TE(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttribute(e);return r===a?null:r===i?l:l=t(i=r,o)}}function ME(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?l:l=t(i=r,o)}}function BE(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttribute(e):(r=this.getAttribute(e),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function DE(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(r=this.getAttributeNS(e.space,e.local),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function OE(e,t){var o=Li(e),i=o==="transform"?hE:$u;return this.attrTween(e,typeof t=="function"?(o.local?DE:BE)(o,i,Dl(this,"attr."+e,t)):t==null?(o.local?AE:VE)(o):(o.local?ME:TE)(o,i,t))}function LE(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function PE(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function zE(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&PE(e,l)),o}return a._value=t,a}function UE(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&LE(e,l)),o}return a._value=t,a}function HE(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=Li(e);return this.tween(o,(i.local?zE:UE)(i,t))}function FE(e,t){return function(){Bl(this,e).delay=+t.apply(this,arguments)}}function GE(e,t){return t=+t,function(){Bl(this,e).delay=t}}function YE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?FE:GE)(t,e)):ht(this.node(),t).delay}function WE(e,t){return function(){Nt(this,e).duration=+t.apply(this,arguments)}}function KE(e,t){return t=+t,function(){Nt(this,e).duration=t}}function qE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?WE:KE)(t,e)):ht(this.node(),t).duration}function XE(e,t){if(typeof t!="function")throw new Error;return function(){Nt(this,e).ease=t}}function jE(e){var t=this._id;return arguments.length?this.each(XE(t,e)):ht(this.node(),t).ease}function ZE(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;Nt(this,e).ease=o}}function JE(e){if(typeof e!="function")throw new Error;return this.each(ZE(this._id,e))}function QE(e){typeof e!="function"&&(e=Gd(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new Mt(i,this._parents,this._name,this._id)}function eN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,l=Math.min(i,a),r=new Array(i),s=0;s<l;++s)for(var c=t[s],d=o[s],u=c.length,f=r[s]=new Array(u),p,m=0;m<u;++m)(p=c[m]||d[m])&&(f[m]=p);for(;s<i;++s)r[s]=t[s];return new Mt(r,this._parents,this._name,this._id)}function tN(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 nN(e,t,o){var i,a,l=tN(t)?Bl:Nt;return function(){var r=l(this,e),s=r.on;s!==i&&(a=(i=s).copy()).on(t,o),r.on=a}}function oN(e,t){var o=this._id;return arguments.length<2?ht(this.node(),o).on.on(e):this.each(nN(o,e,t))}function iN(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function aN(){return this.on("end.remove",iN(this._id))}function lN(e){var t=this._name,o=this._id;typeof e!="function"&&(e=vl(e));for(var i=this._groups,a=i.length,l=new Array(a),r=0;r<a;++r)for(var s=i[r],c=s.length,d=l[r]=new Array(c),u,f,p=0;p<c;++p)(u=s[p])&&(f=e.call(u,u.__data__,p,s))&&("__data__"in u&&(f.__data__=u.__data__),d[p]=f,Zi(d[p],t,o,p,d,ht(u,o)));return new Mt(l,this._parents,t,o)}function rN(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Fd(e));for(var i=this._groups,a=i.length,l=[],r=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,f=0;f<d;++f)if(u=c[f]){for(var p=e.call(u,u.__data__,f,c),m,h=ht(u,o),b=0,g=p.length;b<g;++b)(m=p[b])&&Zi(m,t,o,b,p,h);l.push(p),r.push(u)}return new Mt(l,r,t,o)}var sN=wo.prototype.constructor;function cN(){return new sN(this._groups,this._parents)}function dN(e,t){var o,i,a;return function(){var l=zn(this,e),r=(this.style.removeProperty(e),zn(this,e));return l===r?null:l===o&&r===i?a:a=t(o=l,i=r)}}function xu(e){return function(){this.style.removeProperty(e)}}function uN(e,t,o){var i,a=o+"",l;return function(){var r=zn(this,e);return r===a?null:r===i?l:l=t(i=r,o)}}function fN(e,t,o){var i,a,l;return function(){var r=zn(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),zn(this,e))),r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s))}}function mN(e,t){var o,i,a,l="style."+t,r="end."+l,s;return function(){var c=Nt(this,e),d=c.on,u=c.value[l]==null?s||(s=xu(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(r,a=u),c.on=i}}function pN(e,t,o){var i=(e+="")=="transform"?pE:$u;return t==null?this.styleTween(e,dN(e,i)).on("end.style."+e,xu(e)):typeof t=="function"?this.styleTween(e,fN(e,i,Dl(this,"style."+e,t))).each(mN(this._id,e)):this.styleTween(e,uN(e,i,t),o).on("end.style."+e,null)}function hN(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function yN(e,t,o){var i,a;function l(){var r=t.apply(this,arguments);return r!==a&&(i=(a=r)&&hN(e,r,o)),i}return l._value=t,l}function gN(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,yN(e,t,o??""))}function bN(e){return function(){this.textContent=e}}function _N(e){return function(){var t=e(this);this.textContent=t??""}}function wN(e){return this.tween("text",typeof e=="function"?_N(Dl(this,"text",e)):bN(e==null?"":e+""))}function vN(e){return function(t){this.textContent=e.call(this,t)}}function kN(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&vN(a)),t}return i._value=e,i}function EN(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,kN(e))}function NN(){for(var e=this._name,t=this._id,o=Iu(),i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)if(c=r[d]){var u=ht(c,t);Zi(c,e,o,d,r,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Mt(i,this._parents,e,o)}function $N(){var e,t,o=this,i=o._id,a=o.size();return new Promise(function(l,r){var s={value:r},c={value:function(){--a===0&&l()}};o.each(function(){var d=Nt(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&&l()})}var xN=0;function Mt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function Iu(){return++xN}var Bt=wo.prototype;Mt.prototype={constructor:Mt,select:lN,selectAll:rN,selectChild:Bt.selectChild,selectChildren:Bt.selectChildren,filter:QE,merge:eN,selection:cN,transition:NN,call:Bt.call,nodes:Bt.nodes,node:Bt.node,size:Bt.size,empty:Bt.empty,each:Bt.each,on:oN,attr:OE,attrTween:HE,style:pN,styleTween:gN,text:wN,textTween:EN,remove:aN,tween:RE,delay:YE,duration:qE,ease:jE,easeVarying:JE,end:$N,[Symbol.iterator]:Bt[Symbol.iterator]};function IN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var SN={time:null,delay:0,duration:250,ease:IN};function CN(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 RN(e){var t,o;e instanceof Mt?(t=e._id,e=e._name):(t=Iu(),(o=SN).time=Vl(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&Zi(c,e,t,d,r,o||CN(c,t));return new Mt(i,this._parents,e,t)}wo.prototype.interrupt=IE,wo.prototype.transition=RN;const Qi=e=>()=>e;function VN(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 Dt(e,t,o){this.k=e,this.x=t,this.y=o}Dt.prototype={constructor:Dt,scale:function(e){return e===1?this:new Dt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Dt(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 Ol=new Dt(1,0,0);Dt.prototype;function Ll(e){e.stopImmediatePropagation()}function Co(e){e.preventDefault(),e.stopImmediatePropagation()}function AN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function TN(){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 Su(){return this.__zoom||Ol}function MN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function BN(){return navigator.maxTouchPoints||"ontouchstart"in this}function DN(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],l=e.invertY(t[0][1])-o[0][1],r=e.invertY(t[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),r>l?(l+r)/2:Math.min(0,l)||Math.max(0,r))}function ON(){var e=AN,t=TN,o=DN,i=MN,a=BN,l=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],s=250,c=_E,d=_l("start","zoom","end"),u,f,p,m=500,h=150,b=0,g=10;function _(v){v.property("__zoom",Su).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",Q).filter(a).on("touchstart.zoom",de).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(v,R,E,P){var W=v.selection?v.selection():v;W.property("__zoom",Su),v!==W?K(v,R,E,P):W.interrupt().each(function(){F(this,arguments).event(P).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},_.scaleBy=function(v,R,E,P){_.scaleTo(v,function(){var W=this.__zoom.k,oe=typeof R=="function"?R.apply(this,arguments):R;return W*oe},E,P)},_.scaleTo=function(v,R,E,P){_.transform(v,function(){var W=t.apply(this,arguments),oe=this.__zoom,T=E==null?$(W):typeof E=="function"?E.apply(this,arguments):E,J=oe.invert(T),se=typeof R=="function"?R.apply(this,arguments):R;return o(y(N(oe,se),T,J),W,r)},E,P)},_.translateBy=function(v,R,E,P){_.transform(v,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),r)},null,P)},_.translateTo=function(v,R,E,P,W){_.transform(v,function(){var oe=t.apply(this,arguments),T=this.__zoom,J=P==null?$(oe):typeof P=="function"?P.apply(this,arguments):P;return o(Ol.translate(J[0],J[1]).scale(T.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof E=="function"?-E.apply(this,arguments):-E),oe,r)},P,W)};function N(v,R){return R=Math.max(l[0],Math.min(l[1],R)),R===v.k?v:new Dt(R,v.x,v.y)}function y(v,R,E){var P=R[0]-E[0]*v.k,W=R[1]-E[1]*v.k;return P===v.x&&W===v.y?v:new Dt(v.k,P,W)}function $(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function K(v,R,E,P){v.on("start.zoom",function(){F(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(P).end()}).tween("zoom",function(){var W=this,oe=arguments,T=F(W,oe).event(P),J=t.apply(W,oe),se=E==null?$(J):typeof E=="function"?E.apply(W,oe):E,he=Math.max(J[1][0]-J[0][0],J[1][1]-J[0][1]),we=W.__zoom,re=typeof R=="function"?R.apply(W,oe):R,me=c(we.invert(se).concat(he/we.k),re.invert(se).concat(he/re.k));return function(be){if(be===1)be=re;else{var xe=me(be),Ce=he/xe[2];be=new Dt(Ce,se[0]-xe[0]*Ce,se[1]-xe[1]*Ce)}T.zoom(null,be)}})}function F(v,R,E){return!E&&v.__zooming||new q(v,R)}function q(v,R){this.that=v,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,R),this.taps=0}q.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,R){return this.mouse&&v!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var R=Wt(this.that).datum();d.call(v,this.that,new VN(v,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),R)}};function G(v,...R){if(!e.apply(this,arguments))return;var E=F(this,R).event(v),P=this.__zoom,W=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,i.apply(this,arguments)))),oe=Kt(v);if(E.wheel)(E.mouse[0][0]!==oe[0]||E.mouse[0][1]!==oe[1])&&(E.mouse[1]=P.invert(E.mouse[0]=oe)),clearTimeout(E.wheel);else{if(P.k===W)return;E.mouse=[oe,P.invert(oe)],Ji(this),E.start()}Co(v),E.wheel=setTimeout(T,h),E.zoom("mouse",o(y(N(P,W),E.mouse[0],E.mouse[1]),E.extent,r));function T(){E.wheel=null,E.end()}}function X(v,...R){if(p||!e.apply(this,arguments))return;var E=v.currentTarget,P=F(this,R,!0).event(v),W=Wt(v.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),oe=Kt(v,E),T=v.clientX,J=v.clientY;Wk(v.view),Ll(v),P.mouse=[oe,this.__zoom.invert(oe)],Ji(this),P.start();function se(we){if(Co(we),!P.moved){var re=we.clientX-T,me=we.clientY-J;P.moved=re*re+me*me>b}P.event(we).zoom("mouse",o(y(P.that.__zoom,P.mouse[0]=Kt(we,E),P.mouse[1]),P.extent,r))}function he(we){W.on("mousemove.zoom mouseup.zoom",null),Kk(we.view,P.moved),Co(we),P.event(we).end()}}function Q(v,...R){if(e.apply(this,arguments)){var E=this.__zoom,P=Kt(v.changedTouches?v.changedTouches[0]:v,this),W=E.invert(P),oe=E.k*(v.shiftKey?.5:2),T=o(y(N(E,oe),P,W),t.apply(this,R),r);Co(v),s>0?Wt(this).transition().duration(s).call(K,T,P,v):Wt(this).call(_.transform,T,P,v)}}function de(v,...R){if(e.apply(this,arguments)){var E=v.touches,P=E.length,W=F(this,R,v.changedTouches.length===P).event(v),oe,T,J,se;for(Ll(v),T=0;T<P;++T)J=E[T],se=Kt(J,this),se=[se,this.__zoom.invert(se),J.identifier],W.touch0?!W.touch1&&W.touch0[2]!==se[2]&&(W.touch1=se,W.taps=0):(W.touch0=se,oe=!0,W.taps=1+!!u);u&&(u=clearTimeout(u)),oe&&(W.taps<2&&(f=se[0],u=setTimeout(function(){u=null},m)),Ji(this),W.start())}}function B(v,...R){if(this.__zooming){var E=F(this,R).event(v),P=v.changedTouches,W=P.length,oe,T,J,se;for(Co(v),oe=0;oe<W;++oe)T=P[oe],J=Kt(T,this),E.touch0&&E.touch0[2]===T.identifier?E.touch0[0]=J:E.touch1&&E.touch1[2]===T.identifier&&(E.touch1[0]=J);if(T=E.that.__zoom,E.touch1){var he=E.touch0[0],we=E.touch0[1],re=E.touch1[0],me=E.touch1[1],be=(be=re[0]-he[0])*be+(be=re[1]-he[1])*be,xe=(xe=me[0]-we[0])*xe+(xe=me[1]-we[1])*xe;T=N(T,Math.sqrt(be/xe)),J=[(he[0]+re[0])/2,(he[1]+re[1])/2],se=[(we[0]+me[0])/2,(we[1]+me[1])/2]}else if(E.touch0)J=E.touch0[0],se=E.touch0[1];else return;E.zoom("touch",o(y(T,J,se),E.extent,r))}}function ee(v,...R){if(this.__zooming){var E=F(this,R).event(v),P=v.changedTouches,W=P.length,oe,T;for(Ll(v),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),oe=0;oe<W;++oe)T=P[oe],E.touch0&&E.touch0[2]===T.identifier?delete E.touch0:E.touch1&&E.touch1[2]===T.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(T=Kt(T,this),Math.hypot(f[0]-T[0],f[1]-T[1])<g)){var J=Wt(this).on("dblclick.zoom");J&&J.apply(this,arguments)}}}return _.wheelDelta=function(v){return arguments.length?(i=typeof v=="function"?v:Qi(+v),_):i},_.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Qi(!!v),_):e},_.touchable=function(v){return arguments.length?(a=typeof v=="function"?v:Qi(!!v),_):a},_.extent=function(v){return arguments.length?(t=typeof v=="function"?v:Qi([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),_):t},_.scaleExtent=function(v){return arguments.length?(l[0]=+v[0],l[1]=+v[1],_):[l[0],l[1]]},_.translateExtent=function(v){return arguments.length?(r[0][0]=+v[0][0],r[1][0]=+v[1][0],r[0][1]=+v[0][1],r[1][1]=+v[1][1],_):[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},_.constrain=function(v){return arguments.length?(o=v,_):o},_.duration=function(v){return arguments.length?(s=+v,_):s},_.interpolate=function(v){return arguments.length?(c=v,_):c},_.on=function(){var v=d.on.apply(d,arguments);return v===d?_:v},_.clickDistance=function(v){return arguments.length?(b=(v=+v)*v,_):Math.sqrt(b)},_.tapDistance=function(v){return arguments.length?(g=+v,_):g},_}const Cu=Symbol("MiniMapSlots"),LN=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],PN={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},zN=n.defineComponent({...PN,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(Cu),a=n.useAttrs(),l=n.toRef(()=>a.style??{});function r(f){t("click",f)}function s(f){t("dblclick",f)}function c(f){t("mouseenter",f)}function d(f){t("mousemove",f)}function u(f){t("mouseleave",f)}return(f,p)=>!f.hidden&&f.dimensions.width!==0&&f.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,...f.$attrs})),null,16)):(n.openBlock(),n.createElementBlock("rect",n.mergeProps({key:1,id:f.id},f.$attrs,{class:["vue-flow__minimap-node",{selected:f.selected,dragging:f.dragging}],x:f.position.x,y:f.position.y,rx:f.borderRadius,ry:f.borderRadius,width:f.dimensions.width,height:f.dimensions.height,fill:f.color||l.value.background||l.value.backgroundColor,stroke:f.strokeColor,"stroke-width":f.strokeWidth,"shape-rendering":f.shapeRendering,onClick:r,onDblclick:s,onMouseenter:c,onMousemove:d,onMouseleave:u}),null,16,LN))],64)):n.createCommentVNode("",!0)}}),UN=["width","height","viewBox","aria-labelledby"],HN=["id"],FN=["d","fill","stroke","stroke-width"],GN={name:"MiniMap",compatConfig:{MODE:3}},YN=n.defineComponent({...GN,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,l=150,{id:r,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:f,d3Selection:p,d3Zoom:m,getNodesInitialized:h}=De(),b=n.ref();n.provide(Cu,o);const g=n.toRef(()=>{var W;return e.width??((W=i.style)==null?void 0:W.width)??a}),_=n.toRef(()=>{var W;return e.height??((W=i.style)==null?void 0:W.height)??l}),N=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",y=n.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),$=n.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),K=n.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),F=n.computed(()=>Qa(h.value.filter(W=>!W.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})),G=n.computed(()=>h.value&&h.value.length?zg(F.value,q.value):q.value),X=n.computed(()=>{const W=G.value.width/g.value,oe=G.value.height/_.value;return Math.max(W,oe)}),Q=n.computed(()=>{const W=X.value*g.value,oe=X.value*_.value,T=e.offsetScale*X.value;return{offset:T,x:G.value.x-(W-G.value.width)/2-T,y:G.value.y-(oe-G.value.height)/2-T,width:W+T*2,height:oe+T*2}}),de=n.computed(()=>!Q.value.x||!Q.value.y?"":`
|
|
28
|
-
M${
|
|
29
|
-
h${
|
|
30
|
-
v${
|
|
31
|
-
h${-
|
|
32
|
-
M${
|
|
33
|
-
h${
|
|
27
|
+
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=zc[t])==null?void 0:i.call(zc,...o)),this.name="VueFlowError",this.code=t,this.args=o}}function nl(e){return"clientX"in e}function eb(e){return"sourceEvent"in e}function Et(e,t){const o=nl(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 bo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function tb(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 Ni(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const nb=()=>!0;function ol(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function ob(e,t,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const l of t.values())wi(a,_i(l))>0&&i.push(l);return i}const ib=250;function ab(e,t,o,i){var a,l;let r=[],s=Number.POSITIVE_INFINITY;const c=ob(e,o,t+ib);for(const d of c){const u=[...((a=d.handleBounds)==null?void 0:a.source)??[],...((l=d.handleBounds)==null?void 0:l.target)??[]];for(const f of u){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:p,y:m}=Mn(d,f,f.position,!0),h=Math.sqrt((p-e.x)**2+(m-e.y)**2);h>t||(h<s?(r=[{...f,x:p,y:m}],s=h):h===s&&r.push({...f,x:p,y:m}))}}if(!r.length)return null;if(r.length>1){const d=i.type==="source"?"target":"source";return r.find(u=>u.type===d)??r[0]}return r[0]}function Uc(e,{handle:t,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:l,doc:r,lib:s,flowId:c,isValidConnection:d=nb},u,f,p,m){const h=l==="target",_=t?r.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:b,y:g}=Et(e),I=r.elementFromPoint(b,g),y=I!=null&&I.classList.contains(`${s}-flow__handle`)?I:_,N={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const q=Hc(void 0,y),U=y.getAttribute("data-nodeid"),X=y.getAttribute("data-handleid"),K=y.classList.contains("connectable"),W=y.classList.contains("connectableend");if(!U||!q)return N;const ne={source:h?U:i,sourceHandle:h?X:a,target:h?i:U,targetHandle:h?a:X};N.connection=ne;const L=K&&W&&(o===Tt.Strict?h&&q==="source"||!h&&q==="target":U!==i||X!==a);N.isValid=L&&d(ne,{nodes:f,edges:u,sourceNode:p(ne.source),targetNode:p(ne.target)}),N.toHandle=Fc(U,q,X,m,o,!0)}return N}function Hc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function lb(e,t){let o=null;return t?o="valid":e&&!t&&(o="invalid"),o}function rb(e,t){let o=null;return t?o=!0:e&&!t&&(o=!1),o}function Fc(e,t,o,i,a,l=!1){var r,s,c;const d=i.get(e);if(!d)return null;const u=a===Tt.Strict?(r=d.handleBounds)==null?void 0:r[t]:[...((s=d.handleBounds)==null?void 0:s.source)??[],...((c=d.handleBounds)==null?void 0:c.target)??[]],f=(o?u==null?void 0:u.find(p=>p.id===o):u==null?void 0:u[0])??null;return f&&l?{...f,...Mn(d,f,f.position,!0)}:f}const il={[$e.Left]:$e.Right,[$e.Right]:$e.Left,[$e.Top]:$e.Bottom,[$e.Bottom]:$e.Top},sb=["production","prod"];function _o(e,...t){Gc()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Gc(){return!sb.includes(process.env.NODE_ENV||"")}function Yc(e,t,o,i,a){const l=t.querySelectorAll(`.vue-flow__handle.${e}`);return l!=null&&l.length?Array.from(l).map(r=>{const s=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:e,nodeId:a,position:r.getAttribute("data-handlepos"),x:(s.left-o.left)/i,y:(s.top-o.top)/i,...vi(r)}}):null}function al(e,t,o,i,a,l=!1,r){a.value=!1,e.selected?(l||e.selected&&t)&&(i([e]),n.nextTick(()=>{r.blur()})):o([e])}function Ke(e){return typeof n.unref(e)<"u"}function cb(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 Ht(e)?a=e:a={...e,id:Nc(e)},a=kc(a,void 0,i),Fg(a,t)?!1:a}function db(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:l,...r}=e;return{...r,id:i?Nc(t):l,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Wc(e,t,o){const i={},a=[];for(let l=0;l<e.length;++l){const r=e[l];if(!sn(r)){o(new Ze(We.NODE_INVALID,r==null?void 0:r.id)||`[ID UNKNOWN|INDEX ${l}]`);continue}const s=zg(r,t(r.id),r.parentNode);r.parentNode&&(i[r.parentNode]=!0),a[l]=s}for(const l of a){const r=t(l.parentNode)||a.find(s=>s.id===l.parentNode);l.parentNode&&!r&&o(new Ze(We.NODE_MISSING_PARENT,l.id,l.parentNode)),(l.parentNode||i[l.id])&&(i[l.id]&&(l.isParent=!0),r&&(r.isParent=!0))}return a}function Kc(e,t,o,i,a,l){let r=a;const s=i.get(r)||new Map;i.set(r,s.set(o,t)),r=`${a}-${e}`;const c=i.get(r)||new Map;if(i.set(r,c.set(o,t)),l){r=`${a}-${e}-${l}`;const d=i.get(r)||new Map;i.set(r,d.set(o,t))}}function ll(e,t,o){e.clear();for(const i of o){const{source:a,target:l,sourceHandle:r=null,targetHandle:s=null}=i,c={edgeId:i.id,source:a,target:l,sourceHandle:r,targetHandle:s},d=`${a}-${r}--${l}-${s}`,u=`${l}-${s}--${a}-${r}`;Kc("source",c,u,e,a,r),Kc("target",c,d,e,l,s)}}function qc(e,t){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}function rl(e,t,o,i,a,l,r,s){const c=[];for(const d of e){const u=Ht(d)?d:cb(d,s,a,l);if(!u)continue;const f=o(u.source),p=o(u.target);if(!f||!p){a(new Ze(We.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!f){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:r,sourceNode:f,targetNode:p})){a(new Ze(We.EDGE_INVALID,u.id));continue}const m=i(u.id);c.push({...kc(u,m,l),sourceNode:f,targetNode:p})}return c}const Xc=Symbol("vueFlow"),jc=Symbol("nodeId"),Zc=Symbol("nodeRef"),ub=Symbol("edgeId"),fb=Symbol("edgeRef"),$i=Symbol("slots");function Jc(e){const{vueFlowRef:t,snapToGrid:o,snapGrid:i,noDragClassName:a,nodeLookup:l,nodeExtent:r,nodeDragThreshold:s,viewport:c,autoPanOnNodeDrag:d,autoPanSpeed:u,nodesDraggable:f,panBy:p,findNode:m,multiSelectionActive:h,nodesSelectionActive:_,selectNodesOnDrag:b,removeSelectedElements:g,addSelectedNodes:I,updateNodePositions:y,emits:N}=Oe(),{onStart:q,onDrag:U,onStop:X,onClick:K,el:W,disabled:ne,id:re,selectable:L,dragHandle:Q}=e,v=n.shallowRef(!1);let T=[],$,P=null,H={x:void 0,y:void 0},te={x:0,y:0},M=null,ee=!1,le=!1,me=0,ye=!1;const ce=hb(),ue=({x:j,y:Y})=>{H={x:j,y:Y};let E=!1;if(T=T.map(A=>{const R={x:j-A.distance.x,y:Y-A.distance.y},{computedPosition:G}=tl(A,o.value?Ni(R,i.value):R,N.error,r.value,A.parentNode?m(A.parentNode):void 0);return E=E||A.position.x!==G.x||A.position.y!==G.y,A.position=G,A}),le=le||E,!!E&&(y(T,!0,!0),v.value=!0,M)){const[A,R]=el({id:re,dragItems:T,findNode:m});U({event:M,node:A,nodes:R})}},he=()=>{if(!P)return;const[j,Y]=Vc(te,P,u.value);if(j!==0||Y!==0){const E={x:(H.x??0)-j/c.value.zoom,y:(H.y??0)-Y/c.value.zoom};p({x:j,y:Y})&&ue(E)}me=requestAnimationFrame(he)},ve=(j,Y)=>{ee=!0;const E=m(re);!b.value&&!h.value&&E&&(E.selected||g()),E&&n.toValue(L)&&b.value&&al(E,h.value,I,g,_,!1,Y);const A=ce(j.sourceEvent);if(H=A,T=qg(l.value,f.value,A,re),T.length){const[R,G]=el({id:re,dragItems:T,findNode:m});q({event:j.sourceEvent,node:R,nodes:G})}},Se=(j,Y)=>{var E;j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||(le=!1,s.value===0&&ve(j,Y),H=ce(j.sourceEvent),P=((E=t.value)==null?void 0:E.getBoundingClientRect())||null,te=Et(j.sourceEvent,P))},Ie=(j,Y)=>{const E=ce(j.sourceEvent);if(!ye&&ee&&d.value&&(ye=!0,he()),!ee){const A=E.xSnapped-(H.x??0),R=E.ySnapped-(H.y??0);Math.sqrt(A*A+R*R)>s.value&&ve(j,Y)}(H.x!==E.xSnapped||H.y!==E.ySnapped)&&T.length&&ee&&(M=j.sourceEvent,te=Et(j.sourceEvent,P),ue(E))},pe=j=>{let Y=!1;if(!ee&&!v.value&&!h.value){const E=j.sourceEvent,A=ce(E),R=A.xSnapped-(H.x??0),G=A.ySnapped-(H.y??0),J=Math.sqrt(R*R+G*G);J!==0&&J<=s.value&&(K==null||K(E),Y=!0)}if(T.length&&!Y){le&&(y(T,!1,!1),le=!1);const[E,A]=el({id:re,dragItems:T,findNode:m});X({event:j.sourceEvent,node:E,nodes:A})}T=[],v.value=!1,ye=!1,ee=!1,H={x:void 0,y:void 0},cancelAnimationFrame(me)};return n.watch([()=>n.toValue(ne),W],([j,Y],E,A)=>{if(Y){const R=ft(Y);j||($=Ph().on("start",G=>Se(G,Y)).on("drag",G=>Ie(G,Y)).on("end",G=>pe(G)).filter(G=>{const J=G.target,fe=n.toValue(Q);return!G.button&&(!a.value||!Oc(J,`.${a.value}`,Y)&&(!fe||Oc(J,fe,Y)))}),R.call($)),A(()=>{R.on(".drag",null),$&&($.on("start",null),$.on("drag",null),$.on("end",null))})}}),v}function mb(){return{doubleClick:Ne(),click:Ne(),mouseEnter:Ne(),mouseMove:Ne(),mouseLeave:Ne(),contextMenu:Ne(),updateStart:Ne(),update:Ne(),updateEnd:Ne()}}function pb(e,t){const o=mb();return o.doubleClick.on(i=>{var a,l;t.edgeDoubleClick(i),(l=(a=e.events)==null?void 0:a.doubleClick)==null||l.call(a,i)}),o.click.on(i=>{var a,l;t.edgeClick(i),(l=(a=e.events)==null?void 0:a.click)==null||l.call(a,i)}),o.mouseEnter.on(i=>{var a,l;t.edgeMouseEnter(i),(l=(a=e.events)==null?void 0:a.mouseEnter)==null||l.call(a,i)}),o.mouseMove.on(i=>{var a,l;t.edgeMouseMove(i),(l=(a=e.events)==null?void 0:a.mouseMove)==null||l.call(a,i)}),o.mouseLeave.on(i=>{var a,l;t.edgeMouseLeave(i),(l=(a=e.events)==null?void 0:a.mouseLeave)==null||l.call(a,i)}),o.contextMenu.on(i=>{var a,l;t.edgeContextMenu(i),(l=(a=e.events)==null?void 0:a.contextMenu)==null||l.call(a,i)}),o.updateStart.on(i=>{var a,l;t.edgeUpdateStart(i),(l=(a=e.events)==null?void 0:a.updateStart)==null||l.call(a,i)}),o.update.on(i=>{var a,l;t.edgeUpdate(i),(l=(a=e.events)==null?void 0:a.update)==null||l.call(a,i)}),o.updateEnd.on(i=>{var a,l;t.edgeUpdateEnd(i),(l=(a=e.events)==null?void 0:a.updateEnd)==null||l.call(a,i)}),Object.entries(o).reduce((i,[a,l])=>(i.emit[a]=l.trigger,i.on[a]=l.on,i),{emit:{},on:{}})}function hb(){const{viewport:e,snapGrid:t,snapToGrid:o,vueFlowRef:i}=Oe();return a=>{var l;const r=((l=i.value)==null?void 0:l.getBoundingClientRect())??{left:0,top:0},s=eb(a)?a.sourceEvent:a,{x:c,y:d}=Et(s,r),u=yo({x:c,y:d},e.value),{x:f,y:p}=o.value?Ni(u,t.value):u;return{xSnapped:f,ySnapped:p,...u}}}function xi(){return!0}function Qc({handleId:e,nodeId:t,type:o,isValidConnection:i,edgeUpdaterType:a,onEdgeUpdate:l,onEdgeUpdateEnd:r}){const{id:s,vueFlowRef:c,connectionMode:d,connectionRadius:u,connectOnClick:f,connectionClickStartHandle:p,nodesConnectable:m,autoPanOnConnect:h,autoPanSpeed:_,findNode:b,panBy:g,startConnection:I,updateConnection:y,endConnection:N,emits:q,viewport:U,edges:X,nodes:K,isValidConnection:W,nodeLookup:ne}=Oe();let re=null,L=!1,Q=null;function v($){var P;const H=n.toValue(o)==="target",te=nl($),M=vc($.target),ee=$.currentTarget;if(ee&&(te&&$.button===0||!te)){let le=function(be){E=Et(be,pe),ue=ab(yo(E,U.value,!1,[1,1]),u.value,ne.value,G),A||(R(),A=!0);const xe=Uc(be,{handle:ue,connectionMode:d.value,fromNodeId:n.toValue(t),fromHandleId:n.toValue(e),fromType:H?"target":"source",isValidConnection:ce,doc:M,lib:"vue",flowId:s,nodeLookup:ne.value},X.value,K.value,b,ne.value);Q=xe.handleDomNode,re=xe.connection,L=rb(!!ue,xe.isValid);const Ve={...ke,isValid:L,to:xe.toHandle&&L?ho({x:xe.toHandle.x,y:xe.toHandle.y},U.value):E,toHandle:xe.toHandle,toPosition:L&&xe.toHandle?xe.toHandle.position:il[G.position],toNode:xe.toHandle?ne.value.get(xe.toHandle.nodeId):null};if(L&&ue&&(ke!=null&&ke.toHandle)&&Ve.toHandle&&ke.toHandle.type===Ve.toHandle.type&&ke.toHandle.nodeId===Ve.toHandle.nodeId&&ke.toHandle.id===Ve.toHandle.id&&ke.to.x===Ve.to.x&&ke.to.y===Ve.to.y)return;const Te=ue??xe.toHandle;if(y(Te&&L?ho({x:Te.x,y:Te.y},U.value):E,Te,lb(!!Te,L)),ke=Ve,!ue&&!L&&!Q)return ol(Y);re&&re.source!==re.target&&Q&&(ol(Y),Y=Q,Q.classList.add("connecting","vue-flow__handle-connecting"),Q.classList.toggle("valid",!!L),Q.classList.toggle("vue-flow__handle-valid",!!L))},me=function(be){"touches"in be&&be.touches.length>0||((ue||Q)&&re&&L&&(l?l(be,re):q.connect(re)),q.connectEnd(be),a&&(r==null||r(be)),ol(Y),cancelAnimationFrame(he),N(be),A=!1,L=!1,re=null,Q=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",me),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",me))};const ye=b(n.toValue(t));let ce=n.toValue(i)||W.value||xi;!ce&&ye&&(ce=(H?ye.isValidSourcePos:ye.isValidTargetPos)||xi);let ue,he=0;const{x:ve,y:Se}=Et($),Ie=Hc(n.toValue(a),ee),pe=(P=c.value)==null?void 0:P.getBoundingClientRect();if(!pe||!Ie)return;const j=Fc(n.toValue(t),Ie,n.toValue(e),ne.value,d.value);if(!j)return;let Y,E=Et($,pe),A=!1;const R=()=>{if(!h.value)return;const[be,xe]=Vc(E,pe,_.value);g({x:be,y:xe}),he=requestAnimationFrame(R)},G={...j,nodeId:n.toValue(t),type:Ie,position:j.position},J=ne.value.get(n.toValue(t)),_e={inProgress:!0,isValid:null,from:Mn(J,G,$e.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:J,to:E,toHandle:null,toPosition:il[G.position],toNode:null};I({nodeId:n.toValue(t),id:n.toValue(e),type:Ie,position:(ee==null?void 0:ee.getAttribute("data-handlepos"))||$e.Top,...E},{x:ve-pe.left,y:Se-pe.top}),q.connectStart({event:$,nodeId:n.toValue(t),handleId:n.toValue(e),handleType:Ie});let ke=_e;M.addEventListener("mousemove",le),M.addEventListener("mouseup",me),M.addEventListener("touchmove",le),M.addEventListener("touchend",me)}}function T($){var P,H;if(!f.value)return;const te=n.toValue(o)==="target";if(!p.value){q.clickConnectStart({event:$,nodeId:n.toValue(t),handleId:n.toValue(e)}),I({nodeId:n.toValue(t),type:n.toValue(o),id:n.toValue(e),position:$e.Top,...Et($)},void 0,!0);return}let M=n.toValue(i)||W.value||xi;const ee=b(n.toValue(t));if(!M&&ee&&(M=(te?ee.isValidSourcePos:ee.isValidTargetPos)||xi),ee&&(typeof ee.connectable>"u"?m.value:ee.connectable)===!1)return;const le=vc($.target),me=Uc($,{handle:{nodeId:n.toValue(t),id:n.toValue(e),type:n.toValue(o),position:$e.Top,...Et($)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:M,doc:le,lib:"vue",flowId:s,nodeLookup:ne.value},X.value,K.value,b,ne.value),ye=((P=me.connection)==null?void 0:P.source)===((H=me.connection)==null?void 0:H.target);me.isValid&&me.connection&&!ye&&q.connect(me.connection),q.clickConnectEnd($),N($,!0)}return{handlePointerDown:v,handleClick:T}}function yb(){return n.inject(jc,"")}function ed(e){const t=e??yb()??"",o=n.inject(Zc,n.ref(null)),{findNode:i,edges:a,emits:l}=Oe(),r=i(t);return r||l.error(new Ze(We.NODE_NOT_FOUND,t)),{id:t,nodeEl:o,node:r,parentNode:n.computed(()=>i(r.parentNode)),connectedEdges:n.computed(()=>cn([r],a.value))}}function gb(){return{doubleClick:Ne(),click:Ne(),mouseEnter:Ne(),mouseMove:Ne(),mouseLeave:Ne(),contextMenu:Ne(),dragStart:Ne(),drag:Ne(),dragStop:Ne()}}function bb(e,t){const o=gb();return o.doubleClick.on(i=>{var a,l;t.nodeDoubleClick(i),(l=(a=e.events)==null?void 0:a.doubleClick)==null||l.call(a,i)}),o.click.on(i=>{var a,l;t.nodeClick(i),(l=(a=e.events)==null?void 0:a.click)==null||l.call(a,i)}),o.mouseEnter.on(i=>{var a,l;t.nodeMouseEnter(i),(l=(a=e.events)==null?void 0:a.mouseEnter)==null||l.call(a,i)}),o.mouseMove.on(i=>{var a,l;t.nodeMouseMove(i),(l=(a=e.events)==null?void 0:a.mouseMove)==null||l.call(a,i)}),o.mouseLeave.on(i=>{var a,l;t.nodeMouseLeave(i),(l=(a=e.events)==null?void 0:a.mouseLeave)==null||l.call(a,i)}),o.contextMenu.on(i=>{var a,l;t.nodeContextMenu(i),(l=(a=e.events)==null?void 0:a.contextMenu)==null||l.call(a,i)}),o.dragStart.on(i=>{var a,l;t.nodeDragStart(i),(l=(a=e.events)==null?void 0:a.dragStart)==null||l.call(a,i)}),o.drag.on(i=>{var a,l;t.nodeDrag(i),(l=(a=e.events)==null?void 0:a.drag)==null||l.call(a,i)}),o.dragStop.on(i=>{var a,l;t.nodeDragStop(i),(l=(a=e.events)==null?void 0:a.dragStop)==null||l.call(a,i)}),Object.entries(o).reduce((i,[a,l])=>(i.emit[a]=l.trigger,i.on[a]=l.on,i),{emit:{},on:{}})}function td(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:l,nodesDraggable:r,emits:s}=Oe();return(c,d=!1)=>{const u=l.value?a.value[0]:5,f=l.value?a.value[1]:5,p=d?4:1,m=c.x*u*p,h=c.y*f*p,_=[];for(const b of e.value)if(b.draggable||r&&typeof b.draggable>"u"){const g={x:b.computedPosition.x+m,y:b.computedPosition.y+h},{position:I}=tl(b,g,s.error,t.value,b.parentNode?i(b.parentNode):void 0);_.push({id:b.id,position:I,from:b.position,distance:{x:c.x,y:c.y},dimensions:b.dimensions})}o(_,!0,!1)}}const Ii=.1,_b=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Yt(){return _o("Viewport not initialized yet."),Promise.resolve(!1)}const wb={zoomIn:Yt,zoomOut:Yt,zoomTo:Yt,fitView:Yt,setCenter:Yt,fitBounds:Yt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Yt,setTransform:Yt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function vb(e){function t(i,a){return new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?ao:ci).scaleBy(sl(e.d3Selection,a==null?void 0:a.duration,a==null?void 0:a.ease,()=>{l(!0)}),i):l(!1)})}function o(i,a,l,r){return new Promise(s=>{var c;const{x:d,y:u}=wc({x:-i,y:-a},e.translateExtent),f=Vn.translate(-d,-u).scale(l);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((r==null?void 0:r.interpolate)==="linear"?ao:ci).transform(sl(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),f):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,l)=>new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((l==null?void 0:l.interpolate)==="linear"?ao:ci).scaleTo(sl(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{r(!0)}),a):r(!1)}),setViewport:(a,l)=>o(a.x,a.y,a.zoom,l),setTransform:(a,l)=>o(a.x,a.y,a.zoom,l),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:Ii,includeHiddenNodes:!1,duration:0})=>{var l,r;const s=[];for(const p of e.nodes)p.dimensions.width&&p.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!p.hidden)&&(!((l=a.nodes)!=null&&l.length)||(r=a.nodes)!=null&&r.length&&a.nodes.includes(p.id))&&s.push(p);if(!s.length)return Promise.resolve(!1);const c=Za(s),{x:d,y:u,zoom:f}=Sc(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??Ii);return o(d,u,f,a)},setCenter:(a,l,r)=>{const s=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:e.maxZoom,c=e.dimensions.width/2-a*s,d=e.dimensions.height/2-l*s;return o(c,d,s,r)},fitBounds:(a,l={padding:Ii})=>{const{x:r,y:s,zoom:c}=Sc(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,l.padding??Ii);return o(r,s,c,l)},project:a=>yo(a,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:a=>{if(e.vueFlowRef){const{x:l,y:r}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x-l,y:a.y-r};return yo(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:a=>{if(e.vueFlowRef){const{x:l,y:r}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x+l,y:a.y+r};return ho(s,e.viewport)}return{x:0,y:0}}}:wb)}function sl(e,t=0,o=_b,i=()=>{}){const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(o).on("end",i):e}function kb(e,t,o){const i=n.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let _,b,g=!!(o.nodes.value.length||o.edges.value.length);_=xn([e.modelValue,()=>{var I,y;return(y=(I=e.modelValue)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(b==null||b.pause(),o.setElements(I),!b&&!g&&I.length?g=!0:b==null||b.resume())}),b=xn([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([I,y])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(_==null||_.pause(),e.modelValue.value=[...I,...y],n.nextTick(()=>{_==null||_.resume()}))},{immediate:g}),n.onScopeDispose(()=>{_==null||_.stop(),b==null||b.stop()})})},l=()=>{i.run(()=>{let _,b,g=!!o.nodes.value.length;_=xn([e.nodes,()=>{var I,y;return(y=(I=e.nodes)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(b==null||b.pause(),o.setNodes(I),!b&&!g&&I.length?g=!0:b==null||b.resume())}),b=xn([o.nodes,()=>o.nodes.value.length],([I])=>{var y;(y=e.nodes)!=null&&y.value&&Array.isArray(e.nodes.value)&&(_==null||_.pause(),e.nodes.value=[...I],n.nextTick(()=>{_==null||_.resume()}))},{immediate:g}),n.onScopeDispose(()=>{_==null||_.stop(),b==null||b.stop()})})},r=()=>{i.run(()=>{let _,b,g=!!o.edges.value.length;_=xn([e.edges,()=>{var I,y;return(y=(I=e.edges)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(b==null||b.pause(),o.setEdges(I),!b&&!g&&I.length?g=!0:b==null||b.resume())}),b=xn([o.edges,()=>o.edges.value.length],([I])=>{var y;(y=e.edges)!=null&&y.value&&Array.isArray(e.edges.value)&&(_==null||_.pause(),e.edges.value=[...I],n.nextTick(()=>{_==null||_.resume()}))},{immediate:g}),n.onScopeDispose(()=>{_==null||_.stop(),b==null||b.stop()})})},s=()=>{i.run(()=>{n.watch(()=>t.maxZoom,()=>{t.maxZoom&&Ke(t.maxZoom)&&o.setMaxZoom(t.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{n.watch(()=>t.minZoom,()=>{t.minZoom&&Ke(t.minZoom)&&o.setMinZoom(t.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{n.watch(()=>t.translateExtent,()=>{t.translateExtent&&Ke(t.translateExtent)&&o.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{n.watch(()=>t.nodeExtent,()=>{t.nodeExtent&&Ke(t.nodeExtent)&&o.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{i.run(()=>{n.watch(()=>t.applyDefault,()=>{Ke(t.applyDefault)&&(o.applyDefault.value=t.applyDefault)},{immediate:!0})})},p=()=>{i.run(()=>{const _=async b=>{let g=b;typeof t.autoConnect=="function"&&(g=await t.autoConnect(b)),g!==!1&&o.addEdges([g])};n.watch(()=>t.autoConnect,()=>{Ke(t.autoConnect)&&(o.autoConnect.value=t.autoConnect)},{immediate:!0}),n.watch(o.autoConnect,(b,g,I)=>{b?o.onConnect(_):o.hooks.value.connect.off(_),I(()=>{o.hooks.value.connect.off(_)})},{immediate:!0})})},m=()=>{const _=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(t)){const g=b;if(!_.includes(g)){const I=n.toRef(()=>t[g]),y=o[g];n.isRef(y)&&i.run(()=>{n.watch(I,N=>{Ke(N)&&(y.value=N)},{immediate:!0})})}}};(()=>{a(),l(),r(),c(),s(),d(),u(),f(),p(),m()})()}),()=>i.stop()}function Eb(){return{edgesChange:Ne(),nodesChange:Ne(),nodeDoubleClick:Ne(),nodeClick:Ne(),nodeMouseEnter:Ne(),nodeMouseMove:Ne(),nodeMouseLeave:Ne(),nodeContextMenu:Ne(),nodeDragStart:Ne(),nodeDrag:Ne(),nodeDragStop:Ne(),nodesInitialized:Ne(),miniMapNodeClick:Ne(),miniMapNodeDoubleClick:Ne(),miniMapNodeMouseEnter:Ne(),miniMapNodeMouseMove:Ne(),miniMapNodeMouseLeave:Ne(),connect:Ne(),connectStart:Ne(),connectEnd:Ne(),clickConnectStart:Ne(),clickConnectEnd:Ne(),paneReady:Ne(),init:Ne(),move:Ne(),moveStart:Ne(),moveEnd:Ne(),selectionDragStart:Ne(),selectionDrag:Ne(),selectionDragStop:Ne(),selectionContextMenu:Ne(),selectionStart:Ne(),selectionEnd:Ne(),viewportChangeStart:Ne(),viewportChange:Ne(),viewportChangeEnd:Ne(),paneScroll:Ne(),paneClick:Ne(),paneContextMenu:Ne(),paneMouseEnter:Ne(),paneMouseMove:Ne(),paneMouseLeave:Ne(),edgeContextMenu:Ne(),edgeMouseEnter:Ne(),edgeMouseMove:Ne(),edgeMouseLeave:Ne(),edgeDoubleClick:Ne(),edgeClick:Ne(),edgeUpdateStart:Ne(),edgeUpdate:Ne(),edgeUpdateEnd:Ne(),updateNodeInternals:Ne(),error:Ne(e=>_o(e.message))}}function Nb(e,t){const o=n.getCurrentInstance();n.onBeforeMount(()=>{for(const[a,l]of Object.entries(t.value)){const r=s=>{e(a,s)};l.setEmitter(r),Qn(l.removeEmitter),l.setHasEmitListeners(()=>i(a)),Qn(l.removeHasEmitListeners)}});function i(a){var l;const r=$b(a);return!!((l=o==null?void 0:o.vnode.props)==null?void 0:l[r])}}function $b(e){const[t,...o]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(a,l)=>l.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function nd(){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:qa.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:fo.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:ln.Bezier,style:{}},connectionMode:Tt.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:bo()?"Meta":"Control",zoomActivationKeyCode:bo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Eb(),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 xb=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Ib(e,t,o){const i=vb(e),a=E=>{const A=E??[];e.hooks.updateNodeInternals.trigger(A)},l=E=>Hg(E,e.nodes,e.edges),r=E=>Ug(E,e.nodes,e.edges),s=E=>cn(E,e.edges),c=({id:E,type:A,nodeId:R})=>{var G;const J=E?`-${A}-${E}`:`-${A}`;return Array.from(((G=e.connectionLookup.get(`${R}${J}`))==null?void 0:G.values())??[])},d=E=>{if(E)return t.value.get(E)},u=E=>{if(E)return o.value.get(E)},f=(E,A,R)=>{var G,J;const fe=[];for(const _e of E){const ke={id:_e.id,type:"position",dragging:R,from:_e.from};if(A&&(ke.position=_e.position,_e.parentNode)){const be=d(_e.parentNode);ke.position={x:ke.position.x-(((G=be==null?void 0:be.computedPosition)==null?void 0:G.x)??0),y:ke.position.y-(((J=be==null?void 0:be.computedPosition)==null?void 0:J.y)??0)}}fe.push(ke)}fe!=null&&fe.length&&e.hooks.nodesChange.trigger(fe)},p=E=>{if(!e.vueFlowRef)return;const A=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!A)return;const R=window.getComputedStyle(A),{m22:G}=new window.DOMMatrixReadOnly(R.transform),J=[];for(const fe of E){const _e=fe,ke=d(_e.id);if(ke){const be=vi(_e.nodeElement);if(!!(be.width&&be.height&&(ke.dimensions.width!==be.width||ke.dimensions.height!==be.height||_e.forceUpdate))){const Ve=_e.nodeElement.getBoundingClientRect();ke.dimensions=be,ke.handleBounds.source=Yc("source",_e.nodeElement,Ve,G,ke.id),ke.handleBounds.target=Yc("target",_e.nodeElement,Ve,G,ke.id),J.push({id:ke.id,type:"dimensions",dimensions:be})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),J.length&&e.hooks.nodesChange.trigger(J)},m=(E,A)=>{const R=new Set,G=new Set;for(const _e of E)sn(_e)?R.add(_e.id):Ht(_e)&&G.add(_e.id);const J=Gt(t.value,R,!0),fe=Gt(o.value,G);if(e.multiSelectionActive){for(const _e of R)J.push(Ft(_e,A));for(const _e of G)fe.push(Ft(_e,A))}J.length&&e.hooks.nodesChange.trigger(J),fe.length&&e.hooks.edgesChange.trigger(fe)},h=E=>{if(e.multiSelectionActive){const A=E.map(R=>Ft(R.id,!0));e.hooks.nodesChange.trigger(A);return}e.hooks.nodesChange.trigger(Gt(t.value,new Set(E.map(A=>A.id)),!0)),e.hooks.edgesChange.trigger(Gt(o.value))},_=E=>{if(e.multiSelectionActive){const A=E.map(R=>Ft(R.id,!0));e.hooks.edgesChange.trigger(A);return}e.hooks.edgesChange.trigger(Gt(o.value,new Set(E.map(A=>A.id)))),e.hooks.nodesChange.trigger(Gt(t.value,new Set,!0))},b=E=>{m(E,!0)},g=E=>{const R=(E||e.nodes).map(G=>(G.selected=!1,Ft(G.id,!1)));e.hooks.nodesChange.trigger(R)},I=E=>{const R=(E||e.edges).map(G=>(G.selected=!1,Ft(G.id,!1)));e.hooks.edgesChange.trigger(R)},y=E=>{if(!E||!E.length)return m([],!1);const A=E.reduce((R,G)=>{const J=Ft(G.id,!1);return sn(G)?R.nodes.push(J):R.edges.push(J),R},{nodes:[],edges:[]});A.nodes.length&&e.hooks.nodesChange.trigger(A.nodes),A.edges.length&&e.hooks.edgesChange.trigger(A.edges)},N=E=>{var A;(A=e.d3Zoom)==null||A.scaleExtent([E,e.maxZoom]),e.minZoom=E},q=E=>{var A;(A=e.d3Zoom)==null||A.scaleExtent([e.minZoom,E]),e.maxZoom=E},U=E=>{var A;(A=e.d3Zoom)==null||A.translateExtent(E),e.translateExtent=E},X=E=>{e.nodeExtent=E,a()},K=E=>{var A;(A=e.d3Zoom)==null||A.clickDistance(E)},W=E=>{e.nodesDraggable=E,e.nodesConnectable=E,e.elementsSelectable=E},ne=E=>{const A=E instanceof Function?E(e.nodes):E;!e.initialized&&!A.length||(e.nodes=Wc(A,d,e.hooks.error.trigger))},re=E=>{const A=E instanceof Function?E(e.edges):E;if(!e.initialized&&!A.length)return;const R=rl(A,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);ll(e.connectionLookup,o.value,R),e.edges=R},L=E=>{const A=E instanceof Function?E([...e.nodes,...e.edges]):E;!e.initialized&&!A.length||(ne(A.filter(sn)),re(A.filter(Ht)))},Q=E=>{let A=E instanceof Function?E(e.nodes):E;A=Array.isArray(A)?A:[A];const R=Wc(A,d,e.hooks.error.trigger),G=[];for(const J of R)G.push(Tc(J));G.length&&e.hooks.nodesChange.trigger(G)},v=E=>{let A=E instanceof Function?E(e.edges):E;A=Array.isArray(A)?A:[A];const R=rl(A,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),G=[];for(const J of R)G.push(Tc(J));G.length&&e.hooks.edgesChange.trigger(G)},T=(E,A=!0,R=!1)=>{const G=E instanceof Function?E(e.nodes):E,J=Array.isArray(G)?G:[G],fe=[],_e=[];function ke(xe){const Ve=s(xe);for(const Te of Ve)(!Ke(Te.deletable)||Te.deletable)&&_e.push(Bc(Te.id,Te.source,Te.target,Te.sourceHandle,Te.targetHandle))}function be(xe){const Ve=[];for(const Te of e.nodes)Te.parentNode===xe&&Ve.push(Te);if(Ve.length){for(const Te of Ve)fe.push(Mc(Te.id));A&&ke(Ve);for(const Te of Ve)be(Te.id)}}for(const xe of J){const Ve=typeof xe=="string"?d(xe):xe;Ve&&(Ke(Ve.deletable)&&!Ve.deletable||(fe.push(Mc(Ve.id)),A&&ke([Ve]),R&&be(Ve.id)))}_e.length&&e.hooks.edgesChange.trigger(_e),fe.length&&e.hooks.nodesChange.trigger(fe)},$=E=>{const A=E instanceof Function?E(e.edges):E,R=Array.isArray(A)?A:[A],G=[];for(const J of R){const fe=typeof J=="string"?u(J):J;fe&&(Ke(fe.deletable)&&!fe.deletable||G.push(Bc(typeof J=="string"?J:J.id,fe.source,fe.target,fe.sourceHandle,fe.targetHandle)))}e.hooks.edgesChange.trigger(G)},P=(E,A,R=!0)=>{const G=u(E.id);if(!G)return!1;const J=e.edges.indexOf(G),fe=db(E,A,G,R,e.hooks.error.trigger);if(fe){const[_e]=rl([fe],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((ke,be)=>be===J?_e:ke),ll(e.connectionLookup,o.value,[_e]),_e}return!1},H=(E,A,R={replace:!1})=>{const G=u(E);if(!G)return;const J=typeof A=="function"?A(G):A;G.data=R.replace?J:{...G.data,...J}},te=E=>Ac(E,e.nodes),M=E=>{const A=Ac(E,e.edges);return ll(e.connectionLookup,o.value,A),A},ee=(E,A,R={replace:!1})=>{const G=d(E);if(!G)return;const J=typeof A=="function"?A(G):A;R.replace?e.nodes.splice(e.nodes.indexOf(G),1,J):Object.assign(G,J)},le=(E,A,R={replace:!1})=>{const G=d(E);if(!G)return;const J=typeof A=="function"?A(G):A;G.data=R.replace?J:{...G.data,...J}},me=(E,A,R=!1)=>{R?e.connectionClickStartHandle=E:e.connectionStartHandle=E,e.connectionEndHandle=null,e.connectionStatus=null,A&&(e.connectionPosition=A)},ye=(E,A=null,R=null)=>{e.connectionStartHandle&&(e.connectionPosition=E,e.connectionEndHandle=A,e.connectionStatus=R)},ce=(E,A)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,A?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ue=E=>{const A=Pg(E),R=A?null:po(E)?E:d(E.id);return!A&&!R?[null,null,A]:[A?E:_i(R),R,A]},he=(E,A=!0,R=e.nodes)=>{const[G,J,fe]=ue(E);if(!G)return[];const _e=[];for(const ke of R||e.nodes){if(!fe&&(ke.id===J.id||!ke.computedPosition))continue;const be=_i(ke),xe=wi(be,G);(A&&xe>0||xe>=be.width*be.height||xe>=Number(G.width)*Number(G.height))&&_e.push(ke)}return _e},ve=(E,A,R=!0)=>{const[G]=ue(E);if(!G)return!1;const J=wi(G,A);return R&&J>0||J>=Number(G.width)*Number(G.height)},Se=E=>{const{viewport:A,dimensions:R,d3Zoom:G,d3Selection:J,translateExtent:fe}=e;if(!G||!J||!E.x&&!E.y)return!1;const _e=Vn.translate(A.x+E.x,A.y+E.y).scale(A.zoom),ke=[[0,0],[R.width,R.height]],be=G.constrain()(_e,ke,fe),xe=e.viewport.x!==be.x||e.viewport.y!==be.y||e.viewport.zoom!==be.k;return G.transform(J,be),xe},Ie=E=>{const A=E instanceof Function?E(e):E,R=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ke(A.defaultEdgeOptions)&&(e.defaultEdgeOptions=A.defaultEdgeOptions);const G=A.modelValue||A.nodes||A.edges?[]:void 0;G&&(A.modelValue&&G.push(...A.modelValue),A.nodes&&G.push(...A.nodes),A.edges&&G.push(...A.edges),L(G));const J=()=>{Ke(A.maxZoom)&&q(A.maxZoom),Ke(A.minZoom)&&N(A.minZoom),Ke(A.translateExtent)&&U(A.translateExtent)};for(const fe of Object.keys(A)){const _e=fe,ke=A[_e];![...xb,...R].includes(_e)&&Ke(ke)&&(e[_e]=ke)}Ia(()=>e.d3Zoom).not.toBeNull().then(J),e.initialized||(e.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:p,setElements:L,setNodes:ne,setEdges:re,addNodes:Q,addEdges:v,removeNodes:T,removeEdges:$,findNode:d,findEdge:u,updateEdge:P,updateEdgeData:H,updateNode:ee,updateNodeData:le,applyEdgeChanges:M,applyNodeChanges:te,addSelectedElements:b,addSelectedNodes:h,addSelectedEdges:_,setMinZoom:N,setMaxZoom:q,setTranslateExtent:U,setNodeExtent:X,setPaneClickDistance:K,removeSelectedElements:y,removeSelectedNodes:g,removeSelectedEdges:I,startConnection:me,updateConnection:ye,endConnection:ce,setInteractive:W,setState:Ie,getIntersectingNodes:he,getIncomers:l,getOutgoers:r,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:ve,panBy:Se,fitView:E=>i.value.fitView(E),zoomIn:E=>i.value.zoomIn(E),zoomOut:E=>i.value.zoomOut(E),zoomTo:(E,A)=>i.value.zoomTo(E,A),setViewport:(E,A)=>i.value.setViewport(E,A),setTransform:(E,A)=>i.value.setTransform(E,A),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(E,A,R)=>i.value.setCenter(E,A,R),fitBounds:(E,A)=>i.value.fitBounds(E,A),project:E=>i.value.project(E),screenToFlowCoordinate:E=>i.value.screenToFlowCoordinate(E),flowToScreenCoordinate:E=>i.value.flowToScreenCoordinate(E),toObject:()=>{const E=[],A=[];for(const R of e.nodes){const{computedPosition:G,handleBounds:J,selected:fe,dimensions:_e,isParent:ke,resizing:be,dragging:xe,events:Ve,...Te}=R;E.push(Te)}for(const R of e.edges){const{selected:G,sourceNode:J,targetNode:fe,events:_e,...ke}=R;A.push(ke)}return JSON.parse(JSON.stringify({nodes:E,edges:A,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:E=>new Promise(A=>{const{nodes:R,edges:G,position:J,zoom:fe,viewport:_e}=E;R&&ne(R),G&&re(G);const[ke,be]=_e!=null&&_e.x&&(_e!=null&&_e.y)?[_e.x,_e.y]:J??[null,null];if(ke&&be){const xe=(_e==null?void 0:_e.zoom)||fe||e.viewport.zoom;return Ia(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:ke,y:be,zoom:xe}).then(()=>{A(!0)})})}else A(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const E=nd();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const A=Vn.translate(E.defaultViewport.x??0,E.defaultViewport.y??0).scale(rn(E.defaultViewport.zoom??1,E.minZoom,E.maxZoom)),R=e.viewportRef.getBoundingClientRect(),G=[[0,0],[R.width,R.height]],J=e.d3Zoom.constrain()(A,G,E.translateExtent);e.d3Zoom.transform(e.d3Selection,J)}Ie(E)},$destroy:()=>{}}}const Sb=["data-id","data-handleid","data-nodeid","data-handlepos"],Cb={name:"Handle",compatConfig:{MODE:3}},dn=n.defineComponent({...Cb,props:{id:{default:null},type:{},position:{default:()=>$e.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:l,connectionStartHandle:r,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:f,noPanClassName:p}=Oe(),{id:m,node:h,nodeEl:_,connectedEdges:b}=ed(),g=n.ref(),I=n.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),y=n.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),N=n.toRef(()=>{var re,L,Q,v,T,$;return((re=r.value)==null?void 0:re.nodeId)===m&&((L=r.value)==null?void 0:L.id)===e.id&&((Q=r.value)==null?void 0:Q.type)===i.value||((v=c.value)==null?void 0:v.nodeId)===m&&((T=c.value)==null?void 0:T.id)===e.id&&(($=c.value)==null?void 0:$.type)===i.value}),q=n.toRef(()=>{var re,L,Q;return((re=s.value)==null?void 0:re.nodeId)===m&&((L=s.value)==null?void 0:L.id)===e.id&&((Q=s.value)==null?void 0:Q.type)===i.value}),{handlePointerDown:U,handleClick:X}=Qc({nodeId:m,handleId:e.id,isValidConnection:a,type:i}),K=n.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!b.value.some(re=>{const L=re[`${i.value}Handle`];return re[i.value]!==m?!1:L?L===e.id:!0}):typeof e.connectable=="number"?b.value.filter(re=>{const L=re[`${i.value}Handle`];return re[i.value]!==m?!1:L?L===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(h,b.value):Ke(e.connectable)?e.connectable:u.value);n.onMounted(()=>{var re;if(!h.dimensions.width||!h.dimensions.height)return;const L=(re=h.handleBounds[i.value])==null?void 0:re.find(te=>te.id===e.id);if(!d.value||L)return;const Q=d.value.querySelector(".vue-flow__transformationpane");if(!_.value||!g.value||!Q||!e.id)return;const v=_.value.getBoundingClientRect(),T=g.value.getBoundingClientRect(),$=window.getComputedStyle(Q),{m22:P}=new window.DOMMatrixReadOnly($.transform),H={id:e.id,position:e.position,x:(T.left-v.left)/P,y:(T.top-v.top)/P,type:i.value,nodeId:m,...vi(g.value)};h.handleBounds[i.value]=[...h.handleBounds[i.value]??[],H]});function W(re){const L=nl(re);K.value&&I.value&&(L&&re.button===0||!L)&&U(re)}function ne(re){!m||!s.value&&!I.value||K.value&&X(re)}return t({handleClick:X,handlePointerDown:U,onClick:ne,onPointerDown:W}),(re,L)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"handle",ref:g,"data-id":`${n.unref(l)}-${n.unref(m)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":n.unref(m),"data-handlepos":re.position,class:n.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${re.position}`,`vue-flow__handle-${e.id}`,n.unref(f),n.unref(p),i.value,{connectable:K.value,connecting:q.value,connectablestart:I.value,connectableend:y.value,connectionindicator:K.value&&(I.value&&!N.value||y.value&&N.value)}]]),onMousedown:W,onTouchstartPassive:W,onClick:ne},[n.renderSlot(re.$slots,"default",{id:re.id})],42,Sb))}}),Si=function({sourcePosition:e=$e.Bottom,targetPosition:t=$e.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:l,data:r}){const s=r.label??o;return[n.h(dn,{type:"target",position:t,connectable:i,isValidConnection:a}),typeof s!="string"&&s?n.h(s):n.h(n.Fragment,[s]),n.h(dn,{type:"source",position:e,connectable:i,isValidConnection:l})]};Si.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Si.inheritAttrs=!1,Si.compatConfig={MODE:3};const Rb=Si,Ci=function({targetPosition:e=$e.Top,label:t,connectable:o=!0,isValidTargetPos:i,data:a}){const l=a.label??t;return[n.h(dn,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?n.h(l):n.h(n.Fragment,[l])]};Ci.props=["targetPosition","label","isValidTargetPos","connectable","data"],Ci.inheritAttrs=!1,Ci.compatConfig={MODE:3};const Vb=Ci,Ri=function({sourcePosition:e=$e.Bottom,label:t,connectable:o=!0,isValidSourcePos:i,data:a}){const l=a.label??t;return[typeof l!="string"&&l?n.h(l):n.h(n.Fragment,[l]),n.h(dn,{type:"source",position:e,connectable:o,isValidConnection:i})]};Ri.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Ri.inheritAttrs=!1,Ri.compatConfig={MODE:3};const Ab=Ri,Tb=["transform"],Mb=["width","height","x","y","rx","ry"],Bb=["y"],Db={name:"EdgeText",compatConfig:{MODE:3}},Ob=n.defineComponent({...Db,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 l=o.value.getBBox();(l.width!==t.value.width||l.height!==t.value.height)&&(t.value=l)}return(l,r)=>(n.openBlock(),n.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[l.labelShowBg?(n.openBlock(),n.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*l.labelBgPadding[0]}px`,height:`${t.value.height+2*l.labelBgPadding[1]}px`,x:-l.labelBgPadding[0],y:-l.labelBgPadding[1],style:n.normalizeStyle(l.labelBgStyle),rx:l.labelBgBorderRadius,ry:l.labelBgBorderRadius},null,12,Mb)):n.createCommentVNode("",!0),n.createElementVNode("text",n.mergeProps(l.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:l.labelStyle}),[n.renderSlot(l.$slots,"default",{},()=>[typeof l.label!="string"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.label),{key:0})):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(l.label),1)],64))])],16,Bb)],8,Tb))}}),Lb=["id","d","marker-end","marker-start"],Pb=["d","stroke-width"],zb={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Vi=n.defineComponent({...zb,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),l=n.useAttrs();return t({pathEl:o,interactionEl:i,labelEl:a}),(r,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",n.mergeProps(n.unref(l),{id:r.id,ref_key:"pathEl",ref:o,d:r.path,class:"vue-flow__edge-path","marker-end":r.markerEnd,"marker-start":r.markerStart}),null,16,Lb),r.interactionWidth?(n.openBlock(),n.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:r.path,"stroke-width":r.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Pb)):n.createCommentVNode("",!0),r.label&&r.labelX&&r.labelY?(n.openBlock(),n.createBlock(Ob,{key:1,ref_key:"labelEl",ref:a,x:r.labelX,y:r.labelY,label:r.label,"label-show-bg":r.labelShowBg,"label-bg-style":r.labelBgStyle,"label-bg-padding":r.labelBgPadding,"label-bg-border-radius":r.labelBgBorderRadius,"label-style":r.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 od({sourceX:e,sourceY:t,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,l=o<e?o+a:o-a,r=Math.abs(i-t)/2,s=i<t?i+r:i-r;return[l,s,a,r]}function id({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:r,targetControlY:s}){const c=e*.125+a*.375+r*.375+o*.125,d=t*.125+l*.375+s*.375+i*.125,u=Math.abs(c-e),f=Math.abs(d-t);return[c,d,u,f]}function Ai(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ad({pos:e,x1:t,y1:o,x2:i,y2:a,c:l}){let r,s;switch(e){case $e.Left:r=t-Ai(t-i,l),s=o;break;case $e.Right:r=t+Ai(i-t,l),s=o;break;case $e.Top:r=t,s=o-Ai(o-a,l);break;case $e.Bottom:r=t,s=o+Ai(a-o,l);break}return[r,s]}function ld(e){const{sourceX:t,sourceY:o,sourcePosition:i=$e.Bottom,targetX:a,targetY:l,targetPosition:r=$e.Top,curvature:s=.25}=e,[c,d]=ad({pos:i,x1:t,y1:o,x2:a,y2:l,c:s}),[u,f]=ad({pos:r,x1:a,y1:l,x2:t,y2:o,c:s}),[p,m,h,_]=id({sourceX:t,sourceY:o,targetX:a,targetY:l,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:f});return[`M${t},${o} C${c},${d} ${u},${f} ${a},${l}`,p,m,h,_]}function rd({pos:e,x1:t,y1:o,x2:i,y2:a}){let l,r;switch(e){case $e.Left:case $e.Right:l=.5*(t+i),r=o;break;case $e.Top:case $e.Bottom:l=t,r=.5*(o+a);break}return[l,r]}function sd(e){const{sourceX:t,sourceY:o,sourcePosition:i=$e.Bottom,targetX:a,targetY:l,targetPosition:r=$e.Top}=e,[s,c]=rd({pos:i,x1:t,y1:o,x2:a,y2:l}),[d,u]=rd({pos:r,x1:a,y1:l,x2:t,y2:o}),[f,p,m,h]=id({sourceX:t,sourceY:o,targetX:a,targetY:l,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${t},${o} C${s},${c} ${d},${u} ${a},${l}`,f,p,m,h]}const cd={[$e.Left]:{x:-1,y:0},[$e.Right]:{x:1,y:0},[$e.Top]:{x:0,y:-1},[$e.Bottom]:{x:0,y:1}};function Ub({source:e,sourcePosition:t=$e.Bottom,target:o}){return t===$e.Left||t===$e.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 dd(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Hb({source:e,sourcePosition:t=$e.Bottom,target:o,targetPosition:i=$e.Top,center:a,offset:l}){const r=cd[t],s=cd[i],c={x:e.x+r.x*l,y:e.y+r.y*l},d={x:o.x+s.x*l,y:o.y+s.y*l},u=Ub({source:c,sourcePosition:t,target:d}),f=u.x!==0?"x":"y",p=u[f];let m,h,_;const b={x:0,y:0},g={x:0,y:0},[I,y,N,q]=od({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(r[f]*s[f]===-1){h=a.x??I,_=a.y??y;const X=[{x:h,y:c.y},{x:h,y:d.y}],K=[{x:c.x,y:_},{x:d.x,y:_}];r[f]===p?m=f==="x"?X:K:m=f==="x"?K:X}else{const X=[{x:c.x,y:d.y}],K=[{x:d.x,y:c.y}];if(f==="x"?m=r.x===p?K:X:m=r.y===p?X:K,t===i){const Q=Math.abs(e[f]-o[f]);if(Q<=l){const v=Math.min(l-1,l-Q);r[f]===p?b[f]=(c[f]>e[f]?-1:1)*v:g[f]=(d[f]>o[f]?-1:1)*v}}if(t!==i){const Q=f==="x"?"y":"x",v=r[f]===s[Q],T=c[Q]>d[Q],$=c[Q]<d[Q];(r[f]===1&&(!v&&T||v&&$)||r[f]!==1&&(!v&&$||v&&T))&&(m=f==="x"?X:K)}const W={x:c.x+b.x,y:c.y+b.y},ne={x:d.x+g.x,y:d.y+g.y},re=Math.max(Math.abs(W.x-m[0].x),Math.abs(ne.x-m[0].x)),L=Math.max(Math.abs(W.y-m[0].y),Math.abs(ne.y-m[0].y));re>=L?(h=(W.x+ne.x)/2,_=m[0].y):(h=m[0].x,_=(W.y+ne.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...m,{x:d.x+g.x,y:d.y+g.y},o],h,_,N,q]}function Fb(e,t,o,i){const a=Math.min(dd(e,t)/2,dd(t,o)/2,i),{x:l,y:r}=t;if(e.x===l&&l===o.x||e.y===r&&r===o.y)return`L${l} ${r}`;if(e.y===r){const d=e.x<o.x?-1:1,u=e.y<o.y?1:-1;return`L ${l+a*d},${r}Q ${l},${r} ${l},${r+a*u}`}const s=e.x<o.x?1:-1,c=e.y<o.y?-1:1;return`L ${l},${r+a*c}Q ${l},${r} ${l+a*s},${r}`}function cl(e){const{sourceX:t,sourceY:o,sourcePosition:i=$e.Bottom,targetX:a,targetY:l,targetPosition:r=$e.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[f,p,m,h,_]=Hb({source:{x:t,y:o},sourcePosition:i,target:{x:a,y:l},targetPosition:r,center:{x:c,y:d},offset:u});return[f.reduce((g,I,y)=>{let N;return y>0&&y<f.length-1?N=Fb(f[y-1],I,f[y+1],s):N=`${y===0?"M":"L"}${I.x} ${I.y}`,g+=N,g},""),p,m,h,_]}function Gb(e){const{sourceX:t,sourceY:o,targetX:i,targetY:a}=e,[l,r,s,c]=od({sourceX:t,sourceY:o,targetX:i,targetY:a});return[`M ${t},${o}L ${i},${a}`,l,r,s,c]}const Yb=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]=Gb(e);return n.h(Vi,{path:o,labelX:i,labelY:a,...t,...e})}}}),ud=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]=cl({...e,sourcePosition:e.sourcePosition??$e.Bottom,targetPosition:e.targetPosition??$e.Top});return n.h(Vi,{path:o,labelX:i,labelY:a,...t,...e})}}}),Wb=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(ud,{...e,...t,borderRadius:0})}}),Kb=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]=ld({...e,sourcePosition:e.sourcePosition??$e.Bottom,targetPosition:e.targetPosition??$e.Top});return n.h(Vi,{path:o,labelX:i,labelY:a,...t,...e})}}}),qb=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]=sd({...e,sourcePosition:e.sourcePosition??$e.Bottom,targetPosition:e.targetPosition??$e.Top});return n.h(Vi,{path:o,labelX:i,labelY:a,...t,...e})}}}),Xb={input:Ab,default:Rb,output:Vb},jb={default:Kb,straight:Yb,step:Wb,smoothstep:ud,simplebezier:qb};function Zb(e,t,o){const i=n.computed(()=>_=>t.value.get(_)),a=n.computed(()=>_=>o.value.get(_)),l=n.computed(()=>{const _={...jb,...e.edgeTypes},b=Object.keys(_);for(const g of e.edges)g.type&&!b.includes(g.type)&&(_[g.type]=g.type);return _}),r=n.computed(()=>{const _={...Xb,...e.nodeTypes},b=Object.keys(_);for(const g of e.nodes)g.type&&!b.includes(g.type)&&(_[g.type]=g.type);return _}),s=n.computed(()=>e.onlyRenderVisibleElements?Ic(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 _=[];for(const b of e.edges){const g=t.value.get(b.source),I=t.value.get(b.target);Jg({sourcePos:g.computedPosition||{x:0,y:0},targetPos:I.computedPosition||{x:0,y:0},sourceWidth:g.dimensions.width,sourceHeight:g.dimensions.height,targetWidth:I.dimensions.width,targetHeight:I.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&_.push(b)}return _}return e.edges}),d=n.computed(()=>[...s.value,...c.value]),u=n.computed(()=>{const _=[];for(const b of e.nodes)b.selected&&_.push(b);return _}),f=n.computed(()=>{const _=[];for(const b of e.edges)b.selected&&_.push(b);return _}),p=n.computed(()=>[...u.value,...f.value]),m=n.computed(()=>{const _=[];for(const b of e.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&_.push(b);return _}),h=n.computed(()=>s.value.length>0&&m.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:l,getNodeTypes:r,getEdges:c,getNodes:s,getSelectedElements:p,getSelectedNodes:u,getSelectedEdges:f,getNodesInitialized:m,areNodesInitialized:h}}class un{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)??un.instance;return un.instance=i??new un,o&&(o.config.globalProperties.$vueFlowStorage=un.instance),un.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=nd(),a=n.reactive(i),l={};for(const[p,m]of Object.entries(a.hooks)){const h=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;l[h]=m.on}const r={};for(const[p,m]of Object.entries(a.hooks))r[p]=m.trigger;const s=n.computed(()=>{const p=new Map;for(const m of a.nodes)p.set(m.id,m);return p}),c=n.computed(()=>{const p=new Map;for(const m of a.edges)p.set(m.id,m);return p}),d=Zb(a,s,c),u=Ib(a,s,c);u.setState({...a,...o});const f={...l,...d,...u,...qm(a),nodeLookup:s,edgeLookup:c,emits:r,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function Oe(e){const t=un.getInstance(),o=n.getCurrentScope(),i=typeof e=="object",a=i?e:{id:e},l=a.id,r=l??(o==null?void 0:o.vueFlowId);let s;if(o){const c=n.inject(Xc,null);typeof c<"u"&&c!==null&&(!r||c.id===r)&&(s=c)}if(s||r&&(s=t.get(r)),!s||r&&s.id!==r){const c=l??t.getId(),d=t.create(c,a);s=d,(o??n.effectScope(!0)).run(()=>{n.watch(d.applyDefault,(f,p,m)=>{const h=b=>{d.applyNodeChanges(b)},_=b=>{d.applyEdgeChanges(b)};f?(d.onNodesChange(h),d.onEdgesChange(_)):(d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(_)),m(()=>{d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(_)})},{immediate:!0}),Qn(()=>{if(s){const f=t.get(s.id);f?f.$destroy():_o(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(n.provide(Xc,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 Jb(e){const{emits:t,dimensions:o}=Oe();let i;n.onMounted(()=>{const a=()=>{var l,r;if(!e.value||!(((r=(l=e.value).checkVisibility)==null?void 0:r.call(l))??!0))return;const s=vi(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 Qb={name:"UserSelection",compatConfig:{MODE:3}},e0=n.defineComponent({...Qb,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))}}),t0=["tabIndex"],n0={name:"NodesSelection",compatConfig:{MODE:3}},o0=n.defineComponent({...n0,setup(e){const{emits:t,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:l,userSelectionActive:r}=Oe(),s=td(),c=n.ref(null),d=Jc({el:c,onStart(h){t.selectionDragStart(h),t.nodeDragStart(h)},onDrag(h){t.selectionDrag(h),t.nodeDrag(h)},onStop(h){t.selectionDragStop(h),t.nodeDragStop(h)}});n.onMounted(()=>{var h;l.value||(h=c.value)==null||h.focus({preventScroll:!0})});const u=n.computed(()=>Za(i.value)),f=n.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function p(h){t.selectionContextMenu({event:h,nodes:i.value})}function m(h){l.value||An[h.key]&&(h.preventDefault(),s({x:An[h.key].x,y:An[h.key].y},h.shiftKey))}return(h,_)=>!n.unref(r)&&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(f.value),tabIndex:n.unref(l)?void 0:-1,onContextmenu:p,onKeydown:m},null,46,t0)],6)):n.createCommentVNode("",!0)}});function i0(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const a0={name:"Pane",compatConfig:{MODE:3}},l0=n.defineComponent({...a0,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:o,viewport:i,emits:a,userSelectionActive:l,removeSelectedElements:r,userSelectionRect:s,elementsSelectable:c,nodesSelectionActive:d,getSelectedEdges:u,getSelectedNodes:f,removeNodes:p,removeEdges:m,selectionMode:h,deleteKeyCode:_,multiSelectionKeyCode:b,multiSelectionActive:g,edgeLookup:I,nodeLookup:y,connectionLookup:N,defaultEdgeOptions:q,connectionStartHandle:U,panOnDrag:X}=Oe(),K=n.shallowRef(null),W=n.shallowRef(new Set),ne=n.shallowRef(new Set),re=n.shallowRef(null),L=n.toRef(()=>c.value&&(e.isSelecting||l.value)),Q=n.toRef(()=>U.value!==null);let v=!1,T=!1;const $=mo(_,{actInsideInputWithModifier:!1}),P=mo(b);n.watch($,ce=>{ce&&(p(f.value),m(u.value),d.value=!1)}),n.watch(P,ce=>{g.value=ce});function H(ce,ue){return he=>{he.target===ue&&(ce==null||ce(he))}}function te(ce){if(v||Q.value){v=!1;return}a.paneClick(ce),r(),d.value=!1}function M(ce){var ue;if(Array.isArray(X.value)&&((ue=X.value)!=null&&ue.includes(2))){ce.preventDefault();return}a.paneContextMenu(ce)}function ee(ce){a.paneScroll(ce)}function le(ce){var ue,he,ve;if(re.value=((ue=t.value)==null?void 0:ue.getBoundingClientRect())??null,!c.value||!e.isSelecting||ce.button!==0||ce.target!==K.value||!re.value)return;(ve=(he=ce.target)==null?void 0:he.setPointerCapture)==null||ve.call(he,ce.pointerId);const{x:Se,y:Ie}=i0(ce,re.value);T=!0,v=!1,r(),s.value={width:0,height:0,startX:Se,startY:Ie,x:Se,y:Ie},a.selectionStart(ce)}function me(ce){var ue;if(!re.value||!s.value)return;v=!0;const{x:he,y:ve}=Et(ce,re.value),{startX:Se=0,startY:Ie=0}=s.value,pe={startX:Se,startY:Ie,x:he<Se?he:Se,y:ve<Ie?ve:Ie,width:Math.abs(he-Se),height:Math.abs(ve-Ie)},j=W.value,Y=ne.value;W.value=new Set(Ic(o.value,pe,i.value,h.value===qa.Partial,!0).map(A=>A.id)),ne.value=new Set;const E=((ue=q.value)==null?void 0:ue.selectable)??!0;for(const A of W.value){const R=N.value.get(A);if(R)for(const{edgeId:G}of R.values()){const J=I.value.get(G);J&&(J.selectable??E)&&ne.value.add(G)}}if(!qc(j,W.value)){const A=Gt(y.value,W.value,!0);a.nodesChange(A)}if(!qc(Y,ne.value)){const A=Gt(I.value,ne.value);a.edgesChange(A)}s.value=pe,l.value=!0,d.value=!1}function ye(ce){var ue;ce.button!==0||!T||((ue=ce.target)==null||ue.releasePointerCapture(ce.pointerId),!l.value&&s.value&&ce.target===K.value&&te(ce),l.value=!1,s.value=null,d.value=W.value.size>0,a.selectionEnd(ce),e.selectionKeyPressed&&(v=!1),T=!1)}return(ce,ue)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:K,class:n.normalizeClass(["vue-flow__pane vue-flow__container",{selection:ce.isSelecting}]),onClick:ue[0]||(ue[0]=he=>L.value?void 0:H(te,K.value)(he)),onContextmenu:ue[1]||(ue[1]=he=>H(M,K.value)(he)),onWheelPassive:ue[2]||(ue[2]=he=>H(ee,K.value)(he)),onPointerenter:ue[3]||(ue[3]=he=>L.value?void 0:n.unref(a).paneMouseEnter(he)),onPointerdown:ue[4]||(ue[4]=he=>L.value?le(he):n.unref(a).paneMouseMove(he)),onPointermove:ue[5]||(ue[5]=he=>L.value?me(he):n.unref(a).paneMouseMove(he)),onPointerup:ue[6]||(ue[6]=he=>L.value?ye(he):void 0),onPointerleave:ue[7]||(ue[7]=he=>n.unref(a).paneMouseLeave(he))},[n.renderSlot(ce.$slots,"default"),n.unref(l)&&n.unref(s)?(n.openBlock(),n.createBlock(e0,{key:0,"user-selection-rect":n.unref(s)},null,8,["user-selection-rect"])):n.createCommentVNode("",!0),n.unref(d)&&n.unref(f).length?(n.openBlock(),n.createBlock(o0,{key:1})):n.createCommentVNode("",!0)],34))}}),r0={name:"Transform",compatConfig:{MODE:3}},s0=n.defineComponent({...r0,setup(e){const{viewport:t,fitViewOnInit:o,fitViewOnInitDone:i}=Oe(),a=n.computed(()=>o.value?!i.value:!1),l=n.computed(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(r,s)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:n.normalizeStyle({transform:l.value,opacity:a.value?0:void 0})},[n.renderSlot(r.$slots,"default")],4))}}),c0={name:"Viewport",compatConfig:{MODE:3}},d0=n.defineComponent({...c0,setup(e){const{minZoom:t,maxZoom:o,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:l,selectionKeyCode:r,panActivationKeyCode:s,panOnScroll:c,panOnScrollMode:d,panOnScrollSpeed:u,panOnDrag:f,zoomOnDoubleClick:p,zoomOnPinch:m,zoomOnScroll:h,preventScrolling:_,noWheelClassName:b,noPanClassName:g,emits:I,connectionStartHandle:y,userSelectionActive:N,paneDragging:q,d3Zoom:U,d3Selection:X,d3ZoomHandler:K,viewport:W,viewportRef:ne,paneClickDistance:re}=Oe();Jb(ne);const L=n.shallowRef(!1),Q=n.shallowRef(!1);let v=null,T=!1,$=0,P={x:0,y:0,zoom:0};const H=mo(s),te=mo(r),M=mo(l),ee=n.toRef(()=>(!te.value||te.value&&r.value===!0)&&(H.value||f.value)),le=n.toRef(()=>H.value||c.value),me=n.toRef(()=>r.value===!0&&ee.value!==!0),ye=n.toRef(()=>te.value&&r.value!==!0||N.value||me.value),ce=n.toRef(()=>y.value!==null);n.onMounted(()=>{if(!ne.value){_o("Viewport element is missing");return}const Ie=ne.value,pe=Ie.getBoundingClientRect(),j=Ag().clickDistance(re.value).scaleExtent([t.value,o.value]).translateExtent(a.value),Y=ft(Ie).call(j),E=Y.on("wheel.zoom"),A=Vn.translate(i.value.x??0,i.value.y??0).scale(rn(i.value.zoom??1,t.value,o.value)),R=[[0,0],[pe.width,pe.height]],G=j.constrain()(A,R,a.value);j.transform(Y,G),j.wheelDelta(Ja),U.value=j,X.value=Y,K.value=E,W.value={x:G.x,y:G.y,zoom:G.k},j.on("start",J=>{var fe;if(!J.sourceEvent)return null;$=J.sourceEvent.button,L.value=!0;const _e=ve(J.transform);((fe=J.sourceEvent)==null?void 0:fe.type)==="mousedown"&&(q.value=!0),P=_e,I.viewportChangeStart(_e),I.moveStart({event:J,flowTransform:_e})}),j.on("end",J=>{if(!J.sourceEvent)return null;if(L.value=!1,q.value=!1,ue(ee.value,$??0)&&!T&&I.paneContextMenu(J.sourceEvent),T=!1,he(P,J.transform)){const fe=ve(J.transform);P=fe,I.viewportChangeEnd(fe),I.moveEnd({event:J,flowTransform:fe})}}),j.filter(J=>{var fe;const _e=M.value||h.value,ke=m.value&&J.ctrlKey,be=J.button,xe=J.type==="wheel";if(be===1&&J.type==="mousedown"&&(Se(J,"vue-flow__node")||Se(J,"vue-flow__edge")))return!0;if(!ee.value&&!_e&&!le.value&&!p.value&&!m.value||N.value||ce.value&&!xe||!p.value&&J.type==="dblclick"||Se(J,b.value)&&xe||Se(J,g.value)&&(!xe||le.value&&xe&&!M.value)||!m.value&&J.ctrlKey&&xe||!_e&&!le.value&&!ke&&xe)return!1;if(!m&&J.type==="touchstart"&&((fe=J.touches)==null?void 0:fe.length)>1)return J.preventDefault(),!1;if(!ee.value&&(J.type==="mousedown"||J.type==="touchstart")||me.value&&Array.isArray(f.value)&&f.value.includes(0)&&be===0||Array.isArray(f.value)&&!f.value.includes(be)&&(J.type==="mousedown"||J.type==="touchstart"))return!1;const Ve=Array.isArray(f.value)&&f.value.includes(be)||r.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!be||be<=1;return(!J.ctrlKey||H.value||xe)&&Ve}),n.watch([N,ee],()=>{N.value&&!L.value?j.on("zoom",null):N.value||j.on("zoom",J=>{W.value={x:J.transform.x,y:J.transform.y,zoom:J.transform.k};const fe=ve(J.transform);T=ue(ee.value,$??0),I.viewportChange(fe),I.move({event:J,flowTransform:fe})})},{immediate:!0}),n.watch([N,le,d,M,m,_,b],()=>{le.value&&!M.value&&!N.value?Y.on("wheel.zoom",J=>{if(Se(J,b.value))return!1;const fe=M.value||h.value,_e=m.value&&J.ctrlKey;if(!(!_.value||le.value||fe||_e))return!1;J.preventDefault(),J.stopImmediatePropagation();const be=Y.property("__zoom").k||1,xe=bo();if(!H.value&&J.ctrlKey&&m.value&&xe){const S=_t(J),D=Ja(J),O=be*2**D;j.scaleTo(Y,O,S,J);return}const Ve=J.deltaMode===1?20:1;let Te=d.value===fo.Vertical?0:J.deltaX*Ve,x=d.value===fo.Horizontal?0:J.deltaY*Ve;!xe&&J.shiftKey&&d.value!==fo.Vertical&&!Te&&x&&(Te=x,x=0),j.translateBy(Y,-(Te/be)*u.value,-(x/be)*u.value);const B=ve(Y.property("__zoom"));v&&clearTimeout(v),Q.value?(I.move({event:J,flowTransform:B}),I.viewportChange(B),v=setTimeout(()=>{I.moveEnd({event:J,flowTransform:B}),I.viewportChangeEnd(B),Q.value=!1},150)):(Q.value=!0,I.moveStart({event:J,flowTransform:B}),I.viewportChangeStart(B))},{passive:!1}):typeof E<"u"&&Y.on("wheel.zoom",function(J,fe){const _e=!_.value&&J.type==="wheel"&&!J.ctrlKey,ke=M.value||h.value,be=m.value&&J.ctrlKey;if(!ke&&!c.value&&!be&&J.type==="wheel"||_e||Se(J,b.value))return null;J.preventDefault(),E.call(this,J,fe)},{passive:!1})},{immediate:!0})});function ue(Ie,pe){return pe===2&&Array.isArray(Ie)&&Ie.includes(2)}function he(Ie,pe){return Ie.x!==pe.x&&!Number.isNaN(pe.x)||Ie.y!==pe.y&&!Number.isNaN(pe.y)||Ie.zoom!==pe.k&&!Number.isNaN(pe.k)}function ve(Ie){return{x:Ie.x,y:Ie.y,zoom:Ie.k}}function Se(Ie,pe){return Ie.target.closest(`.${pe}`)}return(Ie,pe)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"viewportRef",ref:ne,class:"vue-flow__viewport vue-flow__container"},[n.createVNode(l0,{"is-selecting":ye.value,"selection-key-pressed":n.unref(te),class:n.normalizeClass({connecting:ce.value,dragging:n.unref(q),draggable:n.unref(f)===!0||Array.isArray(n.unref(f))&&n.unref(f).includes(0)})},{default:n.withCtx(()=>[n.createVNode(s0,null,{default:n.withCtx(()=>[n.renderSlot(Ie.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),u0=["id"],f0=["id"],m0=["id"],p0={name:"A11yDescriptions",compatConfig:{MODE:3}},h0=n.defineComponent({...p0,setup(e){const{id:t,disableKeyboardA11y:o,ariaLiveMessage:i}=Oe();return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{id:`${n.unref(gc)}-${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,u0),n.createElementVNode("div",{id:`${n.unref(bc)}-${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,f0),n.unref(o)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,id:`${n.unref(Lg)}-${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,m0))],64))}});function y0(){const e=Oe();n.watch(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function g0(e,t,o){return o===$e.Left?e-t:o===$e.Right?e+t:e}function b0(e,t,o){return o===$e.Top?e-t:o===$e.Bottom?e+t:e}const dl=function({radius:e=10,centerX:t=0,centerY:o=0,position:i=$e.Top,type:a}){return n.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:g0(t,e,i),cy:b0(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};dl.props=["radius","centerX","centerY","position","type"],dl.compatConfig={MODE:3};const fd=dl,_0=n.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:o,connectionMode:i,edgeUpdaterRadius:a,emits:l,nodesSelectionActive:r,noPanClassName:s,getEdgeTypes:c,removeSelectedEdges:d,findEdge:u,findNode:f,isValidConnection:p,multiSelectionActive:m,disableKeyboardA11y:h,elementsSelectable:_,edgesUpdatable:b,edgesFocusable:g,hooks:I}=Oe(),y=n.computed(()=>u(e.id)),{emit:N,on:q}=pb(y.value,l),U=n.inject($i),X=n.getCurrentInstance(),K=n.ref(!1),W=n.ref(!1),ne=n.ref(""),re=n.ref(null),L=n.ref("source"),Q=n.ref(null),v=n.toRef(()=>typeof y.value.selectable>"u"?_.value:y.value.selectable),T=n.toRef(()=>typeof y.value.updatable>"u"?b.value:y.value.updatable),$=n.toRef(()=>typeof y.value.focusable>"u"?g.value:y.value.focusable);n.provide(ub,e.id),n.provide(fb,Q);const P=n.computed(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),H=n.computed(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),te=n.computed(()=>{const A=y.value.type||"default",R=U==null?void 0:U[`edge-${A}`];if(R)return R;let G=y.value.template??c.value[A];if(typeof G=="string"&&X){const J=Object.keys(X.appContext.components);J&&J.includes(A)&&(G=n.resolveComponent(A,!1))}return G&&typeof G!="string"?G:(l.error(new Ze(We.EDGE_TYPE_MISSING,G)),!1)}),{handlePointerDown:M}=Qc({nodeId:ne,handleId:re,type:L,isValidConnection:p,edgeUpdaterType:L,onEdgeUpdate:me,onEdgeUpdateEnd:ye});return()=>{const A=f(y.value.source),R=f(y.value.target),G="pathOptions"in y.value?y.value.pathOptions:{};if(!A&&!R)return l.error(new Ze(We.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!A)return l.error(new Ze(We.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!R)return l.error(new Ze(We.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||A.hidden||R.hidden)return null;let J;i.value===Tt.Strict?J=A.handleBounds.source:J=[...A.handleBounds.source||[],...A.handleBounds.target||[]];const fe=Pc(J,y.value.sourceHandle);let _e;i.value===Tt.Strict?_e=R.handleBounds.target:_e=[...R.handleBounds.target||[],...R.handleBounds.source||[]];const ke=Pc(_e,y.value.targetHandle),be=(fe==null?void 0:fe.position)||$e.Bottom,xe=(ke==null?void 0:ke.position)||$e.Top,{x:Ve,y:Te}=Mn(A,fe,be),{x,y:B}=Mn(R,ke,xe);return y.value.sourceX=Ve,y.value.sourceY=Te,y.value.targetX=x,y.value.targetY=B,n.h("g",{ref:Q,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${te.value===!1?"default":y.value.type||"default"}`,s.value,P.value,{updating:K.value,selected:y.value.selected,animated:y.value.animated,inactive:!v.value&&!I.value.edgeClick.hasListeners()}],tabIndex:$.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:y.value.ariaLabel??`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":$.value?`${bc}-${t}`:void 0,"aria-roledescription":"edge",role:$.value?"group":"img",...y.value.domAttributes,onClick:ue,onContextmenu:he,onDblclick:ve,onMouseenter:Se,onMousemove:Ie,onMouseleave:pe,onKeyDown:$.value?E:void 0},[W.value?null:n.h(te.value===!1?c.value.default:te.value,{id:e.id,sourceNode:A,targetNode:R,source:y.value.source,target:y.value.target,type:y.value.type,updatable:T.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:{...y.value.events,...q},style:H.value,markerStart:`url('#${go(y.value.markerStart,t)}')`,markerEnd:`url('#${go(y.value.markerEnd,t)}')`,sourcePosition:be,targetPosition:xe,sourceX:Ve,sourceY:Te,targetX:x,targetY:B,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth,...G}),[T.value==="source"||T.value===!0?[n.h("g",{onMousedown:j,onMouseenter:ee,onMouseout:le},n.h(fd,{position:be,centerX:Ve,centerY:Te,radius:a.value,type:"source","data-type":"source"}))]:null,T.value==="target"||T.value===!0?[n.h("g",{onMousedown:Y,onMouseenter:ee,onMouseout:le},n.h(fd,{position:xe,centerX:x,centerY:B,radius:a.value,type:"target","data-type":"target"}))]:null]])};function ee(){K.value=!0}function le(){K.value=!1}function me(A,R){N.update({event:A,edge:y.value,connection:R})}function ye(A){N.updateEnd({event:A,edge:y.value}),W.value=!1}function ce(A,R){A.button===0&&(W.value=!0,ne.value=R?y.value.target:y.value.source,re.value=(R?y.value.targetHandle:y.value.sourceHandle)??null,L.value=R?"target":"source",N.updateStart({event:A,edge:y.value}),M(A))}function ue(A){var R;const G={event:A,edge:y.value};v.value&&(r.value=!1,y.value.selected&&m.value?(d([y.value]),(R=Q.value)==null||R.blur()):o([y.value])),N.click(G)}function he(A){N.contextMenu({event:A,edge:y.value})}function ve(A){N.doubleClick({event:A,edge:y.value})}function Se(A){N.mouseEnter({event:A,edge:y.value})}function Ie(A){N.mouseMove({event:A,edge:y.value})}function pe(A){N.mouseLeave({event:A,edge:y.value})}function j(A){ce(A,!0)}function Y(A){ce(A,!1)}function E(A){var R;!h.value&&_c.includes(A.key)&&v.value&&(A.key==="Escape"?((R=Q.value)==null||R.blur(),d([u(e.id)])):o([u(e.id)]))}}}),w0=n.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:l,connectionLineType:r,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:f}=Oe(),p=(e=n.inject($i))==null?void 0:e["connection-line"],m=n.computed(()=>{var I;return f((I=i.value)==null?void 0:I.nodeId)}),h=n.computed(()=>{var I;return f((I=a.value)==null?void 0:I.nodeId)??null}),_=n.computed(()=>({x:(l.value.x-u.value.x)/u.value.zoom,y:(l.value.y-u.value.y)/u.value.zoom})),b=n.computed(()=>c.value.markerStart?`url(#${go(c.value.markerStart,t)})`:""),g=n.computed(()=>c.value.markerEnd?`url(#${go(c.value.markerEnd,t)})`:"");return()=>{var I,y,N;if(!m.value||!i.value)return null;const q=i.value.id,U=i.value.type,X=m.value.handleBounds;let K=(X==null?void 0:X[U])??[];if(o.value===Tt.Loose){const H=(X==null?void 0:X[U==="source"?"target":"source"])??[];K=[...K,...H]}if(!K)return null;const W=(q?K.find(H=>H.id===q):K[0])??null,ne=(W==null?void 0:W.position)??$e.Top,{x:re,y:L}=Mn(m.value,W,ne);let Q=null;h.value&&(o.value===Tt.Strict?Q=((I=h.value.handleBounds[U==="source"?"target":"source"])==null?void 0:I.find(H=>{var te;return H.id===((te=a.value)==null?void 0:te.id)}))||null:Q=((y=[...h.value.handleBounds.source??[],...h.value.handleBounds.target??[]])==null?void 0:y.find(H=>{var te;return H.id===((te=a.value)==null?void 0:te.id)}))||null);const v=((N=a.value)==null?void 0:N.position)??(ne?il[ne]:null);if(!ne||!v)return null;const T=r.value??c.value.type??ln.Bezier;let $="";const P={sourceX:re,sourceY:L,sourcePosition:ne,targetX:_.value.x,targetY:_.value.y,targetPosition:v};return T===ln.Bezier?[$]=ld(P):T===ln.Step?[$]=cl({...P,borderRadius:0}):T===ln.SmoothStep?[$]=cl(P):T===ln.SimpleBezier?[$]=sd(P):$=`M${re},${L} ${_.value.x},${_.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:re,sourceY:L,sourcePosition:ne,targetX:_.value.x,targetY:_.value.y,targetPosition:v,sourceNode:m.value,sourceHandle:W,targetNode:h.value,targetHandle:Q,markerEnd:g.value,markerStart:b.value,connectionStatus:d.value}):n.h("path",{d:$,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":g.value,"marker-start":b.value})))}}}),v0=["id","markerWidth","markerHeight","markerUnits","orient"],k0={name:"MarkerType",compatConfig:{MODE:3}},E0=n.defineComponent({...k0,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(Xa).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(Xa).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,v0))}}),N0={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},$0={name:"MarkerDefinitions",compatConfig:{MODE:3}},x0=n.defineComponent({...$0,setup(e){const{id:t,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=Oe(),l=n.computed(()=>{const r=new Set,s=[],c=d=>{if(d){const u=go(d,t);r.has(u)||(typeof d=="object"?s.push({...d,id:u,color:d.color||a.value}):s.push({id:u,color:a.value,type:d}),r.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(r,s)=>(n.openBlock(),n.createElementBlock("svg",N0,[n.createElementVNode("defs",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,c=>(n.openBlock(),n.createBlock(E0,{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))])]))}}),I0={name:"Edges",compatConfig:{MODE:3}},S0=n.defineComponent({...I0,setup(e){const{findNode:t,getEdges:o,elevateEdgesOnSelect:i}=Oe();return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(x0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),r=>(n.openBlock(),n.createElementBlock("svg",{key:r.id,class:"vue-flow__edges vue-flow__container",style:n.normalizeStyle({zIndex:n.unref(Qg)(r,n.unref(t),n.unref(i))})},[n.createVNode(n.unref(_0),{id:r.id},null,8,["id"])],4))),128)),n.createVNode(n.unref(w0))],64))}}),C0=n.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:o,selectNodesOnDrag:i,nodesSelectionActive:a,multiSelectionActive:l,emits:r,removeSelectedNodes:s,addSelectedNodes:c,updateNodeDimensions:d,onUpdateNodeInternals:u,getNodeTypes:f,nodeExtent:p,elevateNodesOnSelect:m,disableKeyboardA11y:h,ariaLiveMessage:_,snapToGrid:b,snapGrid:g,nodeDragThreshold:I,nodesDraggable:y,elementsSelectable:N,nodesConnectable:q,nodesFocusable:U,hooks:X}=Oe(),K=n.ref(null);n.provide(Zc,K),n.provide(jc,e.id);const W=n.inject($i),ne=n.getCurrentInstance(),re=td(),{node:L,parentNode:Q}=ed(e.id),{emit:v,on:T}=bb(L,r),$=n.toRef(()=>typeof L.draggable>"u"?y.value:L.draggable),P=n.toRef(()=>typeof L.selectable>"u"?N.value:L.selectable),H=n.toRef(()=>typeof L.connectable>"u"?q.value:L.connectable),te=n.toRef(()=>typeof L.focusable>"u"?U.value:L.focusable),M=n.computed(()=>P.value||$.value||X.value.nodeClick.hasListeners()||X.value.nodeDoubleClick.hasListeners()||X.value.nodeMouseEnter.hasListeners()||X.value.nodeMouseMove.hasListeners()||X.value.nodeMouseLeave.hasListeners()),ee=n.toRef(()=>!!L.dimensions.width&&!!L.dimensions.height),le=n.computed(()=>{const R=L.type||"default",G=W==null?void 0:W[`node-${R}`];if(G)return G;let J=L.template||f.value[R];if(typeof J=="string"&&ne){const fe=Object.keys(ne.appContext.components);fe&&fe.includes(R)&&(J=n.resolveComponent(R,!1))}return J&&typeof J!="string"?J:(r.error(new Ze(We.NODE_TYPE_MISSING,J)),!1)}),me=Jc({id:e.id,el:K,disabled:()=>!$.value,selectable:P,dragHandle:()=>L.dragHandle,onStart(R){v.dragStart(R)},onDrag(R){v.drag(R)},onStop(R){v.dragStop(R)},onClick(R){E(R)}}),ye=n.computed(()=>L.class instanceof Function?L.class(L):L.class),ce=n.computed(()=>{const R=(L.style instanceof Function?L.style(L):L.style)||{},G=L.width instanceof Function?L.width(L):L.width,J=L.height instanceof Function?L.height(L):L.height;return!R.width&&G&&(R.width=typeof G=="string"?G:`${G}px`),!R.height&&J&&(R.height=typeof J=="string"?J:`${J}px`),R}),ue=n.toRef(()=>Number(L.zIndex??ce.value.zIndex??0));return u(R=>{(R.includes(e.id)||!R.length)&&ve()}),n.onMounted(()=>{n.watch(()=>L.hidden,(R=!1,G,J)=>{!R&&K.value&&(e.resizeObserver.observe(K.value),J(()=>{K.value&&e.resizeObserver.unobserve(K.value)}))},{immediate:!0,flush:"post"})}),n.watch([()=>L.type,()=>L.sourcePosition,()=>L.targetPosition],()=>{n.nextTick(()=>{d([{id:e.id,nodeElement:K.value,forceUpdate:!0}])})}),n.watch([()=>L.position.x,()=>L.position.y,()=>{var R;return(R=Q.value)==null?void 0:R.computedPosition.x},()=>{var R;return(R=Q.value)==null?void 0:R.computedPosition.y},()=>{var R;return(R=Q.value)==null?void 0:R.computedPosition.z},ue,()=>L.selected,()=>L.dimensions.height,()=>L.dimensions.width,()=>{var R;return(R=Q.value)==null?void 0:R.dimensions.height},()=>{var R;return(R=Q.value)==null?void 0:R.dimensions.width}],([R,G,J,fe,_e,ke])=>{const be={x:R,y:G,z:ke+(m.value&&L.selected?1e3:0)};typeof J<"u"&&typeof fe<"u"?L.computedPosition=Kg({x:J,y:fe,z:_e},be):L.computedPosition=be},{flush:"post",immediate:!0}),n.watch([()=>L.extent,p],([R,G],[J,fe])=>{(R!==J||G!==fe)&&he()}),L.extent==="parent"||typeof L.extent=="object"&&"range"in L.extent&&L.extent.range==="parent"?Ia(()=>ee).toBe(!0).then(he):he(),()=>L.hidden?null:n.h("div",{ref:K,"data-id":L.id,class:["vue-flow__node",`vue-flow__node-${le.value===!1?"default":L.type||"default"}`,{[o.value]:$.value,dragging:me==null?void 0:me.value,draggable:$.value,selected:L.selected,selectable:P.value,parent:L.isParent},ye.value],style:{visibility:ee.value?"visible":"hidden",zIndex:L.computedPosition.z??ue.value,transform:`translate(${L.computedPosition.x}px,${L.computedPosition.y}px)`,pointerEvents:M.value?"all":"none",...ce.value},tabIndex:te.value?0:void 0,role:te.value?"group":void 0,"aria-describedby":h.value?void 0:`${gc}-${t}`,"aria-label":L.ariaLabel,"aria-roledescription":"node",...L.domAttributes,onMouseenter:Se,onMousemove:Ie,onMouseleave:pe,onContextmenu:j,onClick:E,onDblclick:Y,onKeydown:A},[n.h(le.value===!1?f.value.default:le.value,{id:L.id,type:L.type,data:L.data,events:{...L.events,...T},selected:L.selected,resizing:L.resizing,dragging:me.value,connectable:H.value,position:L.computedPosition,dimensions:L.dimensions,isValidTargetPos:L.isValidTargetPos,isValidSourcePos:L.isValidSourcePos,parent:L.parentNode,parentNodeId:L.parentNode,zIndex:L.computedPosition.z??ue.value,targetPosition:L.targetPosition,sourcePosition:L.sourcePosition,label:L.label,dragHandle:L.dragHandle,onUpdateNodeInternals:ve})]);function he(){const R=L.computedPosition,{computedPosition:G,position:J}=tl(L,b.value?Ni(R,g.value):R,r.error,p.value,Q.value);(L.computedPosition.x!==G.x||L.computedPosition.y!==G.y)&&(L.computedPosition={...L.computedPosition,...G}),(L.position.x!==J.x||L.position.y!==J.y)&&(L.position=J)}function ve(){K.value&&d([{id:e.id,nodeElement:K.value,forceUpdate:!0}])}function Se(R){me!=null&&me.value||v.mouseEnter({event:R,node:L})}function Ie(R){me!=null&&me.value||v.mouseMove({event:R,node:L})}function pe(R){me!=null&&me.value||v.mouseLeave({event:R,node:L})}function j(R){return v.contextMenu({event:R,node:L})}function Y(R){return v.doubleClick({event:R,node:L})}function E(R){P.value&&(!i.value||!$.value||I.value>0)&&al(L,l.value,c,s,a,!1,K.value),v.click({event:R,node:L})}function A(R){if(!(ja(R)||h.value))if(_c.includes(R.key)&&P.value){const G=R.key==="Escape";al(L,l.value,c,s,a,G,K.value)}else $.value&&L.selected&&An[R.key]&&(R.preventDefault(),_.value=`Moved selected node ${R.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~L.position.x}, y: ${~~L.position.y}`,re({x:An[R.key].x,y:An[R.key].y},R.shiftKey))}}});function R0(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 V0={class:"vue-flow__nodes vue-flow__container"},A0={name:"Nodes",compatConfig:{MODE:3}},T0=n.defineComponent({...A0,setup(e){const{getNodes:t,updateNodeDimensions:o,emits:i}=Oe(),a=R0(),l=n.ref();return n.watch(a,r=>{r&&n.nextTick(()=>{i.nodesInitialized(t.value)})},{immediate:!0}),n.onMounted(()=>{l.value=new ResizeObserver(r=>{const s=r.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));n.nextTick(()=>o(s))})}),n.onBeforeUnmount(()=>{var r;return(r=l.value)==null?void 0:r.disconnect()}),(r,s)=>(n.openBlock(),n.createElementBlock("div",V0,[l.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(t),(c,d,u,f)=>{const p=[c.id];if(f&&f.key===c.id&&n.isMemoSame(f,p))return f;const m=(n.openBlock(),n.createBlock(n.unref(C0),{id:c.id,key:c.id,"resize-observer":l.value},null,8,["id","resize-observer"]));return m.memo=p,m},s,0),128)):n.createCommentVNode("",!0)]))}});function M0(){const{emits:e}=Oe();n.onMounted(()=>{if(Gc()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ze(We.MISSING_STYLES))}})}const B0=n.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),D0={name:"VueFlow",compatConfig:{MODE:3}},O0=n.defineComponent({...D0,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(),l=Sa(i,"modelValue",o),r=Sa(i,"nodes",o),s=Sa(i,"edges",o),c=Oe(i),d=kb({modelValue:l,nodes:r,edges:s},i,c);return Nb(o,c.hooks),y0(),M0(),n.provide($i,a),n.onUnmounted(d),t(c),(u,f)=>(n.openBlock(),n.createElementBlock("div",{ref:n.unref(c).vueFlowRef,class:"vue-flow"},[n.createVNode(d0,null,{default:n.withCtx(()=>[n.createVNode(S0),B0,n.createVNode(T0),n.renderSlot(u.$slots,"zoom-pane")]),_:3}),n.renderSlot(u.$slots,"default"),n.createVNode(h0)],512))}}),L0={name:"Panel",compatConfig:{MODE:3}},md=n.defineComponent({...L0,props:{position:{}},setup(e){const t=e,{userSelectionActive:o}=Oe(),i=n.computed(()=>`${t.position}`.split("-"));return(a,l)=>(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))}}),fn=["red","amber","green","teal","blue","indigo","violet","pink"],pd={red:"빨강",amber:"주황",green:"초록",teal:"청록",blue:"파랑",indigo:"남색",violet:"보라",pink:"분홍"};function P0(e){return typeof e=="string"&&e in pd}const z0={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},U0=.15;function H0(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,l=parseInt(o.slice(4,6),16)/255,r=Math.max(i,a,l),s=Math.min(i,a,l),c=r-s,d=(r+s)/2;let u=0,f=0;return c!==0&&(u=c/(1-Math.abs(2*d-1)),r===i?f=(a-l)/c%6:r===a?f=(l-i)/c+2:f=(i-a)/c+4,f*=60,f<0&&(f+=360)),{h:f,s:u,l:d}}function F0(e){if(typeof e!="string")return null;const t=H0(e);if(!t||t.s<U0)return null;let o=null,i=1/0;for(const a of fn){const l=Math.abs(t.h-z0[a]),r=Math.min(l,360-l);r<i&&(i=r,o=a)}return o}function nt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(P0(t))return t;const o=e==null?void 0:e.properties;return F0((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function ul(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const G0={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)"},Y0={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 hd(e,t=!1){return e?t?Y0[e]:G0[e]:null}function Bn(e){return pd[e]}function Dn(e){return`var(--em-swatch-${e}-bar)`}const W0=["width","height","innerHTML"],K0=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"/>',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"/>',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"/>'};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,W0))}}),Pe=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},Re=Pe(K0,[["__scopeId","data-v-5256c2f6"]]),q0={class:"em-inline-issue__msgs"},mn=Pe(n.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const t=e,o={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},i=n.computed(()=>t.refId?t.controller.issuesByRef.value.get(t.refId)??[]:[]),a=n.computed(()=>{let l=null;for(const r of i.value)(l===null||o[r.severity].order<o[l].order)&&(l=r.severity);return l});return(l,r)=>a.value?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["em-inline-issue",`is-${a.value}`])},[n.createVNode(Re,{name:o[a.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),n.createElementVNode("span",q0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,(s,c)=>(n.openBlock(),n.createElementBlock("span",{key:c},n.toDisplayString(s.message),1))),128))])],2)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-17f46a25"]]),X0={class:"em-mlang"},j0={class:"em-mlang__tabs",role:"tablist"},Z0=["aria-selected","onClick"],J0={key:0,class:"em-mlang__dot"},fl=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 l=n.ref(a());n.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function r(d){var u,f;return!!((f=(u=o.modelValue)==null?void 0:u[d])!=null&&f.trim())}const s=n.computed(()=>{var d;return((d=o.modelValue)==null?void 0:d[l.value])??""});function c(d){const u={...o.modelValue};d.trim()===""?delete u[l.value]:u[l.value]=d,i("update:modelValue",u)}return(d,u)=>(n.openBlock(),n.createElementBlock("div",X0,[n.createElementVNode("div",j0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.languages,f=>(n.openBlock(),n.createElementBlock("button",{key:f,type:"button",class:n.normalizeClass(["em-mlang__tab",{"is-active":l.value===f}]),role:"tab","aria-selected":l.value===f,onClick:p=>l.value=f},[n.createTextVNode(n.toDisplayString(f),1),r(f)?(n.openBlock(),n.createElementBlock("span",J0,"•")):n.createCommentVNode("",!0)],10,Z0))),128))]),e.multiline?(n.openBlock(),n.createBlock(n.unref(ie.BSTextArea),{key:0,name:`${e.name}-${l.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}-${l.value}`,width:"100%",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","placeholder","model-value"]))]))}}),[["__scopeId","data-v-274a0fe9"]]),Q0=["disabled"],e1={class:"em-panel__sub-label"},t1={class:"em-field"},n1={class:"em-field"},o1={class:"em-field"},i1={class:"em-class"},a1={class:"em-field"},l1={class:"em-field"},r1={class:"em-field"},s1={class:"em-field"},c1={class:"em-multilang"},d1={class:"em-multilang"},u1={class:"em-jpa"},f1={class:"em-field"},m1={class:"em-field"},p1={class:"em-field"},h1={class:"em-swatch"},y1={class:"em-swatch__row"},g1=["title","onClick"],yd=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,l=n.computed(()=>a.state.logical.entities.find(L=>L.modelId===o.entityId)??null),r=n.computed(()=>l.value?a.state.layout.entityLayouts.find(L=>L.entityRef===l.value.modelId)??null:null),s=n.computed(()=>{var L;return nt(((L=r.value)==null?void 0:L.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"],f=L=>L;function p(L){return L==="inherit"?"기본(따름)":L}function m(L){l.value&&a.updateEntity(l.value.modelId,L)}function h(L,Q,v){var $;const T=(($=l.value)==null?void 0:$.table)??{physicalName:""};m(L==="physicalName"?{table:{...T,physicalName:v}}:{table:{...T,logicalName:{...T.logicalName,[Q]:v}}})}function _(L){m({description:Object.keys(L).length?L:void 0})}function b(L,Q){var v;m({jpaAttrs:{...(v=l.value)==null?void 0:v.jpaAttrs,[L]:Q}})}function g(L,Q){b(L,Q)}const I=n.computed(()=>{var L,Q;return((Q=(L=l.value)==null?void 0:L.jpaAttrs)==null?void 0:Q.discriminatorType)??"inherit"}),y=n.computed(()=>{var L,Q;return!((Q=(L=l.value)==null?void 0:L.jpaAttrs)!=null&&Q.useDiscriminator)});function N(L){b("discriminatorType",L==="inherit"?void 0:L)}function q(L){m({hasPersonalInfo:L})}function U(L){m({superClass:L.trim()||void 0})}function X(L){m({schema:L.trim()||void 0})}function K(L){m({abstractClass:L})}const W=n.computed(()=>{var L,Q;return((Q=(L=l.value)==null?void 0:L.declarationOfInterfaces)==null?void 0:Q.join(", "))??""});function ne(L){const Q=L.split(",").map(v=>v.trim()).filter(Boolean);m({declarationOfInterfaces:Q.length?Q:void 0})}function re(L){l.value&&a.setEntitySwatch(l.value.modelId,L)}return(L,Q)=>{var v,T,$;return l.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:Q[0]||(Q[0]=P=>i("toggle"))},[n.createElementVNode("span",e1,[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||l.value.name||"엔티티"),1)])])):n.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(mn,{controller:n.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),n.createElementVNode("label",t1,[Q[13]||(Q[13]=n.createElementVNode("span",null,"이름",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-name",width:"100%","model-value":l.value.name,"onUpdate:modelValue":Q[1]||(Q[1]=P=>m({name:P}))},null,8,["model-value"])]),n.createElementVNode("label",n1,[Q[14]||(Q[14]=n.createElementVNode("span",null,"스테레오타입",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":l.value.stereotype,items:c,"value-provider":f,"label-provider":f,"onUpdate:modelValue":Q[2]||(Q[2]=P=>m({stereotype:P}))},null,8,["model-value"])]),n.createElementVNode("label",o1,[Q[15]||(Q[15]=n.createElementVNode("span",null,"패키지",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-package",width:"100%","model-value":l.value.packageName??"","onUpdate:modelValue":Q[3]||(Q[3]=P=>m({packageName:P}))},null,8,["model-value"])]),n.createElementVNode("fieldset",i1,[Q[18]||(Q[18]=n.createElementVNode("legend",null,"클래스",-1)),n.createElementVNode("label",a1,[Q[16]||(Q[16]=n.createElementVNode("span",null,"부모 클래스",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:"예: BaseEntity","model-value":l.value.superClass??"","onUpdate:modelValue":Q[4]||(Q[4]=P=>U(P))},null,8,["model-value"])]),n.createElementVNode("label",l1,[Q[17]||(Q[17]=n.createElementVNode("span",null,"구현 인터페이스",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:"콤마로 구분 (예: Serializable, Cloneable)","model-value":W.value,"onUpdate:modelValue":Q[5]||(Q[5]=P=>ne(P))},null,8,["model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-abstract",class:"em-check",label:"추상 클래스","model-value":!!l.value.abstractClass,"onUpdate:modelValue":Q[6]||(Q[6]=P=>K(P))},null,8,["model-value"])]),n.createElementVNode("label",r1,[Q[19]||(Q[19]=n.createElementVNode("span",null,"테이블(물리)",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-table",width:"100%","model-value":((v=l.value.table)==null?void 0:v.physicalName)??"","onUpdate:modelValue":Q[7]||(Q[7]=P=>h("physicalName",null,P))},null,8,["model-value"])]),n.createElementVNode("label",s1,[Q[20]||(Q[20]=n.createElementVNode("span",null,"스키마",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-schema",width:"100%",placeholder:"예: sales, master","model-value":l.value.schema??"","onUpdate:modelValue":Q[8]||(Q[8]=P=>X(P))},null,8,["model-value"])]),n.createElementVNode("fieldset",c1,[Q[21]||(Q[21]=n.createElementVNode("legend",null,"테이블 논리명",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,P=>{var H,te;return n.openBlock(),n.createElementBlock("label",{key:P,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(P),1),n.createVNode(n.unref(ie.BSTextInput),{name:`ent-logical-${P}`,width:"100%","model-value":((te=(H=l.value.table)==null?void 0:H.logicalName)==null?void 0:te[P])??"","onUpdate:modelValue":M=>h("logicalName",P,M)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("fieldset",d1,[Q[22]||(Q[22]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(fl,{multiline:"",name:"ent-desc",languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":l.value.description,"onUpdate:modelValue":_},null,8,["languages","default-lang","model-value"])]),n.createElementVNode("fieldset",u1,[Q[26]||(Q[26]=n.createElementVNode("legend",null,"JPA",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(d,P=>{var H;return n.createVNode(n.unref(ie.BSCheckbox),{key:P.key,name:`jpa-${P.key}`,class:"em-check",label:P.label,"model-value":!!((H=l.value.jpaAttrs)!=null&&H[P.key]),"onUpdate:modelValue":te=>g(P.key,te)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),n.createElementVNode("label",f1,[Q[23]||(Q[23]=n.createElementVNode("span",null,"Discriminator 컬럼명",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"disc-col",width:"100%",placeholder:"예: DTYPE",disabled:y.value,"model-value":((T=l.value.jpaAttrs)==null?void 0:T.discriminatorColumnName)??"","onUpdate:modelValue":Q[9]||(Q[9]=P=>b("discriminatorColumnName",P.trim()||void 0))},null,8,["disabled","model-value"])]),n.createElementVNode("label",m1,[Q[24]||(Q[24]=n.createElementVNode("span",null,"Discriminator 타입",-1)),n.createVNode(n.unref(ie.BSSelect),{disabled:y.value,"model-value":I.value,items:u,"value-provider":f,"label-provider":p,"onUpdate:modelValue":Q[10]||(Q[10]=P=>P&&N(P))},null,8,["disabled","model-value"])]),n.createElementVNode("label",p1,[Q[25]||(Q[25]=n.createElementVNode("span",null,"Discriminator 길이",-1)),n.createVNode(n.unref(ie.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:y.value,"model-value":($=l.value.jpaAttrs)==null?void 0:$.discriminatorLength,"onUpdate:modelValue":Q[11]||(Q[11]=P=>b("discriminatorLength",P||void 0))},null,8,["disabled","model-value"])])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:"개인정보 포함 (hasPersonalInfo)","model-value":!!l.value.hasPersonalInfo,"onUpdate:modelValue":q},null,8,["model-value"]),n.createElementVNode("fieldset",h1,[Q[27]||(Q[27]=n.createElementVNode("legend",null,"헤더 색상",-1)),n.createElementVNode("div",y1,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:"없음",onClick:Q[12]||(Q[12]=P=>re(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),P=>(n.openBlock(),n.createElementBlock("button",{key:P,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":s.value===P}]),style:n.normalizeStyle({background:n.unref(Dn)(P)}),title:n.unref(Bn)(P),onClick:H=>re(P)},null,14,g1))),128))])])],64)):n.createCommentVNode("",!0)],8,Q0)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-c24d4686"]]),gd=["ko","en","ja","zh"];function b1(e){if(e)for(const t of gd){const o=e[t];if(o)return o}}function ml(e){const t=b1(e.label);return t?`${e.groupCode} (${t})`:e.groupCode}function _1(e,t){const o=t.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:gd.some(a=>{var l,r;return(r=(l=i.label)==null?void 0:l[a])==null?void 0:r.toLowerCase().includes(o)})):e}const w1=["aria-expanded"],v1=["aria-selected","onClick","onMouseenter"],k1={key:0,class:"gcc__opt gcc__opt--empty"},bd=Pe(n.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=n.ref(),s=n.ref(""),c=n.ref(!1),d=n.ref(-1),u=n.ref({}),f=n.computed(()=>o.items.find(K=>K.groupCode===o.modelValue)),p=n.computed(()=>f.value?ml(f.value):"");n.watch(p,K=>{c.value||(s.value=K)},{immediate:!0});const m=n.computed(()=>s.value===p.value?o.items:_1(o.items,s.value));function h(){var W;const K=(W=a.value)==null?void 0:W.getBoundingClientRect();K&&(u.value={left:`${K.left}px`,top:`${K.bottom}px`,width:`${K.width}px`})}function _(){c.value=!0,h(),d.value=Math.max(0,m.value.findIndex(K=>K.groupCode===o.modelValue)),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),document.addEventListener("mousedown",X)}function b(){c.value=!1,window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h),document.removeEventListener("mousedown",X)}n.onBeforeUnmount(b);function g(){_(),n.nextTick(()=>{var K;return(K=l.value)==null?void 0:K.select()})}function I(){c.value||_(),d.value=0}function y(K){i("update:modelValue",K.groupCode),s.value=ml(K),b()}function N(){i("update:modelValue",void 0),s.value="",b()}function q(){s.value.trim()===""?N():(s.value=p.value,b())}function U(K){var W;if(K.key==="ArrowDown")c.value||_(),d.value=Math.min(d.value+1,m.value.length-1),K.preventDefault();else if(K.key==="ArrowUp")d.value=Math.max(d.value-1,0),K.preventDefault();else if(K.key==="Enter"){const ne=m.value[d.value];ne&&y(ne),K.preventDefault()}else K.key==="Escape"&&(s.value=p.value,b(),(W=l.value)==null||W.blur())}function X(K){var ne,re;const W=K.target;!((ne=a.value)!=null&&ne.contains(W))&&!((re=r.value)!=null&&re.contains(W))&&q()}return(K,W)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:a,class:"gcc"},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":W[0]||(W[0]=ne=>s.value=ne),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":c.value,placeholder:"코드그룹 검색/선택",onFocus:g,onInput:I,onKeydown:U},null,40,w1),[[n.vModelText,s.value]]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[c.value?(n.openBlock(),n.createElementBlock("ul",{key:0,ref_key:"popup",ref:r,class:"gcc__popup",style:n.normalizeStyle(u.value),role:"listbox"},[n.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:W[1]||(W[1]=n.withModifiers(()=>{},["prevent"])),onClick:N},"(없음)",32),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(ne,re)=>(n.openBlock(),n.createElementBlock("li",{key:ne.groupCode,class:n.normalizeClass(["gcc__opt",{"is-active":re===d.value,"is-selected":ne.groupCode===e.modelValue}]),role:"option","aria-selected":ne.groupCode===e.modelValue,onMousedown:W[2]||(W[2]=n.withModifiers(()=>{},["prevent"])),onClick:L=>y(ne),onMouseenter:L=>d.value=re},n.toDisplayString(n.unref(ml)(ne)),43,v1))),128)),m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",k1,"일치하는 코드그룹 없음"))],4)):n.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-3f798ab1"]]),E1=["disabled"],N1={class:"em-aw__toolbar"},$1={class:"em-aw__count"},x1={class:"em-aw__scroll"},I1={class:"em-aw__table"},S1={key:0,class:"c-code"},C1=["colspan"],R1={class:"c-del"},V1={class:"c-flag"},A1={class:"c-flag"},T1={class:"c-flag"},M1={class:"c-flag"},B1={class:"c-flag"},D1={class:"c-flag"},O1={class:"c-flag"},L1={class:"c-flag"},P1={key:0},z1=["title"],U1=["colspan"],H1={class:"c-del"},F1={class:"em-aw__embed-label"},G1={class:"em-aw__ro"},Y1={class:"em-aw__ro"},W1={class:"em-aw__ro"},K1={class:"em-aw__ro"},q1={colspan:"8"},X1=["colspan"],j1={key:0},Z1="외래키는 연관관계에서 파생됩니다 — 연관관계선을 삭제하세요",Ti="__OWN__",J1=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"}),l=n.computed(()=>new Set(o.selectedAttrIds.value)),r=n.computed(()=>{var S;return(((S=i.value)==null?void 0:S.attributes)??[]).filter(D=>D.attrType!=="DIVIDER").length}),s=n.computed(()=>T.value.length?19:18),c=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function d(S){return S==="none"?"(없음)":S}const u=S=>S;function f(S,D){i.value&&o.updateAttribute(i.value.modelId,S.modelId,D)}function p(S){return!!i.value&&!!jo(o.state.logical,i.value.modelId,S.modelId)}function m(S,D){f(S,{naturalId:D||void 0,naturalIdMutable:D?S.naturalIdMutable:void 0})}function h(){return{naturalId:void 0,naturalIdMutable:void 0}}function _(S,D){f(S,{identifier:D,...D?h():{}})}function b(S,D){f(S,{transient:D||void 0,...D?h():{}})}function g(S){return!!S.transient}const I=S=>S.value,y=S=>S.label;function N(S,D){if(!D)return;const O=re.value.find(de=>de.type===D);if(O){const de=S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"};f(S,{type:D,customType:void 0,dbAttrs:[{...de,dataType:O.dataType,length:O.length,scale:O.scale}]});return}f(S,D===Lt?{type:D}:{type:D,customType:void 0})}function q(S,D){f(S,{customType:D.trim()===""?void 0:D})}function U(S,D){const de={...S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"},...D};D.dataType!==void 0&&!Po.has(de.dataType)&&(de.scale=void 0),f(S,{dbAttrs:[de]})}function X(S){var D;return Po.has(((D=S.dbAttrs[0])==null?void 0:D.dataType)??"")}function K(S,D,O){var de;U(S,{logicalName:{...(de=S.dbAttrs[0])==null?void 0:de.logicalName,[D]:O}})}function W(S){return S.personalInfoAttributeType??"none"}function ne(S,D){f(S,{personalInfoAttributeType:D==="none"?void 0:D})}const re=n.computed(()=>o.predefinedCustomTypeCatalog.value),L=n.computed(()=>o.embeddableCatalog.value);function Q(S){var D,O;return((D=S.label)==null?void 0:D.ko)??((O=S.label)==null?void 0:O.en)??S.type}function v(S){!S||!i.value||o.addPredefinedEmbed(i.value.modelId,S)}const T=n.computed(()=>o.groupCodeCatalog.value);function $(S){var D;return((D=T.value.find(O=>O.groupCode===S.groupCode))==null?void 0:D.codes)??[]}function P(S){return["none",...$(S)]}function H(S){return S==="none"?"none":S.code}function te(S){var O,de;if(S==="none")return"(없음)";const D=((O=S.label)==null?void 0:O.ko)??((de=S.label)==null?void 0:de.en);return D?`${S.code} (${D})`:S.code}function M(S,D){i.value&&o.setAttributeGroupCode(i.value.modelId,S.modelId,D)}function ee(S,D){f(S,{defaultValue:D==="none"?void 0:D})}function le(S,D){f(S,{defaultValue:D.trim()===""?void 0:D})}function me(S){return S.attrType.startsWith("EMBED")&&S.dbAttrs.length>0}function ye(S,D,O){const de=S.dbAttrs.map((ge,w)=>{if(w!==D)return ge;const k={...ge,...O};for(const C of Object.keys(O))O[C]===void 0&&delete k[C];return k});i.value&&o.setEmbedColumns(i.value.modelId,S.modelId,de)}function ce(S,D,O,de){var ge;ye(S,D,{logicalName:{...(ge=S.dbAttrs[D])==null?void 0:ge.logicalName,[O]:de}})}function ue(S,D){var ge,w,k;if(S.attrType==="EMBED_PREDEF"){const C=(ge=o.embeddableCatalog.value.find(Z=>Z.type===S.type))==null?void 0:ge.fields[D];return C?{name:C.name,physicalName:C.physicalName,dataType:C.dataType,length:C.length,shareable:C.shareable,logicalName:C.logicalName}:void 0}const O=(w=S.embedded)==null?void 0:w.embeddableRef;if(!O)return;const de=(k=o.state.logical.entities.find(C=>C.modelId===O))==null?void 0:k.attributes.flatMap(C=>C.dbAttrs)[D];return de?{physicalName:de.physicalName,dataType:de.dataType,length:de.length,scale:de.scale,logicalName:de.logicalName}:void 0}function he(S,D){var O,de;return((O=ue(S,D))==null?void 0:O.dataType)||((de=S.dbAttrs[D])==null?void 0:de.dataType)||""}function ve(S,D){var O,de;return((O=ue(S,D))==null?void 0:O.length)??((de=S.dbAttrs[D])==null?void 0:de.length)}function Se(S,D){var O,de;return((O=ue(S,D))==null?void 0:O.scale)??((de=S.dbAttrs[D])==null?void 0:de.scale)}const Ie=["inherit","true","false"];function pe(S){return S==="inherit"?"기본(따름)":S}function j(S){return(S==null?void 0:S.updatable)===void 0?"inherit":S.updatable?"true":"false"}function Y(S,D,O){ye(S,D,{updatable:O==="inherit"?void 0:O==="true"})}function E(S,D){U(S,{updatable:D==="inherit"?void 0:D==="true"})}const A=["inherit","true","false"];function R(S){return S==="inherit"?"기본(따름)":S}function G(S){return(S==null?void 0:S.insertable)===void 0?"inherit":S.insertable?"true":"false"}function J(S,D,O){ye(S,D,{insertable:O==="inherit"?void 0:O==="true"})}function fe(S,D){U(S,{insertable:D==="inherit"?void 0:D==="true"})}const _e=n.computed(()=>{var S;return Wn(((S=i.value)==null?void 0:S.attributes.flatMap(D=>D.dbAttrs))??[])}),ke=n.computed(()=>{var S;return(((S=i.value)==null?void 0:S.attributes)??[]).filter(D=>D.attrType==="NORMAL"&&D.dbAttrs.length===1&&D.dbAttrs[0]).map(D=>({modelId:D.dbAttrs[0].modelId,label:D.dbAttrs[0].physicalName||D.name}))});function be(){return[Ti,...ke.value.map(S=>S.modelId)]}function xe(S){if(S===Ti)return"전용 컬럼(OWN)";const D=ke.value.find(O=>O.modelId===S);return D?`↗ ${D.label} (공유)`:S}function Ve(S){return(S==null?void 0:S.sharedColumnRef)??Ti}function Te(S,D,O){ye(S,D,{sharedColumnRef:O===Ti?void 0:O})}function x(S){return(S==null?void 0:S.sharedColumnRef)!=null}function B(S){var D;return((D=zo(S,_e.value))==null?void 0:D.physicalName)??""}return(S,D)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",N1,[n.createElementVNode("span",$1,"속성 ("+n.toDisplayString(r.value)+")",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:D[0]||(D[0]=O=>n.unref(o).addAttribute(i.value.modelId))}),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"구분선",onClick:D[1]||(D[1]=O=>n.unref(o).addDivider(i.value.modelId))}),L.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"140px",placeholder:"임베더블 추가","model-value":void 0,items:L.value,"value-provider":O=>O.type,"label-provider":Q,"onUpdate:modelValue":v},null,8,["items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",x1,[n.createElementVNode("table",I1,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[D[2]||(D[2]=n.createElementVNode("th",{class:"c-name"},"이름",-1)),D[3]||(D[3]=n.createElementVNode("th",{class:"c-type"},"타입",-1)),D[4]||(D[4]=n.createElementVNode("th",{class:"c-logical"},"논리명",-1)),D[5]||(D[5]=n.createElementVNode("th",{class:"c-col"},"컬럼(물리)",-1)),D[6]||(D[6]=n.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),D[7]||(D[7]=n.createElementVNode("th",{class:"c-len"},"len",-1)),D[8]||(D[8]=n.createElementVNode("th",{class:"c-scale"},"scale",-1)),D[9]||(D[9]=n.createElementVNode("th",{class:"c-flag"},"Primary Key",-1)),D[10]||(D[10]=n.createElementVNode("th",{class:"c-flag"},"Not Null",-1)),D[11]||(D[11]=n.createElementVNode("th",{class:"c-flag"},"Unique",-1)),D[12]||(D[12]=n.createElementVNode("th",{class:"c-flag"},"Auto Increment",-1)),D[13]||(D[13]=n.createElementVNode("th",{class:"c-flag"},"@Transient",-1)),D[14]||(D[14]=n.createElementVNode("th",{class:"c-flag"},"@NaturalId",-1)),D[15]||(D[15]=n.createElementVNode("th",{class:"c-flag"},"NID mutable",-1)),D[16]||(D[16]=n.createElementVNode("th",{class:"c-flag"},"Multi-Value (Set)",-1)),D[17]||(D[17]=n.createElementVNode("th",{class:"c-ins"},"insertable",-1)),D[18]||(D[18]=n.createElementVNode("th",{class:"c-upd"},"updatable",-1)),D[19]||(D[19]=n.createElementVNode("th",{class:"c-pii"},"개인정보",-1)),T.value.length?(n.openBlock(),n.createElementBlock("th",S1,"코드그룹")):n.createCommentVNode("",!0),D[20]||(D[20]=n.createElementVNode("th",{class:"c-default"},"기본값",-1)),D[21]||(D[21]=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 de,ge,w,k,C,Z,ae,se,V,z,F;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":l.value.has(O.modelId)}])},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-divlabel-${O.modelId}`,width:"100%",placeholder:"구분선 라벨(선택)","model-value":O.name,"onUpdate:modelValue":oe=>f(O,{name:oe})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:s.value,class:"em-aw__divider-note"},"── 시각 구획 ──",8,C1),n.createElementVNode("td",R1,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:oe=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])])],2)):me(O)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-parent",{"is-focused":l.value.has(O.modelId)}])},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${O.modelId}`,width:"100%",placeholder:"이름","model-value":O.name,"onUpdate:modelValue":oe=>f(O,{name:oe})},null,8,["name","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:T.value.length?18:17,class:"em-aw__embed-note"},"임베더블 — 하위 컬럼 "+n.toDisplayString(O.dbAttrs.length)+"개",9,U1),n.createElementVNode("td",H1,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:oe=>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,(oe,Ae)=>{var Le,He,Be,Fe,xt,Xt,jt;return n.openBlock(),n.createElementBlock("tr",{key:oe.modelId,class:"em-aw__embed-col"},[n.createElementVNode("td",F1,"↳ "+n.toDisplayString(((Le=ue(O,Ae))==null?void 0:Le.name)??((He=ue(O,Ae))==null?void 0:He.physicalName)??`컬럼 ${Ae+1}`),1),n.createElementVNode("td",null,[n.createElementVNode("span",G1,n.toDisplayString(he(O,Ae)),1)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-embed-logical-${oe.modelId}`,width:"100%",placeholder:((Fe=(Be=ue(O,Ae))==null?void 0:Be.logicalName)==null?void 0:Fe.ko)??"논리명","model-value":((xt=oe.logicalName)==null?void 0:xt.ko)??"","onUpdate:modelValue":Je=>ce(O,Ae,"ko",Je)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-embed-col-${oe.modelId}`,width:"100%",disabled:x(oe),placeholder:((Xt=ue(O,Ae))==null?void 0:Xt.physicalName)??"컬럼","model-value":x(oe)?B(oe):oe.physicalName,"onUpdate:modelValue":Je=>ye(O,Ae,{physicalName:Je})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(mn,{controller:n.unref(o),"ref-id":oe.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createElementVNode("span",Y1,n.toDisplayString(he(O,Ae)),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",W1,n.toDisplayString(ve(O,Ae)??""),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",K1,n.toDisplayString(Se(O,Ae)??""),1)]),n.createElementVNode("td",q1,[(jt=ue(O,Ae))!=null&&jt.shareable?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"100%","model-value":Ve(oe),items:be(),"value-provider":u,"label-provider":xe,"onUpdate:modelValue":Je=>Je&&Te(O,Ae,Je)},null,8,["model-value","items","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:x(oe),"model-value":x(oe)?"false":G(oe),items:A,"value-provider":u,"label-provider":R,"onUpdate:modelValue":Je=>Je&&J(O,Ae,Je)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:x(oe),"model-value":x(oe)?"false":j(oe),items:Ie,"value-provider":u,"label-provider":pe,"onUpdate:modelValue":Je=>Je&&Y(O,Ae,Je)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:T.value.length?4:3},null,8,X1)])}),128))],64)):(n.openBlock(),n.createElementBlock("tr",{key:1,class:n.normalizeClass({"is-focused":l.value.has(O.modelId)})},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${O.modelId}`,width:"100%",placeholder:"이름","model-value":O.name,"onUpdate:modelValue":oe=>f(O,{name:oe})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-type-${O.modelId}`,width:"100%",placeholder:"타입",disabled:!!O.groupCode,items:n.unref(Ql)(O.type,re.value),"value-provider":I,"label-provider":y,"model-value":O.type,"onUpdate:modelValue":oe=>N(O,oe)},null,8,["name","disabled","items","model-value","onUpdate:modelValue"]),O.type===n.unref(Lt)?(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:0,name:`aw-customtype-${O.modelId}`,width:"100%",placeholder:"커스텀 타입명","model-value":O.customType??"","onUpdate:modelValue":oe=>q(O,oe)},null,8,["name","model-value","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-logical-${O.modelId}`,width:"100%",placeholder:"논리명","model-value":((ge=(de=O.dbAttrs[0])==null?void 0:de.logicalName)==null?void 0:ge.ko)??"","onUpdate:modelValue":oe=>K(O,"ko",oe)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-col-${O.modelId}`,width:"100%",placeholder:"컬럼",disabled:g(O),"model-value":((w=O.dbAttrs[0])==null?void 0:w.physicalName)??"","onUpdate:modelValue":oe=>U(O,{physicalName:oe})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(mn,{controller:n.unref(o),"ref-id":(k=O.dbAttrs[0])==null?void 0:k.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:g(O),items:n.unref(Zl)(((C=O.dbAttrs[0])==null?void 0:C.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":u,"label-provider":n.unref(ua),"model-value":((Z=O.dbAttrs[0])==null?void 0:Z.dataType)??"","onUpdate:modelValue":oe=>oe&&U(O,{dataType:oe})},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:g(O),"model-value":(ae=O.dbAttrs[0])==null?void 0:ae.length,"onUpdate:modelValue":oe=>U(O,{length:oe||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSNumberInput),{name:`aw-scale-${O.modelId}`,width:"100%",placeholder:"scale",disabled:g(O)||!X(O),"model-value":(se=O.dbAttrs[0])==null?void 0:se.scale,"onUpdate:modelValue":oe=>U(O,{scale:oe||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",V1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-pk-${O.modelId}`,"model-value":O.identifier,disabled:a.value||g(O),"onUpdate:modelValue":oe=>_(O,oe)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",A1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nn-${O.modelId}`,"model-value":O.notNull,disabled:g(O),"onUpdate:modelValue":oe=>f(O,{notNull:oe})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",T1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-uq-${O.modelId}`,"model-value":!!((V=O.dbAttrs[0])!=null&&V.unique),disabled:g(O),"onUpdate:modelValue":oe=>U(O,{unique:oe})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",M1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-ai-${O.modelId}`,"model-value":!!((z=O.dbAttrs[0])!=null&&z.autoIncrement),disabled:g(O)||!O.identifier,"onUpdate:modelValue":oe=>U(O,{autoIncrement:oe})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",B1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-tr-${O.modelId}`,"model-value":!!O.transient,disabled:O.identifier,"onUpdate:modelValue":oe=>b(O,oe)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",D1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nid-${O.modelId}`,"model-value":!!O.naturalId,disabled:O.identifier||g(O),"onUpdate:modelValue":oe=>m(O,oe)},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",O1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nidm-${O.modelId}`,"model-value":!!O.naturalIdMutable,disabled:g(O)||!O.naturalId,"onUpdate:modelValue":oe=>f(O,{naturalIdMutable:oe||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",L1,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-mv-${O.modelId}`,"model-value":!!((F=O.dbAttrs[0])!=null&&F.multiValue),disabled:g(O),"onUpdate:modelValue":oe=>U(O,{multiValue:oe||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-ins-${O.modelId}`,width:"100%",disabled:g(O),"model-value":G(O.dbAttrs[0]),items:A,"value-provider":u,"label-provider":R,"onUpdate:modelValue":oe=>oe&&fe(O,oe)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-upd-${O.modelId}`,width:"100%",disabled:g(O),"model-value":j(O.dbAttrs[0]),items:Ie,"value-provider":u,"label-provider":pe,"onUpdate:modelValue":oe=>oe&&E(O,oe)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":W(O),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":oe=>oe&&ne(O,oe)},null,8,["model-value","onUpdate:modelValue"])]),T.value.length?(n.openBlock(),n.createElementBlock("td",P1,[n.createVNode(bd,{"model-value":O.groupCode,items:T.value,"onUpdate:modelValue":oe=>M(O,oe)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("td",null,[$(O).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"100%","model-value":O.defaultValue??"none",items:P(O),"value-provider":H,"label-provider":te,"onUpdate:modelValue":oe=>oe&&ee(O,oe)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`aw-default-${O.modelId}`,width:"100%",placeholder:"기본값","model-value":O.defaultValue??"","onUpdate:modelValue":oe=>le(O,oe)},null,8,["name","model-value","onUpdate:modelValue"]))]),n.createElementVNode("td",{class:"c-del",title:p(O)?Z1:void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:oe=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])],8,z1)],2))],64)}),128)),i.value.attributes.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",j1,[...D[22]||(D[22]=[n.createElementVNode("td",{colspan:"99",class:"em-aw__empty"},"속성 없음 — '추가'로 생성",-1)])]))])])])],8,E1)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-f7e02965"]]),Q1=["disabled"],e_={class:"em-idxw__list"},t_={class:"em-idxw__list-head"},n_=["onClick"],o_={class:"em-idxw__item-name"},i_={key:0,class:"em-idxw__badge"},a_={class:"em-idxw__item-cnt"},l_={key:0,class:"em-idxw__empty"},r_={key:0,class:"em-idxw__edit"},s_={class:"em-idxw__form"},c_={class:"em-field em-idxw__name"},d_={class:"em-field"},u_=["value"],f_={class:"em-idxw__transfer"},m_={class:"em-idxw__pane"},p_={class:"em-idxw__pane-head"},h_={class:"em-idxw__cols"},y_=["onClick"],g_={key:0,class:"em-idxw__empty"},b_={class:"em-idxw__arrows"},__={class:"em-idxw__pane"},w_={class:"em-idxw__pane-head"},v_={class:"em-idxw__cols"},k_={class:"em-idxw__col-name"},E_={class:"em-idxw__col-ops"},N_=["disabled","onClick"],$_=["disabled","onClick"],x_=["onClick"],I_={key:0,class:"em-idxw__empty"},S_={key:1,class:"em-idxw__edit em-idxw__edit--empty"},C_=Pe(n.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(U=>U.modelId===t.entityId)??null),a=n.computed(()=>{var U;return((U=i.value)==null?void 0:U.indexes)??[]}),l=n.computed(()=>{var U;return((U=i.value)==null?void 0:U.attributes)??[]}),r=n.ref(null);n.watch(a,U=>{var X;U.some(K=>K.modelId===r.value)||(r.value=((X=U[0])==null?void 0:X.modelId)??null)},{immediate:!0});const s=n.computed(()=>a.value.find(U=>U.modelId===r.value)??null),c=n.computed(()=>{var U;return new Set(((U=s.value)==null?void 0:U.columns.map(X=>X.columnRef))??[])}),d=n.computed(()=>l.value.filter(U=>!c.value.has(U.modelId))),u=n.ref(new Set);n.watch(r,()=>u.value=new Set);function f(U){var K;const X=(K=U.dbAttrs[0])==null?void 0:K.physicalName;return X&&X!==U.name?`${U.name} (${X})`:U.name}function p(U){const X=l.value.find(K=>K.modelId===U);return X?f(X):U}function m(U,X){i.value&&o.updateIndex(i.value.modelId,U,X)}function h(){var X;if(!i.value)return;const U=Me();o.addIndex(i.value.modelId,{modelId:U,name:`idx_${(((X=i.value.indexes)==null?void 0:X.length)??0)+1}`,unique:!1,columns:[]}),r.value=U}function _(U){i.value&&o.removeIndex(i.value.modelId,U)}function b(U){s.value&&m(s.value.modelId,{parameters:U.trim()===""?void 0:U})}function g(U){const X=new Set(u.value);X.has(U)?X.delete(U):X.add(U),u.value=X}function I(){const U=s.value;if(!U||!u.value.size)return;const X=[...u.value].map(K=>({columnRef:K,descending:!1}));m(U.modelId,{columns:[...U.columns,...X]}),u.value=new Set}function y(U){const X=s.value;X&&m(X.modelId,{columns:X.columns.filter((K,W)=>W!==U)})}function N(U,X){const K=s.value;K&&m(K.modelId,{columns:K.columns.map((W,ne)=>ne===U?{...W,descending:X}:W)})}function q(U,X){const K=s.value;if(!K)return;const W=U+X;if(W<0||W>=K.columns.length)return;const ne=[...K.columns];[ne[U],ne[W]]=[ne[W],ne[U]],m(K.modelId,{columns:ne})}return(U,X)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!n.unref(o).editable.value},[n.createElementVNode("aside",e_,[n.createElementVNode("div",t_,[n.createElementVNode("span",null,"인덱스 ("+n.toDisplayString(a.value.length)+")",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:h})]),n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,K=>(n.openBlock(),n.createElementBlock("li",{key:K.modelId,class:n.normalizeClass(["em-idxw__item",{"is-active":K.modelId===r.value}]),onClick:W=>r.value=K.modelId},[n.createElementVNode("span",o_,n.toDisplayString(K.name||"(이름 없음)"),1),K.unique?(n.openBlock(),n.createElementBlock("span",i_,"UQ")):n.createCommentVNode("",!0),n.createElementVNode("span",a_,n.toDisplayString(K.columns.length),1)],10,n_))),128)),a.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",l_,"인덱스 없음 — '추가'로 생성"))])]),s.value?(n.openBlock(),n.createElementBlock("section",r_,[n.createElementVNode("div",s_,[n.createElementVNode("label",c_,[X[4]||(X[4]=n.createElementVNode("span",null,"인덱스명",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"idxw-name",width:"100%","model-value":s.value.name,"onUpdate:modelValue":X[0]||(X[0]=K=>m(s.value.modelId,{name:K}))},null,8,["model-value"]),n.createVNode(mn,{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":X[1]||(X[1]=K=>m(s.value.modelId,{unique:K}))},null,8,["model-value"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:"인덱스 삭제",onClick:X[2]||(X[2]=K=>_(s.value.modelId))})]),n.createElementVNode("label",d_,[X[5]||(X[5]=n.createElementVNode("span",null,"조건 (partial index)",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:s.value.parameters??"",rows:"2",placeholder:"예: WHERE status = 'A' AND deleted = false",onChange:X[3]||(X[3]=K=>b(K.target.value))},null,40,u_)]),n.createElementVNode("div",f_,[n.createElementVNode("div",m_,[n.createElementVNode("div",p_,"가용 컬럼 ("+n.toDisplayString(d.value.length)+")",1),n.createElementVNode("ul",h_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,K=>(n.openBlock(),n.createElementBlock("li",{key:K.modelId,class:n.normalizeClass(["em-idxw__col",{"is-sel":u.value.has(K.modelId)}]),onClick:W=>g(K.modelId)},n.toDisplayString(f(K)),11,y_))),128)),d.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",g_,"모든 컬럼 사용됨"))])]),n.createElementVNode("div",b_,[n.createVNode(n.unref(ie.BSButton),{caption:"추가 →",disabled:!u.value.size,onClick:I},null,8,["disabled"])]),n.createElementVNode("div",__,[n.createElementVNode("div",w_,"인덱스 컬럼 ("+n.toDisplayString(s.value.columns.length)+")",1),n.createElementVNode("ul",v_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value.columns,(K,W)=>(n.openBlock(),n.createElementBlock("li",{key:W,class:"em-idxw__col em-idxw__col--idx"},[n.createElementVNode("span",k_,n.toDisplayString(p(K.columnRef)),1),n.createVNode(n.unref(ie.BSCheckbox),{name:`idxw-desc-${W}`,class:"em-check",label:"DESC","model-value":K.descending,"onUpdate:modelValue":ne=>N(W,ne)},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("span",E_,[n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:"위로",disabled:W===0,onClick:ne=>q(W,-1)},"↑",8,N_),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:"아래로",disabled:W===s.value.columns.length-1,onClick:ne=>q(W,1)},"↓",8,$_),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:"제거",onClick:ne=>y(W)},"✕",8,x_)])]))),128)),s.value.columns.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",I_,"컬럼 없음 — 좌측에서 추가"))])])])])):(n.openBlock(),n.createElementBlock("section",S_,"인덱스를 선택하거나 추가하세요."))],8,Q1)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-46db4ab5"]]),R_={class:"em-op-src"},V_={class:"em-op-src__actions"},_d=Pe(n.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function}},setup(e){const t=e,o=ie.useModalHandle(),i=n.ref(t.sourceCode);function a(){t.onSave(i.value),o.close()}return(l,r)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:`본문 — ${t.operationName}()`},{default:n.withCtx(()=>[n.createElementVNode("div",R_,[n.withDirectives(n.createElementVNode("textarea",{"onUpdate:modelValue":r[0]||(r[0]=s=>i.value=s),class:"em-op-src__area",spellcheck:"false",placeholder:"// Java 구현 코드"},null,512),[[n.vModelText,i.value]]),n.createElementVNode("div",V_,[n.createVNode(n.unref(ie.BSButton),{caption:"저장",onClick:a}),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"닫기",onClick:r[1]||(r[1]=s=>n.unref(o).close())})])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-acb84aec"]]),A_=["disabled"],T_={class:"em-ow__toolbar"},M_={class:"em-ow__count"},B_={class:"em-ow__scroll"},D_={class:"em-ow__table"},O_={class:"c-del"},L_={key:0},P_=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(h=>h.modelId===t.entityId)??null),l=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],r=["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(h){return h==="none"?"(없음)":h}const c=h=>h;function d(h,_){a.value&&o.updateOperation(a.value.modelId,h.modelId,_)}function u(h,_,b){d(h,{description:{...h.description,[_]:b}})}function f(h){return h.personalInfoAttributeType??"none"}function p(h,_){d(h,{personalInfoAttributeType:_==="none"?void 0:_})}function m(h){i.openModal({component:_d,bind:{operationName:h.name,sourceCode:h.sourceCode??"",onSave:_=>d(h,{sourceCode:_})}})}return(h,_)=>{var b,g;return a.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",T_,[n.createElementVNode("span",M_,"오퍼레이션 ("+n.toDisplayString(((b=a.value.operations)==null?void 0:b.length)??0)+")",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:_[0]||(_[0]=I=>n.unref(o).addOperation(a.value.modelId))})]),n.createElementVNode("div",B_,[n.createElementVNode("table",D_,[_[2]||(_[2]=n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",{class:"c-name"},"이름"),n.createElementVNode("th",{class:"c-vis"},"visibility"),n.createElementVNode("th",{class:"c-desc"},"설명"),n.createElementVNode("th",{class:"c-pii"},"개인정보"),n.createElementVNode("th",{class:"c-src"},"본문"),n.createElementVNode("th",{class:"c-del"})])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.operations??[],I=>{var y;return n.openBlock(),n.createElementBlock("tr",{key:I.modelId},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-name-${I.modelId}`,width:"100%",placeholder:"오퍼레이션명","model-value":I.name,"onUpdate:modelValue":N=>d(I,{name:N})},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":I.visibility??"PACKAGE",items:l,"value-provider":c,"label-provider":c,"onUpdate:modelValue":N=>N&&d(I,{visibility:N})},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-desc-${I.modelId}`,width:"100%",placeholder:"설명(ko)","model-value":((y=I.description)==null?void 0:y.ko)??"","onUpdate:modelValue":N=>u(I,"ko",N)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":f(I),items:r,"value-provider":c,"label-provider":s,"onUpdate:modelValue":N=>N&&p(I,N)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:I.sourceCode?"본문 ●":"본문",onClick:N=>m(I)},null,8,["caption","onClick"])]),n.createElementVNode("td",O_,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:N=>n.unref(o).removeOperation(a.value.modelId,I.modelId)},null,8,["onClick"])])])}),128)),(g=a.value.operations)!=null&&g.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",L_,[..._[1]||(_[1]=[n.createElementVNode("td",{colspan:"6",class:"em-ow__empty"},"오퍼레이션 없음 — '추가'로 생성",-1)])]))])])])],8,A_)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a621eb69"]]),z_={class:"em-detail__tabs"},U_=["onClick"],H_=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 l=[{key:"basics",label:"기본"},{key:"columns",label:"속성"},{key:"indexes",label:"인덱스"},{key:"operations",label:"오퍼레이션"}],r=n.ref("basics");return(s,c)=>{var d;return n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:`엔티티 — ${((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",z_,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(l,u=>n.createElementVNode("button",{key:u.key,type:"button",class:n.normalizeClass(["em-detail__tab",{"is-active":r.value===u.key}]),onClick:f=>r.value=u.key},n.toDisplayString(u.label),11,U_)),64))]),n.createElementVNode("div",{class:n.normalizeClass(["em-detail__body",{"is-readonly":!n.unref(o).editable.value}])},[r.value==="basics"?(n.openBlock(),n.createBlock(yd,{key:0,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):r.value==="columns"?(n.openBlock(),n.createBlock(J1,{key:1,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):r.value==="indexes"?(n.openBlock(),n.createBlock(C_,{key:2,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):(n.openBlock(),n.createBlock(P_,{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-67239153"]]);function Mi(e,t,o){e.openModal({component:H_,bind:{controller:n.markRaw(t),entityId:o}})}const wd="외래키는 연관관계에서 파생됩니다. 삭제하려면 연관관계선을 선택해 삭제하세요.";function F_(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 l=Me();o.set(a.modelId,l),a.modelId=l;for(const r of a.dbAttrs)r.modelId=Me()}for(const a of t.indexes??[]){a.modelId=Me();for(const l of a.columns)l.columnRef=o.get(l.columnRef)??l.columnRef}return t}const pn=Symbol("editorController");function vd(e="m1",t="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:t,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function Bi(e,t){const o=[];for(const i of t.remove)o.push(Nn(e,i));for(const i of t.update)o.push(en(e,i.attributeId,i.patch));for(const i of t.add)o.push(St(e,i));return o}function On(e,t,o){return{...e,entities:e.entities.map(i=>i.modelId===t?{...i,attributes:o(i.attributes)}:i)}}function Ln(e,t){const o=[];for(const[i,a]of Yf(e,t,Me))o.push(...Bi(i,a));return o}function kd(e,t,o){const i=new Set(o.remove);return On(e,t,a=>[...a.filter(l=>!i.has(l.modelId)).map(l=>{const r=o.update.find(s=>s.attributeId===l.modelId);return r?{...l,...r.patch}:l}),...o.add])}function pl(e,t){const o=Jn(e,t,Me),i=Bi(t,o),a=kd(e,t,o);return i.push(...Ln(a,t)),i}function Ed(e){return e.attributes.flatMap(t=>t.dbAttrs).map(t=>({...t,modelId:Me()}))}function G_(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((m,h)=>Math.max(m,h.order),-1)+1,f=new Set(o.attributes.map(m=>m.name));let p="id";for(let m=2;f.has(p);m++)p=`id${m}`;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(St(t,a))}const l=[];for(const u of e.entities)for(const f of u.attributes){if(((d=f.embedded)==null?void 0:d.embeddableRef)!==t)continue;const p=e.associations.find(b=>b.modelId===f.embedded.associationRef);if(!p)continue;const m=p.end1.entityRef===u.modelId,h=m?p.end1:p.end2,_=m?p.end2:p.end1;l.push({ownerId:u.modelId,dispId:f.modelId,assocId:p.modelId,end1:{entityRef:u.modelId,multiplicity:h.multiplicity,navigable:h.navigable,composition:!1},end2:{entityRef:t,multiplicity:_.multiplicity,navigable:_.navigable,composition:!1}})}const r={...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 f=new Set(l.filter(p=>p.ownerId===u.modelId).map(p=>p.dispId));return f.size?{...u,attributes:u.attributes.filter(p=>!f.has(p.modelId))}:u}),associations:e.associations.map(u=>{const f=l.find(p=>p.assocId===u.modelId);return f?{...u,end1:f.end1,end2:f.end2}:u})},s=Jn(r,t,Me);for(const u of l){const f=s.add.find(p=>{var m;return((m=p.derivedFrom)==null?void 0:m.associationRef)===u.assocId});f&&(u.end2.attributeRef=f.modelId)}for(const u of l)i.push(Nn(u.ownerId,u.dispId)),i.push(Wo(u.assocId,{end1:u.end1,end2:u.end2}));i.push(...Bi(t,s));const c=kd(r,t,s);return i.push(...Ln(c,t)),i}function Y_(e,t){const o=e.entities.find(l=>l.modelId===t);if(!o)return[];const i=[],a=l=>l&&l.charAt(0).toLowerCase()+l.slice(1);for(const l of e.associations){if(l.end1.entityRef===l.end2.entityRef)continue;const r=l.end1.entityRef===t,s=l.end2.entityRef===t;if(!r&&!s)continue;const c=r?l.end2.entityRef:l.end1.entityRef,d=e.entities.find(y=>y.modelId===c);if(!d||d.attributes.some(y=>{var N;return((N=y.embedded)==null?void 0:N.associationRef)===l.modelId}))continue;const u=Me(),f=d.attributes.reduce((y,N)=>Math.max(y,N.order),-1)+1,p=new Set(d.attributes.map(y=>y.name)),m=a(o.name);let h=m;for(let y=2;p.has(h);y++)h=`${m}${y}`;const _=o.attributes.filter(y=>!y.identifier&&!y.derivedFrom).flatMap(y=>y.dbAttrs).map(y=>({...y,modelId:Me()})),b={modelId:u,name:h,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:f,dbAttrs:_,embedded:{associationRef:l.modelId,embeddableRef:t}};i.push(St(c,b));const g=r?"end2":"end1",I=r?"end1":"end2";i.push(Wo(l.modelId,{identifying:!1,[g]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Me()},[I]:{entityRef:t,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function W_(e=vd(),t={}){var Ve,Te;const o=n.reactive(e);let i=new _a(o);const a=n.ref(t.embeddableCatalog??[]),l=n.ref(t.groupCodeCatalog??[]),r=n.ref(t.predefinedCustomTypeCatalog??[]),s=n.ref(t.languages??["ko","en","ja","zh"]),c=n.ref(t.userLanguage??"ko"),d=n.ref(t.reservedWords),u=n.ref(t.selectableDataTypes),f=n.ref(t.largeEntityThreshold),p=n.ref(t.flagEntitiesWithoutRelations??!1),m=n.ref(!1),h=n.ref(!1),_=n.ref(!1),b=n.ref(0),g=n.ref(null);let I=0;const y=x=>{if(t.onNotice){t.onNotice(x);return}g.value={text:x,id:++I}},N=n.ref(((Ve=t.meta)==null?void 0:Ve.schemaVersion)??1),q=n.ref(((Te=t.meta)==null?void 0:Te.opWriteEnabled)??!1),U=n.computed(()=>N.value>=2&&q.value),X=t.historyTransport,K=n.computed(()=>U.value&&X!==void 0),W=t.restoreTransport,ne=n.ref(0),re=n.computed(()=>U.value&&Q.value&&W!==void 0);async function L(x){if(!W||!Q.value)return{ok:!1,reason:"unavailable"};const B=await W(x);return B.ok&&ne.value++,B}const Q=n.ref(!(N.value>=2&&q.value===!1)),v=n.ref("LOGICAL_PHYSICAL"),T=n.ref("straight"),$=n.ref(!0),P=n.ref(!0),H=n.ref(null),te=n.computed(()=>{var x;return((x=H.value)==null?void 0:x.kind)==="attribute"?{entityId:H.value.entityId,attrId:H.value.anchor}:null}),M=n.computed(()=>{var x;return((x=H.value)==null?void 0:x.kind)==="attribute"?H.value.ids:[]}),ee=n.computed(()=>{var x,B;return((x=H.value)==null?void 0:x.kind)==="entity"?H.value.id:((B=H.value)==null?void 0:B.kind)==="attribute"?H.value.entityId:null}),le=n.ref(null);let me=0;const ye=n.ref(null),ce=n.ref(null);let ue=t.meta;function he(){i.onChange(()=>{m.value=i.canUndo,h.value=i.canRedo,_.value=i.isDirty,b.value++})}he();let ve=null,Se=null;function Ie(){Se==null||Se(),Se=null,ve=null}function pe(){if(Ie(),!U.value||!t.opTransport)return;const x=new jr({diagramId:o.layout.diagramId,state:o,transport:t.opTransport,origin:"gui",onFreeze:B=>{Q.value=!1,ce.value=B},onError:t.onOpError});x.seed((ue==null?void 0:ue.revSeed)??{}),Se=x.attach(i),ve=x}pe();const j=n.computed(()=>Ul(o.logical,o.layout)),Y=n.computed(()=>({reservedWords:d.value,selectableDataTypes:u.value,largeEntityThreshold:f.value,flagEntitiesWithoutRelations:p.value,embeddableCatalog:a.value})),E=n.computed(()=>nr(o.logical,Y.value)),A=n.computed(()=>{const x=new Map;for(const B of E.value){if(!B.targetRef)continue;const S=x.get(B.targetRef);S?S.push(B):x.set(B.targetRef,[B])}return x}),R=x=>{Q.value&&i.execute(x)},G=x=>o.layout.entityLayouts.some(B=>B.entityRef===x&&!!B.locked),J=x=>o.layout.groupLayouts.some(B=>B.groupRef===x&&!!B.locked),fe=x=>{const B=o.logical.associations.find(S=>S.modelId===x);return!!B&&(G(B.end1.entityRef)||G(B.end2.entityRef))},_e=(x,B,S)=>{if(G(x))return;const D=en(x,B,S),O=On(o.logical,x,ge=>ge.map(w=>w.modelId===B?{...w,...S}:w)),de=Ln(O,x);R(de.length?Ue("속성 수정",[D,...de]):D)};function ke(x){const B=x.map(k=>o.layout.entityLayouts.find(C=>C.entityRef===k)).filter(k=>!!k);if(!B.length)return{location:{x:40,y:40},size:{width:400,height:300}};let S=1/0,D=1/0,O=-1/0,de=-1/0;for(const k of B){const C=k.geo.size.width||220,Z=k.geo.size.height||140;S=Math.min(S,k.geo.location.x),D=Math.min(D,k.geo.location.y),O=Math.max(O,k.geo.location.x+C),de=Math.max(de,k.geo.location.y+Z)}const ge=40,w=28;return{location:{x:S-ge,y:D-ge-w},size:{width:O-S+ge*2,height:de-D+ge*2+w}}}function be(x,B,S){var k;const D=o.layout.groupLayouts.find(C=>C.groupRef===x),O=(D==null?void 0:D.geo.location)??B,de=B.x-O.x,ge=B.y-O.y,w=[br(x,B),...S.map(C=>En(C.id,C.location))];if(de||ge){const C=new Set(((k=o.logical.groups.find(Z=>Z.modelId===x))==null?void 0:k.memberEntityRefs)??[]);for(const Z of o.logical.associations){if(!C.has(Z.end1.entityRef)||!C.has(Z.end2.entityRef))continue;const ae=o.layout.associationLayouts.find(se=>se.associationRef===Z.modelId);ae&&ae.waypoints.length&&w.push(Tr(Z.modelId,de,ge))}for(const Z of(D==null?void 0:D.memberNoteRefs)??[]){const ae=o.layout.notes.find(se=>se.modelId===Z);ae&&w.push(Zn(Z,{x:ae.geo.location.x+de,y:ae.geo.location.y+ge}))}}return w}const xe={state:o,resolved:j,issues:E,issuesByRef:A,flagEntitiesWithoutRelations:p,canUndo:m,canRedo:h,dirty:_,revision:b,notice:g,editable:Q,schemaVersion:N,opWriteEnabled:q,opMode:U,opConflict:ce,historyTransport:X,historyAvailable:K,restoreTransport:W,restoreAvailable:re,restoreToSeq:L,reloadRequest:ne,displayMode:v,routingMode:T,showGrid:$,showMinimap:P,selection:H,selectedAttr:te,selectedAttrIds:M,inspectedEntityId:ee,focusRequest:le,clipboard:ye,embeddableCatalog:a,groupCodeCatalog:l,predefinedCustomTypeCatalog:r,languages:s,userLanguage:c,selectableDataTypes:u,setEditable(x){Q.value=x&&U.value},setEmbeddableCatalog(x){a.value=x},setGroupCodeCatalog(x){l.value=x},setPredefinedCustomTypeCatalog(x){r.value=x},selectAttribute(x,B,S="replace"){const D=H.value,O=(D==null?void 0:D.kind)==="attribute"&&D.entityId===x;if(S==="replace"||!O){H.value={kind:"attribute",entityId:x,ids:[B],anchor:B};return}if(S==="toggle"){const ae=D.ids.includes(B),se=ae?D.ids.filter(z=>z!==B):[...D.ids,B];if(!se.length){H.value=null;return}const V=ae&&D.anchor===B?se[se.length-1]:ae?D.anchor:B;H.value={kind:"attribute",entityId:x,ids:se,anchor:V};return}const de=o.logical.entities.find(ae=>ae.modelId===x),ge=[...(de==null?void 0:de.attributes)??[]].sort((ae,se)=>ae.order-se.order).map(ae=>ae.modelId),w=ge.indexOf(D.anchor),k=ge.indexOf(B);if(w<0||k<0){H.value={kind:"attribute",entityId:x,ids:[B],anchor:B};return}const[C,Z]=w<=k?[w,k]:[k,w];H.value={kind:"attribute",entityId:x,ids:ge.slice(C,Z+1),anchor:D.anchor}},moveAttributeFocus(x){const B=H.value;if((B==null?void 0:B.kind)!=="attribute")return!1;const S=o.logical.entities.find(ge=>ge.modelId===B.entityId);if(!S||!S.attributes.length)return!1;const D=S.attributes.findIndex(ge=>ge.modelId===B.anchor);if(D<0)return!1;const O=Math.min(Math.max(D+x,0),S.attributes.length-1);if(O===D)return!0;const de=S.attributes[O].modelId;return H.value={kind:"attribute",entityId:B.entityId,ids:[de],anchor:de},!0},nudgeSelectedAttributes(x){const B=H.value;if((B==null?void 0:B.kind)!=="attribute")return!1;const S=o.logical.entities.find(ae=>ae.modelId===B.entityId);if(!S)return!1;const D=S.attributes,O=new Set(B.ids),de=D.map((ae,se)=>O.has(ae.modelId)?se:-1).filter(ae=>ae>=0);if(!de.length)return!1;const ge=Math.min(...de),w=D.filter(ae=>!O.has(ae.modelId)),k=D.slice(0,ge).filter(ae=>!O.has(ae.modelId)).length;let C;if(x<0){if(k<=0)return!0;C=k-1}else{if(w.length-k<=0)return!0;C=k+1}if(G(B.entityId))return!0;const Z=D.filter(ae=>O.has(ae.modelId)).map(ae=>ae.modelId);return R(Ea(B.entityId,Z,C)),!0},deleteSelection(){if(!Q.value)return!1;const x=H.value;if(!x)return!1;if(x.kind==="attribute"){if(G(x.entityId))return!1;const B=x.ids;if(!B.length)return!1;B.length===1?xe.removeAttribute(x.entityId,B[0]):xe.removeAttributes(x.entityId,B)}else if(x.kind==="entity"){if(G(x.id))return!1;xe.removeEntity(x.id)}else if(x.kind==="note")xe.removeNote(x.id);else if(x.kind==="group"){if(J(x.id))return!1;xe.removeGroup(x.id)}else xe.removeAssociation(x.id);return H.value=null,!0},nudgeNodes(x,B,S){if(!x.length||B===0&&S===0)return!1;const D=new Set(o.logical.entities.map(C=>C.modelId)),O=new Set(o.logical.groups.map(C=>C.modelId)),de=new Set(o.layout.notes.map(C=>C.modelId)),ge=new Set;for(const C of x){if(!O.has(C))continue;const Z=o.logical.groups.find(ae=>ae.modelId===C);for(const ae of(Z==null?void 0:Z.memberEntityRefs)??[])ge.add(ae)}const w=[],k=[];for(const C of x)if(O.has(C)){if(J(C))continue;const Z=o.layout.groupLayouts.find(z=>z.groupRef===C);if(!Z)continue;const ae=o.logical.groups.find(z=>z.modelId===C),se=((ae==null?void 0:ae.memberEntityRefs)??[]).map(z=>{var oe;const F=((oe=o.layout.entityLayouts.find(Ae=>Ae.entityRef===z))==null?void 0:oe.geo.location)??{x:0,y:0};return{id:z,location:{x:F.x+B,y:F.y+S}}}),V={x:Z.geo.location.x+B,y:Z.geo.location.y+S};w.push(Ue("그룹 이동",be(C,V,se))),k.push("g:"+C)}else if(D.has(C)){if(ge.has(C)||G(C))continue;const Z=o.layout.entityLayouts.find(ae=>ae.entityRef===C);if(!Z)continue;w.push(En(C,{x:Z.geo.location.x+B,y:Z.geo.location.y+S})),k.push("e:"+C)}else if(de.has(C)){const Z=o.layout.notes.find(ae=>ae.modelId===C);if(!Z)continue;w.push(Zn(C,{x:Z.geo.location.x+B,y:Z.geo.location.y+S})),k.push("n:"+C)}return w.length?(R(Ue("이동",w,"nudge:"+k.sort().join(","))),!0):!1},requestFocus(x){le.value={id:x,nonce:++me}},undo:()=>{Q.value&&i.undo()},redo:()=>{Q.value&&i.redo()},markSaved:()=>{Q.value&&(ve==null||ve.flush(),i.markSavePoint())},loadDiagram(x,B){Ie(),o.logical=x.logical,o.layout=x.layout,i=new _a(o),he(),N.value=(B==null?void 0:B.schemaVersion)??1,q.value=(B==null?void 0:B.opWriteEnabled)??!1,Q.value=!(N.value>=2&&q.value===!1),ue=B,ce.value=null,H.value=null,m.value=i.canUndo,h.value=i.canRedo,_.value=i.isDirty,pe()},flush(){ve==null||ve.flush()},whenOpsSettled(){return(ve==null?void 0:ve.whenSettled())??Promise.resolve()},addEntity(x="NewEntity",B={x:80,y:80}){const S=Me(),D={modelId:S,name:x,stereotype:"JPA_ENTITY",table:{physicalName:x.toLowerCase()},attributes:[{modelId:Me(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Me(),physicalName:"id",dataType:"BIGINT"}]}]};return R(wa(D,{location:{...B},size:{width:220,height:140}})),S},renameEntity(x,B){G(x)||R(dr(x,B))},updateEntity(x,B){if(G(x))return;const S=cr(x,B),D=o.logical.entities.find(ge=>ge.modelId===x),O=B.stereotype==="JPA_EMBEDDABLE"&&!!D&&D.stereotype!=="JPA_EMBEDDABLE",de=!!B.stereotype&&B.stereotype!=="JPA_EMBEDDABLE"&&!!D&&D.stereotype==="JPA_EMBEDDABLE";if(O&&D){const ge=D.attributes.filter(ae=>ae.identifier&&!ae.derivedFrom).map(ae=>en(x,ae.modelId,{identifier:!1})),w=On({...o.logical,entities:o.logical.entities.map(ae=>ae.modelId===x?{...ae,stereotype:"JPA_EMBEDDABLE"}:ae)},x,ae=>ae.map(se=>se.identifier&&!se.derivedFrom?{...se,identifier:!1}:se)),k=pl(w,x),C=Y_(o.logical,x),Z=[S,...ge,...k,...C];R(Z.length>1?Ue("임베더블 변환",Z):S);return}if(de){const ge=G_(o.logical,x),w=[S,...ge];R(w.length>1?Ue("엔터티 전환",w):S);return}R(S)},moveEntity(x,B){G(x)||R(En(x,B))},resizeEntity(x,B){G(x)||R(ur(x,B))},removeEntity(x){G(x)||R(sr(x))},setEntitySwatch(x,B){R(fr(x,B))},setEntityCollapsed(x,B){R(mr(x,B))},setEntityLocked(x,B){R(pr(x,B))},isEntityLocked(x){return G(x)},collapseAll(){R(va(!0))},expandAll(){R(va(!1))},setAttributeSwatch(x,B,S){R(Go(x,B,S))},dragGroup(x,B,S){J(x)||R(Ue("그룹 이동",be(x,B,S)))},resizeGroup(x,B){J(x)||R(_r(x,B))},setGroupSwatch(x,B){R(wr(x,B))},setGroupLocked(x,B){R(vr(x,B))},isGroupLocked(x){return J(x)},updateGroup(x,B){J(x)||R(hr(x,B))},createGroup(x,B){if(!x.length)return null;const S=[];for(const de of o.logical.groups)for(const ge of x)de.memberEntityRefs.includes(ge)&&S.push(Yo(de.modelId,ge));const D=Me(),O={modelId:D,name:B?{ko:B}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...x]};return S.push(ka(O,ke(x))),R(Ue("그룹 생성",S)),H.value=null,D},addEmptyGroup(x,B){const S=Me();return R(ka({modelId:S,name:B?{ko:B}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...x},size:{width:360,height:260}})),S},removeGroup(x){J(x)||R(yr(x))},dropEntity(x,B,S){var de;if(G(x))return;const D=((de=o.logical.groups.find(ge=>ge.memberEntityRefs.includes(x)))==null?void 0:de.modelId)??null,O=[En(x,B)];D!==S&&(D&&O.push(Yo(D,x)),S&&O.push(gr(S,x))),R(Ue("이동",O))},ungroupEntity(x){const B=o.logical.groups.find(S=>S.memberEntityRefs.includes(x));B&&R(Yo(B.modelId,x))},dropNote(x,B,S){var de;const D=((de=o.layout.groupLayouts.find(ge=>{var w;return(w=ge.memberNoteRefs)==null?void 0:w.includes(x)}))==null?void 0:de.groupRef)??null,O=[Zn(x,B)];D!==S&&(D&&O.push(Hr(D,x)),S&&O.push(Ur(S,x))),R(Ue("이동",O))},addPredefinedEmbed(x,B){if(G(x))return;const S=a.value.find(k=>k.type===B),D=o.logical.entities.find(k=>k.modelId===x);if(!S||!D)return;const O=D.attributes.reduce((k,C)=>Math.max(k,C.order),-1)+1,de=Me(),ge=S.fields.map(()=>({modelId:Me(),physicalName:"",dataType:""})),w={modelId:de,name:S.defaultName,type:S.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:O,dbAttrs:ge};return R(St(x,w)),de},addAttribute(x,B={}){if(G(x))return B.modelId??"";const S=o.logical.entities.find(Z=>Z.modelId===x),D=S?S.attributes.length:0,O=B.modelId??Me(),de=B.name??`field${D}`,ge={modelId:O,name:de,type:B.type??fa,attrType:B.attrType??"NORMAL",identifier:B.identifier??!1,notNull:B.notNull??!1,order:D,dbAttrs:B.dbAttrs??[{modelId:Me(),physicalName:de,dataType:"VARCHAR",length:255}],...B},w=St(x,ge),k=On(o.logical,x,Z=>[...Z,ge]),C=Ln(k,x);return R(C.length?Ue("속성 추가",[w,...C]):w),O},addDivider(x){if(G(x))return"";const B=o.logical.entities.find(de=>de.modelId===x),S=B?B.attributes.length:0,D=Me();return R(St(x,{modelId:D,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:S,dbAttrs:[]})),D},updateAttribute(x,B,S){_e(x,B,S)},setAttributeGroupCode(x,B,S){_e(x,B,{groupCode:S,type:S?Yn:fa})},setEmbedColumns(x,B,S){var k,C;if(G(x))return;const D=en(x,B,{dbAttrs:S}),O=(k=o.logical.entities.find(Z=>Z.modelId===x))==null?void 0:k.attributes.find(Z=>Z.modelId===B),de=(C=O==null?void 0:O.embedded)==null?void 0:C.associationRef,ge=de?o.logical.associations.find(Z=>Z.modelId===de):void 0,w=[];ge&&de&&(ge.end1.legacyEmbedRaw&&w.push($n(de,"end1",{legacyEmbedRaw:void 0})),ge.end2.legacyEmbedRaw&&w.push($n(de,"end2",{legacyEmbedRaw:void 0}))),R(w.length?Ue("임베드 컬럼 수정",[D,...w]):D)},removeAttribute(x,B){if(G(x))return;if(jo(o.logical,x,B)){y(wd);return}const S=Nn(x,B),D=On(o.logical,x,de=>de.filter(ge=>ge.modelId!==B)),O=Ln(D,x);R(O.length?Ue("속성 삭제",[S,...O]):S)},removeAttributes(x,B){var w;if(!B.length||G(x))return;const S=B.filter(k=>!jo(o.logical,x,k));if(S.length<B.length&&y(wd),!S.length)return;const D=S.map(k=>Nn(x,k)),O=new Set(S),de=On(o.logical,x,k=>k.filter(C=>!O.has(C.modelId))),ge=[...D,...Ln(de,x)];R(ge.length===1?ge[0]:Ue("속성 삭제",ge)),((w=H.value)==null?void 0:w.kind)==="attribute"&&H.value.entityId===x&&(H.value=null)},setAttributeSwatches(x,B,S){B.length&&(B.length===1?R(Go(x,B[0],S)):R(Ue("속성 색상",B.map(D=>Go(x,D,S)))))},reorderAttributes(x,B,S){!B.length||G(x)||R(Ea(x,B,S))},addIndex(x,B){G(x)||R(Sr(x,B))},updateIndex(x,B,S){G(x)||R(Cr(x,B,S))},removeIndex(x,B){G(x)||R(Rr(x,B))},addOperation(x,B={}){var ge;if(G(x))return B.modelId??"";const S=o.logical.entities.find(w=>w.modelId===x),D=((ge=S==null?void 0:S.operations)==null?void 0:ge.length)??0,O=B.modelId??Me(),de={modelId:O,name:B.name??`method${D}`,visibility:B.visibility??"PACKAGE",order:D,...B};return R(kr(x,de)),O},updateOperation(x,B,S){G(x)||R(Er(x,B,S))},removeOperation(x,B){G(x)||R(Nr(x,B))},reorderOperations(x,B,S){!B.length||G(x)||R($r(x,B,S))},setOperationSwatch(x,B,S){R(xr(x,B,S))},addAssociation(x,B,S,D){if(G(x)||G(B))return"";const O=Me(),de={modelId:O,end1:{entityRef:x,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:S},end2:{entityRef:B,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},ge={...o.logical,associations:[...o.logical.associations,de]},w=Jn(ge,B,Me),k=w.add[0];k&&(de.end2.attributeRef=k.modelId);const C={associationRef:O,waypoints:[],sourceColumnRef:S,targetColumnRef:(k==null?void 0:k.modelId)??D},Z=Na(de,C),ae=Bi(B,w);return R(ae.length?Ue("관계 추가",[Z,...ae]):Z),O},addEmbedAssociation(x,B){if(G(x))return;const S=o.logical.entities.find(oe=>oe.modelId===x),D=o.logical.entities.find(oe=>oe.modelId===B);if(!S||!D||D.stereotype!=="JPA_EMBEDDABLE")return;const O=Me(),de=Me(),ge=Me(),w=S.attributes.reduce((oe,Ae)=>Math.max(oe,Ae.order),-1)+1,k=Ed(D),C=oe=>oe&&oe.charAt(0).toLowerCase()+oe.slice(1),Z=new Set(S.attributes.map(oe=>oe.name)),ae=C(D.name);let se=ae;for(let oe=2;Z.has(se);oe++)se=`${ae}${oe}`;const V={modelId:de,name:se,type:D.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:w,dbAttrs:k,embedded:{associationRef:O,embeddableRef:B}},z={modelId:O,end1:{entityRef:x,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:ge},end2:{entityRef:B,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:de}},F={associationRef:O,waypoints:[],sourceColumnRef:de,targetColumnRef:void 0};return R(Ue("임베드 추가",[St(x,V),Na(z,F)])),O},setEmbedCollectionMode(x,B){if(fe(x))return;const S=o.logical.associations.find(C=>C.modelId===x);if(!S)return;let D,O;for(const C of o.logical.entities){const Z=C.attributes.find(ae=>{var se;return((se=ae.embedded)==null?void 0:se.associationRef)===x&&ae.attrType==="EMBED_OWN"});if(Z){D=C.modelId,O=Z;break}}if(!D||!O)return;const de=O.embedded.embeddableRef,ge=S.end2.entityRef===de?"end2":"end1",w=S[ge],k=w.multiplicity!=="EXACTLY_ONE_INSTANCE";if(!(B==="COLLECTION"?k:!k))if(B==="COLLECTION")R(Ue("임베드 컬렉션 전환",[en(D,O.modelId,{dbAttrs:[]}),$n(x,ge,{multiplicity:"ZERO_OR_MORE_INSTANCES",jpa:{...w.jpa,collectionType:"LIST"}})]));else{const C=o.logical.entities.find(Z=>Z.modelId===de);if(!C)return;R(Ue("임베드 단일 전환",[en(D,O.modelId,{dbAttrs:Ed(C)}),$n(x,ge,{multiplicity:"EXACTLY_ONE_INSTANCE",jpa:{...w.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(x){if(fe(x))return;const B=o.logical.associations.find(ge=>ge.modelId===x),S=Ir(x);if(!B){R(S);return}for(const ge of o.logical.entities){const w=ge.attributes.find(k=>{var C;return((C=k.embedded)==null?void 0:C.associationRef)===x});if(w){R(Ue("임베드 삭제",[S,Nn(ge.modelId,w.modelId)]));return}}const D=B.end2.entityRef,O={...o.logical,associations:o.logical.associations.filter(ge=>ge.modelId!==x)},de=pl(O,D);R(de.length?Ue("관계 삭제",[S,...de]):S)},setAssociationIdentifying(x,B){if(fe(x))return;const S=o.logical.associations.find(w=>w.modelId===x),D=Wo(x,{identifying:B});if(!S||S.identifying===B){R(D);return}const O=S.end2.entityRef,de={...o.logical,associations:o.logical.associations.map(w=>w.modelId===x?{...w,identifying:B}:w)},ge=pl(de,O);R(ge.length?Ue("식별 관계 변경",[D,...ge]):D)},updateAssociationEnd(x,B,S){fe(x)||R($n(x,B,S))},moveWaypoint(x,B,S){R(Vr(x,B,S))},addWaypoint(x,B,S){R(Br(x,B,S))},removeWaypoint(x,B){R(Ar(x,B))},clearWaypoints(x){R(Mr(x))},addNote(x="메모",B={x:80,y:80}){const S=Me();return R(Dr({modelId:S,memo:x,geo:{location:{...B},size:{width:200,height:120}}})),S},removeNote(x){R(Or(x))},moveNote(x,B){R(Zn(x,B))},resizeNote(x,B){R(Lr(x,B))},setNoteMemo(x,B){R(Pr(x,B))},setNoteSwatch(x,B){R(zr(x,B))},addNoteConnection(x,B){R(Fr(x,B))},removeNoteConnection(x,B){R(Gr(x,B))},moveNoteConnectionWaypoint(x,B,S,D){R(Yr(x,B,S,D))},addNoteConnectionWaypoint(x,B,S,D){R(Wr(x,B,S,D))},removeNoteConnectionWaypoint(x,B,S){R(Kr(x,B,S))},clearNoteConnectionWaypoints(x,B){R(qr(x,B))},autoLayout(){const x=Gl(o.logical,o.layout);x.length&&R(Ue("자동 배치",x.map(B=>En(B.id,B.location))))},copy(){const x=H.value;if((x==null?void 0:x.kind)==="attribute"){const de=o.logical.entities.find(w=>w.modelId===x.entityId);if(!de)return;const ge=[...de.attributes].sort((w,k)=>w.order-k.order).filter(w=>x.ids.includes(w.modelId));if(!ge.length)return;ye.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:ge}));return}const B=ee.value;if(!B)return;const S=o.logical.entities.find(de=>de.modelId===B),D=o.layout.entityLayouts.find(de=>de.entityRef===B);if(!S)return;const O=(D==null?void 0:D.geo)??{location:{x:80,y:80},size:{width:220,height:140}};ye.value=JSON.parse(JSON.stringify({kind:"entity",entity:S,geo:O}))},paste(){if(!Q.value)return;const x=ye.value;if(!x)return;if(x.kind==="attribute"){const D=ee.value;if(!D)return;const O=o.logical.entities.find(Z=>Z.modelId===D);if(!O)return;const de=new Set(O.attributes.map(Z=>Z.name)),ge=new Set(O.attributes.flatMap(Z=>Z.dbAttrs.map(ae=>ae.physicalName))),w=O.attributes.length,k=[],C=x.attributes.map((Z,ae)=>{const se=JSON.parse(JSON.stringify(Z));se.modelId=Me();for(const V of se.dbAttrs)V.modelId=Me();de.has(se.name)&&(se.name=`${se.name}_copy`);for(const V of se.dbAttrs)V.physicalName&&ge.has(V.physicalName)&&(V.physicalName=`${V.physicalName}_copy`);return se.order=w+ae,k.push(se.modelId),St(D,se)});R(C.length===1?C[0]:Ue("속성 붙여넣기",C)),H.value={kind:"attribute",entityId:D,ids:k,anchor:k[k.length-1]};return}const B=F_(x.entity),S={location:{x:x.geo.location.x+40,y:x.geo.location.y+40},size:{...x.geo.size}};R(wa(B,S)),H.value={kind:"entity",id:B.modelId}}};return xe}const Di=Symbol("groupHover"),Nd=Symbol("groupDrag"),Pn=Symbol("relationHighlight"),K_={key:0,class:"em-sel","aria-hidden":"true"},q_=["title","aria-expanded","disabled"],X_={class:"em-entity__stereotype"},j_={key:1,class:"em-entity__name"},Z_=["data-attr","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],J_=["onPointerdown"],Q_={key:1,class:"em-entity__divider-label"},ew=["title"],tw={class:"em-key-slot"},nw={class:"em-key-slot"},ow={key:0,class:"em-entity__type"},iw=["onClick"],aw={class:"em-entity__attrname"},lw={class:"em-entity__type"},rw=["data-op"],sw=["onPointerdown"],cw={class:"em-entity__op-vis","aria-hidden":"true"},dw=["title"],uw={key:4,class:"em-entity__footer"},$d=Pe(n.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(pn,null),i=ie.useModal();function a(){o&&Mi(i,o,t.id)}const l=n.inject(Di,null),r=n.inject(Pn,null),s=n.computed(()=>!!o&&o.editable.value);function c(){l&&(l.value=t.data.groupRef??null)}function d(){r==null||r.setEntityHover(t.id)}function u(){r==null||r.setEntityHover(null)}const f=n.computed(()=>!!r&&r.primaryEntityIds.value.has(t.id)),p=n.computed(()=>!!r&&r.relatedEntityIds.value.has(t.id)&&!f.value),m=n.computed(()=>{var w;return((w=o==null?void 0:o.selection.value)==null?void 0:w.kind)==="entity"&&o.selection.value.id===t.id}),h=n.computed(()=>!!t.selected&&!m.value),_=n.computed(()=>{var w;return o&&((w=o.selectedAttr.value)==null?void 0:w.entityId)===t.id?new Set(o.selectedAttrIds.value):new Set}),b=n.computed(()=>_.value.size>0);function g(w,k){const C=k.shiftKey?"range":k.metaKey||k.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(t.id,w.modelId,C)}const I=n.computed(()=>!!r&&r.active.value&&!r.relatedEntityIds.value.has(t.id)&&!m.value),y=n.computed(()=>t.data.entity),N=n.computed(()=>t.data.displayMode??"LOGICAL_PHYSICAL"),q=n.computed(()=>t.data.collapsed??!1),U=n.computed(()=>t.data.locked??!1);function X(){s.value&&(o==null||o.setEntityCollapsed(t.id,!q.value))}const K=n.computed(()=>N.value==="PHYSICAL"||N.value==="LOGICAL_PHYSICAL"),W=n.computed(()=>{const w=N.value==="PHYSICAL"||N.value==="LOGICAL_PHYSICAL",k={};for(const C of y.value.attributes){const Z=C.attrType.startsWith("RELATION")&&C.dbAttrs.length>0;k[C.modelId]={pk:C.identifier,fk:Z&&w,required:C.notNull&&!C.identifier}}return k});function ne(w){if(!w)return"";const k=[];return w.pk&&w.fk?k.push("PFK (식별 외래키)"):w.pk?k.push("PK (기본키)"):w.fk&&k.push("FK (외래키)"),w.required&&k.push("필수 (NOT NULL)"),k.join(" · ")}const re=n.computed(()=>{const w=ul(nt(t.data.style)),k={};return w&&(k["--em-header-bg"]=w.bar,k["--em-header-fg"]=w.barOn),k});function L(w){var k,C;return(C=ul(nt((k=t.data.attributeStyles)==null?void 0:k[w.modelId])))==null?void 0:C.text}const Q=n.computed(()=>[...y.value.operations??[]].sort((w,k)=>w.order-k.order)),v=n.computed(()=>N.value==="CLASS"&&Q.value.length>0),T={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function $(w){return w?T[w]:"~"}function P(w){var k,C;return(C=ul(nt((k=t.data.operationStyles)==null?void 0:k[w.modelId])))==null?void 0:C.text}function H(w,k,C){switch(N.value){case"CLASS":return[{text:w}];case"PHYSICAL":return[{text:C||w}];case"LOGICAL":return[k?{text:k}:{text:"(논리명)",missing:!0}];default:{const Z=k?{text:k}:{text:"(논리명)",missing:!0};return C?[Z,{text:` · ${C}`}]:[Z]}}}function te(w){var k,C,Z;return M(w)?[{text:w.name}]:H(w.name,(C=(k=w.dbAttrs[0])==null?void 0:k.logicalName)==null?void 0:C.ko,((Z=w.dbAttrs[0])==null?void 0:Z.physicalName)??"")}function M(w){return w.attrType.startsWith("EMBED")&&w.dbAttrs.length>0}function ee(w){return w.attrType==="DIVIDER"}function le(w){if(w.attrType!=="EMBED_PREDEF")return w.dbAttrs;const k=o==null?void 0:o.embeddableCatalog.value.find(Z=>Z.type===w.type);if(!k)return w.dbAttrs;const C=Wn(y.value.attributes.flatMap(Z=>Z.dbAttrs));return w.dbAttrs.map((Z,ae)=>{const se=k.fields[ae],V=zo(Z,C);return V?{...Z,physicalName:V.physicalName,logicalName:Z.logicalName??(se==null?void 0:se.logicalName),dataType:Z.dataType||(se==null?void 0:se.dataType)||""}:se?{...Z,physicalName:Z.physicalName||se.physicalName,logicalName:Z.logicalName??se.logicalName,dataType:Z.dataType||se.dataType,length:Z.length??se.length}:Z})}function me(w){var k;return H(w.physicalName,(k=w.logicalName)==null?void 0:k.ko,w.physicalName)}function ye(w){const k=er(w,(o==null?void 0:o.state.logical.associations)??[]);return pa(N.value,w,k)}const ce=n.computed(()=>{var w,k,C;return H(y.value.name,(k=(w=y.value.table)==null?void 0:w.logicalName)==null?void 0:k.ko,((C=y.value.table)==null?void 0:C.physicalName)??"")}),ue=n.ref(!1),he=n.ref(""),ve=n.ref(null);async function Se(){var w,k;s.value&&(he.value=y.value.name,ue.value=!0,await n.nextTick(),(w=ve.value)==null||w.focus(),(k=ve.value)==null||k.select())}function Ie(){if(!ue.value)return;ue.value=!1;const w=he.value.trim();w&&w!==y.value.name&&(o==null||o.renameEntity(t.id,w))}function pe(){o==null||o.addAttribute(t.id)}function j(){o==null||o.addDivider(t.id)}const{screenToFlowCoordinate:Y,findNode:E}=Oe(),A=n.ref(null),R=n.computed(()=>{const w=A.value??t.data.size;return w?{width:`${w.width}px`,minHeight:`${w.height}px`}:void 0});let G=null;function J(w){var Z,ae,se;if(!s.value)return;w.stopPropagation();const k=(Z=E(t.id))==null?void 0:Z.dimensions,C=Y({x:w.clientX,y:w.clientY});G={fx:C.x,fy:C.y,w:(k==null?void 0:k.width)??((ae=t.data.size)==null?void 0:ae.width)??200,h:(k==null?void 0:k.height)??((se=t.data.size)==null?void 0:se.height)??120},w.target.setPointerCapture(w.pointerId)}function fe(w){if(!G)return;const k=Y({x:w.clientX,y:w.clientY});A.value={width:Math.max(40,G.w+(k.x-G.fx)),height:Math.max(40,G.h+(k.y-G.fy))}}function _e(w){var k,C,Z;if(G&&A.value&&o){const ae=(k=E(t.id))==null?void 0:k.dimensions;o.resizeEntity(t.id,{width:Math.round((ae==null?void 0:ae.width)??A.value.width),height:Math.round((ae==null?void 0:ae.height)??A.value.height)})}G=null,A.value=null,(Z=(C=w.target).releasePointerCapture)==null||Z.call(C,w.pointerId)}const ke=n.ref(null),be=n.ref(null);function xe(w,k){if(!s.value)return;k.stopPropagation(),k.preventDefault();const C=_.value,Z=C.has(w.modelId)?new Set(C):new Set([w.modelId]);be.value={ids:Z,dropIndex:-1,lineY:0},k.target.setPointerCapture(k.pointerId)}function Ve(w){if(!be.value||!ke.value)return;const k=Array.from(ke.value.querySelectorAll(".em-entity__row"));if(!k.length)return;let C=k.length;for(let se=0;se<k.length;se++){const V=k[se].getBoundingClientRect();if(w.clientY<V.top+V.height/2){C=se;break}}const Z=k[k.length-1],ae=C<k.length?k[C].offsetTop:Z.offsetTop+Z.offsetHeight;be.value={...be.value,dropIndex:C,lineY:ae}}function Te(){const w=be.value;if(be.value=null,!w||w.dropIndex<0)return;const k=y.value.attributes,C=k.filter(z=>w.ids.has(z.modelId)).map(z=>z.modelId),Z=k.filter((z,F)=>w.ids.has(z.modelId)&&F<w.dropIndex).length,ae=w.dropIndex-Z,se=k.filter(z=>!w.ids.has(z.modelId)).map(z=>z.modelId);[...se.slice(0,ae),...C,...se.slice(ae)].join(",")!==k.map(z=>z.modelId).join(",")&&(o==null||o.reorderAttributes(t.id,C,ae))}function x(){be.value=null}const B=n.ref(null),S=n.ref(null);function D(w,k){s.value&&(k.stopPropagation(),k.preventDefault(),S.value={id:w.modelId,dropIndex:-1,lineY:0},k.target.setPointerCapture(k.pointerId))}function O(w){if(!S.value||!B.value)return;const k=Array.from(B.value.querySelectorAll(".em-entity__op-row"));if(!k.length)return;let C=k.length;for(let se=0;se<k.length;se++){const V=k[se].getBoundingClientRect();if(w.clientY<V.top+V.height/2){C=se;break}}const Z=k[k.length-1],ae=C<k.length?k[C].offsetTop:Z.offsetTop+Z.offsetHeight;S.value={...S.value,dropIndex:C,lineY:ae}}function de(){const w=S.value;if(S.value=null,!w||w.dropIndex<0)return;const C=Q.value.findIndex(ae=>ae.modelId===w.id);if(C<0)return;const Z=w.dropIndex-(C<w.dropIndex?1:0);Z!==C&&(o==null||o.reorderOperations(t.id,[w.id],Z))}function ge(){S.value=null}return(w,k)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-entity",{"is-hover-origin":f.value,"is-related":p.value,"is-dimmed":I.value,"is-selected":m.value,"is-multi-selected":h.value,"has-focused-attr":b.value,"is-locked":U.value}]),style:n.normalizeStyle(R.value),onPointerdown:c,onMouseenter:d,onMouseleave:u,onDblclick:a},[m.value?(n.openBlock(),n.createElementBlock("div",K_,[...k[7]||(k[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(Se,["stop"])},[n.createElementVNode("button",{type:"button",class:"em-entity__caret nodrag",title:q.value?"펼치기":"접기","aria-expanded":!q.value,disabled:!s.value,onClick:n.withModifiers(X,["stop"]),onPointerdown:k[0]||(k[0]=n.withModifiers(()=>{},["stop"])),onDblclick:k[1]||(k[1]=n.withModifiers(()=>{},["stop"]))},n.toDisplayString(q.value?"▸":"▾"),41,q_),n.createElementVNode("span",X_,"«"+n.toDisplayString(y.value.stereotype)+"»",1),ue.value?n.withDirectives((n.openBlock(),n.createElementBlock("input",{key:0,ref_key:"inputEl",ref:ve,"onUpdate:modelValue":k[2]||(k[2]=C=>he.value=C),class:"em-entity__name-input nodrag",onKeyup:[n.withKeys(Ie,["enter"]),k[3]||(k[3]=n.withKeys(C=>ue.value=!1,["esc"]))],onBlur:Ie,onPointerdown:k[4]||(k[4]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,he.value]]):(n.openBlock(),n.createElementBlock("span",j_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ce.value,(C,Z)=>(n.openBlock(),n.createElementBlock("span",{key:Z,class:n.normalizeClass({"em-entity__missing":C.missing})},n.toDisplayString(C.text),3))),128))])),U.value?(n.openBlock(),n.createBlock(Re,{key:2,name:"lock",size:12,class:"em-entity__lock",title:"편집 잠금"})):n.createCommentVNode("",!0)],36),q.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:ke,class:"em-entity__attrs"},[be.value&&be.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${be.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value.attributes,C=>{var Z,ae,se,V;return n.openBlock(),n.createElementBlock(n.Fragment,{key:C.modelId},[n.createElementVNode("li",{class:n.normalizeClass(["em-entity__row",{"is-attr-selected":_.value.has(C.modelId),"is-dragging":(Z=be.value)==null?void 0:Z.ids.has(C.modelId),"is-embed":M(C),"is-divider":ee(C),nodrag:ee(C)&&s.value}]),"data-attr":C.modelId,onClick:n.withModifiers(z=>g(C,z),["stop"]),onPointerdown:z=>ee(C)?xe(C,z):void 0,onPointermove:z=>ee(C)?Ve(z):void 0,onPointerup:z=>ee(C)?Te():void 0,onPointercancel:z=>ee(C)?x():void 0},[s.value&&!ee(C)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:z=>xe(C,z),onPointermove:Ve,onPointerup:Te,onPointercancel:x,onClick:k[5]||(k[5]=n.withModifiers(()=>{},["stop"]))},"⠿",40,J_)):n.createCommentVNode("",!0),ee(C)?(n.openBlock(),n.createElementBlock("span",Q_,n.toDisplayString(C.name),1)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createVNode(n.unref(dn),{id:`l:${C.modelId}`,type:"target",position:n.unref($e).Left,class:"em-handle"},null,8,["id","position"]),n.createElementVNode("span",{class:"em-entity__keys",title:ne(W.value[C.modelId]),"aria-hidden":"true"},[n.createElementVNode("span",tw,[(ae=W.value[C.modelId])!=null&&ae.pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:12,class:"em-key is-pk"})):(se=W.value[C.modelId])!=null&&se.required?(n.openBlock(),n.createBlock(Re,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):n.createCommentVNode("",!0)]),n.createElementVNode("span",nw,[M(C)?(n.openBlock(),n.createBlock(Re,{key:0,name:"table",size:11,class:"em-embed-glyph"})):(V=W.value[C.modelId])!=null&&V.fk?(n.openBlock(),n.createBlock(Re,{key:1,name:"key",size:12,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,ew),n.createElementVNode("span",{class:"em-entity__attrname",style:n.normalizeStyle({color:L(C)})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te(C),(z,F)=>(n.openBlock(),n.createElementBlock("span",{key:F,class:n.normalizeClass({"em-entity__missing":z.missing})},n.toDisplayString(z.text),3))),128))],4),ye(C)?(n.openBlock(),n.createElementBlock("span",ow,n.toDisplayString(ye(C)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(dn),{id:`r:${C.modelId}`,type:"source",position:n.unref($e).Right,class:"em-handle"},null,8,["id","position"])],64))],42,Z_),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(M(C)&&K.value?le(C):[],z=>(n.openBlock(),n.createElementBlock("li",{key:`${C.modelId}:${z.modelId}`,class:n.normalizeClass(["em-entity__embed-col",{"is-group-selected":_.value.has(C.modelId)}]),onClick:n.withModifiers(F=>g(C,F),["stop"])},[k[8]||(k[8]=n.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),n.createElementVNode("span",aw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(me(z),(F,oe)=>(n.openBlock(),n.createElementBlock("span",{key:oe,class:n.normalizeClass({"em-entity__missing":F.missing})},n.toDisplayString(F.text),3))),128))]),n.createElementVNode("span",lw,n.toDisplayString(z.dataType),1)],10,iw))),128))],64)}),128))],512)),!q.value&&v.value?(n.openBlock(),n.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:B,class:"em-entity__ops"},[S.value&&S.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${S.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Q.value,C=>{var Z;return n.openBlock(),n.createElementBlock("li",{key:C.modelId,class:n.normalizeClass(["em-entity__op-row",{"is-dragging":((Z=S.value)==null?void 0:Z.id)===C.modelId}]),"data-op":C.modelId},[s.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:ae=>D(C,ae),onPointermove:O,onPointerup:de,onPointercancel:ge,onClick:k[6]||(k[6]=n.withModifiers(()=>{},["stop"]))},"⠿",40,sw)):n.createCommentVNode("",!0),n.createElementVNode("span",cw,n.toDisplayString($(C.visibility)),1),n.createElementVNode("span",{class:"em-entity__op-name",style:n.normalizeStyle({color:P(C)})},n.toDisplayString(C.name)+"()",5)],10,rw)}),128))],512)):Q.value.length?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:`오퍼레이션 ${Q.value.length}개 — 클래스 표시 모드에서 펼쳐 보입니다`},[n.createVNode(Re,{name:"method",size:12}),n.createElementVNode("span",null,"오퍼레이션 "+n.toDisplayString(Q.value.length)+"개",1)],8,dw)):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("footer",uw,[n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:pe},"+ 속성"),k[9]||(k[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.createCommentVNode("",!0),s.value&&!ue.value?(n.openBlock(),n.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:J,onPointermove:fe,onPointerup:_e},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-7efbcdb3"]]),fw={key:0,class:"em-sel","aria-hidden":"true"},mw={class:"em-group__label"},pw={class:"em-group__name"},hw={key:0,class:"em-group__pkg"},yw={key:1,class:"em-group__flag"},xd=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(()=>nt(t.data.style)),l=n.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),r=n.inject(pn,null),s=n.computed(()=>!!r&&r.editable.value),c=n.computed(()=>{var W;return!!t.id&&((W=r==null?void 0:r.selection.value)==null?void 0:W.kind)==="group"&&r.selection.value.id===t.id}),d=n.computed(()=>!!t.selected&&!c.value),u=n.inject(Di,null),f=n.computed(()=>!!t.id&&(u==null?void 0:u.value)===t.id),p=n.inject(Pn,null);function m(){t.id&&(p==null||p.setGroupHover(t.id))}function h(){p==null||p.setGroupHover(null)}const _=n.computed(()=>!!p&&p.hoverGroupId.value===t.id),b=n.computed(()=>!!p&&p.hoverGroupId.value!==null&&p.hoverGroupId.value!==t.id),{screenToFlowCoordinate:g,findNode:I}=Oe();let y=null,N=null;function q(W){var L;if(!t.id||!s.value)return;W.stopPropagation();const ne=((L=I(t.id))==null?void 0:L.dimensions)??{width:400,height:300},re=g({x:W.clientX,y:W.clientY});y={fx:re.x,fy:re.y,w:ne.width,h:ne.height},W.target.setPointerCapture(W.pointerId)}function U(W){if(!y||!t.id)return;const ne=g({x:W.clientX,y:W.clientY});N={width:Math.max(160,y.w+(ne.x-y.fx)),height:Math.max(120,y.h+(ne.y-y.fy))};const re=I(t.id);re&&(re.style={width:`${N.width}px`,height:`${N.height}px`})}function X(W){var ne,re;y&&N&&t.id&&r&&r.resizeGroup(t.id,N),y=null,N=null,(re=(ne=W.target).releasePointerCapture)==null||re.call(ne,W.pointerId)}const K=n.computed(()=>{const W=o.value.name;return(W==null?void 0:W.ko)||(W==null?void 0:W.en)||(W==null?void 0:W.ja)||(W==null?void 0:W.zh)||o.value.packageName||"그룹"});return(W,ne)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-group",{"is-drop-target":f.value,"is-hover-origin":_.value,"is-dimmed":b.value,"is-selected":c.value,"is-multi-selected":d.value,"is-locked":i.value}]),style:n.normalizeStyle(l.value),onMouseenter:m,onMouseleave:h},[c.value?(n.openBlock(),n.createElementBlock("div",fw,[...ne[0]||(ne[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",mw,[n.createElementVNode("span",pw,n.toDisplayString(K.value),1),o.value.packageName?(n.openBlock(),n.createElementBlock("span",hw,n.toDisplayString(o.value.packageName),1)):n.createCommentVNode("",!0),o.value.excludeDDLGeneration?(n.openBlock(),n.createElementBlock("span",yw,"DDL 제외")):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createBlock(Re,{key:2,name:"lock",size:12,class:"em-group__lock",title:"편집 잠금"})):n.createCommentVNode("",!0)]),s.value&&!i.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:q,onPointermove:U,onPointerup:X},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-681f8dc8"]]),gw={key:0,class:"em-sel","aria-hidden":"true"},bw={key:2,class:"em-note__text"},Id=Pe(n.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(pn,null),i=n.inject(Di,null),a=n.inject(Pn,null),l=n.computed(()=>t.data.note),r=n.computed(()=>!!o&&o.editable.value),s=n.computed(()=>nt(l.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 f(){a==null||a.setNoteHover(null)}const p=n.computed(()=>{var v;return((v=a==null?void 0:a.source.value)==null?void 0:v.kind)==="note"&&a.source.value.id===t.id}),m=n.computed(()=>!!a&&a.relatedNoteIds.value.has(t.id)&&!p.value),h=n.computed(()=>{var v;return((v=o==null?void 0:o.selection.value)==null?void 0:v.kind)==="note"&&o.selection.value.id===t.id}),_=n.computed(()=>!!t.selected&&!h.value),b=n.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(t.id)&&!h.value),g=[{id:"n-top",pos:$e.Top},{id:"n-right",pos:$e.Right},{id:"n-bottom",pos:$e.Bottom},{id:"n-left",pos:$e.Left}],I=n.ref(!1),y=n.ref(""),N=n.ref(null);async function q(){var v;r.value&&(y.value=l.value.memo,I.value=!0,await n.nextTick(),(v=N.value)==null||v.focus())}function U(){I.value&&(I.value=!1,y.value!==l.value.memo&&(o==null||o.setNoteMemo(t.id,y.value)))}const{screenToFlowCoordinate:X,findNode:K}=Oe();let W=null,ne=null;function re(v){var P;if(!r.value)return;v.stopPropagation();const T=((P=K(t.id))==null?void 0:P.dimensions)??l.value.geo.size,$=X({x:v.clientX,y:v.clientY});W={fx:$.x,fy:$.y,w:T.width,h:T.height},v.target.setPointerCapture(v.pointerId)}function L(v){if(!W)return;const T=X({x:v.clientX,y:v.clientY});ne={width:Math.max(140,W.w+(T.x-W.fx)),height:Math.max(60,W.h+(T.y-W.fy))};const $=K(t.id);$&&($.style={width:`${ne.width}px`,height:`${ne.height}px`})}function Q(v){var T,$;W&&ne&&o&&o.resizeNote(t.id,ne),W=null,ne=null,($=(T=v.target).releasePointerCapture)==null||$.call(T,v.pointerId)}return(v,T)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":m.value,"is-dimmed":b.value,"is-selected":h.value,"is-multi-selected":_.value}]),style:n.normalizeStyle(c.value),onDblclick:q,onPointerdown:d,onMouseenter:u,onMouseleave:f},[h.value?(n.openBlock(),n.createElementBlock("div",gw,[...T[4]||(T[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),I.value?n.withDirectives((n.openBlock(),n.createElementBlock("textarea",{key:1,ref_key:"area",ref:N,"onUpdate:modelValue":T[0]||(T[0]=$=>y.value=$),class:"em-note__edit nodrag",onBlur:U,onKeydown:T[1]||(T[1]=n.withKeys($=>I.value=!1,["esc"])),onPointerdown:T[2]||(T[2]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,y.value]]):(n.openBlock(),n.createElementBlock("div",bw,n.toDisplayString(l.value.memo),1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(g,$=>n.createVNode(n.unref(dn),{id:$.id,key:$.id,type:"source",position:$.pos,class:"em-note-handle",onPointerdown:T[3]||(T[3]=n.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),r.value&&!I.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:re,onPointermove:L,onPointerup:Q},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-77c75add"]]),_w=20,ww=22,vw=7,kw=22,Sd=31,Cd=7,Ew=20,Rd=11,Vd=11,Nw=Sd+Cd;function $w(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function xw(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Oi(e,t,o){const i=t.x-e.x,a=t.y-e.y,l=Math.hypot(i,a)||1;return{x:e.x+i*o/l,y:e.y+a*o/l}}function Ad(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function Li(e,t,o){return{x:Math.cos(o)*t+e.x,y:Math.sin(o)*t+e.y}}function Td(e,t,o,i){const a=i/2,l=e.x===t.x&&e.y===t.y?Math.PI/2:Ad(e,t);return[Li(o,a,l-Math.PI/2),Li(o,a,l+Math.PI/2)]}function Md(e,t,o,i){const a=t*180/Math.PI,r=(a>=0?i?a-20:a+20:i?a+20:a-20)*Math.PI/180;return{x:Math.sin(r)*o+e.x,y:Math.cos(r)*o+e.y}}function Bd(e,t,o,i){const a=[],l=[],r=[];if(e.x===t.x&&e.y===t.y)return{lines:a,circles:l,polygons:r};if(i==="db"){const c=Oi(e,t,_w),[d,u]=Td(e,t,c,ww);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}),$w(o.multiplicity)){const f=Oi(e,t,Sd);l.push({cx:f.x,cy:f.y,r:Cd})}if(xw(o.multiplicity)){const f=Oi(e,t,vw),[p,m]=Td(e,t,f,kw);a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:m.x,y2:m.y}),a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.y})}return{lines:a,circles:l,polygons:r}}let s=e;if(o.composition){const c=Oi(e,t,Ew),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Ad(e,t),f=Li(d,Rd/2,u-Math.PI/2),p=Li(d,Rd/2,u+Math.PI/2);r.push({points:[e,f,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(t.x-e.x,t.y-e.y),d=Md(s,c,Vd,!0),u=Md(s,c,Vd,!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:l,polygons:r}}const Dd=200,Od=120,hl=24;function Ld(e){var a,l;if(!e)return{x:0,y:0,width:Dd,height:Od};const t=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Dd,i=((l=e.dimensions)==null?void 0:l.height)||Od;return{x:t.x,y:t.y,width:o,height:i}}function Pd(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function zd(e){const t=n.computed(()=>Ld(e.sourceNode())),o=n.computed(()=>Ld(e.targetNode())),i=n.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=n.computed(()=>{var m,h;const d=t.value,u=d.x+d.width;let f=((m=e.sourceRowY)==null?void 0:m.call(e))??d.y+d.height/3,p=((h=e.targetRowY)==null?void 0:h.call(e))??d.y+d.height*2/3;if(Math.abs(p-f)<hl){const _=(f+p)/2;f=_-hl/2,p=_+hl/2}return{source:{x:u,y:f},target:{x:u,y:p}}}),l=n.computed(()=>e.waypoints()[0]??Pd(o.value)),r=n.computed(()=>{const d=e.waypoints();return d[d.length-1]??Pd(t.value)}),s=n.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?sa(t.value,d,l.value.x):ra(t.value,l.value)}),c=n.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?sa(o.value,d,r.value.x):ra(o.value,r.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 yl=Symbol("waypointController"),Iw=["d"],Sw=["d"],Cw=["d"],Rw=["x1","y1","x2","y2"],Vw=["cx","cy","r"],Aw=["x","y"],Tw=["x","y"],Mw=["cx","cy","onDblclick"],Bw=["x","y","onPointerdown","onDblclick"],Ud=Pe(n.defineComponent({__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=Oe(),i=n.inject(yl),a=n.inject(pn,null),l=n.computed(()=>!!a&&a.editable.value),r=n.inject(Nd,null),s=n.inject(Pn,null),c=n.computed(()=>!!s&&s.relatedEdgeIds.value.has(t.id)),d=n.computed(()=>{var pe;return((pe=a==null?void 0:a.selection.value)==null?void 0:pe.kind)==="association"&&a.selection.value.id===t.id}),u=n.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(t.id)&&!d.value),f=n.computed(()=>{const pe=r==null?void 0:r.value;if(!pe||!a)return null;const j=a.resolved.value.entities,Y=A=>{var R;return(R=j.find(G=>G.entity.modelId===A))==null?void 0:R.groupRef},E=t.data.association;return Y(E.end1.entityRef)===pe.groupId&&Y(E.end2.entityRef)===pe.groupId?{dx:pe.dx,dy:pe.dy}:null}),p=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),m=n.ref(-1),h=n.ref({x:0,y:0}),_=n.computed(()=>{const pe=f.value;return p.value.map((j,Y)=>Y===m.value?h.value:pe?{x:j.x+pe.dx,y:j.y+pe.dy}:j)}),b=n.computed(()=>{var pe;return!!((pe=t.sourceNode.data)!=null&&pe.collapsed)}),g=n.computed(()=>{var pe;return!!((pe=t.targetNode.data)!=null&&pe.collapsed)}),{source:I,target:y,sourceSide:N,targetSide:q,isSelf:U}=zd({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>_.value,sourceRowY:()=>t.data.sourceColumnRef&&!b.value?t.sourceY:void 0,targetRowY:()=>t.data.targetColumnRef&&!g.value?t.targetY:void 0}),X=Nw+4,K=n.computed(()=>U.value?Fl(I.value,y.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?ia(I.value,N.value,_.value,y.value,q.value,X):la(I.value,_.value,y.value)),W=n.computed(()=>U.value||!l.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?aa(I.value,N.value,_.value,y.value,q.value,X):ca(I.value,_.value,y.value).map((pe,j)=>({point:pe,segIndex:j}))),ne=n.computed(()=>U.value||!l.value?[]:_.value);function re(pe){switch(pe){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(pe,j){m.value=pe,h.value={...p.value[pe]},j.target.setPointerCapture(j.pointerId),j.stopPropagation()}function Q(pe){if(m.value<0)return;const j=o({x:pe.clientX,y:pe.clientY});h.value={x:j.x,y:j.y}}function v(pe){var j,Y;m.value>=0&&i&&i.movePoint(t.id,m.value,{...h.value}),m.value=-1,(Y=(j=pe.target).releasePointerCapture)==null||Y.call(j,pe.pointerId)}function T(pe,j){j.stopPropagation(),i==null||i.removePoint(t.id,pe)}function $(pe,j){if(!i)return;const Y=o({x:j.clientX,y:j.clientY});i.insertPoint(t.id,pe,{x:Y.x,y:Y.y})}const P=n.computed(()=>re(t.data.association.end1.multiplicity)),H=n.computed(()=>re(t.data.association.end2.multiplicity)),te=n.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),M=n.computed(()=>te.value==="class"),ee=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const pe=Gn(N.value);return{x:I.value.x+pe.x*10,y:I.value.y+pe.y*10}}return _.value[0]??y.value}),le=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const j=Gn(q.value);return{x:y.value.x+j.x*10,y:y.value.y+j.y*10}}const pe=_.value;return pe[pe.length-1]??I.value}),me=n.computed(()=>{const pe=t.data.association;return{multiplicity:pe.end1.multiplicity,navigable:pe.end1.navigable,composition:pe.end1.composition,otherNavigable:pe.end2.navigable}}),ye=n.computed(()=>{const pe=t.data.association;return{multiplicity:pe.end2.multiplicity,navigable:pe.end2.navigable,composition:pe.end2.composition,otherNavigable:pe.end1.navigable}}),ce=n.computed(()=>Bd(I.value,ee.value,me.value,te.value)),ue=n.computed(()=>Bd(y.value,le.value,ye.value,te.value)),he=n.computed(()=>[...ce.value.lines,...ue.value.lines]),ve=n.computed(()=>[...ce.value.circles,...ue.value.circles]),Se=n.computed(()=>[...ce.value.polygons,...ue.value.polygons].map(pe=>`M${pe.points.map(j=>`${j.x},${j.y}`).join(" L")} Z`)),Ie=n.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(pe,j)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:K.value,fill:"none",class:"em-edge__hit"},null,8,Iw),n.createElementVNode("path",{d:K.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,Sw),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Se.value,(Y,E)=>(n.openBlock(),n.createElementBlock("path",{key:`mpoly-${E}`,d:Y,class:n.normalizeClass(["em-edge__marker em-edge__marker--fill",Ie.value])},null,10,Cw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.value,(Y,E)=>(n.openBlock(),n.createElementBlock("line",{key:`mline-${E}`,x1:Y.x1,y1:Y.y1,x2:Y.x2,y2:Y.y2,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,Rw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ve.value,(Y,E)=>(n.openBlock(),n.createElementBlock("circle",{key:`mcirc-${E}`,cx:Y.cx,cy:Y.cy,r:Y.r,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,Vw))),128)),M.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("text",{x:n.unref(I).x+8,y:n.unref(I).y-6,class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(P.value),11,Aw),n.createElementVNode("text",{x:n.unref(y).x-8,y:n.unref(y).y-6,"text-anchor":"end",class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(H.value),11,Tw)],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W.value,(Y,E)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${E}`,cx:Y.point.x,cy:Y.point.y,r:"4",class:n.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:n.withModifiers(A=>$(Y.segIndex,A),["stop"])},null,42,Mw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ne.value,(Y,E)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${E}`,x:Y.x-5,y:Y.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:A=>L(E,A),onPointermove:Q,onPointerup:v,onDblclick:A=>T(E,A)},null,42,Bw))),128))],64))}}),[["__scopeId","data-v-71d5ef34"]]);var Mt=(e=>(e.Lines="lines",e.Dots="dots",e))(Mt||{});const Hd=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]}`})},Fd=function({radius:e,color:t}){return n.h("circle",{cx:e,cy:e,r:e,fill:t})};Mt.Lines+"",Mt.Dots+"";const Dw={[Mt.Dots]:"#81818a",[Mt.Lines]:"#eee"},Ow=["id","x","y","width","height","patternTransform"],Lw={key:2,height:"100",width:"100"},Pw=["fill"],zw=["x","y","fill"],Uw={name:"Background",compatConfig:{MODE:3}},Hw=n.defineComponent({...Uw,props:{id:{},variant:{default:()=>Mt.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 r=o.value.zoom,[s,c]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],d=[s*r||1,c*r||1],u=e.size*r,[f,p]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],m=[f*r||1+d[0]/2,p*r||1+d[1]/2];return{scaledGap:d,offset:m,size:u}}),a=n.toRef(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),l=n.toRef(()=>e.color||e.patternColor||Dw[e.variant||Mt.Dots]);return(r,s)=>(n.openBlock(),n.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:n.normalizeStyle({height:`${r.height>100?100:r.height}%`,width:`${r.width>100?100:r.width}%`})},[n.renderSlot(r.$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(r.$slots,"pattern",{},()=>[r.variant===n.unref(Mt).Lines?(n.openBlock(),n.createBlock(n.unref(Hd),{key:0,size:r.lineWidth,color:l.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):r.variant===n.unref(Mt).Dots?(n.openBlock(),n.createBlock(n.unref(Fd),{key:1,color:l.value,radius:i.value.size/2},null,8,["color","radius"])):n.createCommentVNode("",!0),r.bgColor?(n.openBlock(),n.createElementBlock("svg",Lw,[n.createElementVNode("rect",{width:"100%",height:"100%",fill:r.bgColor},null,8,Pw)])):n.createCommentVNode("",!0)])],8,Ow)]),n.createElementVNode("rect",{x:r.x,y:r.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,zw),n.renderSlot(r.$slots,"default",{id:a.value})],4))}}),Fw={name:"ControlButton",compatConfig:{MODE:3}},Gw=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},Yw={type:"button",class:"vue-flow__controls-button"};function Ww(e,t,o,i,a,l){return n.openBlock(),n.createElementBlock("button",Yw,[n.renderSlot(e.$slots,"default")])}const hn=Gw(Fw,[["render",Ww]]),Kw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},qw=[n.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Xw(e,t){return n.openBlock(),n.createElementBlock("svg",Kw,qw)}const jw={render:Xw},Zw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Jw=[n.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function Qw(e,t){return n.openBlock(),n.createElementBlock("svg",Zw,Jw)}const ev={render:Qw},tv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},nv=[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 ov(e,t){return n.openBlock(),n.createElementBlock("svg",tv,nv)}const iv={render:ov},av={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},lv=[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 rv(e,t){return n.openBlock(),n.createElementBlock("svg",av,lv)}const sv={render:rv},cv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},dv=[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 uv(e,t){return n.openBlock(),n.createElementBlock("svg",cv,dv)}const fv={render:uv},mv={name:"Controls",compatConfig:{MODE:3}},pv=n.defineComponent({...mv,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>hc.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:l,zoomIn:r,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:f}=Oe(),p=n.toRef(()=>o.value||i.value||a.value),m=n.toRef(()=>d.value.zoom<=u.value),h=n.toRef(()=>d.value.zoom>=f.value);function _(){r(),t("zoomIn")}function b(){s(),t("zoomOut")}function g(){c(e.fitViewParams),t("fitView")}function I(){l(!p.value),t("interactionChange",!p.value)}return(y,N)=>(n.openBlock(),n.createBlock(n.unref(md),{class:"vue-flow__controls",position:y.position},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"top"),y.showZoom?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.renderSlot(y.$slots,"control-zoom-in",{},()=>[n.createVNode(hn,{class:"vue-flow__controls-zoomin",disabled:h.value,onClick:_},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-zoom-in",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(jw))))])]),_:3},8,["disabled"])]),n.renderSlot(y.$slots,"control-zoom-out",{},()=>[n.createVNode(hn,{class:"vue-flow__controls-zoomout",disabled:m.value,onClick:b},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-zoom-out",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(ev))))])]),_:3},8,["disabled"])])],64)):n.createCommentVNode("",!0),y.showFitView?n.renderSlot(y.$slots,"control-fit-view",{key:1},()=>[n.createVNode(hn,{class:"vue-flow__controls-fitview",onClick:g},{default:n.withCtx(()=>[n.renderSlot(y.$slots,"icon-fit-view",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(iv))))])]),_:3})]):n.createCommentVNode("",!0),y.showInteractive?n.renderSlot(y.$slots,"control-interactive",{key:2},()=>[y.showInteractive?(n.openBlock(),n.createBlock(hn,{key:0,class:"vue-flow__controls-interactive",onClick:I},{default:n.withCtx(()=>[p.value?n.renderSlot(y.$slots,"icon-unlock",{key:0},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(fv))))]):n.createCommentVNode("",!0),p.value?n.createCommentVNode("",!0):n.renderSlot(y.$slots,"icon-lock",{key:1},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(sv))))])]),_:3})):n.createCommentVNode("",!0)]):n.createCommentVNode("",!0),n.renderSlot(y.$slots,"default")]),_:3},8,["position"]))}});var hv={value:()=>{}};function gl(){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 Pi(o)}function Pi(e){this._=e}function yv(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}})}Pi.prototype=gl.prototype={constructor:Pi,on:function(e,t){var o=this._,i=yv(e+"",o),a,l=-1,r=i.length;if(arguments.length<2){for(;++l<r;)if((a=(e=i[l]).type)&&(a=gv(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<r;)if(a=(e=i[l]).type)o[a]=Gd(o[a],e.name,t);else if(t==null)for(a in o)o[a]=Gd(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 Pi(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,l;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[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,l=i.length;a<l;++a)i[a].value.apply(t,o)}};function gv(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function Gd(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=hv,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var bl="http://www.w3.org/1999/xhtml";const Yd={svg:"http://www.w3.org/2000/svg",xhtml:bl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zi(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Yd.hasOwnProperty(t)?{space:Yd[t],local:e}:e}function bv(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===bl&&t.documentElement.namespaceURI===bl?t.createElement(e):t.createElementNS(o,e)}}function _v(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wd(e){var t=zi(e);return(t.local?_v:bv)(t)}function wv(){}function _l(e){return e==null?wv:function(){return this.querySelector(e)}}function vv(e){typeof e!="function"&&(e=_l(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=new Array(r),c,d,u=0;u<r;++u)(c=l[u])&&(d=e.call(c,c.__data__,u,l))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new ct(i,this._parents)}function kv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ev(){return[]}function Kd(e){return e==null?Ev:function(){return this.querySelectorAll(e)}}function Nv(e){return function(){return kv(e.apply(this,arguments))}}function $v(e){typeof e=="function"?e=Nv(e):e=Kd(e);for(var t=this._groups,o=t.length,i=[],a=[],l=0;l<o;++l)for(var r=t[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&(i.push(e.call(c,c.__data__,d,r)),a.push(c));return new ct(i,a)}function qd(e){return function(){return this.matches(e)}}function Xd(e){return function(t){return t.matches(e)}}var xv=Array.prototype.find;function Iv(e){return function(){return xv.call(this.children,e)}}function Sv(){return this.firstElementChild}function Cv(e){return this.select(e==null?Sv:Iv(typeof e=="function"?e:Xd(e)))}var Rv=Array.prototype.filter;function Vv(){return Array.from(this.children)}function Av(e){return function(){return Rv.call(this.children,e)}}function Tv(e){return this.selectAll(e==null?Vv:Av(typeof e=="function"?e:Xd(e)))}function Mv(e){typeof e!="function"&&(e=qd(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new ct(i,this._parents)}function jd(e){return new Array(e.length)}function Bv(){return new ct(this._enter||this._groups.map(jd),this._parents)}function Ui(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ui.prototype={constructor:Ui,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 Dv(e){return function(){return e}}function Ov(e,t,o,i,a,l){for(var r=0,s,c=t.length,d=l.length;r<d;++r)(s=t[r])?(s.__data__=l[r],i[r]=s):o[r]=new Ui(e,l[r]);for(;r<c;++r)(s=t[r])&&(a[r]=s)}function Lv(e,t,o,i,a,l,r){var s,c,d=new Map,u=t.length,f=l.length,p=new Array(u),m;for(s=0;s<u;++s)(c=t[s])&&(p[s]=m=r.call(c,c.__data__,s,t)+"",d.has(m)?a[s]=c:d.set(m,c));for(s=0;s<f;++s)m=r.call(e,l[s],s,l)+"",(c=d.get(m))?(i[s]=c,c.__data__=l[s],d.delete(m)):o[s]=new Ui(e,l[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function Pv(e){return e.__data__}function zv(e,t){if(!arguments.length)return Array.from(this,Pv);var o=t?Lv:Ov,i=this._parents,a=this._groups;typeof e!="function"&&(e=Dv(e));for(var l=a.length,r=new Array(l),s=new Array(l),c=new Array(l),d=0;d<l;++d){var u=i[d],f=a[d],p=f.length,m=Uv(e.call(u,u&&u.__data__,d,i)),h=m.length,_=s[d]=new Array(h),b=r[d]=new Array(h),g=c[d]=new Array(p);o(u,f,_,b,g,m,t);for(var I=0,y=0,N,q;I<h;++I)if(N=_[I]){for(I>=y&&(y=I+1);!(q=b[y])&&++y<h;);N._next=q||null}}return r=new ct(r,i),r._enter=s,r._exit=c,r}function Uv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Hv(){return new ct(this._exit||this._groups.map(jd),this._parents)}function Fv(e,t,o){var i=this.enter(),a=this,l=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?l.remove():o(l),i&&a?i.merge(a).order():a}function Gv(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._groups,a=o.length,l=i.length,r=Math.min(a,l),s=new Array(a),c=0;c<r;++c)for(var d=o[c],u=i[c],f=d.length,p=s[c]=new Array(f),m,h=0;h<f;++h)(m=d[h]||u[h])&&(p[h]=m);for(;c<a;++c)s[c]=o[c];return new ct(s,this._parents)}function Yv(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],a=i.length-1,l=i[a],r;--a>=0;)(r=i[a])&&(l&&r.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(r,l),l=r);return this}function Wv(e){e||(e=Kv);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var o=this._groups,i=o.length,a=new Array(i),l=0;l<i;++l){for(var r=o[l],s=r.length,c=a[l]=new Array(s),d,u=0;u<s;++u)(d=r[u])&&(c[u]=d);c.sort(t)}return new ct(a,this._parents).order()}function Kv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xv(){return Array.from(this)}function jv(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length;a<l;++a){var r=i[a];if(r)return r}return null}function Zv(){let e=0;for(const t of this)++e;return e}function Jv(){return!this.node()}function Qv(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],l=0,r=a.length,s;l<r;++l)(s=a[l])&&e.call(s,s.__data__,l,a);return this}function ek(e){return function(){this.removeAttribute(e)}}function tk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nk(e,t){return function(){this.setAttribute(e,t)}}function ok(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ik(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function ak(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 lk(e,t){var o=zi(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?tk:ek:typeof t=="function"?o.local?ak:ik:o.local?ok:nk)(o,t))}function Zd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function rk(e){return function(){this.style.removeProperty(e)}}function sk(e,t,o){return function(){this.style.setProperty(e,t,o)}}function ck(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function dk(e,t,o){return arguments.length>1?this.each((t==null?rk:typeof t=="function"?ck:sk)(e,t,o??"")):zn(this.node(),e)}function zn(e,t){return e.style.getPropertyValue(t)||Zd(e).getComputedStyle(e,null).getPropertyValue(t)}function uk(e){return function(){delete this[e]}}function fk(e,t){return function(){this[e]=t}}function mk(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function pk(e,t){return arguments.length>1?this.each((t==null?uk:typeof t=="function"?mk:fk)(e,t)):this.node()[e]}function Jd(e){return e.trim().split(/^|\s+/)}function wl(e){return e.classList||new Qd(e)}function Qd(e){this._node=e,this._names=Jd(e.getAttribute("class")||"")}Qd.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 eu(e,t){for(var o=wl(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function tu(e,t){for(var o=wl(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function hk(e){return function(){eu(this,e)}}function yk(e){return function(){tu(this,e)}}function gk(e,t){return function(){(t.apply(this,arguments)?eu:tu)(this,e)}}function bk(e,t){var o=Jd(e+"");if(arguments.length<2){for(var i=wl(this.node()),a=-1,l=o.length;++a<l;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?gk:t?hk:yk)(o,t))}function _k(){this.textContent=""}function wk(e){return function(){this.textContent=e}}function vk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function kk(e){return arguments.length?this.each(e==null?_k:(typeof e=="function"?vk:wk)(e)):this.node().textContent}function Ek(){this.innerHTML=""}function Nk(e){return function(){this.innerHTML=e}}function $k(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function xk(e){return arguments.length?this.each(e==null?Ek:(typeof e=="function"?$k:Nk)(e)):this.node().innerHTML}function Ik(){this.nextSibling&&this.parentNode.appendChild(this)}function Sk(){return this.each(Ik)}function Ck(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Rk(){return this.each(Ck)}function Vk(e){var t=typeof e=="function"?e:Wd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ak(){return null}function Tk(e,t){var o=typeof e=="function"?e:Wd(e),i=t==null?Ak:typeof t=="function"?t:_l(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Mk(){var e=this.parentNode;e&&e.removeChild(this)}function Bk(){return this.each(Mk)}function Dk(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ok(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lk(e){return this.select(e?Ok:Dk)}function Pk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zk(e){return function(t){e.call(this,t,this.__data__)}}function Uk(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 Hk(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,l;o<a;++o)l=t[o],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function Fk(e,t,o){return function(){var i=this.__on,a,l=zk(t);if(i){for(var r=0,s=i.length;r<s;++r)if((a=i[r]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=o),a.value=t;return}}this.addEventListener(e.type,l,o),a={type:e.type,name:e.name,value:t,listener:l,options:o},i?i.push(a):this.__on=[a]}}function Gk(e,t,o){var i=Uk(e+""),a,l=i.length,r;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<l;++a)if((r=i[a]).type===u.type&&r.name===u.name)return u.value}return}for(s=t?Fk:Hk,a=0;a<l;++a)this.each(s(i[a],t,o));return this}function nu(e,t,o){var i=Zd(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 Yk(e,t){return function(){return nu(this,e,t)}}function Wk(e,t){return function(){return nu(this,e,t.apply(this,arguments))}}function Kk(e,t){return this.each((typeof t=="function"?Wk:Yk)(e,t))}function*qk(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,l=i.length,r;a<l;++a)(r=i[a])&&(yield r)}var ou=[null];function ct(e,t){this._groups=e,this._parents=t}function wo(){return new ct([[document.documentElement]],ou)}function Xk(){return this}ct.prototype=wo.prototype={constructor:ct,select:vv,selectAll:$v,selectChild:Cv,selectChildren:Tv,filter:Mv,data:zv,enter:Bv,exit:Hv,join:Fv,merge:Gv,selection:Xk,order:Yv,sort:Wv,call:qv,nodes:Xv,node:jv,size:Zv,empty:Jv,each:Qv,attr:lk,style:dk,property:pk,classed:bk,text:kk,html:xk,raise:Sk,lower:Rk,append:Vk,insert:Tk,remove:Bk,clone:Lk,datum:Pk,on:Gk,dispatch:Kk,[Symbol.iterator]:qk};function Wt(e){return typeof e=="string"?new ct([[document.querySelector(e)]],[document.documentElement]):new ct([[e]],ou)}function jk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kt(e,t){if(e=jk(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 vl={capture:!0,passive:!1};function kl(e){e.preventDefault(),e.stopImmediatePropagation()}function Zk(e){var t=e.document.documentElement,o=Wt(e).on("dragstart.drag",kl,vl);"onselectstart"in t?o.on("selectstart.drag",kl,vl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Jk(e,t){var o=e.document.documentElement,i=Wt(e).on("dragstart.drag",null);t&&(i.on("click.drag",kl,vl),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 iu(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function vo(){}var ko=.7,Hi=1/ko,Un="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qk=/^#([0-9a-f]{3,8})$/,eE=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),tE=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),nE=new RegExp(`^rgba\\(${Un},${Un},${Un},${Eo}\\)$`),oE=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${Eo}\\)$`),iE=new RegExp(`^hsl\\(${Eo},${Nt},${Nt}\\)$`),aE=new RegExp(`^hsla\\(${Eo},${Nt},${Nt},${Eo}\\)$`),au={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(vo,No,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lu,formatHex:lu,formatHex8:lE,formatHsl:rE,formatRgb:ru,toString:ru});function lu(){return this.rgb().formatHex()}function lE(){return this.rgb().formatHex8()}function rE(){return fu(this).formatHsl()}function ru(){return this.rgb().formatRgb()}function No(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=Qk.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?su(t):o===3?new lt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?Fi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?Fi(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=eE.exec(e))?new lt(t[1],t[2],t[3],1):(t=tE.exec(e))?new lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nE.exec(e))?Fi(t[1],t[2],t[3],t[4]):(t=oE.exec(e))?Fi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iE.exec(e))?uu(t[1],t[2]/100,t[3]/100,1):(t=aE.exec(e))?uu(t[1],t[2]/100,t[3]/100,t[4]):au.hasOwnProperty(e)?su(au[e]):e==="transparent"?new lt(NaN,NaN,NaN,0):null}function su(e){return new lt(e>>16&255,e>>8&255,e&255,1)}function Fi(e,t,o,i){return i<=0&&(e=t=o=NaN),new lt(e,t,o,i)}function sE(e){return e instanceof vo||(e=No(e)),e?(e=e.rgb(),new lt(e.r,e.g,e.b,e.opacity)):new lt}function Nl(e,t,o,i){return arguments.length===1?sE(e):new lt(e,t,o,i??1)}function lt(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}El(lt,Nl,iu(vo,{brighter(e){return e=e==null?Hi:Math.pow(Hi,e),new lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new lt(yn(this.r),yn(this.g),yn(this.b),Gi(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:cu,formatHex:cu,formatHex8:cE,formatRgb:du,toString:du}));function cu(){return`#${gn(this.r)}${gn(this.g)}${gn(this.b)}`}function cE(){return`#${gn(this.r)}${gn(this.g)}${gn(this.b)}${gn((isNaN(this.opacity)?1:this.opacity)*255)}`}function du(){const e=Gi(this.opacity);return`${e===1?"rgb(":"rgba("}${yn(this.r)}, ${yn(this.g)}, ${yn(this.b)}${e===1?")":`, ${e})`}`}function Gi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gn(e){return e=yn(e),(e<16?"0":"")+e.toString(16)}function uu(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new ht(e,t,o,i)}function fu(e){if(e instanceof ht)return new ht(e.h,e.s,e.l,e.opacity);if(e instanceof vo||(e=No(e)),!e)return new ht;if(e instanceof ht)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),l=Math.max(t,o,i),r=NaN,s=l-a,c=(l+a)/2;return s?(t===l?r=(o-i)/s+(o<i)*6:o===l?r=(i-t)/s+2:r=(t-o)/s+4,s/=c<.5?l+a:2-l-a,r*=60):s=c>0&&c<1?0:r,new ht(r,s,c,e.opacity)}function dE(e,t,o,i){return arguments.length===1?fu(e):new ht(e,t,o,i??1)}function ht(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}El(ht,dE,iu(vo,{brighter(e){return e=e==null?Hi:Math.pow(Hi,e),new ht(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new ht(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 lt($l(e>=240?e-240:e+120,a,i),$l(e,a,i),$l(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new ht(mu(this.h),Yi(this.s),Yi(this.l),Gi(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=Gi(this.opacity);return`${e===1?"hsl(":"hsla("}${mu(this.h)}, ${Yi(this.s)*100}%, ${Yi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mu(e){return e=(e||0)%360,e<0?e+360:e}function Yi(e){return Math.max(0,Math.min(1,e||0))}function $l(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 pu=e=>()=>e;function uE(e,t){return function(o){return e+o*t}}function fE(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 mE(e){return(e=+e)==1?hu:function(t,o){return o-t?fE(t,o,e):pu(isNaN(t)?o:t)}}function hu(e,t){var o=t-e;return o?uE(e,o):pu(isNaN(e)?t:e)}const yu=(function e(t){var o=mE(t);function i(a,l){var r=o((a=Nl(a)).r,(l=Nl(l)).r),s=o(a.g,l.g),c=o(a.b,l.b),d=hu(a.opacity,l.opacity);return function(u){return a.r=r(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 xl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Il=new RegExp(xl.source,"g");function pE(e){return function(){return e}}function hE(e){return function(t){return e(t)+""}}function yE(e,t){var o=xl.lastIndex=Il.lastIndex=0,i,a,l,r=-1,s=[],c=[];for(e=e+"",t=t+"";(i=xl.exec(e))&&(a=Il.exec(t));)(l=a.index)>o&&(l=t.slice(o,l),s[r]?s[r]+=l:s[++r]=l),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:qt(i,a)})),o=Il.lastIndex;return o<t.length&&(l=t.slice(o),s[r]?s[r]+=l:s[++r]=l),s.length<2?c[0]?hE(c[0].x):pE(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(d);return s.join("")})}var gu=180/Math.PI,Sl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bu(e,t,o,i,a,l){var r,s,c;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(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,r=-r),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*gu,skewX:Math.atan(c)*gu,scaleX:r,scaleY:s}}var Wi;function gE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Sl:bu(t.a,t.b,t.c,t.d,t.e,t.f)}function bE(e){return e==null||(Wi||(Wi=document.createElementNS("http://www.w3.org/2000/svg","g")),Wi.setAttribute("transform",e),!(e=Wi.transform.baseVal.consolidate()))?Sl:(e=e.matrix,bu(e.a,e.b,e.c,e.d,e.e,e.f))}function _u(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function l(d,u,f,p,m,h){if(d!==f||u!==p){var _=m.push("translate(",null,t,null,o);h.push({i:_-4,x:qt(d,f)},{i:_-2,x:qt(u,p)})}else(f||p)&&m.push("translate("+f+t+p+o)}function r(d,u,f,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:f.push(a(f)+"rotate(",null,i)-2,x:qt(d,u)})):u&&f.push(a(f)+"rotate("+u+i)}function s(d,u,f,p){d!==u?p.push({i:f.push(a(f)+"skewX(",null,i)-2,x:qt(d,u)}):u&&f.push(a(f)+"skewX("+u+i)}function c(d,u,f,p,m,h){if(d!==f||u!==p){var _=m.push(a(m)+"scale(",null,",",null,")");h.push({i:_-4,x:qt(d,f)},{i:_-2,x:qt(u,p)})}else(f!==1||p!==1)&&m.push(a(m)+"scale("+f+","+p+")")}return function(d,u){var f=[],p=[];return d=e(d),u=e(u),l(d.translateX,d.translateY,u.translateX,u.translateY,f,p),r(d.rotate,u.rotate,f,p),s(d.skewX,u.skewX,f,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,f,p),d=u=null,function(m){for(var h=-1,_=p.length,b;++h<_;)f[(b=p[h]).i]=b.x(m);return f.join("")}}}var _E=_u(gE,"px, ","px)","deg)"),wE=_u(bE,", ",")",")"),vE=1e-12;function wu(e){return((e=Math.exp(e))+1/e)/2}function kE(e){return((e=Math.exp(e))-1/e)/2}function EE(e){return((e=Math.exp(2*e))-1)/(e+1)}const NE=(function e(t,o,i){function a(l,r){var s=l[0],c=l[1],d=l[2],u=r[0],f=r[1],p=r[2],m=u-s,h=f-c,_=m*m+h*h,b,g;if(_<vE)g=Math.log(p/d)/t,b=function(X){return[s+X*m,c+X*h,d*Math.exp(t*X*g)]};else{var I=Math.sqrt(_),y=(p*p-d*d+i*_)/(2*d*o*I),N=(p*p-d*d-i*_)/(2*p*o*I),q=Math.log(Math.sqrt(y*y+1)-y),U=Math.log(Math.sqrt(N*N+1)-N);g=(U-q)/t,b=function(X){var K=X*g,W=wu(q),ne=d/(o*I)*(W*EE(t*K+q)-kE(q));return[s+ne*m,c+ne*h,d*W/wu(t*K+q)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return a.rho=function(l){var r=Math.max(.001,+l),s=r*r,c=s*s;return e(r,s,c)},a})(Math.SQRT2,2,4);var Hn=0,$o=0,xo=0,vu=1e3,Ki,Io,qi=0,bn=0,Xi=0,So=typeof performance=="object"&&performance.now?performance:Date,ku=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cl(){return bn||(ku($E),bn=So.now()+Xi)}function $E(){bn=0}function ji(){this._call=this._time=this._next=null}ji.prototype=Eu.prototype={constructor:ji,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Cl():+o)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:Ki=this,Io=this),this._call=e,this._time=o,Rl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rl())}};function Eu(e,t,o){var i=new ji;return i.restart(e,t,o),i}function xE(){Cl(),++Hn;for(var e=Ki,t;e;)(t=bn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hn}function Nu(){bn=(qi=So.now())+Xi,Hn=$o=0;try{xE()}finally{Hn=0,SE(),bn=0}}function IE(){var e=So.now(),t=e-qi;t>vu&&(Xi-=t,qi=e)}function SE(){for(var e,t=Ki,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:Ki=o);Io=e,Rl(i)}function Rl(e){if(!Hn){$o&&($o=clearTimeout($o));var t=e-bn;t>24?(e<1/0&&($o=setTimeout(Nu,e-So.now()-Xi)),xo&&(xo=clearInterval(xo))):(xo||(qi=So.now(),xo=setInterval(IE,vu)),Hn=1,ku(Nu))}}function $u(e,t,o){var i=new ji;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var CE=gl("start","end","cancel","interrupt"),RE=[],xu=0,Iu=1,Vl=2,Zi=3,Su=4,Al=5,Ji=6;function Qi(e,t,o,i,a,l){var r=e.__transition;if(!r)e.__transition={};else if(o in r)return;VE(e,o,{name:t,index:i,group:a,on:CE,tween:RE,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:xu})}function Tl(e,t){var o=yt(e,t);if(o.state>xu)throw new Error("too late; already scheduled");return o}function $t(e,t){var o=yt(e,t);if(o.state>Zi)throw new Error("too late; already running");return o}function yt(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function VE(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=Eu(l,0,o.time);function l(d){o.state=Iu,o.timer.restart(r,o.delay,o.time),o.delay<=d&&r(d-o.delay)}function r(d){var u,f,p,m;if(o.state!==Iu)return c();for(u in i)if(m=i[u],m.name===o.name){if(m.state===Zi)return $u(r);m.state===Su?(m.state=Ji,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[u]):+u<t&&(m.state=Ji,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete i[u])}if($u(function(){o.state===Zi&&(o.state=Su,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=Vl,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Vl){for(o.state=Zi,a=new Array(p=o.tween.length),u=0,f=-1;u<p;++u)(m=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++f]=m);a.length=f+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Al,1),f=-1,p=a.length;++f<p;)a[f].call(e,u);o.state===Al&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Ji,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function ea(e,t){var o=e.__transition,i,a,l=!0,r;if(o){t=t==null?null:t+"";for(r in o){if((i=o[r]).name!==t){l=!1;continue}a=i.state>Vl&&i.state<Al,i.state=Ji,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[r]}l&&delete e.__transition}}function AE(e){return this.each(function(){ea(this,e)})}function TE(e,t){var o,i;return function(){var a=$t(this,e),l=a.tween;if(l!==o){i=o=l;for(var r=0,s=i.length;r<s;++r)if(i[r].name===t){i=i.slice(),i.splice(r,1);break}}a.tween=i}}function ME(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var l=$t(this,e),r=l.tween;if(r!==i){a=(i=r).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)}l.tween=a}}function BE(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=yt(this.node(),o).tween,a=0,l=i.length,r;a<l;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((t==null?TE:ME)(o,e,t))}function Ml(e,t,o){var i=e._id;return e.each(function(){var a=$t(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return yt(a,i).value[t]}}function Cu(e,t){var o;return(typeof t=="number"?qt:t instanceof No?yu:(o=No(t))?(t=o,yu):yE)(e,t)}function DE(e){return function(){this.removeAttribute(e)}}function OE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function LE(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttribute(e);return r===a?null:r===i?l:l=t(i=r,o)}}function PE(e,t,o){var i,a=o+"",l;return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?l:l=t(i=r,o)}}function zE(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttribute(e):(r=this.getAttribute(e),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function UE(e,t,o){var i,a,l;return function(){var r,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(r=this.getAttributeNS(e.space,e.local),c=s+"",r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s)))}}function HE(e,t){var o=zi(e),i=o==="transform"?wE:Cu;return this.attrTween(e,typeof t=="function"?(o.local?UE:zE)(o,i,Ml(this,"attr."+e,t)):t==null?(o.local?OE:DE)(o):(o.local?PE:LE)(o,i,t))}function FE(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function GE(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function YE(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&GE(e,l)),o}return a._value=t,a}function WE(e,t){var o,i;function a(){var l=t.apply(this,arguments);return l!==i&&(o=(i=l)&&FE(e,l)),o}return a._value=t,a}function KE(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=zi(e);return this.tween(o,(i.local?YE:WE)(i,t))}function qE(e,t){return function(){Tl(this,e).delay=+t.apply(this,arguments)}}function XE(e,t){return t=+t,function(){Tl(this,e).delay=t}}function jE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qE:XE)(t,e)):yt(this.node(),t).delay}function ZE(e,t){return function(){$t(this,e).duration=+t.apply(this,arguments)}}function JE(e,t){return t=+t,function(){$t(this,e).duration=t}}function QE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ZE:JE)(t,e)):yt(this.node(),t).duration}function eN(e,t){if(typeof t!="function")throw new Error;return function(){$t(this,e).ease=t}}function tN(e){var t=this._id;return arguments.length?this.each(eN(t,e)):yt(this.node(),t).ease}function nN(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;$t(this,e).ease=o}}function oN(e){if(typeof e!="function")throw new Error;return this.each(nN(this._id,e))}function iN(e){typeof e!="function"&&(e=qd(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var l=t[a],r=l.length,s=i[a]=[],c,d=0;d<r;++d)(c=l[d])&&e.call(c,c.__data__,d,l)&&s.push(c);return new Bt(i,this._parents,this._name,this._id)}function aN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,l=Math.min(i,a),r=new Array(i),s=0;s<l;++s)for(var c=t[s],d=o[s],u=c.length,f=r[s]=new Array(u),p,m=0;m<u;++m)(p=c[m]||d[m])&&(f[m]=p);for(;s<i;++s)r[s]=t[s];return new Bt(r,this._parents,this._name,this._id)}function lN(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 rN(e,t,o){var i,a,l=lN(t)?Tl:$t;return function(){var r=l(this,e),s=r.on;s!==i&&(a=(i=s).copy()).on(t,o),r.on=a}}function sN(e,t){var o=this._id;return arguments.length<2?yt(this.node(),o).on.on(e):this.each(rN(o,e,t))}function cN(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function dN(){return this.on("end.remove",cN(this._id))}function uN(e){var t=this._name,o=this._id;typeof e!="function"&&(e=_l(e));for(var i=this._groups,a=i.length,l=new Array(a),r=0;r<a;++r)for(var s=i[r],c=s.length,d=l[r]=new Array(c),u,f,p=0;p<c;++p)(u=s[p])&&(f=e.call(u,u.__data__,p,s))&&("__data__"in u&&(f.__data__=u.__data__),d[p]=f,Qi(d[p],t,o,p,d,yt(u,o)));return new Bt(l,this._parents,t,o)}function fN(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Kd(e));for(var i=this._groups,a=i.length,l=[],r=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,f=0;f<d;++f)if(u=c[f]){for(var p=e.call(u,u.__data__,f,c),m,h=yt(u,o),_=0,b=p.length;_<b;++_)(m=p[_])&&Qi(m,t,o,_,p,h);l.push(p),r.push(u)}return new Bt(l,r,t,o)}var mN=wo.prototype.constructor;function pN(){return new mN(this._groups,this._parents)}function hN(e,t){var o,i,a;return function(){var l=zn(this,e),r=(this.style.removeProperty(e),zn(this,e));return l===r?null:l===o&&r===i?a:a=t(o=l,i=r)}}function Ru(e){return function(){this.style.removeProperty(e)}}function yN(e,t,o){var i,a=o+"",l;return function(){var r=zn(this,e);return r===a?null:r===i?l:l=t(i=r,o)}}function gN(e,t,o){var i,a,l;return function(){var r=zn(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),zn(this,e))),r===c?null:r===i&&c===a?l:(a=c,l=t(i=r,s))}}function bN(e,t){var o,i,a,l="style."+t,r="end."+l,s;return function(){var c=$t(this,e),d=c.on,u=c.value[l]==null?s||(s=Ru(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(r,a=u),c.on=i}}function _N(e,t,o){var i=(e+="")=="transform"?_E:Cu;return t==null?this.styleTween(e,hN(e,i)).on("end.style."+e,Ru(e)):typeof t=="function"?this.styleTween(e,gN(e,i,Ml(this,"style."+e,t))).each(bN(this._id,e)):this.styleTween(e,yN(e,i,t),o).on("end.style."+e,null)}function wN(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function vN(e,t,o){var i,a;function l(){var r=t.apply(this,arguments);return r!==a&&(i=(a=r)&&wN(e,r,o)),i}return l._value=t,l}function kN(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,vN(e,t,o??""))}function EN(e){return function(){this.textContent=e}}function NN(e){return function(){var t=e(this);this.textContent=t??""}}function $N(e){return this.tween("text",typeof e=="function"?NN(Ml(this,"text",e)):EN(e==null?"":e+""))}function xN(e){return function(t){this.textContent=e.call(this,t)}}function IN(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&xN(a)),t}return i._value=e,i}function SN(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,IN(e))}function CN(){for(var e=this._name,t=this._id,o=Vu(),i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)if(c=r[d]){var u=yt(c,t);Qi(c,e,o,d,r,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bt(i,this._parents,e,o)}function RN(){var e,t,o=this,i=o._id,a=o.size();return new Promise(function(l,r){var s={value:r},c={value:function(){--a===0&&l()}};o.each(function(){var d=$t(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&&l()})}var VN=0;function Bt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function Vu(){return++VN}var Dt=wo.prototype;Bt.prototype={constructor:Bt,select:uN,selectAll:fN,selectChild:Dt.selectChild,selectChildren:Dt.selectChildren,filter:iN,merge:aN,selection:pN,transition:CN,call:Dt.call,nodes:Dt.nodes,node:Dt.node,size:Dt.size,empty:Dt.empty,each:Dt.each,on:sN,attr:HE,attrTween:KE,style:_N,styleTween:kN,text:$N,textTween:SN,remove:dN,tween:BE,delay:jE,duration:QE,ease:tN,easeVarying:oN,end:RN,[Symbol.iterator]:Dt[Symbol.iterator]};function AN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var TN={time:null,delay:0,duration:250,ease:AN};function MN(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 BN(e){var t,o;e instanceof Bt?(t=e._id,e=e._name):(t=Vu(),(o=TN).time=Cl(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var r=i[l],s=r.length,c,d=0;d<s;++d)(c=r[d])&&Qi(c,e,t,d,r,o||MN(c,t));return new Bt(i,this._parents,e,t)}wo.prototype.interrupt=AE,wo.prototype.transition=BN;const ta=e=>()=>e;function DN(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 Bl=new Ot(1,0,0);Ot.prototype;function Dl(e){e.stopImmediatePropagation()}function Co(e){e.preventDefault(),e.stopImmediatePropagation()}function ON(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function LN(){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 Au(){return this.__zoom||Bl}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zN(){return navigator.maxTouchPoints||"ontouchstart"in this}function UN(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],l=e.invertY(t[0][1])-o[0][1],r=e.invertY(t[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),r>l?(l+r)/2:Math.min(0,l)||Math.max(0,r))}function HN(){var e=ON,t=LN,o=UN,i=PN,a=zN,l=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],s=250,c=NE,d=gl("start","zoom","end"),u,f,p,m=500,h=150,_=0,b=10;function g(v){v.property("__zoom",Au).on("wheel.zoom",K,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",ne).filter(a).on("touchstart.zoom",re).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(v,T,$,P){var H=v.selection?v.selection():v;H.property("__zoom",Au),v!==H?q(v,T,$,P):H.interrupt().each(function(){U(this,arguments).event(P).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},g.scaleBy=function(v,T,$,P){g.scaleTo(v,function(){var H=this.__zoom.k,te=typeof T=="function"?T.apply(this,arguments):T;return H*te},$,P)},g.scaleTo=function(v,T,$,P){g.transform(v,function(){var H=t.apply(this,arguments),te=this.__zoom,M=$==null?N(H):typeof $=="function"?$.apply(this,arguments):$,ee=te.invert(M),le=typeof T=="function"?T.apply(this,arguments):T;return o(y(I(te,le),M,ee),H,r)},$,P)},g.translateBy=function(v,T,$,P){g.transform(v,function(){return o(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),r)},null,P)},g.translateTo=function(v,T,$,P,H){g.transform(v,function(){var te=t.apply(this,arguments),M=this.__zoom,ee=P==null?N(te):typeof P=="function"?P.apply(this,arguments):P;return o(Bl.translate(ee[0],ee[1]).scale(M.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof $=="function"?-$.apply(this,arguments):-$),te,r)},P,H)};function I(v,T){return T=Math.max(l[0],Math.min(l[1],T)),T===v.k?v:new Ot(T,v.x,v.y)}function y(v,T,$){var P=T[0]-$[0]*v.k,H=T[1]-$[1]*v.k;return P===v.x&&H===v.y?v:new Ot(v.k,P,H)}function N(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function q(v,T,$,P){v.on("start.zoom",function(){U(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){U(this,arguments).event(P).end()}).tween("zoom",function(){var H=this,te=arguments,M=U(H,te).event(P),ee=t.apply(H,te),le=$==null?N(ee):typeof $=="function"?$.apply(H,te):$,me=Math.max(ee[1][0]-ee[0][0],ee[1][1]-ee[0][1]),ye=H.__zoom,ce=typeof T=="function"?T.apply(H,te):T,ue=c(ye.invert(le).concat(me/ye.k),ce.invert(le).concat(me/ce.k));return function(he){if(he===1)he=ce;else{var ve=ue(he),Se=me/ve[2];he=new Ot(Se,le[0]-ve[0]*Se,le[1]-ve[1]*Se)}M.zoom(null,he)}})}function U(v,T,$){return!$&&v.__zooming||new X(v,T)}function X(v,T){this.that=v,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,T),this.taps=0}X.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,T){return this.mouse&&v!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var T=Wt(this.that).datum();d.call(v,this.that,new DN(v,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),T)}};function K(v,...T){if(!e.apply(this,arguments))return;var $=U(this,T).event(v),P=this.__zoom,H=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,i.apply(this,arguments)))),te=Kt(v);if($.wheel)($.mouse[0][0]!==te[0]||$.mouse[0][1]!==te[1])&&($.mouse[1]=P.invert($.mouse[0]=te)),clearTimeout($.wheel);else{if(P.k===H)return;$.mouse=[te,P.invert(te)],ea(this),$.start()}Co(v),$.wheel=setTimeout(M,h),$.zoom("mouse",o(y(I(P,H),$.mouse[0],$.mouse[1]),$.extent,r));function M(){$.wheel=null,$.end()}}function W(v,...T){if(p||!e.apply(this,arguments))return;var $=v.currentTarget,P=U(this,T,!0).event(v),H=Wt(v.view).on("mousemove.zoom",le,!0).on("mouseup.zoom",me,!0),te=Kt(v,$),M=v.clientX,ee=v.clientY;Zk(v.view),Dl(v),P.mouse=[te,this.__zoom.invert(te)],ea(this),P.start();function le(ye){if(Co(ye),!P.moved){var ce=ye.clientX-M,ue=ye.clientY-ee;P.moved=ce*ce+ue*ue>_}P.event(ye).zoom("mouse",o(y(P.that.__zoom,P.mouse[0]=Kt(ye,$),P.mouse[1]),P.extent,r))}function me(ye){H.on("mousemove.zoom mouseup.zoom",null),Jk(ye.view,P.moved),Co(ye),P.event(ye).end()}}function ne(v,...T){if(e.apply(this,arguments)){var $=this.__zoom,P=Kt(v.changedTouches?v.changedTouches[0]:v,this),H=$.invert(P),te=$.k*(v.shiftKey?.5:2),M=o(y(I($,te),P,H),t.apply(this,T),r);Co(v),s>0?Wt(this).transition().duration(s).call(q,M,P,v):Wt(this).call(g.transform,M,P,v)}}function re(v,...T){if(e.apply(this,arguments)){var $=v.touches,P=$.length,H=U(this,T,v.changedTouches.length===P).event(v),te,M,ee,le;for(Dl(v),M=0;M<P;++M)ee=$[M],le=Kt(ee,this),le=[le,this.__zoom.invert(le),ee.identifier],H.touch0?!H.touch1&&H.touch0[2]!==le[2]&&(H.touch1=le,H.taps=0):(H.touch0=le,te=!0,H.taps=1+!!u);u&&(u=clearTimeout(u)),te&&(H.taps<2&&(f=le[0],u=setTimeout(function(){u=null},m)),ea(this),H.start())}}function L(v,...T){if(this.__zooming){var $=U(this,T).event(v),P=v.changedTouches,H=P.length,te,M,ee,le;for(Co(v),te=0;te<H;++te)M=P[te],ee=Kt(M,this),$.touch0&&$.touch0[2]===M.identifier?$.touch0[0]=ee:$.touch1&&$.touch1[2]===M.identifier&&($.touch1[0]=ee);if(M=$.that.__zoom,$.touch1){var me=$.touch0[0],ye=$.touch0[1],ce=$.touch1[0],ue=$.touch1[1],he=(he=ce[0]-me[0])*he+(he=ce[1]-me[1])*he,ve=(ve=ue[0]-ye[0])*ve+(ve=ue[1]-ye[1])*ve;M=I(M,Math.sqrt(he/ve)),ee=[(me[0]+ce[0])/2,(me[1]+ce[1])/2],le=[(ye[0]+ue[0])/2,(ye[1]+ue[1])/2]}else if($.touch0)ee=$.touch0[0],le=$.touch0[1];else return;$.zoom("touch",o(y(M,ee,le),$.extent,r))}}function Q(v,...T){if(this.__zooming){var $=U(this,T).event(v),P=v.changedTouches,H=P.length,te,M;for(Dl(v),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),te=0;te<H;++te)M=P[te],$.touch0&&$.touch0[2]===M.identifier?delete $.touch0:$.touch1&&$.touch1[2]===M.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(M=Kt(M,this),Math.hypot(f[0]-M[0],f[1]-M[1])<b)){var ee=Wt(this).on("dblclick.zoom");ee&&ee.apply(this,arguments)}}}return g.wheelDelta=function(v){return arguments.length?(i=typeof v=="function"?v:ta(+v),g):i},g.filter=function(v){return arguments.length?(e=typeof v=="function"?v:ta(!!v),g):e},g.touchable=function(v){return arguments.length?(a=typeof v=="function"?v:ta(!!v),g):a},g.extent=function(v){return arguments.length?(t=typeof v=="function"?v:ta([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),g):t},g.scaleExtent=function(v){return arguments.length?(l[0]=+v[0],l[1]=+v[1],g):[l[0],l[1]]},g.translateExtent=function(v){return arguments.length?(r[0][0]=+v[0][0],r[1][0]=+v[1][0],r[0][1]=+v[0][1],r[1][1]=+v[1][1],g):[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},g.constrain=function(v){return arguments.length?(o=v,g):o},g.duration=function(v){return arguments.length?(s=+v,g):s},g.interpolate=function(v){return arguments.length?(c=v,g):c},g.on=function(){var v=d.on.apply(d,arguments);return v===d?g:v},g.clickDistance=function(v){return arguments.length?(_=(v=+v)*v,g):Math.sqrt(_)},g.tapDistance=function(v){return arguments.length?(b=+v,g):b},g}const Tu=Symbol("MiniMapSlots"),FN=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],GN={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},YN=n.defineComponent({...GN,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(Tu),a=n.useAttrs(),l=n.toRef(()=>a.style??{});function r(f){t("click",f)}function s(f){t("dblclick",f)}function c(f){t("mouseenter",f)}function d(f){t("mousemove",f)}function u(f){t("mouseleave",f)}return(f,p)=>!f.hidden&&f.dimensions.width!==0&&f.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,...f.$attrs})),null,16)):(n.openBlock(),n.createElementBlock("rect",n.mergeProps({key:1,id:f.id},f.$attrs,{class:["vue-flow__minimap-node",{selected:f.selected,dragging:f.dragging}],x:f.position.x,y:f.position.y,rx:f.borderRadius,ry:f.borderRadius,width:f.dimensions.width,height:f.dimensions.height,fill:f.color||l.value.background||l.value.backgroundColor,stroke:f.strokeColor,"stroke-width":f.strokeWidth,"shape-rendering":f.shapeRendering,onClick:r,onDblclick:s,onMouseenter:c,onMousemove:d,onMouseleave:u}),null,16,FN))],64)):n.createCommentVNode("",!0)}}),WN=["width","height","viewBox","aria-labelledby"],KN=["id"],qN=["d","fill","stroke","stroke-width"],XN={name:"MiniMap",compatConfig:{MODE:3}},jN=n.defineComponent({...XN,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,l=150,{id:r,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:f,d3Selection:p,d3Zoom:m,getNodesInitialized:h}=Oe(),_=n.ref();n.provide(Tu,o);const b=n.toRef(()=>{var H;return e.width??((H=i.style)==null?void 0:H.width)??a}),g=n.toRef(()=>{var H;return e.height??((H=i.style)==null?void 0:H.height)??l}),I=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",y=n.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),N=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:()=>""),U=n.computed(()=>Za(h.value.filter(H=>!H.hidden))),X=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})),K=n.computed(()=>h.value&&h.value.length?Gg(U.value,X.value):X.value),W=n.computed(()=>{const H=K.value.width/b.value,te=K.value.height/g.value;return Math.max(H,te)}),ne=n.computed(()=>{const H=W.value*b.value,te=W.value*g.value,M=e.offsetScale*W.value;return{offset:M,x:K.value.x-(H-K.value.width)/2-M,y:K.value.y-(te-K.value.height)/2-M,width:H+M*2,height:te+M*2}}),re=n.computed(()=>!ne.value.x||!ne.value.y?"":`
|
|
28
|
+
M${ne.value.x-ne.value.offset},${ne.value.y-ne.value.offset}
|
|
29
|
+
h${ne.value.width+ne.value.offset*2}
|
|
30
|
+
v${ne.value.height+ne.value.offset*2}
|
|
31
|
+
h${-ne.value.width-ne.value.offset*2}z
|
|
32
|
+
M${X.value.x+e.maskBorderRadius},${X.value.y}
|
|
33
|
+
h${X.value.width-2*e.maskBorderRadius}
|
|
34
34
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
|
|
35
|
-
v${
|
|
35
|
+
v${X.value.height-2*e.maskBorderRadius}
|
|
36
36
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
|
|
37
|
-
h${-(
|
|
37
|
+
h${-(X.value.width-2*e.maskBorderRadius)}
|
|
38
38
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
39
|
-
v${-(
|
|
40
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);n.watchEffect(W=>{if(b.value){const oe=Wt(b.value),T=he=>{if(he.sourceEvent.type!=="wheel"||!p.value||!m.value)return;const we=he.sourceEvent.ctrlKey&&bo()?10:1,re=-he.sourceEvent.deltaY*(he.sourceEvent.deltaMode===1?.05:he.sourceEvent.deltaMode?1:.002)*e.zoomStep,me=c.value.zoom*2**(re*we);m.value.scaleTo(p.value,me)},J=he=>{if(he.sourceEvent.type!=="mousemove"||!p.value||!m.value)return;const we=X.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),re={x:c.value.x-he.sourceEvent.movementX*we,y:c.value.y-he.sourceEvent.movementY*we},me=[[0,0],[u.value.width,u.value.height]],be=Ol.translate(re.x,re.y).scale(c.value.zoom),xe=m.value.constrain()(be,me,d.value);m.value.transform(p.value,xe)},se=ON().wheelDelta(he=>el(he)*(e.zoomStep/10)).on("zoom",e.pannable?J:()=>{}).on("zoom.wheel",e.zoomable?T:()=>{});oe.call(se),W(()=>{oe.on("zoom",null)})}},{flush:"post"});function B(W){const[oe,T]=Kt(W);t("click",{event:W,position:{x:oe,y:T}})}function ee(W,oe){const T={event:W,node:oe,connectedEdges:dn([oe],s.value)};f.miniMapNodeClick(T),t("nodeClick",T)}function v(W,oe){const T={event:W,node:oe,connectedEdges:dn([oe],s.value)};f.miniMapNodeDoubleClick(T),t("nodeDblclick",T)}function R(W,oe){const T={event:W,node:oe,connectedEdges:dn([oe],s.value)};f.miniMapNodeMouseEnter(T),t("nodeMouseenter",T)}function E(W,oe){const T={event:W,node:oe,connectedEdges:dn([oe],s.value)};f.miniMapNodeMouseMove(T),t("nodeMousemove",T)}function P(W,oe){const T={event:W,node:oe,connectedEdges:dn([oe],s.value)};f.miniMapNodeMouseLeave(T),t("nodeMouseleave",T)}return(W,oe)=>(n.openBlock(),n.createBlock(n.unref(dd),{position:W.position,class:n.normalizeClass(["vue-flow__minimap",{pannable:W.pannable,zoomable:W.zoomable}])},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{ref_key:"el",ref:b,width:g.value,height:_.value,viewBox:[Q.value.x,Q.value.y,Q.value.width,Q.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${n.unref(r)}`,onClick:B},[W.ariaLabel?(n.openBlock(),n.createElementBlock("title",{key:0,id:`vue-flow__minimap-${n.unref(r)}`},n.toDisplayString(W.ariaLabel),9,HN)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),T=>(n.openBlock(),n.createBlock(zN,{id:T.id,key:T.id,f:"",position:T.computedPosition,dimensions:T.dimensions,selected:T.selected,dragging:T.dragging,style:n.normalizeStyle(T.style),class:n.normalizeClass(K.value(T)),color:y.value(T),"border-radius":W.nodeBorderRadius,"stroke-color":$.value(T),"stroke-width":W.nodeStrokeWidth,"shape-rendering":n.unref(N),type:T.type,hidden:T.hidden,onClick:J=>ee(J,T),onDblclick:J=>v(J,T),onMouseenter:J=>R(J,T),onMousemove:J=>E(J,T),onMouseleave:J=>P(J,T)},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:de.value,fill:W.maskColor,stroke:W.maskStrokeColor,"stroke-width":W.maskStrokeWidth,"fill-rule":"evenodd"},null,8,FN)],8,UN))]),_:1},8,["position","class"]))}}),WN=["d"],KN=["cx","cy","onDblclick"],qN=["x","y","onPointerdown","onDblclick"],XN=Le(n.defineComponent({__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=De(),i=n.inject(bl),a=n.inject(hn,null),l=n.computed(()=>!!a&&a.editable.value),r=n.inject(Pn,null),s=n.computed(()=>!!r&&r.active.value&&(!r.relatedEntityIds.value.has(t.data.targetRef)||!r.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}),f=n.computed(()=>c.value.map((G,X)=>X===d.value?u.value:G)),{source:p,target:m,sourceSide:h,targetSide:b}=Dd({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>f.value}),g=n.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?na(p.value,h.value,f.value,m.value,b.value):ia(p.value,f.value,m.value)),_=n.computed(()=>l.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?oa(p.value,h.value,f.value,m.value,b.value):ra(p.value,f.value,m.value).map((G,X)=>({point:G,segIndex:X})):[]),N=n.computed(()=>l.value?f.value:[]);function y(G,X){d.value=G,u.value={...c.value[G]},X.target.setPointerCapture(X.pointerId),X.stopPropagation()}function $(G){if(d.value<0)return;const X=o({x:G.clientX,y:G.clientY});u.value={x:X.x,y:X.y}}function K(G){var X,Q;d.value>=0&&i&&i.movePoint(t.id,d.value,{...u.value}),d.value=-1,(Q=(X=G.target).releasePointerCapture)==null||Q.call(X,G.pointerId)}function F(G,X){X.stopPropagation(),i==null||i.removePoint(t.id,G)}function q(G,X){if(!i)return;const Q=o({x:X.clientX,y:X.clientY});i.insertPoint(t.id,G,{x:Q.x,y:Q.y})}return(G,X)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:g.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:n.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,WN),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,(Q,de)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${de}`,cx:Q.point.x,cy:Q.point.y,r:"4",class:n.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:n.withModifiers(B=>q(Q.segIndex,B),["stop"])},null,42,KN))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,(Q,de)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${de}`,x:Q.x-5,y:Q.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:B=>y(de,B),onPointermove:$,onPointerup:K,onDblclick:B=>F(de,B)},null,42,qN))),128))],64))}}),[["__scopeId","data-v-4c93c9c3"]]),jN=["data-theme"],ZN={key:0,class:"em-ctx__sep",role:"separator"},JN={key:1,class:"em-ctx__swatches"},QN={class:"em-ctx__swatches-label"},e$={class:"em-ctx__chips"},t$=["onClick"],n$=["title","onClick"],o$=["disabled","onClick"],i$={class:"em-ctx__icon"},a$={class:"em-ctx__caption"},l$=Le(n.defineComponent({__name:"EmContextMenu",setup(e,{expose:t}){const o=n.ref(!1),i=n.ref([]),a=n.ref(void 0),l=n.ref(null),r=n.reactive({x:0,y:0}),s=8;async function c(m,h){var _;i.value=h,a.value=(_=m.target)!=null&&_.closest('[data-theme="dark"]')?"dark":void 0,r.x=m.clientX,r.y=m.clientY,o.value=!0,window.addEventListener("keydown",u),window.addEventListener("resize",d),await n.nextTick();const b=l.value;if(!b)return;const g=b.getBoundingClientRect();r.x+g.width>window.innerWidth-s&&(r.x=Math.max(s,window.innerWidth-s-g.width)),r.y+g.height>window.innerHeight-s&&(r.y=Math.max(s,window.innerHeight-s-g.height))}function d(){o.value&&(o.value=!1,i.value=[],window.removeEventListener("keydown",u),window.removeEventListener("resize",d))}function u(m){m.key==="Escape"&&(m.stopPropagation(),d())}function f(m){m.disabled||(m.handler(),d())}function p(m,h){m.onPick(h),d()}return n.onBeforeUnmount(d),t({open:c,close:d}),(m,h)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":a.value},[n.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:d,onContextmenu:n.withModifiers(d,["prevent"])},null,32),n.createElementVNode("div",{ref_key:"menuEl",ref:l,class:"em-ctx",style:n.normalizeStyle({left:r.x+"px",top:r.y+"px"}),role:"menu",onContextmenu:h[0]||(h[0]=n.withModifiers(()=>{},["prevent"]))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,(b,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:g},[b.type==="separator"?(n.openBlock(),n.createElementBlock("div",ZN)):b.type==="swatches"?(n.openBlock(),n.createElementBlock("div",JN,[n.createElementVNode("span",QN,n.toDisplayString(b.caption),1),n.createElementVNode("div",e$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":b.current===null}]),title:"없음",onClick:_=>p(b,null)},null,10,t$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),_=>(n.openBlock(),n.createElementBlock("button",{key:_,type:"button",class:n.normalizeClass(["em-ctx__chip",{"is-on":b.current===_}]),style:n.normalizeStyle({background:n.unref(Dn)(_)}),title:n.unref(Bn)(_),onClick:N=>p(b,_)},null,14,n$))),128))])])):(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:n.normalizeClass(["em-ctx__item",{"is-danger":b.danger,"is-disabled":b.disabled}]),disabled:b.disabled,role:"menuitem",onClick:_=>f(b)},[n.createElementVNode("span",i$,[b.icon?(n.openBlock(),n.createBlock(Ve,{key:0,name:b.icon,size:15},null,8,["name"])):n.createCommentVNode("",!0)]),n.createElementVNode("span",a$,n.toDisplayString(b.caption),1)],10,o$))],64))),128))],36)],8,jN)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-77a7a1b5"]]),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 Fn(e){const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function r$(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function s$(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 l=e.firstChild,r=a.getClientRects();if(!l||l.nodeType!==3||r.length<=1){const h=r.length?a.getBoundingClientRect():e.getBoundingClientRect();if(h.width===0&&h.height===0)return[];const b=t(h.left,h.top+h.height/2);return[{...i,x:b.x,y:b.y,text:(e.textContent??"").trim()}]}const s=l.textContent??"",c=[];let d="",u=null,f=0,p=0;const m=()=>{const h=d.trim();if(h){const b=t(f,(u+p)/2);c.push({...i,x:b.x,y:b.y,text:h})}d=""};for(let h=0;h<s.length;h++){a.setStart(l,h),a.setEnd(l,h+1);const b=a.getBoundingClientRect();u===null||Math.abs(b.top-u)>1?(m(),u=b.top,f=b.left,p=b.bottom,d=s[h]):(d+=s[h],p=Math.max(p,b.bottom))}return m(),c}function ea(e,t){const o=[];for(const i of e.querySelectorAll("*"))r$(i)&&(i.closest(Pl)||Fn(i)&&o.push(...s$(i,t)));return o}function Ro(e){return Math.round(e*100)/100}function c$(e,t){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(Pl)||!Fn(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const l=t(a.left,a.top),r=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="${Ro(l.x)}" y="${Ro(l.y)}" width="${Ro(r.x-l.x)}" height="${Ro(r.y-l.y)}" viewBox="${c}" fill="none" stroke="${s.color}" stroke-width="${d}" stroke-linecap="round" stroke-linejoin="round">${i.innerHTML}</svg>`)}return o}function d$(e){const t=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!Fn(o))continue;const i=getComputedStyle(o),a=i.stroke,l=parseFloat(i.strokeWidth)||1.5,r=i.fill&&i.fill!=="none"?i.fill:"none",s=o.tagName.toLowerCase(),c=d=>Ro(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="${l}" stroke-linecap="round" />`):s==="circle"?t.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${l}" />`):s==="path"&&t.push(`<path d="${o.getAttribute("d")}" fill="${r}" stroke="${a}" stroke-width="${l}" stroke-linejoin="round" />`)}return t}function Ru(e,t,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===t||a.closest(Pl)||!Fn(a))continue;const l=getComputedStyle(a),r=parseFloat(l.borderTopWidth);if(!r)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:l.borderTopColor,strokeWidth:r})}return i}function Vo(e,t){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=t(o.left,o.top),l=t(o.right,o.bottom),r=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:l.x-a.x,h:l.y-a.y,fill:i.backgroundColor,stroke:i.borderTopColor,strokeWidth:parseFloat(i.borderTopWidth)||void 0,strokeDasharray:r?"6 4":void 0,radius:s}}function zl(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 u$(e){const t=e.vueFlowRef.value;if(!t)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(m,h)=>e.screenToFlowCoordinate({x:m,y:h}),i=[],a=[],l=[],r=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const m of e.nodes.value){const h=t.querySelector(`.vue-flow__node[data-id="${CSS.escape(m.id)}"]`);if(!h||!Fn(h))continue;const b=h.firstElementChild;if(b)if(m.type==="group"){const g=Vo(b,o);zl(s,g),i.push({...g,texts:[]});const _=b.querySelector(".em-group__label");_&&i.push({...Vo(_,o),stroke:"none",texts:[]}),i.push({...g,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ea(b,o)})}else if(m.type==="note"){const g={...Vo(b,o),texts:ea(b,o),lines:Ru(b,b,o)};zl(s,g),l.push(g)}else{const g=Vo(b,o);zl(s,g);const _=g.radius??{tl:0,tr:0};a.push({...g,stroke:"none",texts:[]});const N=b.querySelector(".em-entity__header");if(N){const y=Vo(N,o);a.push({x:g.x,y:g.y,w:g.w,h:y.y+y.h-g.y,fill:y.fill,stroke:"none",radius:{tl:_.tl,tr:_.tr,br:0,bl:0},texts:[]})}a.push({...g,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ea(b,o),lines:Ru(b,b,o),icons:c$(b,o)}),a.push({...g,fill:"none",texts:[]})}}for(const m of t.querySelectorAll(".vue-flow__edge")){const h=m.querySelector("path.em-edge__path, path.em-note-edge__path");if(!h||!Fn(h))continue;const b=h.getAttribute("d");if(!b)continue;const g=getComputedStyle(h),_=g.strokeDasharray,N=d$(m);r.push({d:b,stroke:g.stroke,strokeWidth:parseFloat(g.strokeWidth)||1.5,strokeDasharray:_&&_!=="none"?_:void 0,labels:ea(m,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:r,entities:a,notes:l}}function Vu(e){return Zl(u$(e))}function Au(e,t="diagram.svg"){const o=Vu(e),i=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(i);try{const l=document.createElement("a");l.href=a,l.download=t,document.body.appendChild(l),l.click(),l.remove()}finally{URL.revokeObjectURL(a)}}const Ul="nc:",Tu=Le(n.defineComponent({__name:"DiagramCanvas",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ae.useModal(),l=n.ref(!1),r=n.ref(!1),s={x:0,y:0};function c(S){s.x=S.clientX,s.y=S.clientY}const d=n.ref(null);n.provide(Mi,d);const u=n.ref(null);n.provide(wd,u);const f=n.ref(null),p=n.computed(()=>{const S=f.value,D=new Set;if(!S)return D;if(S.kind==="entity")D.add(S.id);else if(S.kind==="group"){const I=i.resolved.value.groups.find(L=>L.group.modelId===S.id);for(const L of(I==null?void 0:I.group.memberEntityRefs)??[])D.add(L)}return D}),m=n.computed(()=>{const S=f.value,D=new Set(p.value),I=new Set,L=new Set;if(!S)return{related:D,edges:I,notes:L};if(S.kind==="note"){L.add(S.id);for(const ue of i.resolved.value.noteConnections)ue.noteRef===S.id&&D.add(ue.targetRef);return{related:D,edges:I,notes:L}}const ie=p.value;if(!ie.size)return{related:D,edges:I,notes:L};for(const ue of i.resolved.value.associations){const{end1:fe,end2:A}=ue.association;(ie.has(fe.entityRef)||ie.has(A.entityRef))&&(I.add(ue.association.modelId),D.add(fe.entityRef),D.add(A.entityRef))}for(const ue of i.resolved.value.noteConnections)D.has(ue.targetRef)&&L.add(ue.noteRef);return{related:D,edges:I,notes:L}});n.provide(Pn,{source:f,active:n.computed(()=>f.value!==null),primaryEntityIds:p,relatedEntityIds:n.computed(()=>m.value.related),relatedEdgeIds:n.computed(()=>m.value.edges),relatedNoteIds:n.computed(()=>m.value.notes),hoverGroupId:n.computed(()=>{var S;return((S=f.value)==null?void 0:S.kind)==="group"?f.value.id:null}),setEntityHover:S=>{u.value||r.value||(f.value=S?{kind:"entity",id:S}:null)},setGroupHover:S=>{u.value||r.value||(f.value=S?{kind:"group",id:S}:null)},setNoteHover:S=>{u.value||r.value||(f.value=S?{kind:"note",id:S}:null)}}),n.provide(hn,i);function h(S,D){return`${Ul}${S}:${D}`}function b(S){if(!S.startsWith(Ul))return null;const[D,I]=S.slice(Ul.length).split(":");return D&&I?{noteRef:D,targetRef:I}:null}n.provide(bl,{points:S=>{var I,L;const D=b(S);return D?((I=i.resolved.value.noteConnections.find(ie=>ie.noteRef===D.noteRef&&ie.targetRef===D.targetRef))==null?void 0:I.waypoints)??[]:((L=i.resolved.value.associations.find(ie=>ie.association.modelId===S))==null?void 0:L.waypoints)??[]},movePoint:(S,D,I)=>{const L=b(S);L?i.moveNoteConnectionWaypoint(L.noteRef,L.targetRef,D,I):i.moveWaypoint(S,D,I)},insertPoint:(S,D,I)=>{const L=b(S);L?i.addNoteConnectionWaypoint(L.noteRef,L.targetRef,D,I):i.addWaypoint(S,D,I)},removePoint:(S,D)=>{const I=b(S);I?i.removeNoteConnectionWaypoint(I.noteRef,I.targetRef,D):i.removeWaypoint(S,D)}});const g=De(),{nodes:_,edges:N,findNode:y,findEdge:$,addNodes:K,addEdges:F,removeNodes:q,removeEdges:G,fitView:X,setCenter:Q,getViewport:de,screenToFlowCoordinate:B,getSelectedNodes:ee,updateNodeInternals:v}=g,R=n.ref(!1);async function E(){R.value=!0,await n.nextTick(),await new Promise(S=>requestAnimationFrame(()=>S(null)));try{Au(g)}finally{R.value=!1}}t({exportSvg:E});function P(){const S=de(),{width:D,height:I}=g.dimensions.value;return{x:(D/2-S.x)/S.zoom,y:(I/2-S.y)/S.zoom}}function W(){const S=P();i.addEntity("NewEntity",{x:S.x,y:S.y})}function oe(){const S=P();i.addNote("메모",{x:S.x,y:S.y})}function T(S){for(const D of i.resolved.value.groups){const{location:I,size:L}=D.geo;if(S.x>=I.x&&S.x<=I.x+L.width&&S.y>=I.y&&S.y<=I.y+L.height)return D.group.modelId}return null}function J(){const S=i.resolved.value,D=new Map(S.groups.map(fe=>[fe.group.modelId,fe.geo])),I=new Set(S.groups.map(fe=>fe.group.modelId)),L=new Set([...I,...S.entities.map(fe=>fe.entity.modelId),...S.notes.map(fe=>fe.note.modelId)]);for(const fe of[..._.value])L.has(fe.id)||q([fe.id]);for(const fe of S.groups){const A=fe.group.modelId,Z={width:`${fe.geo.size.width}px`,height:`${fe.geo.size.height}px`},z={group:fe.group,style:fe.style,locked:fe.locked},ce=fe.locked?!1:void 0,Ae=y(A);Ae?(Ae.position={...fe.geo.location},Ae.data=z,Ae.style=Z,Ae.draggable=ce):K([{id:A,type:"group",position:{...fe.geo.location},draggable:ce,style:Z,data:z}])}for(const fe of S.entities){const A=fe.entity.modelId,Z=fe.groupRef&&I.has(fe.groupRef)?fe.groupRef:void 0,z={entity:fe.entity,displayMode:i.displayMode.value,collapsed:fe.collapsed,locked:fe.locked,groupRef:Z,size:fe.geo.size,style:fe.style,attributeStyles:fe.attributeStyles,operationStyles:fe.operationStyles},ce=fe.locked?!1:void 0,Ae=Z?D.get(Z):void 0,Ue=Ae?{x:fe.geo.location.x-Ae.location.x,y:fe.geo.location.y-Ae.location.y}:{...fe.geo.location},Oe=y(A);Oe?(Oe.position=Ue,Oe.data=z,Oe.parentNode=Z,Oe.draggable=ce):K([{id:A,type:"entity",position:Ue,parentNode:Z,draggable:ce,data:z}])}for(const fe of S.notes){const A=fe.note,Z=A.modelId,z=fe.groupRef&&I.has(fe.groupRef)?fe.groupRef:void 0,ce={note:A,groupRef:z},Ae={width:`${A.geo.size.width}px`,height:`${A.geo.size.height}px`},Ue=z?D.get(z):void 0,Oe=Ue?{x:A.geo.location.x-Ue.location.x,y:A.geo.location.y-Ue.location.y}:{...A.geo.location},Me=y(Z);Me?(Me.position=Oe,Me.data=ce,Me.style=Ae,Me.parentNode=z):K([{id:Z,type:"note",position:Oe,parentNode:z,style:Ae,data:ce}])}const ie=new Map(S.associations.map(fe=>[fe.association.modelId,fe])),ue=new Set(S.noteConnections.map(fe=>h(fe.noteRef,fe.targetRef)));for(const fe of[...N.value])!ie.has(fe.id)&&!ue.has(fe.id)&&G([fe.id]);for(const[fe,A]of ie){const Z={id:fe,type:"association",source:A.association.end1.entityRef,target:A.association.end2.entityRef,sourceHandle:A.sourceColumnRef?`r:${A.sourceColumnRef}`:void 0,targetHandle:A.targetColumnRef?`l:${A.targetColumnRef}`:void 0,data:{association:A.association,sourceColumnRef:A.sourceColumnRef,targetColumnRef:A.targetColumnRef}},z=$(fe);z?(z.data=Z.data,z.sourceHandle=Z.sourceHandle,z.targetHandle=Z.targetHandle):F([Z])}for(const fe of S.noteConnections){const A=h(fe.noteRef,fe.targetRef),Z={noteRef:fe.noteRef,targetRef:fe.targetRef},z=$(A);z?z.data=Z:F([{id:A,type:"note-connection",source:fe.noteRef,target:fe.targetRef,data:Z}])}se()}function se(){n.nextTick(()=>requestAnimationFrame(()=>v()))}function he(){const S=ee.value.map(I=>I.id);if(S.length)return S;const D=i.selection.value;return D&&(D.kind==="entity"||D.kind==="note"||D.kind==="group")?[D.id]:[]}function we(S){var ie;const D=S.target;if(D&&(D.tagName==="INPUT"||D.tagName==="TEXTAREA"||D.isContentEditable))return;if(!i.editable.value){(S.metaKey||S.ctrlKey)&&S.key.toLowerCase()==="c"&&(i.copy(),S.preventDefault());return}if(S.key==="Delete"||S.key==="Backspace"){i.deleteSelection()&&S.preventDefault();return}if(S.key==="ArrowUp"||S.key==="ArrowDown"||S.key==="ArrowLeft"||S.key==="ArrowRight"){if(((ie=i.selection.value)==null?void 0:ie.kind)==="attribute"){if(S.key==="ArrowUp"||S.key==="ArrowDown"){const Z=S.key==="ArrowDown"?1:-1;(S.altKey?i.nudgeSelectedAttributes(Z):i.moveAttributeFocus(Z))&&S.preventDefault()}return}const ue=S.shiftKey?10:1,fe=S.key==="ArrowLeft"?-ue:S.key==="ArrowRight"?ue:0,A=S.key==="ArrowUp"?-ue:S.key==="ArrowDown"?ue:0;i.nudgeNodes(he(),fe,A)&&S.preventDefault();return}if(!(S.metaKey||S.ctrlKey))return;const L=S.key.toLowerCase();L==="c"?(i.copy(),S.preventDefault()):L==="v"?(i.paste(),S.preventDefault()):L==="z"&&(S.shiftKey?i.redo():i.undo(),S.preventDefault())}n.onMounted(async()=>{J(),await n.nextTick(),X(),window.addEventListener("keydown",we),window.addEventListener("pointerup",re),window.addEventListener("pointermove",c,{passive:!0})}),n.onBeforeUnmount(()=>{window.removeEventListener("keydown",we),window.removeEventListener("pointerup",re),window.removeEventListener("pointermove",c)});function re(){d.value=null}function me(){r.value=!0,f.value=null}function be(){var L;r.value=!1;const S=(L=document.elementFromPoint(s.x,s.y))==null?void 0:L.closest(".vue-flow__node"),D=S==null?void 0:S.dataset.id;if(!D){f.value=null;return}const I=S.classList.contains("vue-flow__node-group")?"group":S.classList.contains("vue-flow__node-note")?"note":"entity";f.value={kind:I,id:D}}n.watch([()=>i.resolved.value,()=>i.displayMode.value],J),n.watch(()=>i.revision.value,se),n.watch(()=>i.resolved.value,S=>{const D=f.value;if(!D)return;(D.kind==="entity"?S.entities.some(L=>L.entity.modelId===D.id):D.kind==="group"?S.groups.some(L=>L.group.modelId===D.id):S.notes.some(L=>L.note.modelId===D.id))||(f.value=null)});function xe(S){const D=S.computedPosition??S.position,I=S.dimensions??{width:0,height:0};return{x:D.x+I.width/2,y:D.y+I.height/2}}function Ce(S){const D=S.node;if(D){if(f.value=null,D.type==="group"){const I=i.resolved.value.groups.find(L=>L.group.modelId===D.id);u.value=I?{groupId:D.id,dx:D.position.x-I.geo.location.x,dy:D.position.y-I.geo.location.y}:null,d.value=null;return}if(D.type!=="entity"&&D.type!=="note"){d.value=null;return}d.value=T(xe(D))}}function Se(S){var L;d.value=null,u.value=null;const D=(L=S.nodes)!=null&&L.length?S.nodes:[S.node],I=D.filter(ie=>(ie==null?void 0:ie.type)==="group");if(I.length){for(const ie of I){if(!ie)continue;const ue=i.resolved.value.entities.filter(fe=>fe.groupRef===ie.id).map(fe=>{const A=y(fe.entity.modelId),Z=(A==null?void 0:A.computedPosition)??(A==null?void 0:A.position)??{x:0,y:0};return{id:fe.entity.modelId,location:{x:Z.x,y:Z.y}}});i.dragGroup(ie.id,{x:ie.position.x,y:ie.position.y},ue)}return}for(const ie of D){if(!ie||ie.type==="group")continue;const ue=ie.computedPosition??ie.position,fe=ie.dimensions??{width:0,height:0},A={x:ue.x+fe.width/2,y:ue.y+fe.height/2};ie.type==="note"?i.dropNote(ie.id,{x:ue.x,y:ue.y},T(A)):i.dropEntity(ie.id,{x:ue.x,y:ue.y},T(A))}}function ye(S){var Z,z,ce,Ae,Ue;if(!i.editable.value||!S.source||!S.target)return;const D=((Z=y(S.source))==null?void 0:Z.type)==="note",I=((z=y(S.target))==null?void 0:z.type)==="note";if(D||I){if(D&&I)return;const Oe=D?S.source:S.target,Me=D?S.target:S.source;((ce=y(Me))==null?void 0:ce.type)==="entity"&&i.addNoteConnection(Oe,Me);return}const L=Oe=>{var Me;return(Me=i.state.logical.entities.find(st=>st.modelId===Oe))==null?void 0:Me.stereotype},ie=L(S.source)==="JPA_EMBEDDABLE",ue=L(S.target)==="JPA_EMBEDDABLE";if(ie||ue){if(ie&&ue)return;const Oe=ie?S.source:S.target,Me=ie?S.target:S.source;i.addEmbedAssociation(Me,Oe);return}const fe=(Ae=S.sourceHandle)!=null&&Ae.startsWith("r:")?S.sourceHandle.slice(2):void 0,A=(Ue=S.targetHandle)!=null&&Ue.startsWith("l:")?S.targetHandle.slice(2):void 0;i.addAssociation(S.source,S.target,fe,A)}const Y=n.ref(null);function C(S,D){var L;const I=i.state.layout.entityLayouts.find(ie=>ie.entityRef===S);return Qe((L=I==null?void 0:I.attributeStyles)==null?void 0:L[D])}function k(S,D){var L;const I=i.state.layout.entityLayouts.find(ie=>ie.entityRef===S);return Qe((L=I==null?void 0:I.operationStyles)==null?void 0:L[D])}function V(S){var D;return Qe((D=i.state.layout.groupLayouts.find(I=>I.groupRef===S))==null?void 0:D.style)}function H(S){var D;return Qe((D=i.state.layout.notes.find(I=>I.modelId===S))==null?void 0:D.style)}function te(S){var L,ie;if(S.preventDefault(),!i.editable.value)return;const D=()=>B({x:S.clientX,y:S.clientY}),I=[{caption:"엔티티 추가",icon:"add-entity",handler:()=>{const ue=D();i.addEntity("NewEntity",{x:ue.x,y:ue.y})}},{caption:"노트 추가",icon:"note",handler:()=>{const ue=D();i.addNote("메모",{x:ue.x,y:ue.y})}},{caption:"그룹 추가",icon:"folder",handler:()=>{const ue=D();i.addEmptyGroup({x:ue.x,y:ue.y})}}];((L=i.clipboard.value)==null?void 0:L.kind)==="entity"&&I.push({caption:"붙여넣기",icon:"clipboard",handler:()=>i.paste()}),i.resolved.value.entities.length>0&&I.push({type:"separator"},{caption:"모두 접기",icon:"collapse-all",handler:()=>i.collapseAll()},{caption:"모두 펼치기",icon:"expand-all",handler:()=>i.expandAll()}),(ie=Y.value)==null||ie.open(S,I)}function ne({event:S,node:D}){var Z,z,ce,Ae,Ue,Oe,Me,st,Xt,jt,Zt,Xe,Ao,ke,je,To,Mo,Bo;const I=S;if(I.preventDefault(),!i.editable.value){if(D.type==="group"||D.type==="note")return;const Be=(z=(Z=I.target)==null?void 0:Z.closest("[data-attr]"))==null?void 0:z.dataset.attr;if(Be){const He=i.selection.value;(He==null?void 0:He.kind)==="attribute"&&He.entityId===D.id&&He.ids.includes(Be)||i.selectAttribute(D.id,Be);const $t=((ce=i.selection.value)==null?void 0:ce.kind)==="attribute"&&i.selection.value.entityId===D.id?[...i.selection.value.ids]:[Be];(Ae=Y.value)==null||Ae.open(I,[{caption:$t.length>1?`복사 (${$t.length})`:"복사",icon:"copy",handler:()=>i.copy()}]);return}(Ue=Y.value)==null||Ue.open(I,[{caption:"상세 편집…",icon:"pencil",handler:()=>Ai(a,i,D.id)},{caption:"복사",icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:D.id},i.copy()}}]);return}if(D.type==="group"){const Be=i.isGroupLocked(D.id),He=[];Be||He.push({type:"swatches",caption:"색상",current:V(D.id),onPick:We=>i.setGroupSwatch(D.id,We)},{type:"separator"}),He.push({caption:Be?"잠금 해제":"잠금",icon:Be?"unlock":"lock",handler:()=>i.setGroupLocked(D.id,!Be)}),Be||He.push({type:"separator"},{caption:"그룹 해제",icon:"trash",danger:!0,handler:()=>i.removeGroup(D.id)}),(Oe=Y.value)==null||Oe.open(I,He);return}if(D.type==="note"){(Me=Y.value)==null||Me.open(I,[{type:"swatches",caption:"색상",current:H(D.id),onPick:Be=>i.setNoteSwatch(D.id,Be)},{type:"separator"},{caption:"노트 삭제",icon:"trash",danger:!0,handler:()=>i.removeNote(D.id)}]);return}const L=(Xt=(st=I.target)==null?void 0:st.closest("[data-attr]"))==null?void 0:Xt.dataset.attr;if(L){const Be=i.selection.value;(Be==null?void 0:Be.kind)==="attribute"&&Be.entityId===D.id&&Be.ids.includes(L)||i.selectAttribute(D.id,L);const We=((jt=i.selection.value)==null?void 0:jt.kind)==="attribute"&&i.selection.value.entityId===D.id?[...i.selection.value.ids]:[L];if(i.isEntityLocked(D.id)){(Zt=Y.value)==null||Zt.open(I,[{caption:We.length>1?`복사 (${We.length})`:"복사",icon:"copy",handler:()=>i.copy()}]);return}const $t=We.length>1,et=[{caption:"속성 추가",icon:"field",handler:()=>i.addAttribute(D.id)},{type:"swatches",caption:$t?`색상 (${We.length})`:"색상",current:$t?null:C(D.id,L),onPick:QI=>i.setAttributeSwatches(D.id,We,QI)},{type:"separator"},{caption:$t?`복사 (${We.length})`:"복사",icon:"copy",handler:()=>i.copy()}],Do=i.clipboard.value;(Do==null?void 0:Do.kind)==="attribute"&&et.push({caption:Do.attributes.length>1?`속성 붙여넣기 (${Do.attributes.length})`:"속성 붙여넣기",icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:D.id},i.paste()}}),et.push({type:"separator"},{caption:$t?`속성 삭제 (${We.length})`:"속성 삭제",icon:"trash",danger:!0,handler:()=>i.removeAttributes(D.id,We)}),(Xe=Y.value)==null||Xe.open(I,et);return}const ie=(ke=(Ao=I.target)==null?void 0:Ao.closest("[data-op]"))==null?void 0:ke.dataset.op;if(ie){if(i.isEntityLocked(D.id))return;(je=Y.value)==null||je.open(I,[{caption:"오퍼레이션 추가",icon:"method",handler:()=>i.addOperation(D.id)},{type:"swatches",caption:"색상",current:k(D.id,ie),onPick:Be=>i.setOperationSwatch(D.id,ie,Be)},{type:"separator"},{caption:"오퍼레이션 삭제",icon:"trash",danger:!0,handler:()=>i.removeOperation(D.id,ie)}]);return}const ue=i.resolved.value.entities.find(Be=>Be.entity.modelId===D.id),fe=!!(ue!=null&&ue.locked),A=[{caption:fe?"상세 보기…":"상세 편집…",icon:"pencil",handler:()=>Ai(a,i,D.id)}];if(!fe){A.push({type:"separator"},{caption:"속성 추가",icon:"field",handler:()=>i.addAttribute(D.id)},{caption:"메서드 추가",icon:"method",handler:()=>i.addOperation(D.id)},{caption:"그룹으로 묶기",icon:"folder",handler:()=>{const He=ee.value.filter(We=>We.type==="entity").map(We=>We.id);i.createGroup(He.includes(D.id)&&He.length?He:[D.id])}},{caption:"셀프 연관 추가",icon:"arrow-lr",handler:()=>i.addAssociation(D.id,D.id)});const Be=i.embeddableCatalog.value;if(Be.length){A.push({type:"separator"});for(const He of Be){const We=((To=He.label)==null?void 0:To.ko)??((Mo=He.label)==null?void 0:Mo.en)??He.type;A.push({caption:`임베더블 추가: ${We}`,icon:"link",handler:()=>i.addPredefinedEmbed(D.id,He.type)})}}}if(A.push({type:"separator"}),A.push({caption:ue!=null&&ue.collapsed?"펼치기":"접기",icon:ue!=null&&ue.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(D.id,!(ue!=null&&ue.collapsed))}),ue!=null&&ue.groupRef&&!fe&&A.push({caption:"그룹에서 빼기",icon:"folder",handler:()=>i.ungroupEntity(D.id)}),A.push({caption:fe?"잠금 해제":"잠금",icon:fe?"unlock":"lock",handler:()=>i.setEntityLocked(D.id,!fe)}),A.push({caption:"복사",icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:D.id},i.copy()}}),!fe){const Be=i.clipboard.value;(Be==null?void 0:Be.kind)==="attribute"&&A.push({caption:Be.attributes.length>1?`속성 붙여넣기 (${Be.attributes.length})`:"속성 붙여넣기",icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:D.id},i.paste()}}),A.push({type:"separator"}),A.push({caption:"엔티티 삭제",icon:"trash",danger:!0,handler:()=>i.removeEntity(D.id)})}(Bo=Y.value)==null||Bo.open(I,A)}function ge({event:S,edge:D}){var ie,ue;const I=S;if(I.preventDefault(),!i.editable.value)return;const L=b(D.id);if(L){(ie=Y.value)==null||ie.open(I,[{caption:"꺾은선 풀기",icon:"route",handler:()=>i.clearNoteConnectionWaypoints(L.noteRef,L.targetRef)},{type:"separator"},{caption:"연결 삭제",icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(L.noteRef,L.targetRef)}]);return}(ue=Y.value)==null||ue.open(I,[{caption:"꺾은선 풀기",icon:"route",handler:()=>i.clearWaypoints(D.id)},{type:"separator"},{caption:"관계 삭제",icon:"trash",danger:!0,handler:()=>i.removeAssociation(D.id)}])}function ve(S){return S==="group"?"group":S==="note"?"note":"entity"}function Ee({node:S}){if(ee.value.length>1){i.selection.value=null;return}i.selection.value={kind:ve(S.type),id:S.id}}function w({nodes:S}){S.length>1&&(i.selection.value=null)}function x({edge:S}){const D=b(S.id);i.selection.value=D?{kind:"note",id:D.noteRef}:{kind:"association",id:S.id}}function j(S){const D=i.selection.value;return!!D&&D.kind!=="attribute"&&D.id===S.id}function le(S){var D,I;return j(S)?S.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":S.type==="note"?"var(--em-note-soft)":S.type==="group"?fd(Qe((D=S.data)==null?void 0:D.style),!0)??"var(--em-mm-group)":fd(Qe((I=S.data)==null?void 0:I.style))??"var(--em-mm-entity)"}function _e(S){return j(S)?"var(--em-selection)":S.type==="note"?"var(--em-note-accent)":S.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function O(S,D){Q(S,D,{zoom:de().zoom,duration:350})}n.watch(()=>i.focusRequest.value,S=>{if(!S)return;const D=y(S.id);if(!D)return;const I=D.computedPosition??D.position,L=D.dimensions??{width:0,height:0};O(I.x+L.width/2,I.y+L.height/2)});function U({position:S}){O(S.x,S.y)}function M({node:S}){i.selection.value={kind:ve(S.type),id:S.id};const D=S.computedPosition??S.position,I=S.dimensions??{width:0,height:0};O(D.x+I.width/2,D.y+I.height/2)}function pe({node:S}){X({nodes:[S.id],duration:350,maxZoom:1.2,padding:.6})}return(S,D)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-canvas",{"is-connecting":l.value,"is-panning":r.value}])},[n.createVNode(n.unref(T0),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!R.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(At).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:me,onMoveEnd:be,onConnect:ye,onConnectStart:D[1]||(D[1]=I=>l.value=!0),onConnectEnd:D[2]||(D[2]=I=>l.value=!1),onNodeDrag:Ce,onNodeDragStop:Se,onNodeClick:Ee,onEdgeClick:x,onSelectionChange:w,onPaneClick:D[3]||(D[3]=I=>n.unref(i).selection.value=null),onPaneContextMenu:te,onNodeContextMenu:ne,onEdgeContextMenu:ge},{"node-group":n.withCtx(I=>[n.createVNode(kd,n.normalizeProps(n.guardReactiveProps(I)),null,16)]),"node-entity":n.withCtx(I=>[n.createVNode(vd,n.normalizeProps(n.guardReactiveProps(I)),null,16)]),"node-note":n.withCtx(I=>[n.createVNode(Ed,n.normalizeProps(n.guardReactiveProps(I)),null,16)]),"edge-association":n.withCtx(I=>[n.createVNode(Od,n.normalizeProps(n.guardReactiveProps(I)),null,16)]),"edge-note-connection":n.withCtx(I=>[n.createVNode(XN,n.normalizeProps(n.guardReactiveProps(I)),null,16)]),default:n.withCtx(()=>[n.unref(i).showGrid.value?(n.openBlock(),n.createBlock(n.unref(Ow),{key:0,gap:16,"pattern-color":"var(--em-border)"})):n.createCommentVNode("",!0),n.createVNode(n.unref(cv),{"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(yn),{class:"em-palette__group-start",title:"엔티티 추가",onClick:W},{default:n.withCtx(()=>[n.createVNode(Ve,{name:"add-entity",size:14})]),_:1}),n.createVNode(n.unref(yn),{title:"노트 추가",onClick:oe},{default:n.withCtx(()=>[n.createVNode(Ve,{name:"note",size:14})]),_:1}),n.createVNode(n.unref(yn),{title:"자동 배치",onClick:D[0]||(D[0]=I=>n.unref(i).autoLayout())},{default:n.withCtx(()=>[n.createVNode(Ve,{name:"auto-layout",size:14})]),_:1})],64)):n.createCommentVNode("",!0)]),_:1}),n.unref(i).showMinimap.value?(n.openBlock(),n.createBlock(n.unref(YN),{key:1,pannable:"",width:224,height:160,"node-color":le,"node-stroke-color":_e,"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:U,onNodeClick:M,onNodeDblclick:pe})):n.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),n.createVNode(l$,{ref_key:"menuRef",ref:Y},null,512)],2))}}),[["__scopeId","data-v-eaeafa69"]]),f$={class:"em-explorer em-scroll-overlay"},m$={class:"em-explorer__rows"},p$=["data-key","onClick","onDblclick"],h$=["onClick"],y$=["title"],g$={class:"em-key-slot"},b$={class:"em-key-slot"},_$={class:"em-explorer__label"},Mu=Le(n.defineComponent({__name:"DiagramExplorer",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ae.useModal(),l=n.computed(()=>{var v;const _=i.resolved.value,N=i.displayMode.value,y=R=>{var E,P,W;return Oo(N,R.name,(P=(E=R.table)==null?void 0:E.logicalName)==null?void 0:P.ko,(W=R.table)==null?void 0:W.physicalName)},$=N==="PHYSICAL"||N==="LOGICAL_PHYSICAL",K=R=>{const E=R.attrType.startsWith("RELATION")&&R.dbAttrs.length>0;return{icon:R.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:R.identifier,fk:E&&$}}},F=R=>R.attrType.startsWith("EMBED")&&R.dbAttrs.length>0,q=N==="PHYSICAL"||N==="LOGICAL_PHYSICAL",G=R=>{if(R.attrType!=="EMBED_PREDEF")return R.dbAttrs;const E=i.embeddableCatalog.value.find(P=>P.type===R.type);return E?R.dbAttrs.map((P,W)=>{const oe=E.fields[W];return oe?{...P,physicalName:P.physicalName||oe.physicalName,logicalName:P.logicalName??oe.logicalName,dataType:P.dataType||oe.dataType,length:P.length??oe.length}:P}):R.dbAttrs},X=(R,E)=>{var T,J,se;const P={entityId:E,attrId:R.modelId};if(F(R)){const he=fa(N,R);return{key:`attr:${R.modelId}`,label:R.name+(he?` : ${he}`:""),icon:"table",attrRef:P,focusId:E,children:q?G(R).map(we=>{var re;return{key:`attr:${R.modelId}:col:${we.modelId}`,label:Oo(N,we.physicalName,(re=we.logicalName)==null?void 0:re.ko,we.physicalName)+(we.dataType?` : ${we.dataType}`:""),icon:"field",attrRef:P,focusId:E,children:[]}}):[]}}const W=tr(R,i.state.logical.associations),oe=fa(N,R,W);return{key:`attr:${R.modelId}`,label:Oo(N,R.name,(J=(T=R.dbAttrs[0])==null?void 0:T.logicalName)==null?void 0:J.ko,(se=R.dbAttrs[0])==null?void 0:se.physicalName)+(oe?` : ${oe}`:""),...K(R),attrRef:P,focusId:E,children:[]}},Q=R=>{const E=R.entity,P=[...E.attributes].sort((W,oe)=>W.order-oe.order);return{key:`entity:${E.modelId}`,label:y(E),icon:"table",selectKind:"entity",selectId:E.modelId,focusId:E.modelId,children:P.map(W=>X(W,E.modelId))}},de=new Map,B=[];for(const R of _.entities)if(R.groupRef){const E=de.get(R.groupRef)??[];E.push(R),de.set(R.groupRef,E)}else B.push(R);const ee=[];for(const R of _.groups){const E=R.group;ee.push({key:`group:${E.modelId}`,label:((v=E.name)==null?void 0:v.ko)||E.packageName||"(그룹)",icon:"folder",focusId:E.modelId,children:(de.get(E.modelId)??[]).map(Q)})}for(const R of B)ee.push(Q(R));if(_.associations.length){const R=new Map(_.entities.map(E=>[E.entity.modelId,y(E.entity)]));ee.push({key:"section:associations",label:`관계 (${_.associations.length})`,icon:"arrow-lr",children:_.associations.map(E=>{const P=E.association,W=R.get(P.end1.entityRef)??P.end1.entityRef,oe=R.get(P.end2.entityRef)??P.end2.entityRef;return{key:`assoc:${P.modelId}`,label:`${W} — ${oe}`,icon:"arrow-lr",selectKind:"association",selectId:P.modelId,children:[]}})})}return _.notes.length&&ee.push({key:"section:notes",label:`노트 (${_.notes.length})`,icon:"note",children:_.notes.map(({note:R})=>{var E;return{key:`note:${R.modelId}`,label:((E=R.memo.split(`
|
|
41
|
-
`)[0])==null?void 0:E.slice(0,30))||"(빈 노트)",icon:"note",selectKind:"note",selectId:R.modelId,focusId:R.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||"다이어그램",icon:"network",children:ee}});function r(_){return _?_.pk&&_.fk?"PFK (식별 외래키)":_.pk?"PK (기본키)":_.fk?"FK (외래키)":"":""}const s=n.ref(new Set);function c(_){const N=new Set(s.value);N.has(_)?N.delete(_):N.add(_),s.value=N}const d=n.computed(()=>{const _=[],N=(y,$)=>{if(_.push({node:y,depth:$}),!s.value.has(y.key))for(const K of y.children)N(K,$+1)};return N(l.value,0),_}),u=n.computed(()=>{const _=[],N=y=>{if(y.children.length){y.key!=="root"&&_.push(y.key);for(const $ of y.children)N($)}};return N(l.value),_}),f=n.computed(()=>!u.value.some(_=>s.value.has(_)));function p(){s.value=f.value?new Set(u.value):new Set}t({toggleAll:p,allExpanded:f,hasExpandable:n.computed(()=>u.value.length>0)});function m(_){const N=i.selection.value;return _.attrRef?(N==null?void 0:N.kind)==="attribute"&&N.entityId===_.attrRef.entityId&&N.ids.includes(_.attrRef.attrId):!!N&&N.kind!=="attribute"&&!!_.selectId&&_.selectKind===N.kind&&_.selectId===N.id}function h(_){const N=i.selection.value;return _.selectKind==="entity"&&(N==null?void 0:N.kind)==="attribute"&&N.entityId===_.selectId}function b(_,N){if(_.attrRef){const y=N.shiftKey?"range":N.metaKey||N.ctrlKey?"toggle":"replace";i.selectAttribute(_.attrRef.entityId,_.attrRef.attrId,y)}else _.selectKind&&_.selectId&&(i.selection.value={kind:_.selectKind,id:_.selectId});_.focusId&&i.requestFocus(_.focusId)}function g(_){_.selectKind==="entity"&&_.selectId&&Ai(a,i,_.selectId)}return(_,N)=>(n.openBlock(),n.createElementBlock("section",f$,[n.createElementVNode("div",m$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,({node:y,depth:$})=>(n.openBlock(),n.createElementBlock("div",{key:y.key,class:n.normalizeClass(["em-explorer__row",{"is-active":m(y),"is-focus-parent":h(y),"is-selectable":!!y.selectKind||!!y.attrRef||!!y.focusId}]),"data-key":y.key,style:n.normalizeStyle({paddingLeft:4+$*14+"px"}),onClick:K=>b(y,K),onDblclick:K=>g(y)},[n.createElementVNode("span",{class:n.normalizeClass(["em-explorer__chevron",{"is-leaf":!y.children.length,"is-open":!s.value.has(y.key)}]),onClick:n.withModifiers(K=>y.children.length&&c(y.key),["stop"])},[y.children.length?(n.openBlock(),n.createBlock(Ve,{key:0,name:"chevron",size:14})):n.createCommentVNode("",!0)],10,h$),y.keyMarks?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-explorer__keys",title:r(y.keyMarks),"aria-hidden":"true"},[n.createElementVNode("span",g$,[y.keyMarks.pk?(n.openBlock(),n.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-pk"})):y.keyMarks.fk?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Ve,{key:1,class:"em-explorer__icon",name:y.icon,size:14},null,8,["name"]))]),n.createElementVNode("span",b$,[y.keyMarks.fk?(n.openBlock(),n.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,y$)):(n.openBlock(),n.createBlock(Ve,{key:1,class:"em-explorer__icon",name:y.icon,size:15},null,8,["name"])),n.createElementVNode("span",_$,n.toDisplayString(y.label),1)],46,p$))),128))])]))}}),[["__scopeId","data-v-4fcb6509"]]),w$={class:"em-text-preview"},v$={class:"em-text-preview__pre"},k$={class:"em-text-preview__actions"},E$=Le(n.defineComponent({__name:"EntityTextPreview",props:{text:{}},setup(e){const t=e,o=ae.useModalHandle();async function i(){try{await navigator.clipboard.writeText(t.text),ae.showNotification("클립보드에 복사되었습니다.","info")}catch{ae.showNotification("복사에 실패했습니다.","error")}}return(a,l)=>(n.openBlock(),n.createBlock(n.unref(ae.BSModalFrame),{title:"코드생성 입력 (논리 모델 텍스트)"},{default:n.withCtx(()=>[n.createElementVNode("div",w$,[n.createElementVNode("pre",v$,n.toDisplayString(t.text),1),n.createElementVNode("div",k$,[n.createVNode(n.unref(ae.BSButton),{caption:"복사",onClick:i}),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"닫기",onClick:l[0]||(l[0]=r=>n.unref(o).close())})])])]),_:1}))}}),[["__scopeId","data-v-b6e12b4b"]]),N$={class:"em-toolbar"},$$={class:"em-toolbar__mode"},Bu=Le(n.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","toggleHistory"],setup(e,{emit:t}){const i=e.controller,a=t,l=ae.useModal(),r=[{v:"LOGICAL",label:"논리"},{v:"PHYSICAL",label:"물리"},{v:"LOGICAL_PHYSICAL",label:"논리·물리"},{v:"CLASS",label:"클래스"}],s=n.computed({get:()=>i.displayMode.value,set:p=>i.displayMode.value=p});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=n.computed(()=>{const p=i.resolved.value.entities;return p.length>0&&p.every(m=>m.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function f(){l.openModal({component:E$,bind:{text:Xl(i.state.logical)}})}return(p,m)=>(n.openBlock(),n.createElementBlock("div",N$,[n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"실행 취소",disabled:!n.unref(i).canUndo.value||!n.unref(i).editable.value,onClick:m[0]||(m[0]=h=>n.unref(i).undo())},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"undo",size:16})]),_:1},8,["disabled"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"다시 실행",disabled:!n.unref(i).canRedo.value||!n.unref(i).editable.value,onClick:m[1]||(m[1]=h=>n.unref(i).redo())},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"redo",size:16})]),_:1},8,["disabled"]),m[9]||(m[9]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createElementVNode("label",$$,[m[7]||(m[7]=n.createTextVNode(" 표시 ",-1)),n.createVNode(n.unref(ae.BSSelect),{modelValue:s.value,"onUpdate:modelValue":m[2]||(m[2]=h=>s.value=h),items:r,"value-provider":h=>h.v,"label-provider":h=>h.label},null,8,["modelValue","value-provider","label-provider"])]),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:n.unref(i).routingMode.value==="orthogonal"?"직각":"직선",tooltip:"연결선 모드 전환",onClick:c},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"route",size:16})]),_:1},8,["caption"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showGrid.value}]),caption:"그리드",tooltip:n.unref(i).showGrid.value?"그리드 끄기":"그리드 켜기",onClick:m[3]||(m[3]=h=>n.unref(i).showGrid.value=!n.unref(i).showGrid.value)},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"grid",size:16})]),_:1},8,["class","tooltip"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showMinimap.value}]),caption:"미니맵",tooltip:n.unref(i).showMinimap.value?"미니맵 끄기":"미니맵 켜기",onClick:m[4]||(m[4]=h=>n.unref(i).showMinimap.value=!n.unref(i).showMinimap.value)},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"map",size:16})]),_:1},8,["class","tooltip"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:d.value?"모두 펼치기":"모두 접기",disabled:!n.unref(i).editable.value,onClick:u},{left:n.withCtx(()=>[n.createVNode(Ve,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),m[10]||(m[10]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"텍스트 보기",onClick:f},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"file-text",size:16})]),_:1}),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"SVG 내보내기",onClick:m[5]||(m[5]=h=>a("exportSvg"))},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"image",size:16})]),_:1}),n.unref(i).historyAvailable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[m[8]||(m[8]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":e.historyOpen}]),caption:"이력",tooltip:e.historyOpen?"변경 이력 닫기":"변경 이력 열기",onClick:m[6]||(m[6]=h=>a("toggleHistory"))},{left:n.withCtx(()=>[n.createVNode(Ve,{name:"undo",size:16})]),_:1},8,["class","tooltip"])],64)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-13589c57"]]),x$=Le(n.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=t;return(i,a)=>(n.openBlock(),n.createBlock(n.unref(ae.BSButton),{variant:"text",class:n.normalizeClass(["em-mode-toggle",{"is-view":!e.editable}]),disabled:!e.opMode,caption:e.editable?"편집 모드":"조회 모드",title:e.opMode?e.editable?"클릭하면 조회 모드로 전환":"클릭하면 편집 모드로 전환":"이 다이어그램은 조회 전용입니다",onClick:a[0]||(a[0]=l=>o("toggle"))},{left:n.withCtx(()=>[n.createVNode(Ve,{name:e.editable?"pencil":"eye",size:14},null,8,["name"])]),_:1},8,["class","disabled","caption","title"]))}}),[["__scopeId","data-v-ae148426"]]),I$=["disabled"],S$={class:"em-panel__sub"},C$={class:"em-nav"},R$={key:0,class:"em-nav__divider","aria-hidden":"true"},V$={key:1},A$=["onClick","onKeydown"],T$={class:"em-nav__name"},M$=["title"],B$={key:0,class:"em-panel__note"},D$=["data-attr-block"],O$={class:"em-attr__row"},L$={key:0,class:"em-attr__row"},P$={class:"em-attr__row"},z$={class:"em-attr__row"},U$={class:"em-attr__flags"},H$={class:"em-attr__pii"},F$={class:"em-attr__pii"},G$={class:"em-attr__pii"},Y$={key:0,class:"em-attr__pii em-attr__codetop"},W$={class:"em-multilang"},K$={key:2,class:"em-embed-cols"},q$={class:"em-embed-col__label"},X$={class:"em-attr__row"},j$={class:"em-attr__row"},Z$={key:0,class:"em-embed-upd"},J$={class:"em-embed-upd"},Q$={class:"em-embed-upd"},ex={class:"em-swatch__row em-attr__swatch"},tx=["onClick"],nx=["title","onClick"],ox={key:0,class:"em-attr__swatch-hint"},ta="__OWN__",ix=Le(n.defineComponent({__name:"EntityColumnsSection",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(A=>A.modelId===t.entityId)??null),a=n.computed(()=>i.value?o.state.layout.entityLayouts.find(A=>A.entityRef===i.value.modelId)??null:null),l=n.computed(()=>{var A;return((A=i.value)==null?void 0:A.stereotype)==="JPA_EMBEDDABLE"}),r=n.computed(()=>new Set(o.selectedAttrIds.value)),s=n.computed(()=>{var A;return((A=i.value)==null?void 0:A.attributes.filter(Z=>Z.attrType!=="DIVIDER"))??[]}),c=n.computed(()=>{var A;return((A=i.value)==null?void 0:A.attributes)??[]}),d=n.computed(()=>s.value.filter(A=>r.value.has(A.modelId)));function u(A){return{pk:A.identifier,fk:A.attrType.startsWith("RELATION")&&A.dbAttrs.length>0,required:A.notNull&&!A.identifier}}function f(A){const Z=u(A),z=[Z.pk&&"PK",Z.fk&&"FK",Z.required&&"NOT NULL"].filter(Boolean);return z.length?z.join(" · "):void 0}function p(A,Z){i.value&&o.selectAttribute(i.value.modelId,A.modelId,Z.shiftKey?"range":Z.metaKey||Z.ctrlKey?"toggle":"replace")}const m=["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 h(A){return A==="none"?"(없음)":A}const b=A=>A;function g(A){var Z,z;return Qe((z=(Z=a.value)==null?void 0:Z.attributeStyles)==null?void 0:z[A.modelId])}function _(A){return r.value.size>1&&r.value.has(A.modelId)}function N(A,Z){if(!i.value)return;const z=_(A)?o.selectedAttrIds.value:[A.modelId];o.setAttributeSwatches(i.value.modelId,z,Z)}function y(A,Z){i.value&&o.updateAttribute(i.value.modelId,A.modelId,Z)}function $(A,Z){y(A,{naturalId:Z||void 0,naturalIdMutable:Z?A.naturalIdMutable:void 0})}function K(){return{naturalId:void 0,naturalIdMutable:void 0}}function F(A,Z){y(A,{identifier:Z,...Z?K():{}})}function q(A,Z){y(A,{transient:Z||void 0,...Z?K():{}})}function G(A){return!!A.transient}const X=A=>A.value,Q=A=>A.label;function de(A,Z){if(!Z)return;const z=oe.value.find(ce=>ce.type===Z);if(z){const ce=A.dbAttrs[0]??{modelId:A.modelId+".c",physicalName:A.name,dataType:"VARCHAR"};y(A,{type:Z,customType:void 0,dbAttrs:[{...ce,dataType:z.dataType,length:z.length,scale:z.scale}]});return}y(A,Z===Ot?{type:Z}:{type:Z,customType:void 0})}function B(A,Z){y(A,{customType:Z.trim()===""?void 0:Z})}function ee(A,Z){const ce={...A.dbAttrs[0]??{modelId:A.modelId+".c",physicalName:A.name,dataType:"VARCHAR"},...Z};Z.dataType!==void 0&&!Lo.has(ce.dataType)&&(ce.scale=void 0),y(A,{dbAttrs:[ce]})}function v(A){var Z;return Lo.has(((Z=A.dbAttrs[0])==null?void 0:Z.dataType)??"")}function R(A,Z,z){var ce;ee(A,{logicalName:{...(ce=A.dbAttrs[0])==null?void 0:ce.logicalName,[Z]:z}})}function E(A,Z){y(A,{description:Object.keys(Z).length?Z:void 0})}function P(A){return A.personalInfoAttributeType??"none"}function W(A,Z){y(A,{personalInfoAttributeType:Z==="none"?void 0:Z})}const oe=n.computed(()=>o.predefinedCustomTypeCatalog.value),T=n.computed(()=>o.embeddableCatalog.value),J=n.ref(void 0);function se(A){var Z,z;return((Z=A.label)==null?void 0:Z.ko)??((z=A.label)==null?void 0:z.en)??A.type}function he(A){if(!A||!i.value)return;const Z=o.addPredefinedEmbed(i.value.modelId,A);Z&&o.selectAttribute(i.value.modelId,Z),J.value=void 0}function we(){if(!i.value)return;const A=o.addAttribute(i.value.modelId);o.selectAttribute(i.value.modelId,A)}const re=n.computed(()=>o.groupCodeCatalog.value);function me(A){var Z;return((Z=re.value.find(z=>z.groupCode===A.groupCode))==null?void 0:Z.codes)??[]}function be(A){return["none",...me(A)]}function xe(A){return A==="none"?"none":A.code}function Ce(A){var z,ce;if(A==="none")return"(없음)";const Z=((z=A.label)==null?void 0:z.ko)??((ce=A.label)==null?void 0:ce.en);return Z?`${A.code} (${Z})`:A.code}function Se(A,Z){i.value&&o.setAttributeGroupCode(i.value.modelId,A.modelId,Z)}function ye(A,Z){y(A,{defaultValue:Z==="none"?void 0:Z})}function Y(A,Z){y(A,{defaultValue:Z.trim()===""?void 0:Z})}function C(A){return A.attrType.startsWith("EMBED")&&A.dbAttrs.length>0}function k(A,Z,z){const ce=A.dbAttrs.map((Ae,Ue)=>{if(Ue!==Z)return Ae;const Oe={...Ae,...z};for(const Me of Object.keys(z))z[Me]===void 0&&delete Oe[Me];return Oe});i.value&&o.setEmbedColumns(i.value.modelId,A.modelId,ce)}function V(A,Z,z,ce){var Ae;k(A,Z,{logicalName:{...(Ae=A.dbAttrs[Z])==null?void 0:Ae.logicalName,[z]:ce}})}function H(A,Z){var Ae,Ue,Oe;if(A.attrType==="EMBED_PREDEF"){const Me=(Ae=o.embeddableCatalog.value.find(st=>st.type===A.type))==null?void 0:Ae.fields[Z];return Me?{name:Me.name,physicalName:Me.physicalName,dataType:Me.dataType,length:Me.length,shareable:Me.shareable,logicalName:Me.logicalName}:void 0}const z=(Ue=A.embedded)==null?void 0:Ue.embeddableRef;if(!z)return;const ce=(Oe=o.state.logical.entities.find(Me=>Me.modelId===z))==null?void 0:Oe.attributes.flatMap(Me=>Me.dbAttrs)[Z];return ce?{physicalName:ce.physicalName,dataType:ce.dataType,length:ce.length,scale:ce.scale,logicalName:ce.logicalName}:void 0}function te(A,Z){var z,ce;return((z=H(A,Z))==null?void 0:z.dataType)||((ce=A.dbAttrs[Z])==null?void 0:ce.dataType)||""}function ne(A,Z){var z,ce;return((z=H(A,Z))==null?void 0:z.length)??((ce=A.dbAttrs[Z])==null?void 0:ce.length)}function ge(A,Z){var z,ce;return((z=H(A,Z))==null?void 0:z.scale)??((ce=A.dbAttrs[Z])==null?void 0:ce.scale)}const ve=["inherit","true","false"];function Ee(A){return A==="inherit"?"기본(따름)":A}function w(A){return(A==null?void 0:A.updatable)===void 0?"inherit":A.updatable?"true":"false"}function x(A,Z,z){k(A,Z,{updatable:z==="inherit"?void 0:z==="true"})}function j(A,Z){ee(A,{updatable:Z==="inherit"?void 0:Z==="true"})}const le=["inherit","true","false"];function _e(A){return A==="inherit"?"기본(따름)":A}function O(A){return(A==null?void 0:A.insertable)===void 0?"inherit":A.insertable?"true":"false"}function U(A,Z,z){k(A,Z,{insertable:z==="inherit"?void 0:z==="true"})}function M(A,Z){ee(A,{insertable:Z==="inherit"?void 0:Z==="true"})}const pe=n.computed(()=>{var A;return Wn(((A=i.value)==null?void 0:A.attributes.flatMap(Z=>Z.dbAttrs))??[])}),S=n.computed(()=>{var A;return(((A=i.value)==null?void 0:A.attributes)??[]).filter(Z=>Z.attrType==="NORMAL"&&Z.dbAttrs.length===1&&Z.dbAttrs[0]).map(Z=>({modelId:Z.dbAttrs[0].modelId,label:Z.dbAttrs[0].physicalName||Z.name}))});function D(){return[ta,...S.value.map(A=>A.modelId)]}function I(A){if(A===ta)return"전용 컬럼(OWN)";const Z=S.value.find(z=>z.modelId===A);return Z?`↗ ${Z.label} (공유)`:A}function L(A){return(A==null?void 0:A.sharedColumnRef)??ta}function ie(A,Z,z){k(A,Z,{sharedColumnRef:z===ta?void 0:z})}function ue(A){return(A==null?void 0:A.sharedColumnRef)!=null}function fe(A){var Z;return((Z=Po(A,pe.value))==null?void 0:Z.physicalName)??""}return(A,Z)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(o).editable.value},[n.createElementVNode("h4",S$,[n.createTextVNode("속성 ("+n.toDisplayString(s.value.length)+") ",1),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:we}),T.value.length?(n.openBlock(),n.createBlock(n.unref(ae.BSSelect),{key:0,width:"120px",placeholder:"임베더블 추가","model-value":J.value,items:T.value,"value-provider":z=>z.type,"label-provider":se,"onUpdate:modelValue":he},null,8,["model-value","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",C$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,z=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:z.modelId},[z.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("li",R$,[...Z[0]||(Z[0]=[n.createElementVNode("hr",null,null,-1)])])):(n.openBlock(),n.createElementBlock("li",V$,[n.createElementVNode("div",{class:n.normalizeClass(["em-nav__item",{"is-selected":r.value.has(z.modelId)}]),role:"button",tabindex:"0",onClick:ce=>p(z,ce),onKeydown:[n.withKeys(n.withModifiers(ce=>p(z,ce),["prevent"]),["enter"]),n.withKeys(n.withModifiers(ce=>p(z,ce),["prevent"]),["space"])]},[n.createElementVNode("span",T$,n.toDisplayString(z.name||"(이름 없음)"),1),n.createElementVNode("span",{class:"em-nav__marks",title:f(z)},[u(z).pk?(n.openBlock(),n.createBlock(Ve,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):u(z).required?(n.openBlock(),n.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):n.createCommentVNode("",!0),u(z).fk?(n.openBlock(),n.createBlock(Ve,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):n.createCommentVNode("",!0)],8,M$)],42,A$)]))],64))),128))]),s.value.length&&!d.value.length?(n.openBlock(),n.createElementBlock("p",B$," 위 목록에서 속성을 선택하면 편집 폼이 표시됩니다. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,z=>{var ce,Ae,Ue,Oe,Me,st,Xt,jt,Zt,Xe,Ao;return n.openBlock(),n.createElementBlock("div",{key:z.modelId,class:n.normalizeClass(["em-attr",{"is-focused":r.value.has(z.modelId)}]),"data-attr-block":z.modelId},[n.createElementVNode("div",O$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`attr-name-${z.modelId}`,width:"100%",placeholder:"이름","model-value":z.name,"onUpdate:modelValue":ke=>y(z,{name:ke})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSSelect),{name:`attr-type-${z.modelId}`,width:"84px",placeholder:"타입",disabled:z.attrType.startsWith("EMBED")||!!z.groupCode,items:n.unref(er)(z.type,oe.value),"value-provider":X,"label-provider":Q,"model-value":z.type,"onUpdate:modelValue":ke=>de(z,ke)},null,8,["name","disabled","items","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ke=>n.unref(o).removeAttribute(i.value.modelId,z.modelId)},null,8,["onClick"])]),z.type===n.unref(Ot)?(n.openBlock(),n.createElementBlock("div",L$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`attr-customtype-${z.modelId}`,width:"100%",placeholder:"커스텀 타입명","model-value":z.customType??"","onUpdate:modelValue":ke=>B(z,ke)},null,8,["name","model-value","onUpdate:modelValue"])])):n.createCommentVNode("",!0),C(z)?(n.openBlock(),n.createElementBlock("div",K$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.dbAttrs,(ke,je)=>{var To,Mo,Bo,Be,He,We,$t;return n.openBlock(),n.createElementBlock("div",{key:ke.modelId,class:"em-embed-col"},[n.createElementVNode("span",q$,n.toDisplayString(((To=H(z,je))==null?void 0:To.name)??((Mo=H(z,je))==null?void 0:Mo.physicalName)??`컬럼 ${je+1}`),1),n.createElementVNode("div",X$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`embed-col-${ke.modelId}`,width:"100%",disabled:ue(ke),placeholder:((Bo=H(z,je))==null?void 0:Bo.physicalName)??"컬럼","model-value":ue(ke)?fe(ke):ke.physicalName,"onUpdate:modelValue":et=>k(z,je,{physicalName:et})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSTextInput),{name:`embed-dtype-${ke.modelId}`,width:"84px",disabled:"","model-value":te(z,je)},null,8,["name","model-value"]),n.createVNode(n.unref(ae.BSNumberInput),{name:`embed-len-${ke.modelId}`,width:"48px",disabled:"","model-value":ne(z,je)},null,8,["name","model-value"]),n.createVNode(n.unref(ae.BSNumberInput),{name:`embed-scale-${ke.modelId}`,width:"48px",disabled:"","model-value":ge(z,je)},null,8,["name","model-value"])]),n.createVNode(pn,{controller:n.unref(o),"ref-id":ke.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",j$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`embed-logical-${ke.modelId}`,width:"100%",placeholder:((He=(Be=H(z,je))==null?void 0:Be.logicalName)==null?void 0:He.ko)??"논리명","model-value":((We=ke.logicalName)==null?void 0:We.ko)??"","onUpdate:modelValue":et=>V(z,je,"ko",et)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),($t=H(z,je))!=null&&$t.shareable?(n.openBlock(),n.createElementBlock("label",Z$,[Z[7]||(Z[7]=n.createElementVNode("span",null,"통화 컬럼",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"110px","model-value":L(ke),items:D(),"value-provider":b,"label-provider":I,"onUpdate:modelValue":et=>et&&ie(z,je,et)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",J$,[Z[8]||(Z[8]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"110px",disabled:ue(ke),"model-value":ue(ke)?"false":O(ke),items:le,"value-provider":b,"label-provider":_e,"onUpdate:modelValue":et=>et&&U(z,je,et)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",Q$,[Z[9]||(Z[9]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"110px",disabled:ue(ke),"model-value":ue(ke)?"false":w(ke),items:ve,"value-provider":b,"label-provider":Ee,"onUpdate:modelValue":et=>et&&x(z,je,et)},null,8,["disabled","model-value","onUpdate:modelValue"])])])}),128))])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",P$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`attr-logical-${z.modelId}`,width:"100%",placeholder:"논리명","model-value":((Ae=(ce=z.dbAttrs[0])==null?void 0:ce.logicalName)==null?void 0:Ae.ko)??"","onUpdate:modelValue":ke=>R(z,"ko",ke)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("div",z$,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`attr-col-${z.modelId}`,width:"100%",placeholder:"컬럼",disabled:G(z),"model-value":((Ue=z.dbAttrs[0])==null?void 0:Ue.physicalName)??"","onUpdate:modelValue":ke=>ee(z,{physicalName:ke})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSSelect),{name:`attr-dtype-${z.modelId}`,width:"84px",placeholder:"dataType",disabled:G(z),items:n.unref(Jl)(((Oe=z.dbAttrs[0])==null?void 0:Oe.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":b,"label-provider":n.unref(ca),"model-value":((Me=z.dbAttrs[0])==null?void 0:Me.dataType)??"","onUpdate:modelValue":ke=>ke&&ee(z,{dataType:ke})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSNumberInput),{name:`attr-len-${z.modelId}`,width:"48px",placeholder:"len",disabled:G(z),"model-value":(st=z.dbAttrs[0])==null?void 0:st.length,"onUpdate:modelValue":ke=>ee(z,{length:ke||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSNumberInput),{name:`attr-scale-${z.modelId}`,width:"48px",placeholder:"scale",disabled:G(z)||!v(z),"model-value":(Xt=z.dbAttrs[0])==null?void 0:Xt.scale,"onUpdate:modelValue":ke=>ee(z,{scale:ke||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(pn,{controller:n.unref(o),"ref-id":(jt=z.dbAttrs[0])==null?void 0:jt.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",U$,[n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-pk-${z.modelId}`,label:"Primary Key","model-value":z.identifier,disabled:l.value||G(z),"onUpdate:modelValue":ke=>F(z,ke)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-nn-${z.modelId}`,label:"Not Null","model-value":z.notNull,disabled:G(z),"onUpdate:modelValue":ke=>y(z,{notNull:ke})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-uq-${z.modelId}`,label:"Unique","model-value":!!((Zt=z.dbAttrs[0])!=null&&Zt.unique),disabled:G(z),"onUpdate:modelValue":ke=>ee(z,{unique:ke})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-ai-${z.modelId}`,label:"Auto Increment","model-value":!!((Xe=z.dbAttrs[0])!=null&&Xe.autoIncrement),disabled:G(z)||!z.identifier,"onUpdate:modelValue":ke=>ee(z,{autoIncrement:ke})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-tr-${z.modelId}`,label:"@Transient","model-value":!!z.transient,disabled:z.identifier,"onUpdate:modelValue":ke=>q(z,ke)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-nid-${z.modelId}`,label:"@NaturalId","model-value":!!z.naturalId,disabled:z.identifier||G(z),"onUpdate:modelValue":ke=>$(z,ke)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${z.modelId}`,label:"mutable","model-value":!!z.naturalIdMutable,disabled:G(z)||!z.naturalId,"onUpdate:modelValue":ke=>y(z,{naturalIdMutable:ke||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`attr-mv-${z.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ao=z.dbAttrs[0])!=null&&Ao.multiValue),disabled:G(z),"onUpdate:modelValue":ke=>ee(z,{multiValue:ke||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("label",H$,[Z[1]||(Z[1]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"100%",disabled:G(z),"model-value":O(z.dbAttrs[0]),items:le,"value-provider":b,"label-provider":_e,"onUpdate:modelValue":ke=>ke&&M(z,ke)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",F$,[Z[2]||(Z[2]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"100%",disabled:G(z),"model-value":w(z.dbAttrs[0]),items:ve,"value-provider":b,"label-provider":Ee,"onUpdate:modelValue":ke=>ke&&j(z,ke)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",G$,[Z[3]||(Z[3]=n.createElementVNode("span",null,"개인정보",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"100%","model-value":P(z),items:m,"value-provider":b,"label-provider":h,"onUpdate:modelValue":ke=>ke&&W(z,ke)},null,8,["model-value","onUpdate:modelValue"])]),re.value.length?(n.openBlock(),n.createElementBlock("label",Y$,[Z[4]||(Z[4]=n.createElementVNode("span",null,"코드그룹",-1)),n.createVNode(hd,{"model-value":z.groupCode,items:re.value,"onUpdate:modelValue":ke=>Se(z,ke)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",{class:n.normalizeClass(["em-attr__pii",{"em-attr__codetop":!re.value.length}])},[Z[5]||(Z[5]=n.createElementVNode("span",null,"기본값",-1)),me(z).length?(n.openBlock(),n.createBlock(n.unref(ae.BSSelect),{key:0,width:"100%","model-value":z.defaultValue??"none",items:be(z),"value-provider":xe,"label-provider":Ce,"onUpdate:modelValue":ke=>ke&&ye(z,ke)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ae.BSTextInput),{key:1,name:`attr-default-${z.modelId}`,width:"100%",placeholder:"기본값","model-value":z.defaultValue??"","onUpdate:modelValue":ke=>Y(z,ke)},null,8,["name","model-value","onUpdate:modelValue"]))],2),n.createElementVNode("fieldset",W$,[Z[6]||(Z[6]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(pl,{multiline:"",name:`attr-desc-${z.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,"model-value":z.description,"onUpdate:modelValue":ke=>E(z,ke)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),n.createElementVNode("div",ex,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":g(z)===null}]),title:"없음",onClick:ke=>N(z,null)},"∅",10,tx),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),ke=>(n.openBlock(),n.createElementBlock("button",{key:ke,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":g(z)===ke}]),style:n.normalizeStyle({background:n.unref(Dn)(ke)}),title:n.unref(Bn)(ke),onClick:je=>N(z,ke)},null,14,nx))),128)),_(z)?(n.openBlock(),n.createElementBlock("span",ox,"선택 "+n.toDisplayString(r.value.size)+"개 일괄",1)):n.createCommentVNode("",!0)])],10,D$)}),128))],8,I$)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-5b6c4296"]]),ax=["disabled"],lx={class:"em-panel__sub-label"},rx={class:"em-attr__row"},sx={class:"em-field em-idx-params"},cx=["value","onChange"],dx=Le(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,l=n.computed(()=>a.state.logical.entities.find(m=>m.modelId===o.entityId)??null);function r(){var h;if(!l.value)return;const m=l.value.attributes[0];a.addIndex(l.value.modelId,{modelId:Te(),name:`idx_${(((h=l.value.indexes)==null?void 0:h.length)??0)+1}`,unique:!1,columns:m?[{columnRef:m.modelId,descending:!1}]:[]})}function s(m,h){l.value&&a.updateIndex(l.value.modelId,m,h)}function c(m){var b;const h=(b=l.value)==null?void 0:b.attributes[0];h&&s(m.modelId,{columns:[...m.columns,{columnRef:h.modelId,descending:!1}]})}function d(m,h,b){s(m.modelId,{columns:m.columns.map((g,_)=>_===h?{...g,columnRef:b}:g)})}function u(m,h,b){s(m.modelId,{columns:m.columns.map((g,_)=>_===h?{...g,descending:b}:g)})}function f(m,h){s(m.modelId,{columns:m.columns.filter((b,g)=>g!==h)})}function p(m,h){s(m.modelId,{parameters:h.trim()===""?void 0:h})}return(m,h)=>{var b;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:h[0]||(h[0]=g=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",lx,[e.collapsible?(n.openBlock(),n.createBlock(Ve,{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(((b=l.value.indexes)==null?void 0:b.length)??0)+") ",1)]),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:n.withModifiers(r,["stop"])})],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(l.value.indexes??[],g=>(n.openBlock(),n.createElementBlock("div",{key:g.modelId,class:"em-attr"},[n.createElementVNode("div",rx,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`idx-name-${g.modelId}`,width:"100%",placeholder:"인덱스명","model-value":g.name,"onUpdate:modelValue":_=>s(g.modelId,{name:_})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`idx-uq-${g.modelId}`,class:"em-check",label:"UQ","model-value":g.unique,"onUpdate:modelValue":_=>s(g.modelId,{unique:_})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:_=>n.unref(a).removeIndex(l.value.modelId,g.modelId)},null,8,["onClick"])]),n.createVNode(pn,{controller:n.unref(a),"ref-id":g.modelId},null,8,["controller","ref-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.columns,(_,N)=>(n.openBlock(),n.createElementBlock("div",{key:N,class:"em-attr__row"},[n.createVNode(n.unref(ae.BSSelect),{class:"grow","model-value":_.columnRef,items:l.value.attributes,"value-provider":y=>y.modelId,"label-provider":y=>y.name,"onUpdate:modelValue":y=>y&&d(g,N,y)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`idx-${g.modelId}-desc-${N}`,class:"em-check",label:"DESC","model-value":_.descending,"onUpdate:modelValue":y=>u(g,N,y)},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"−",onClick:y=>f(g,N)},null,8,["onClick"])]))),128)),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"컬럼",onClick:_=>c(g)},null,8,["onClick"]),n.createElementVNode("label",sx,[h[1]||(h[1]=n.createElementVNode("span",null,"조건 (partial index)",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:g.parameters??"",rows:"2",placeholder:"예: WHERE status = 'A'",onChange:_=>p(g,_.target.value)},null,40,cx)])]))),128)):n.createCommentVNode("",!0)],8,ax)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-dcc068ac"]]),ux=["disabled"],fx={class:"em-panel__sub-label"},mx={class:"em-attr__row"},px={class:"em-attr__row"},hx={class:"em-multilang"},yx={class:"em-attr__pii"},gx={class:"em-swatch__row em-attr__swatch"},bx=["onClick"],_x=["title","onClick"],wx=Le(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,l=ae.useModal(),r=n.computed(()=>a.state.logical.entities.find(y=>y.modelId===o.entityId)??null),s=n.computed(()=>r.value?a.state.layout.entityLayouts.find(y=>y.entityRef===r.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(y){return y==="none"?"(없음)":y}const f=y=>y;function p(y,$){r.value&&a.updateOperation(r.value.modelId,y.modelId,$)}function m(y,$){p(y,{description:Object.keys($).length?$:void 0})}function h(y){return y.personalInfoAttributeType??"none"}function b(y,$){p(y,{personalInfoAttributeType:$==="none"?void 0:$})}function g(y){var $,K;return Qe((K=($=s.value)==null?void 0:$.operationStyles)==null?void 0:K[y.modelId])}function _(y,$){r.value&&a.setOperationSwatch(r.value.modelId,y.modelId,$)}function N(y){l.openModal({component:yd,bind:{operationName:y.name,sourceCode:y.sourceCode??"",onSave:$=>p(y,{sourceCode:$})}})}return(y,$)=>{var K;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:$[1]||($[1]=F=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",fx,[e.collapsible?(n.openBlock(),n.createBlock(Ve,{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(((K=r.value.operations)==null?void 0:K.length)??0)+") ",1)]),n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:"추가",onClick:$[0]||($[0]=n.withModifiers(F=>n.unref(a).addOperation(r.value.modelId),["stop"]))})],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(r.value.operations??[],F=>(n.openBlock(),n.createElementBlock("div",{key:F.modelId,class:"em-attr"},[n.createElementVNode("div",mx,[n.createVNode(n.unref(ae.BSTextInput),{class:"grow",name:`op-name-${F.modelId}`,width:"100%",placeholder:"오퍼레이션명","model-value":F.name,"onUpdate:modelValue":q=>p(F,{name:q})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSSelect),{width:"96px","model-value":F.visibility??"PACKAGE",items:c,"value-provider":f,"label-provider":f,"onUpdate:modelValue":q=>q&&p(F,{visibility:q})},null,8,["model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:q=>n.unref(a).removeOperation(r.value.modelId,F.modelId)},null,8,["onClick"])]),n.createElementVNode("div",px,[n.createVNode(n.unref(ae.BSButton),{variant:"text",caption:F.sourceCode?"본문 편집 ●":"본문 편집",onClick:q=>N(F)},null,8,["caption","onClick"])]),n.createElementVNode("fieldset",hx,[$[2]||($[2]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(pl,{multiline:"",name:`op-desc-${F.modelId}`,languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":F.description,"onUpdate:modelValue":q=>m(F,q)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",yx,[$[3]||($[3]=n.createElementVNode("span",null,"개인정보",-1)),n.createVNode(n.unref(ae.BSSelect),{width:"100%","model-value":h(F),items:d,"value-provider":f,"label-provider":u,"onUpdate:modelValue":q=>q&&b(F,q)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("div",gx,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":g(F)===null}]),title:"없음",onClick:q=>_(F,null)},"∅",10,bx),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),q=>(n.openBlock(),n.createElementBlock("button",{key:q,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":g(F)===q}]),style:n.normalizeStyle({background:n.unref(Dn)(q)}),title:n.unref(Bn)(q),onClick:G=>_(F,q)},null,14,_x))),128))])]))),128)):n.createCommentVNode("",!0)],8,ux)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-9c684fb9"]]),vx={class:"em-panel__head"},kx={class:"em-panel__head-row"},Ex={class:"em-panel__context"},Nx={key:0,class:"em-panel__lock"},$x=["disabled"],xx={key:0,class:"em-panel__note"},Ix={key:1,class:"em-panel__note"},Sx={key:2,class:"em-jpa"},Cx={class:"em-field"},Rx={class:"em-field"},Vx={key:0,class:"em-field"},Ax={class:"em-panel__sub"},Tx={class:"em-field"},Mx={class:"em-jpa"},Bx={key:0,class:"em-panel__note"},Dx={class:"em-jpa"},Ox={class:"em-field"},Lx={key:0,class:"em-panel__note"},Px={class:"em-field"},zx={class:"em-multilang"},Ux={class:"em-field"},Hx=["value"],Fx={class:"em-field"},Gx={class:"em-swatch"},Yx={class:"em-swatch__row"},Wx=["title","onClick"],Kx={class:"em-panel__note"},qx={class:"em-field"},Xx=["value"],jx={class:"em-swatch"},Zx={class:"em-swatch__row"},Jx=["title","onClick"],Du=Le(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,l=n.computed(()=>a.selection.value),r=n.computed(()=>a.inspectedEntityId.value),s=n.computed(()=>{const Y=r.value;return Y?a.state.logical.entities.find(C=>C.modelId===Y)??null:null}),c=n.computed(()=>{const Y=l.value;if((Y==null?void 0:Y.kind)==="association"){const k=a.state.logical.associations.find(V=>V.modelId===Y.id);return!!k&&(a.isEntityLocked(k.end1.entityRef)||a.isEntityLocked(k.end2.entityRef))}const C=r.value;return!!C&&a.isEntityLocked(C)}),d=n.computed(()=>{var Y;return((Y=a.selectedAttr.value)==null?void 0:Y.attrId)??null}),u=n.computed(()=>new Set(a.selectedAttrIds.value)),f=n.computed(()=>d.value!==null),p=n.ref({});n.watch(f,()=>{p.value={}});function m(Y){return p.value[Y]??f.value}function h(Y){p.value={...p.value,[Y]:!m(Y)}}const b=n.computed(()=>{var k;const Y=s.value;if(!Y)return"엔티티";const C=(k=Y.table)==null?void 0:k.physicalName;return C?`${Y.name} (${C})`:Y.name}),g=n.computed(()=>{const Y=l.value;return(Y==null?void 0:Y.kind)==="association"?a.state.logical.associations.find(C=>C.modelId===Y.id)??null:null}),_=n.computed(()=>{const Y=l.value;return(Y==null?void 0:Y.kind)==="group"?a.state.logical.groups.find(C=>C.modelId===Y.id)??null:null}),N=n.computed(()=>{const Y=l.value;return(Y==null?void 0:Y.kind)==="note"?a.state.layout.notes.find(C=>C.modelId===Y.id)??null:null}),y=n.computed(()=>{var C,k;const Y=(C=_.value)==null?void 0:C.name;return(Y==null?void 0:Y.ko)||(Y==null?void 0:Y.en)||(Y==null?void 0:Y.ja)||(Y==null?void 0:Y.zh)||((k=_.value)==null?void 0:k.packageName)||"그룹"}),$=n.computed(()=>{if(s.value){const Y=u.value.size;if(Y>1)return`엔티티 · ${s.value.name} › 속성 · ${Y}개`;if(d.value){const C=s.value.attributes.find(k=>k.modelId===d.value);return(C==null?void 0:C.attrType)==="DIVIDER"?`엔티티 · ${s.value.name} › 구분선`:`엔티티 · ${s.value.name} › 속성 · ${(C==null?void 0:C.name)??""}`}return`엔티티 · ${s.value.name}`}if(g.value){const Y=C=>{var k;return((k=a.state.logical.entities.find(V=>V.modelId===C))==null?void 0:k.name)??C};return`관계 · ${Y(g.value.end1.entityRef)} — ${Y(g.value.end2.entityRef)}`}return _.value?`그룹 · ${y.value}`:N.value?"노트":"선택된 항목 없음"}),K=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],F=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],q=["LIST","SET"],G=["inherit","LAZY","EAGER"],X=Y=>Y;function Q(Y){return Y==="inherit"?"기본(따름)":Y}const de=n.computed(()=>!!g.value&&g.value.end1.entityRef===g.value.end2.entityRef);function B(Y,C){g.value&&a.updateAssociationEnd(g.value.modelId,Y,C)}function ee(Y){g.value&&!de.value&&a.setAssociationIdentifying(g.value.modelId,Y)}function v(Y){var C,k,V;return!!((V=(k=(C=g.value)==null?void 0:C[Y].jpa)==null?void 0:k.cascadeTypes)!=null&&V.includes("ALL"))}function R(Y,C,k){var te,ne;const V=(te=g.value)==null?void 0:te[Y];if(C==="ALL"&&k){B(Y,{jpa:{...V==null?void 0:V.jpa,cascadeTypes:["ALL"]}});return}const H=new Set(((ne=V==null?void 0:V.jpa)==null?void 0:ne.cascadeTypes)??[]);k?H.add(C):H.delete(C),B(Y,{jpa:{...V==null?void 0:V.jpa,cascadeTypes:[...H]}})}function E(Y,C){var V;const k=(V=g.value)==null?void 0:V[Y];B(Y,{jpa:{...k==null?void 0:k.jpa,...C}})}function P(Y){var C,k;return((k=(C=g.value)==null?void 0:C[Y].jpa)==null?void 0:k.fetchType)??"inherit"}function W(Y,C){E(Y,{fetchType:C==="inherit"?void 0:C})}function oe(Y){var k;const C=(k=g.value)==null?void 0:k[Y==="end1"?"end2":"end1"];return(C==null?void 0:C.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(C==null?void 0:C.multiplicity)==="ONE_OR_MORE_INSTANCES"}const T=n.computed(()=>{const Y=g.value;if(!Y)return null;for(const C of a.state.logical.entities){const k=C.attributes.find(te=>{var ne;return((ne=te.embedded)==null?void 0:ne.associationRef)===Y.modelId&&te.attrType==="EMBED_OWN"});if(!k)continue;const V=Y.end2.entityRef===k.embedded.embeddableRef?"end2":"end1",H=Y[V].jpa;return{which:V,isCollection:Y[V].multiplicity!=="EXACTLY_ONE_INSTANCE",collectionType:(H==null?void 0:H.collectionType)??"LIST",collectionTable:(H==null?void 0:H.collectionTable)??"",orderColumn:(H==null?void 0:H.orderColumn)??""}}return null});function J(Y){g.value&&a.setEmbedCollectionMode(g.value.modelId,Y?"COLLECTION":"SINGLE")}function se(Y){const C=T.value;C&&E(C.which,Y==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function he(Y){const C=T.value;C&&E(C.which,{collectionTable:Y.trim()||void 0})}function we(Y){const C=T.value;C&&E(C.which,{orderColumn:Y.trim()||void 0})}function re(Y){_.value&&a.updateGroup(_.value.modelId,Y)}function me(Y,C){var k;re({name:{...(k=_.value)==null?void 0:k.name,[Y]:C}})}const be=n.computed(()=>{var Y;return _.value?Qe((Y=a.state.layout.groupLayouts.find(C=>C.groupRef===_.value.modelId))==null?void 0:Y.style):null});function xe(Y){_.value&&a.setGroupSwatch(_.value.modelId,Y)}function Ce(Y){N.value&&a.setNoteMemo(N.value.modelId,Y)}const Se=n.computed(()=>{var Y;return Qe((Y=N.value)==null?void 0:Y.style)});function ye(Y){N.value&&a.setNoteSwatch(N.value.modelId,Y)}return(Y,C)=>(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:"너비 조절",onPointerdown:C[0]||(C[0]=(...k)=>e.startResize&&e.startResize(...k))},null,34),n.createElementVNode("header",vx,[n.createElementVNode("div",kx,[C[13]||(C[13]=n.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),n.createElementVNode("button",{type:"button",class:"em-panel__btn",title:"접기",onClick:C[1]||(C[1]=k=>i("collapse"))},[n.createVNode(Ve,{name:"panel-right-close",size:16})])]),n.createElementVNode("p",Ex,n.toDisplayString($.value),1),c.value&&r.value?(n.openBlock(),n.createElementBlock("div",Nx,[n.createVNode(Ve,{name:"lock",size:13}),C[14]||(C[14]=n.createElementVNode("span",null,"편집 잠김 — 이동·수정·삭제 차단",-1)),n.unref(a).editable.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:C[2]||(C[2]=k=>n.unref(a).setEntityLocked(r.value,!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(md,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("basics"),title:b.value,onToggle:C[3]||(C[3]=k=>h("basics"))},null,8,["controller","entity-id","collapsed","title"]),n.createVNode(ix,{controller:n.unref(a),"entity-id":s.value.modelId},null,8,["controller","entity-id"]),n.createVNode(dx,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("index"),onToggle:C[4]||(C[4]=k=>h("index"))},null,8,["controller","entity-id","collapsed"]),n.createVNode(wx,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("ops"),onToggle:C[5]||(C[5]=k=>h("ops"))},null,8,["controller","entity-id","collapsed"])],64)):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(n.unref(ae.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:"identifying (식별 관계)","model-value":!!g.value.identifying,disabled:de.value||!!T.value,"onUpdate:modelValue":ee},null,8,["model-value","disabled"]),de.value?(n.openBlock(),n.createElementBlock("p",xx,"셀프 연관은 식별 관계로 둘 수 없습니다 (비식별 FK 강제).")):T.value?(n.openBlock(),n.createElementBlock("p",Ix,"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 (임베더블은 독립 식별자가 없음).")):n.createCommentVNode("",!0),T.value?(n.openBlock(),n.createElementBlock("fieldset",Sx,[C[18]||(C[18]=n.createElementVNode("legend",null,"임베드",-1)),n.createVNode(n.unref(ae.BSCheckbox),{name:"embed-collection",class:"em-check",label:"컬렉션 (@ElementCollection)","model-value":T.value.isCollection,"onUpdate:modelValue":J},null,8,["model-value"]),T.value.isCollection?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",Cx,[C[15]||(C[15]=n.createElementVNode("span",null,"collectionType",-1)),n.createVNode(n.unref(ae.BSSelect),{"model-value":T.value.collectionType,items:q,"value-provider":X,"label-provider":X,"onUpdate:modelValue":C[6]||(C[6]=k=>k&&se(k))},null,8,["model-value"])]),n.createElementVNode("label",Rx,[C[16]||(C[16]=n.createElementVNode("span",null,"collectionTable",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:"미지정 시 코드젠 폴백","model-value":T.value.collectionTable,"onUpdate:modelValue":he},null,8,["model-value"])]),T.value.collectionType==="LIST"?(n.openBlock(),n.createElementBlock("label",Vx,[C[17]||(C[17]=n.createElementVNode("span",null,"orderColumn",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:"미지정 시 순서 비보존","model-value":T.value.orderColumn,"onUpdate:modelValue":we},null,8,["model-value"])])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),C[19]||(C[19]=n.createElementVNode("p",{class:"em-panel__note"},"카디널리티는 이 토글로 변경됩니다 (임베더블 end 다중성 직접 편집 대신).",-1))])):n.createCommentVNode("",!0),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["end1","end2"],k=>{var V,H,te,ne;return n.createElementVNode("div",{key:k,class:"em-end"},[n.createElementVNode("h4",Ax,n.toDisplayString(k)+" → "+n.toDisplayString(g.value[k].entityRef),1),n.createElementVNode("label",Tx,[C[20]||(C[20]=n.createElementVNode("span",null,"다중성",-1)),n.createVNode(n.unref(ae.BSSelect),{"model-value":g.value[k].multiplicity,items:K,"value-provider":X,"label-provider":X,disabled:((V=T.value)==null?void 0:V.which)===k,"onUpdate:modelValue":ge=>B(k,{multiplicity:ge})},null,8,["model-value","disabled","onUpdate:modelValue"])]),n.createVNode(n.unref(ae.BSCheckbox),{name:`${k}-navigable`,class:"em-check",label:"navigable","model-value":g.value[k].navigable,"onUpdate:modelValue":ge=>B(k,{navigable:ge})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ae.BSCheckbox),{name:`${k}-composition`,class:"em-check",label:"composition","model-value":g.value[k].composition,"onUpdate:modelValue":ge=>B(k,{composition:ge})},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("fieldset",Mx,[C[21]||(C[21]=n.createElementVNode("legend",null,"cascade",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(F,ge=>{var ve,Ee;return n.createVNode(n.unref(ae.BSCheckbox),{key:ge,name:`${k}-cascade-${ge}`,class:"em-check",label:ge,"model-value":!!((Ee=(ve=g.value[k].jpa)==null?void 0:ve.cascadeTypes)!=null&&Ee.includes(ge)),disabled:ge!=="ALL"&&v(k),"onUpdate:modelValue":w=>R(k,ge,w)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),v(k)?(n.openBlock(),n.createElementBlock("p",Bx,"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).")):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",Dx,[C[24]||(C[24]=n.createElementVNode("legend",null,"JPA 상세",-1)),n.createElementVNode("label",Ox,[C[22]||(C[22]=n.createElementVNode("span",null,"fetchType",-1)),n.createVNode(n.unref(ae.BSSelect),{"model-value":P(k),items:G,"value-provider":X,"label-provider":Q,"onUpdate:modelValue":ge=>ge&&W(k,ge)},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ae.BSCheckbox),{name:`${k}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((H=g.value[k].jpa)!=null&&H.orphanRemoval),disabled:oe(k),"onUpdate:modelValue":ge=>E(k,{orphanRemoval:ge})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),oe(k)&&((te=g.value[k].jpa)!=null&&te.orphanRemoval)?(n.openBlock(),n.createElementBlock("p",Lx,"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).")):n.createCommentVNode("",!0),n.createElementVNode("label",Px,[C[23]||(C[23]=n.createElementVNode("span",null,"orderBy",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:`${k}-orderby`,width:"100%",placeholder:"예: name ASC","model-value":((ne=g.value[k].jpa)==null?void 0:ne.orderBy)??"","onUpdate:modelValue":ge=>E(k,{orderBy:ge.trim()||void 0})},null,8,["name","model-value","onUpdate:modelValue"])])])])}),64))],64)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("fieldset",zx,[C[25]||(C[25]=n.createElementVNode("legend",null,"그룹명",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,k=>{var V;return n.openBlock(),n.createElementBlock("label",{key:k,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(k),1),n.createVNode(n.unref(ae.BSTextInput),{name:`grp-name-${k}`,width:"100%","model-value":((V=_.value.name)==null?void 0:V[k])??"","onUpdate:modelValue":H=>me(k,H)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("label",Ux,[C[26]||(C[26]=n.createElementVNode("span",null,"설명",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:_.value.description??"",rows:"3",onChange:C[7]||(C[7]=k=>re({description:k.target.value}))},null,40,Hx)]),n.createElementVNode("label",Fx,[C[27]||(C[27]=n.createElementVNode("span",null,"패키지",-1)),n.createVNode(n.unref(ae.BSTextInput),{name:"grp-package",width:"100%","model-value":_.value.packageName??"","onUpdate:modelValue":C[8]||(C[8]=k=>re({packageName:k}))},null,8,["model-value"])]),n.createVNode(n.unref(ae.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:"DDL 생성 제외","model-value":_.value.excludeDDLGeneration,"onUpdate:modelValue":C[9]||(C[9]=k=>re({excludeDDLGeneration:k}))},null,8,["model-value"]),n.createElementVNode("fieldset",Gx,[C[28]||(C[28]=n.createElementVNode("legend",null,"색상",-1)),n.createElementVNode("div",Yx,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":be.value===null}]),title:"없음",onClick:C[10]||(C[10]=k=>xe(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),k=>(n.openBlock(),n.createElementBlock("button",{key:k,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":be.value===k}]),style:n.normalizeStyle({background:n.unref(Dn)(k)}),title:n.unref(Bn)(k),onClick:V=>xe(k)},null,14,Wx))),128))])]),n.createElementVNode("p",Kx,"멤버 엔티티 "+n.toDisplayString(_.value.memberEntityRefs.length)+"개",1)],64)):n.createCommentVNode("",!0),N.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("label",qx,[C[29]||(C[29]=n.createElementVNode("span",null,"메모",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:N.value.memo,rows:"6",onChange:C[11]||(C[11]=k=>Ce(k.target.value))},null,40,Xx)]),n.createElementVNode("fieldset",jx,[C[30]||(C[30]=n.createElementVNode("legend",null,"색상",-1)),n.createElementVNode("div",Zx,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Se.value===null}]),title:"없음",onClick:C[12]||(C[12]=k=>ye(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(mn),k=>(n.openBlock(),n.createElementBlock("button",{key:k,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":Se.value===k}]),style:n.normalizeStyle({background:n.unref(Dn)(k)}),title:n.unref(Bn)(k),onClick:V=>ye(k)},null,14,Jx))),128))])])],64)):n.createCommentVNode("",!0)],8,$x)],4))}}),[["__scopeId","data-v-2bdf0dab"]]),Qx={NAME:"이름",JPA:"JPA",TYPE:"타입",DSN:"설계"};function eI(e){const t=e.split("-")[1];return t?Qx[t]??t:e}function tI(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const nI=["title"],oI=["title","onClick"],iI={key:0,class:"em-validation__body"},aI={class:"em-validation__opt"},lI={key:0,class:"em-validation__empty"},rI={key:1,class:"em-validation__empty"},sI={key:2,class:"em-validation__list"},cI=["onClick"],dI={class:"em-validation__item-msg"},uI={key:0,class:"em-validation__item-entity"},fI=["title"],mI=Le(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 g of o.state.logical.entities)b.set(g.modelId,g.name);return b});function l(b){const g=tI(b);if(!g)return null;const _=a.value.get(g);return _===void 0?null:_.trim()===""?"(이름 없음)":_}const r={error:{order:0,icon:"alert-circle",label:"오류"},warning:{order:1,icon:"alert-triangle",label:"경고"},info:{order:2,icon:"info",label:"정보"}},s=n.computed(()=>{const b={error:0,warning:0,info:0};for(const g of i.value)b[g.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,g)=>r[b.severity].order-r[g.severity].order)),u=n.computed(()=>d.value.map(b=>({issue:b,entityName:l(b),category:eI(b.ruleId)}))),f=n.ref(!1);function p(b){c.value[b]=!c.value[b]}function m(b){if(!f.value){f.value=!0;return}p(b)}function h(b){b.targetRef&&o.requestFocus(b.targetRef)}return(b,g)=>(n.openBlock(),n.createElementBlock("section",{class:n.normalizeClass(["em-validation",{"is-open":f.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:n.normalizeStyle(f.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[n.createElementVNode("header",{class:"em-validation__head",onClick:g[1]||(g[1]=_=>f.value=!f.value)},[n.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:f.value?"접기":"펼치기"},[n.createVNode(Ve,{name:"chevron",size:14,class:n.normalizeClass([{"is-open":f.value},"em-validation__chevron"])},null,8,["class"]),g[3]||(g[3]=n.createElementVNode("span",{class:"em-validation__title"},"검증",-1))],8,nI),n.createElementVNode("div",{class:"em-validation__counts",onClick:g[0]||(g[0]=n.withModifiers(()=>{},["stop"]))},[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["error","warning","info"],_=>n.createElementVNode("button",{key:_,type:"button",class:n.normalizeClass(["em-validation__count",[`is-${_}`,{"is-off":!c.value[_]}]]),title:f.value?`${r[_].label} ${c.value[_]?"숨기기":"표시"}`:"검증 패널 펼치기",onClick:N=>m(_)},[n.createVNode(Ve,{name:r[_].icon,size:14},null,8,["name"]),n.createElementVNode("span",null,n.toDisplayString(s.value[_]),1)],10,oI)),64))])]),f.value?(n.openBlock(),n.createElementBlock("div",iI,[n.createElementVNode("label",aI,[n.createVNode(n.unref(ae.BSCheckbox),{name:"val-flag-norel",label:"관계 없는 엔티티 검사","model-value":n.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":g[2]||(g[2]=_=>n.unref(o).flagEntitiesWithoutRelations.value=_)},null,8,["model-value"])]),i.value.length===0?(n.openBlock(),n.createElementBlock("p",lI,"검증 이슈가 없습니다.")):d.value.length===0?(n.openBlock(),n.createElementBlock("p",rI," 표시할 이슈가 없습니다 (필터 적용 중). ")):(n.openBlock(),n.createElementBlock("ul",sI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,({issue:_,entityName:N,category:y},$)=>(n.openBlock(),n.createElementBlock("li",{key:`${_.ruleId}:${_.targetRef??"model"}:${$}`,class:n.normalizeClass(["em-validation__item",[`is-${_.severity}`,{"is-clickable":!!_.targetRef}]]),onClick:K=>h(_)},[n.createVNode(Ve,{name:r[_.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),n.createElementVNode("span",dI,[N?(n.openBlock(),n.createElementBlock("span",uI,n.toDisplayString(N),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(_.message),1)]),n.createElementVNode("span",{class:"em-validation__item-cat",title:_.ruleId},n.toDisplayString(y),9,fI)],10,cI))),128))]))])):n.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-21432077"]]),pI={class:"em-history"},hI={class:"em-history__head"},yI={class:"em-history__title"},gI={class:"em-history__head-actions"},bI=["disabled"],_I={class:"em-history__filters"},wI={class:"em-history__filter"},vI={class:"em-history__body"},kI={key:0,class:"em-history__empty"},EI={key:1,class:"em-history__empty is-error"},NI={key:2,class:"em-history__empty"},$I={key:3,class:"em-history__list"},xI=["onClick"],II={class:"em-history__summary"},SI={class:"em-history__seq"},CI={class:"em-history__gmeta"},RI={class:"em-history__who"},VI={key:0,class:"em-history__time"},AI={key:1,class:"em-history__restored-from"},TI={key:0,class:"em-history__detail"},MI={class:"em-history__action-head"},BI={class:"em-history__action-name"},DI={key:0,class:"em-history__fields"},OI={class:"em-history__fname"},LI={key:0,class:"em-history__old"},PI={class:"em-history__val"},zI={key:1,class:"em-history__restore"},UI=["disabled","onClick"],HI=["disabled"],FI=["onClick"],GI=Le(n.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,l=n.ref([]),r=n.ref(!1),s=n.ref(null),c=n.ref(!1);async function d(){if(a.historyTransport){r.value=!0,s.value=null;try{l.value=await a.historyTransport(),c.value=!0}catch(T){s.value=T instanceof Error?T.message:"이력을 불러오지 못했습니다."}finally{r.value=!1}}}async function u(){await a.whenOpsSettled(),await d()}n.watch(()=>o.open,T=>{T&&u()},{immediate:!0});let f=null;n.watch(()=>a.revision.value,()=>{o.open&&(f&&clearTimeout(f),f=setTimeout(()=>void u(),500))}),n.watch(()=>a.reloadRequest.value,()=>{o.open&&u()});const p=n.computed(()=>new Map(a.state.logical.entities.map(T=>[T.modelId,T]))),m=n.computed(()=>new Map(a.state.logical.associations.map(T=>[T.modelId,T]))),h=n.computed(()=>new Map((a.state.logical.groups??[]).map(T=>{var J;return[T.modelId,T.packageName||((J=T.name)==null?void 0:J.ko)||T.modelId]})));function b(T){var we,re,me,be,xe,Ce,Se;const J=m.value.get(T);if(!J)return"연관";if((we=J.description)!=null&&we.trim())return J.description.trim();const se=(be=(me=p.value.get((re=J.end1)==null?void 0:re.entityRef))==null?void 0:me.name)==null?void 0:be.trim(),he=(Se=(Ce=p.value.get((xe=J.end2)==null?void 0:xe.entityRef))==null?void 0:Ce.name)==null?void 0:Se.trim();return se&&he?`${se}→${he}`:"연관"}function g(T){var J,se,he,we;if(T.kind==="entity")return((se=(J=p.value.get(T.ref))==null?void 0:J.name)==null?void 0:se.trim())||"(이름 없음)";if(T.kind==="attribute"||T.kind==="operation"||T.kind==="index"){const re=T.entityRef?p.value.get(T.entityRef):void 0,be=((T.kind==="attribute"?re==null?void 0:re.attributes:T.kind==="operation"?re==null?void 0:re.operations:re==null?void 0:re.indexes)??[]).find(Ce=>Ce.modelId===T.ref),xe=(he=re==null?void 0:re.name)==null?void 0:he.trim();return`${xe?xe+".":""}${((we=be==null?void 0:be.name)==null?void 0:we.trim())||T.ref}`}return T.kind==="association"?b(T.ref):T.kind==="associationEnd"?`${b(T.ref)}(${T.end})`:T.kind==="group"?`그룹 ${h.value.get(T.ref)??T.ref}`:T.ref}const _={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},N={add:"추가",update:"수정",remove:"삭제"},y=n.ref("all"),$=[{v:"all",label:"전체"},{v:"edit",label:"편집"},{v:"restore",label:"복원"}],K=n.computed({get:()=>y.value,set:T=>{T&&(y.value=T)}}),F=n.computed(()=>rr(l.value)),q=n.computed(()=>F.value.length?F.value[0].seq:null),G=n.computed(()=>y.value==="all"?F.value:F.value.filter(T=>(T.kind??"edit")===y.value));function X(T){return T===void 0?"—":T===null?"(비움)":typeof T=="object"?JSON.stringify(T):String(T)}function Q(T){const J=g(T.subject);if(T.verb==="add")return`${J} 추가`;if(T.verb==="remove")return`${J} 삭제`;if(T.fields.length===1){const se=T.fields[0];return`${J}.${se.field} ${se.oldValue!==void 0?X(se.oldValue)+"→":""}${X(se.value)}`}return`${J} ${T.fields.length}개 변경`}function de(T){return T.actions.length===0?"변경 없음":T.actions.length===1?Q(T.actions[0]):`${Q(T.actions[0])} 외 ${T.actions.length-1}건`}const B=n.ref(new Set);function ee(T){const J=new Set(B.value);J.has(T)?J.delete(T):J.add(T),B.value=J}function v(T){if(T==null)return"";const J=new Date(T);return isNaN(J.getTime())?String(T):J.toLocaleString()}function R(T){const J=T.author,se=T.origin;return J&&se?`${J}(${se})`:J||(se?`(${se})`:"—")}const E=n.ref(null),P=n.ref(!1);function W(T){E.value=T}async function oe(T){P.value=!0;try{const J=await a.restoreToSeq(T);J.ok||(s.value=`복원 실패: ${J.reason??"알 수 없음"}`)}finally{P.value=!1,E.value=null}}return(T,J)=>(n.openBlock(),n.createBlock(n.Transition,{name:"em-history"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("section",pI,[n.createElementVNode("header",hI,[n.createElementVNode("div",yI,[n.createVNode(Ve,{name:"undo",size:15}),J[4]||(J[4]=n.createElementVNode("span",null,"변경 이력",-1))]),n.createElementVNode("div",gI,[n.createElementVNode("button",{type:"button",class:"em-history__btn",title:"새로고침",disabled:r.value,onClick:J[0]||(J[0]=se=>d())},[n.createVNode(Ve,{name:"redo",size:15})],8,bI),n.createElementVNode("button",{type:"button",class:"em-history__btn",title:"닫기",onClick:J[1]||(J[1]=se=>i("close"))},[n.createVNode(Ve,{name:"panel-close",size:15})])])]),n.createElementVNode("div",_I,[n.createElementVNode("label",wI,[J[5]||(J[5]=n.createElementVNode("span",null,"표시",-1)),n.createVNode(n.unref(ae.BSSelect),{modelValue:K.value,"onUpdate:modelValue":J[2]||(J[2]=se=>K.value=se),items:$,"value-provider":se=>se.v,"label-provider":se=>se.label},null,8,["modelValue","value-provider","label-provider"])])]),n.createElementVNode("div",vI,[r.value&&!c.value?(n.openBlock(),n.createElementBlock("p",kI,"이력을 불러오는 중…")):s.value?(n.openBlock(),n.createElementBlock("p",EI,n.toDisplayString(s.value),1)):G.value.length===0?(n.openBlock(),n.createElementBlock("p",NI,n.toDisplayString(c.value?"표시할 변경 이력이 없습니다.":"이력을 불러오세요."),1)):(n.openBlock(),n.createElementBlock("ul",$I,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G.value,se=>(n.openBlock(),n.createElementBlock("li",{key:se.seq,class:n.normalizeClass(["em-history__group",[`is-${se.kind??"edit"}`]])},[n.createElementVNode("div",{class:"em-history__ghead",onClick:he=>ee(se.seq)},[n.createVNode(Ve,{name:"chevron",size:13,class:n.normalizeClass(["em-history__chevron",{"is-open":B.value.has(se.seq)}])},null,8,["class"]),n.createElementVNode("span",{class:n.normalizeClass(["em-history__kind",`is-${se.kind??"edit"}`])},n.toDisplayString(se.kind==="restore"?"복원":"편집"),3),n.createElementVNode("span",II,n.toDisplayString(de(se)),1),n.createElementVNode("span",SI,"#"+n.toDisplayString(se.seq),1)],8,xI),n.createElementVNode("div",CI,[n.createElementVNode("span",RI,n.toDisplayString(R(se)),1),se.ts?(n.openBlock(),n.createElementBlock("span",VI,n.toDisplayString(v(se.ts)),1)):n.createCommentVNode("",!0),se.kind==="restore"&&se.restoredFromSeq!=null?(n.openBlock(),n.createElementBlock("span",AI,"← #"+n.toDisplayString(se.restoredFromSeq),1)):n.createCommentVNode("",!0)]),B.value.has(se.seq)?(n.openBlock(),n.createElementBlock("div",TI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(se.actions,(he,we)=>(n.openBlock(),n.createElementBlock("div",{key:we,class:"em-history__action"},[n.createElementVNode("div",MI,[n.createVNode(Ve,{name:_[he.subject.kind],size:12},null,8,["name"]),n.createElementVNode("span",BI,n.toDisplayString(g(he.subject)),1),n.createElementVNode("span",{class:n.normalizeClass(["em-history__verb",`is-${he.verb}`])},n.toDisplayString(N[he.verb]),3)]),he.fields.length?(n.openBlock(),n.createElementBlock("ul",DI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.fields,(re,me)=>(n.openBlock(),n.createElementBlock("li",{key:me,class:"em-history__field"},[n.createElementVNode("span",OI,n.toDisplayString(re.field),1),re.oldValue!==void 0?(n.openBlock(),n.createElementBlock("span",LI,n.toDisplayString(X(re.oldValue)),1)):n.createCommentVNode("",!0),re.oldValue!==void 0?(n.openBlock(),n.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):n.createCommentVNode("",!0),n.createElementVNode("span",PI,n.toDisplayString(X(re.value)),1)]))),128))])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0),n.unref(a).restoreAvailable.value&&se.seq!==q.value?(n.openBlock(),n.createElementBlock("div",zI,[E.value===se.seq?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[J[6]||(J[6]=n.createElementVNode("span",{class:"em-history__confirm-msg"},"이 시점으로 되돌립니다.",-1)),n.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:P.value,onClick:he=>oe(se.seq)},"복원",8,UI),n.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:P.value,onClick:J[3]||(J[3]=he=>E.value=null)},"취소",8,HI)],64)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:he=>W(se.seq)},[n.createVNode(Ve,{name:"undo",size:12}),J[7]||(J[7]=n.createTextVNode(" 이 시점으로 복원 ",-1))],8,FI))])):n.createCommentVNode("",!0)],2))),128))]))])],512),[[n.vShow,e.open]])]),_:1}))}}),[["__scopeId","data-v-23ba7bba"]]);function YI(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 Ou(e){const t=n.ref(YI(e.storageKey,e.min)??e.initial),o=n.ref(!1);function i(a){a.preventDefault();const l=a.clientX,r=t.value;o.value=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const s=d=>{const u=e.edge==="left"?l-d.clientX:d.clientX-l;let f=r+u;f=Math.max(e.min,f),e.max!=null&&(f=Math.min(e.max,f)),t.value=f},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 WI={class:"em-modeler"},KI={class:"em-modeler__body"},qI={class:"em-drawer__inner"},XI={class:"em-drawer__head"},jI={class:"em-drawer__actions"},ZI=["title"],JI=Le(n.defineComponent({__name:"EntityModeler",props:{controller:{}},setup(e){const t=n.ref(!0),o=n.ref(!0),i=n.ref(!1),{width:a,dragging:l,startResize:r}=Ou({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:s,dragging:c,startResize:d}=Ou({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),u=n.ref(null),f=n.ref(null);return(p,m)=>{var h,b,g;return n.openBlock(),n.createElementBlock("div",WI,[n.createVNode(Bu,{controller:e.controller,"history-open":i.value,onExportSvg:m[0]||(m[0]=_=>{var N;return(N=u.value)==null?void 0:N.exportSvg()}),onToggleHistory:m[1]||(m[1]=_=>i.value=!i.value)},null,8,["controller","history-open"]),n.createElementVNode("div",KI,[n.createElementVNode("aside",{class:n.normalizeClass(["em-drawer",{"is-collapsed":!t.value}]),style:n.normalizeStyle({width:n.unref(a)+"px"})},[n.createElementVNode("div",qI,[n.createElementVNode("header",XI,[m[9]||(m[9]=n.createElementVNode("span",null,"Diagram Explorer",-1)),n.createElementVNode("div",jI,[(h=f.value)!=null&&h.hasExpandable?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:(b=f.value)!=null&&b.allExpanded?"모두 접기":"모두 펼치기",onClick:m[2]||(m[2]=_=>{var N;return(N=f.value)==null?void 0:N.toggleAll()})},[n.createVNode(Ve,{name:(g=f.value)!=null&&g.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,ZI)):n.createCommentVNode("",!0),n.createElementVNode("button",{type:"button",class:"em-drawer__btn",title:"접기",onClick:m[3]||(m[3]=_=>t.value=!1)},[n.createVNode(Ve,{name:"panel-close",size:16})])])]),n.createVNode(Mu,{ref_key:"explorer",ref:f,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(l)}]),title:"너비 조절",onPointerdown:m[4]||(m[4]=(..._)=>n.unref(r)&&n.unref(r)(..._))},null,34),[[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:"Diagram Explorer 열기",onClick:m[5]||(m[5]=_=>t.value=!0)},[n.createVNode(Ve,{name:"panel-open",size:18})],512),[[n.vShow,!t.value]])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["em-modeler__canvas",{"is-drawer-open":t.value,"is-resizing":n.unref(l),"is-inspector-collapsed":!o.value}]),style:n.normalizeStyle({"--em-drawer-shift":n.unref(a)-6+"px"})},[n.createVNode(Tu,{ref_key:"canvas",ref:u,controller:e.controller},null,8,["controller"])],6),n.withDirectives(n.createVNode(Du,{controller:e.controller,width:n.unref(s),resizing:n.unref(c),"start-resize":n.unref(d),onCollapse:m[6]||(m[6]=_=>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:"Inspector 열기",onClick:m[7]||(m[7]=_=>o.value=!0)},[n.createVNode(Ve,{name:"panel-right-open",size:18})],512),[[n.vShow,!o.value]])]),_:1}),n.createVNode(GI,{controller:e.controller,open:i.value,onClose:m[8]||(m[8]=_=>i.value=!1)},null,8,["controller","open"])]),n.createVNode(mI,{controller:e.controller,"panel-width":n.unref(s),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-dc519653"]]);Ne.APPLY_MODEL_OPS_INPUT_SCHEMA=lm,Ne.AssociationEdge=Od,Ne.CUSTOM_TYPE_VALUE=Ot,Ne.CommandStack=ga,Ne.DEFAULT_JAVA_TYPE=da,Ne.DiagramCanvas=Tu,Ne.DiagramExplorer=Mu,Ne.EDITOR=hn,Ne.EditModeToggle=x$,Ne.EditorToolbar=Bu,Ne.EntityModeler=JI,Ne.EntityNode=vd,Ne.GROUP_CODE_ENUM_VALUE=Yn,Ne.GroupNode=kd,Ne.JAVA_TYPES=ua,Ne.NoteNode=Ed,Ne.OpSyncAdapter=Kr,Ne.PHYSICAL_NAME_MAX_LENGTH=ma,Ne.PropertyPanel=Du,Ne.RevCache=Wr,Ne.SELECTABLE_JAVA_TYPES=Ql,Ne.SYMBOLIC_OP_KINDS=qr,Ne.SYMBOLIC_OP_SCHEMA=as,Ne.anchoredEdgePoint=la,Ne.buildAgentBatch=rm,Ne.buildDiagramSvg=Vu,Ne.buildOrthogonalPath=na,Ne.buildSelfLoopPath=Gl,Ne.buildStraightPath=ia,Ne.commands=Rf,Ne.computeAutoLayout=Yl,Ne.createEditorController=U_,Ne.displayLabel=Oo,Ne.emptyState=gd,Ne.entityModelToText=Xl,Ne.estimateEntityHeight=Kl,Ne.exportDiagramSvg=Au,Ne.fromPersisted=wm,Ne.indexColumnsByModelId=Wn,Ne.javaTypeLabel=vn,Ne.migrateLegacyMoney=uf,Ne.newId=Te,Ne.orthogonalMidpoints=oa,Ne.packEntityBoxes=Gu,Ne.physicalNameWarning=zo,Ne.projectActionLog=rr,Ne.projectEntityAudit=ar,Ne.projectFieldAudit=Lt,Ne.rectExitPoint=aa,Ne.renderDiagramSvg=Zl,Ne.resolveDiagram=Hl,Ne.resolveSharedColumn=Po,Ne.resolveSymbolicOps=jf,Ne.restoreDeepEqual=kn,Ne.segmentMidpoints=ra,Ne.sideDir=Gn,Ne.synthesizeRestoreOps=vf,Ne.toPersisted=Mm,Ne.toPersistedV2=Bm,Ne.validateModel=or,Object.defineProperty(Ne,Symbol.toStringTag,{value:"Module"})}));
|
|
39
|
+
v${-(X.value.height-2*e.maskBorderRadius)}
|
|
40
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);n.watchEffect(H=>{if(_.value){const te=Wt(_.value),M=me=>{if(me.sourceEvent.type!=="wheel"||!p.value||!m.value)return;const ye=me.sourceEvent.ctrlKey&&bo()?10:1,ce=-me.sourceEvent.deltaY*(me.sourceEvent.deltaMode===1?.05:me.sourceEvent.deltaMode?1:.002)*e.zoomStep,ue=c.value.zoom*2**(ce*ye);m.value.scaleTo(p.value,ue)},ee=me=>{if(me.sourceEvent.type!=="mousemove"||!p.value||!m.value)return;const ye=W.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),ce={x:c.value.x-me.sourceEvent.movementX*ye,y:c.value.y-me.sourceEvent.movementY*ye},ue=[[0,0],[u.value.width,u.value.height]],he=Bl.translate(ce.x,ce.y).scale(c.value.zoom),ve=m.value.constrain()(he,ue,d.value);m.value.transform(p.value,ve)},le=HN().wheelDelta(me=>Ja(me)*(e.zoomStep/10)).on("zoom",e.pannable?ee:()=>{}).on("zoom.wheel",e.zoomable?M:()=>{});te.call(le),H(()=>{te.on("zoom",null)})}},{flush:"post"});function L(H){const[te,M]=Kt(H);t("click",{event:H,position:{x:te,y:M}})}function Q(H,te){const M={event:H,node:te,connectedEdges:cn([te],s.value)};f.miniMapNodeClick(M),t("nodeClick",M)}function v(H,te){const M={event:H,node:te,connectedEdges:cn([te],s.value)};f.miniMapNodeDoubleClick(M),t("nodeDblclick",M)}function T(H,te){const M={event:H,node:te,connectedEdges:cn([te],s.value)};f.miniMapNodeMouseEnter(M),t("nodeMouseenter",M)}function $(H,te){const M={event:H,node:te,connectedEdges:cn([te],s.value)};f.miniMapNodeMouseMove(M),t("nodeMousemove",M)}function P(H,te){const M={event:H,node:te,connectedEdges:cn([te],s.value)};f.miniMapNodeMouseLeave(M),t("nodeMouseleave",M)}return(H,te)=>(n.openBlock(),n.createBlock(n.unref(md),{position:H.position,class:n.normalizeClass(["vue-flow__minimap",{pannable:H.pannable,zoomable:H.zoomable}])},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{ref_key:"el",ref:_,width:b.value,height:g.value,viewBox:[ne.value.x,ne.value.y,ne.value.width,ne.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${n.unref(r)}`,onClick:L},[H.ariaLabel?(n.openBlock(),n.createElementBlock("title",{key:0,id:`vue-flow__minimap-${n.unref(r)}`},n.toDisplayString(H.ariaLabel),9,KN)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(h),M=>(n.openBlock(),n.createBlock(YN,{id:M.id,key:M.id,f:"",position:M.computedPosition,dimensions:M.dimensions,selected:M.selected,dragging:M.dragging,style:n.normalizeStyle(M.style),class:n.normalizeClass(q.value(M)),color:y.value(M),"border-radius":H.nodeBorderRadius,"stroke-color":N.value(M),"stroke-width":H.nodeStrokeWidth,"shape-rendering":n.unref(I),type:M.type,hidden:M.hidden,onClick:ee=>Q(ee,M),onDblclick:ee=>v(ee,M),onMouseenter:ee=>T(ee,M),onMousemove:ee=>$(ee,M),onMouseleave:ee=>P(ee,M)},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:re.value,fill:H.maskColor,stroke:H.maskStrokeColor,"stroke-width":H.maskStrokeWidth,"fill-rule":"evenodd"},null,8,qN)],8,WN))]),_:1},8,["position","class"]))}}),ZN=["d"],JN=["cx","cy","onDblclick"],QN=["x","y","onPointerdown","onDblclick"],e$=Pe(n.defineComponent({__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=Oe(),i=n.inject(yl),a=n.inject(pn,null),l=n.computed(()=>!!a&&a.editable.value),r=n.inject(Pn,null),s=n.computed(()=>!!r&&r.active.value&&(!r.relatedEntityIds.value.has(t.data.targetRef)||!r.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}),f=n.computed(()=>c.value.map((K,W)=>W===d.value?u.value:K)),{source:p,target:m,sourceSide:h,targetSide:_}=zd({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>f.value}),b=n.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?ia(p.value,h.value,f.value,m.value,_.value):la(p.value,f.value,m.value)),g=n.computed(()=>l.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?aa(p.value,h.value,f.value,m.value,_.value):ca(p.value,f.value,m.value).map((K,W)=>({point:K,segIndex:W})):[]),I=n.computed(()=>l.value?f.value:[]);function y(K,W){d.value=K,u.value={...c.value[K]},W.target.setPointerCapture(W.pointerId),W.stopPropagation()}function N(K){if(d.value<0)return;const W=o({x:K.clientX,y:K.clientY});u.value={x:W.x,y:W.y}}function q(K){var W,ne;d.value>=0&&i&&i.movePoint(t.id,d.value,{...u.value}),d.value=-1,(ne=(W=K.target).releasePointerCapture)==null||ne.call(W,K.pointerId)}function U(K,W){W.stopPropagation(),i==null||i.removePoint(t.id,K)}function X(K,W){if(!i)return;const ne=o({x:W.clientX,y:W.clientY});i.insertPoint(t.id,K,{x:ne.x,y:ne.y})}return(K,W)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:b.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:n.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,ZN),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(ne,re)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${re}`,cx:ne.point.x,cy:ne.point.y,r:"4",class:n.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:n.withModifiers(L=>X(ne.segIndex,L),["stop"])},null,42,JN))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(I.value,(ne,re)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${re}`,x:ne.x-5,y:ne.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:L=>y(re,L),onPointermove:N,onPointerup:q,onDblclick:L=>U(re,L)},null,42,QN))),128))],64))}}),[["__scopeId","data-v-4c93c9c3"]]),t$=["data-theme"],n$={key:0,class:"em-ctx__sep",role:"separator"},o$={key:1,class:"em-ctx__swatches"},i$={class:"em-ctx__swatches-label"},a$={class:"em-ctx__chips"},l$=["onClick"],r$=["title","onClick"],s$=["disabled","onClick"],c$={class:"em-ctx__icon"},d$={class:"em-ctx__caption"},u$=Pe(n.defineComponent({__name:"EmContextMenu",setup(e,{expose:t}){const o=n.ref(!1),i=n.ref([]),a=n.ref(void 0),l=n.ref(null),r=n.reactive({x:0,y:0}),s=8;async function c(m,h){var g;i.value=h,a.value=(g=m.target)!=null&&g.closest('[data-theme="dark"]')?"dark":void 0,r.x=m.clientX,r.y=m.clientY,o.value=!0,window.addEventListener("keydown",u),window.addEventListener("resize",d),await n.nextTick();const _=l.value;if(!_)return;const b=_.getBoundingClientRect();r.x+b.width>window.innerWidth-s&&(r.x=Math.max(s,window.innerWidth-s-b.width)),r.y+b.height>window.innerHeight-s&&(r.y=Math.max(s,window.innerHeight-s-b.height))}function d(){o.value&&(o.value=!1,i.value=[],window.removeEventListener("keydown",u),window.removeEventListener("resize",d))}function u(m){m.key==="Escape"&&(m.stopPropagation(),d())}function f(m){m.disabled||(m.handler(),d())}function p(m,h){m.onPick(h),d()}return n.onBeforeUnmount(d),t({open:c,close:d}),(m,h)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":a.value},[n.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:d,onContextmenu:n.withModifiers(d,["prevent"])},null,32),n.createElementVNode("div",{ref_key:"menuEl",ref:l,class:"em-ctx",style:n.normalizeStyle({left:r.x+"px",top:r.y+"px"}),role:"menu",onContextmenu:h[0]||(h[0]=n.withModifiers(()=>{},["prevent"]))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,(_,b)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:b},[_.type==="separator"?(n.openBlock(),n.createElementBlock("div",n$)):_.type==="swatches"?(n.openBlock(),n.createElementBlock("div",o$,[n.createElementVNode("span",i$,n.toDisplayString(_.caption),1),n.createElementVNode("div",a$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":_.current===null}]),title:"없음",onClick:g=>p(_,null)},null,10,l$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),g=>(n.openBlock(),n.createElementBlock("button",{key:g,type:"button",class:n.normalizeClass(["em-ctx__chip",{"is-on":_.current===g}]),style:n.normalizeStyle({background:n.unref(Dn)(g)}),title:n.unref(Bn)(g),onClick:I=>p(_,g)},null,14,r$))),128))])])):(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:n.normalizeClass(["em-ctx__item",{"is-danger":_.danger,"is-disabled":_.disabled}]),disabled:_.disabled,role:"menuitem",onClick:g=>f(_)},[n.createElementVNode("span",c$,[_.icon?(n.openBlock(),n.createBlock(Re,{key:0,name:_.icon,size:15},null,8,["name"])):n.createCommentVNode("",!0)]),n.createElementVNode("span",d$,n.toDisplayString(_.caption),1)],10,s$))],64))),128))],36)],8,t$)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-77a7a1b5"]]),Ol=[".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 Fn(e){const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function f$(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function m$(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 l=e.firstChild,r=a.getClientRects();if(!l||l.nodeType!==3||r.length<=1){const h=r.length?a.getBoundingClientRect():e.getBoundingClientRect();if(h.width===0&&h.height===0)return[];const _=t(h.left,h.top+h.height/2);return[{...i,x:_.x,y:_.y,text:(e.textContent??"").trim()}]}const s=l.textContent??"",c=[];let d="",u=null,f=0,p=0;const m=()=>{const h=d.trim();if(h){const _=t(f,(u+p)/2);c.push({...i,x:_.x,y:_.y,text:h})}d=""};for(let h=0;h<s.length;h++){a.setStart(l,h),a.setEnd(l,h+1);const _=a.getBoundingClientRect();u===null||Math.abs(_.top-u)>1?(m(),u=_.top,f=_.left,p=_.bottom,d=s[h]):(d+=s[h],p=Math.max(p,_.bottom))}return m(),c}function na(e,t){const o=[];for(const i of e.querySelectorAll("*"))f$(i)&&(i.closest(Ol)||Fn(i)&&o.push(...m$(i,t)));return o}function Ro(e){return Math.round(e*100)/100}function p$(e,t){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(Ol)||!Fn(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const l=t(a.left,a.top),r=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="${Ro(l.x)}" y="${Ro(l.y)}" width="${Ro(r.x-l.x)}" height="${Ro(r.y-l.y)}" viewBox="${c}" fill="none" stroke="${s.color}" stroke-width="${d}" stroke-linecap="round" stroke-linejoin="round">${i.innerHTML}</svg>`)}return o}function h$(e){const t=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!Fn(o))continue;const i=getComputedStyle(o),a=i.stroke,l=parseFloat(i.strokeWidth)||1.5,r=i.fill&&i.fill!=="none"?i.fill:"none",s=o.tagName.toLowerCase(),c=d=>Ro(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="${l}" stroke-linecap="round" />`):s==="circle"?t.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${l}" />`):s==="path"&&t.push(`<path d="${o.getAttribute("d")}" fill="${r}" stroke="${a}" stroke-width="${l}" stroke-linejoin="round" />`)}return t}function Mu(e,t,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===t||a.closest(Ol)||!Fn(a))continue;const l=getComputedStyle(a),r=parseFloat(l.borderTopWidth);if(!r)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:l.borderTopColor,strokeWidth:r})}return i}function Vo(e,t){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=t(o.left,o.top),l=t(o.right,o.bottom),r=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:l.x-a.x,h:l.y-a.y,fill:i.backgroundColor,stroke:i.borderTopColor,strokeWidth:parseFloat(i.borderTopWidth)||void 0,strokeDasharray:r?"6 4":void 0,radius:s}}function Ll(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 y$(e){const t=e.vueFlowRef.value;if(!t)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(m,h)=>e.screenToFlowCoordinate({x:m,y:h}),i=[],a=[],l=[],r=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const m of e.nodes.value){const h=t.querySelector(`.vue-flow__node[data-id="${CSS.escape(m.id)}"]`);if(!h||!Fn(h))continue;const _=h.firstElementChild;if(_)if(m.type==="group"){const b=Vo(_,o);Ll(s,b),i.push({...b,texts:[]});const g=_.querySelector(".em-group__label");g&&i.push({...Vo(g,o),stroke:"none",texts:[]}),i.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:na(_,o)})}else if(m.type==="note"){const b={...Vo(_,o),texts:na(_,o),lines:Mu(_,_,o)};Ll(s,b),l.push(b)}else{const b=Vo(_,o);Ll(s,b);const g=b.radius??{tl:0,tr:0};a.push({...b,stroke:"none",texts:[]});const I=_.querySelector(".em-entity__header");if(I){const y=Vo(I,o);a.push({x:b.x,y:b.y,w:b.w,h:y.y+y.h-b.y,fill:y.fill,stroke:"none",radius:{tl:g.tl,tr:g.tr,br:0,bl:0},texts:[]})}a.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:na(_,o),lines:Mu(_,_,o),icons:p$(_,o)}),a.push({...b,fill:"none",texts:[]})}}for(const m of t.querySelectorAll(".vue-flow__edge")){const h=m.querySelector("path.em-edge__path, path.em-note-edge__path");if(!h||!Fn(h))continue;const _=h.getAttribute("d");if(!_)continue;const b=getComputedStyle(h),g=b.strokeDasharray,I=h$(m);r.push({d:_,stroke:b.stroke,strokeWidth:parseFloat(b.strokeWidth)||1.5,strokeDasharray:g&&g!=="none"?g:void 0,labels:na(m,o),markers:I.length?I: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:r,entities:a,notes:l}}function Bu(e){return jl(y$(e))}function Du(e,t="diagram.svg"){const o=Bu(e),i=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(i);try{const l=document.createElement("a");l.href=a,l.download=t,document.body.appendChild(l),l.click(),l.remove()}finally{URL.revokeObjectURL(a)}}const g$={key:0,class:"em-toast",role:"status","aria-live":"polite"},Pl="nc:",Ou=Pe(n.defineComponent({__name:"DiagramCanvas",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),l=n.ref(null);let r;n.watch(()=>i.notice.value,w=>{w&&(l.value=w.text,r&&clearTimeout(r),r=setTimeout(()=>l.value=null,3200))}),n.onBeforeUnmount(()=>r&&clearTimeout(r));const s=n.ref(!1),c=n.ref(!1),d={x:0,y:0};function u(w){d.x=w.clientX,d.y=w.clientY}const f=n.ref(null);n.provide(Di,f);const p=n.ref(null);n.provide(Nd,p);const m=n.ref(null),h=n.computed(()=>{const w=m.value,k=new Set;if(!w)return k;if(w.kind==="entity")k.add(w.id);else if(w.kind==="group"){const C=i.resolved.value.groups.find(Z=>Z.group.modelId===w.id);for(const Z of(C==null?void 0:C.group.memberEntityRefs)??[])k.add(Z)}return k}),_=n.computed(()=>{const w=m.value,k=new Set(h.value),C=new Set,Z=new Set;if(!w)return{related:k,edges:C,notes:Z};if(w.kind==="note"){Z.add(w.id);for(const se of i.resolved.value.noteConnections)se.noteRef===w.id&&k.add(se.targetRef);return{related:k,edges:C,notes:Z}}const ae=h.value;if(!ae.size)return{related:k,edges:C,notes:Z};for(const se of i.resolved.value.associations){const{end1:V,end2:z}=se.association;(ae.has(V.entityRef)||ae.has(z.entityRef))&&(C.add(se.association.modelId),k.add(V.entityRef),k.add(z.entityRef))}for(const se of i.resolved.value.noteConnections)k.has(se.targetRef)&&Z.add(se.noteRef);return{related:k,edges:C,notes:Z}});n.provide(Pn,{source:m,active:n.computed(()=>m.value!==null),primaryEntityIds:h,relatedEntityIds:n.computed(()=>_.value.related),relatedEdgeIds:n.computed(()=>_.value.edges),relatedNoteIds:n.computed(()=>_.value.notes),hoverGroupId:n.computed(()=>{var w;return((w=m.value)==null?void 0:w.kind)==="group"?m.value.id:null}),setEntityHover:w=>{p.value||c.value||(m.value=w?{kind:"entity",id:w}:null)},setGroupHover:w=>{p.value||c.value||(m.value=w?{kind:"group",id:w}:null)},setNoteHover:w=>{p.value||c.value||(m.value=w?{kind:"note",id:w}:null)}}),n.provide(pn,i);function b(w,k){return`${Pl}${w}:${k}`}function g(w){if(!w.startsWith(Pl))return null;const[k,C]=w.slice(Pl.length).split(":");return k&&C?{noteRef:k,targetRef:C}:null}n.provide(yl,{points:w=>{var C,Z;const k=g(w);return k?((C=i.resolved.value.noteConnections.find(ae=>ae.noteRef===k.noteRef&&ae.targetRef===k.targetRef))==null?void 0:C.waypoints)??[]:((Z=i.resolved.value.associations.find(ae=>ae.association.modelId===w))==null?void 0:Z.waypoints)??[]},movePoint:(w,k,C)=>{const Z=g(w);Z?i.moveNoteConnectionWaypoint(Z.noteRef,Z.targetRef,k,C):i.moveWaypoint(w,k,C)},insertPoint:(w,k,C)=>{const Z=g(w);Z?i.addNoteConnectionWaypoint(Z.noteRef,Z.targetRef,k,C):i.addWaypoint(w,k,C)},removePoint:(w,k)=>{const C=g(w);C?i.removeNoteConnectionWaypoint(C.noteRef,C.targetRef,k):i.removeWaypoint(w,k)}});const I=Oe(),{nodes:y,edges:N,findNode:q,findEdge:U,addNodes:X,addEdges:K,removeNodes:W,removeEdges:ne,fitView:re,setCenter:L,getViewport:Q,screenToFlowCoordinate:v,getSelectedNodes:T,updateNodeInternals:$}=I,P=n.ref(!1);async function H(){P.value=!0,await n.nextTick(),await new Promise(w=>requestAnimationFrame(()=>w(null)));try{Du(I)}finally{P.value=!1}}t({exportSvg:H});function te(){const w=Q(),{width:k,height:C}=I.dimensions.value;return{x:(k/2-w.x)/w.zoom,y:(C/2-w.y)/w.zoom}}function M(){const w=te();i.addEntity("NewEntity",{x:w.x,y:w.y})}function ee(){const w=te();i.addNote("메모",{x:w.x,y:w.y})}function le(w){for(const k of i.resolved.value.groups){const{location:C,size:Z}=k.geo;if(w.x>=C.x&&w.x<=C.x+Z.width&&w.y>=C.y&&w.y<=C.y+Z.height)return k.group.modelId}return null}function me(){const w=i.resolved.value,k=new Map(w.groups.map(V=>[V.group.modelId,V.geo])),C=new Set(w.groups.map(V=>V.group.modelId)),Z=new Set([...C,...w.entities.map(V=>V.entity.modelId),...w.notes.map(V=>V.note.modelId)]);for(const V of[...y.value])Z.has(V.id)||W([V.id]);for(const V of w.groups){const z=V.group.modelId,F={width:`${V.geo.size.width}px`,height:`${V.geo.size.height}px`},oe={group:V.group,style:V.style,locked:V.locked},Ae=V.locked?!1:void 0,Le=q(z);Le?(Le.position={...V.geo.location},Le.data=oe,Le.style=F,Le.draggable=Ae):X([{id:z,type:"group",position:{...V.geo.location},draggable:Ae,style:F,data:oe}])}for(const V of w.entities){const z=V.entity.modelId,F=V.groupRef&&C.has(V.groupRef)?V.groupRef:void 0,oe={entity:V.entity,displayMode:i.displayMode.value,collapsed:V.collapsed,locked:V.locked,groupRef:F,size:V.geo.size,style:V.style,attributeStyles:V.attributeStyles,operationStyles:V.operationStyles},Ae=V.locked?!1:void 0,Le=F?k.get(F):void 0,He=Le?{x:V.geo.location.x-Le.location.x,y:V.geo.location.y-Le.location.y}:{...V.geo.location},Be=q(z);Be?(Be.position=He,Be.data=oe,Be.parentNode=F,Be.draggable=Ae):X([{id:z,type:"entity",position:He,parentNode:F,draggable:Ae,data:oe}])}for(const V of w.notes){const z=V.note,F=z.modelId,oe=V.groupRef&&C.has(V.groupRef)?V.groupRef:void 0,Ae={note:z,groupRef:oe},Le={width:`${z.geo.size.width}px`,height:`${z.geo.size.height}px`},He=oe?k.get(oe):void 0,Be=He?{x:z.geo.location.x-He.location.x,y:z.geo.location.y-He.location.y}:{...z.geo.location},Fe=q(F);Fe?(Fe.position=Be,Fe.data=Ae,Fe.style=Le,Fe.parentNode=oe):X([{id:F,type:"note",position:Be,parentNode:oe,style:Le,data:Ae}])}const ae=new Map(w.associations.map(V=>[V.association.modelId,V])),se=new Set(w.noteConnections.map(V=>b(V.noteRef,V.targetRef)));for(const V of[...N.value])!ae.has(V.id)&&!se.has(V.id)&&ne([V.id]);for(const[V,z]of ae){const F={id:V,type:"association",source:z.association.end1.entityRef,target:z.association.end2.entityRef,sourceHandle:z.sourceColumnRef?`r:${z.sourceColumnRef}`:void 0,targetHandle:z.targetColumnRef?`l:${z.targetColumnRef}`:void 0,data:{association:z.association,sourceColumnRef:z.sourceColumnRef,targetColumnRef:z.targetColumnRef}},oe=U(V);oe?(oe.data=F.data,oe.sourceHandle=F.sourceHandle,oe.targetHandle=F.targetHandle):K([F])}for(const V of w.noteConnections){const z=b(V.noteRef,V.targetRef),F={noteRef:V.noteRef,targetRef:V.targetRef},oe=U(z);oe?oe.data=F:K([{id:z,type:"note-connection",source:V.noteRef,target:V.targetRef,data:F}])}ye()}function ye(){n.nextTick(()=>requestAnimationFrame(()=>$()))}function ce(){const w=T.value.map(C=>C.id);if(w.length)return w;const k=i.selection.value;return k&&(k.kind==="entity"||k.kind==="note"||k.kind==="group")?[k.id]:[]}function ue(w){var ae;const k=w.target;if(k&&(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable))return;if(!i.editable.value){(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="c"&&(i.copy(),w.preventDefault());return}if(w.key==="Delete"||w.key==="Backspace"){i.deleteSelection()&&w.preventDefault();return}if(w.key==="ArrowUp"||w.key==="ArrowDown"||w.key==="ArrowLeft"||w.key==="ArrowRight"){if(((ae=i.selection.value)==null?void 0:ae.kind)==="attribute"){if(w.key==="ArrowUp"||w.key==="ArrowDown"){const F=w.key==="ArrowDown"?1:-1;(w.altKey?i.nudgeSelectedAttributes(F):i.moveAttributeFocus(F))&&w.preventDefault()}return}const se=w.shiftKey?10:1,V=w.key==="ArrowLeft"?-se:w.key==="ArrowRight"?se:0,z=w.key==="ArrowUp"?-se:w.key==="ArrowDown"?se:0;i.nudgeNodes(ce(),V,z)&&w.preventDefault();return}if(!(w.metaKey||w.ctrlKey))return;const Z=w.key.toLowerCase();Z==="c"?(i.copy(),w.preventDefault()):Z==="v"?(i.paste(),w.preventDefault()):Z==="z"&&(w.shiftKey?i.redo():i.undo(),w.preventDefault())}n.onMounted(async()=>{me(),await n.nextTick(),re(),window.addEventListener("keydown",ue),window.addEventListener("pointerup",he),window.addEventListener("pointermove",u,{passive:!0})}),n.onBeforeUnmount(()=>{window.removeEventListener("keydown",ue),window.removeEventListener("pointerup",he),window.removeEventListener("pointermove",u)});function he(){f.value=null}function ve(){c.value=!0,m.value=null}function Se(){var Z;c.value=!1;const w=(Z=document.elementFromPoint(d.x,d.y))==null?void 0:Z.closest(".vue-flow__node"),k=w==null?void 0:w.dataset.id;if(!k){m.value=null;return}const C=w.classList.contains("vue-flow__node-group")?"group":w.classList.contains("vue-flow__node-note")?"note":"entity";m.value={kind:C,id:k}}n.watch([()=>i.resolved.value,()=>i.displayMode.value],me),n.watch(()=>i.revision.value,ye),n.watch(()=>i.resolved.value,w=>{const k=m.value;if(!k)return;(k.kind==="entity"?w.entities.some(Z=>Z.entity.modelId===k.id):k.kind==="group"?w.groups.some(Z=>Z.group.modelId===k.id):w.notes.some(Z=>Z.note.modelId===k.id))||(m.value=null)});function Ie(w){const k=w.computedPosition??w.position,C=w.dimensions??{width:0,height:0};return{x:k.x+C.width/2,y:k.y+C.height/2}}function pe(w){const k=w.node;if(k){if(m.value=null,k.type==="group"){const C=i.resolved.value.groups.find(Z=>Z.group.modelId===k.id);p.value=C?{groupId:k.id,dx:k.position.x-C.geo.location.x,dy:k.position.y-C.geo.location.y}:null,f.value=null;return}if(k.type!=="entity"&&k.type!=="note"){f.value=null;return}f.value=le(Ie(k))}}function j(w){var Z;f.value=null,p.value=null;const k=(Z=w.nodes)!=null&&Z.length?w.nodes:[w.node],C=k.filter(ae=>(ae==null?void 0:ae.type)==="group");if(C.length){for(const ae of C){if(!ae)continue;const se=i.resolved.value.entities.filter(V=>V.groupRef===ae.id).map(V=>{const z=q(V.entity.modelId),F=(z==null?void 0:z.computedPosition)??(z==null?void 0:z.position)??{x:0,y:0};return{id:V.entity.modelId,location:{x:F.x,y:F.y}}});i.dragGroup(ae.id,{x:ae.position.x,y:ae.position.y},se)}return}for(const ae of k){if(!ae||ae.type==="group")continue;const se=ae.computedPosition??ae.position,V=ae.dimensions??{width:0,height:0},z={x:se.x+V.width/2,y:se.y+V.height/2};ae.type==="note"?i.dropNote(ae.id,{x:se.x,y:se.y},le(z)):i.dropEntity(ae.id,{x:se.x,y:se.y},le(z))}}function Y(w){var F,oe,Ae,Le,He;if(!i.editable.value||!w.source||!w.target)return;const k=((F=q(w.source))==null?void 0:F.type)==="note",C=((oe=q(w.target))==null?void 0:oe.type)==="note";if(k||C){if(k&&C)return;const Be=k?w.source:w.target,Fe=k?w.target:w.source;((Ae=q(Fe))==null?void 0:Ae.type)==="entity"&&i.addNoteConnection(Be,Fe);return}const Z=Be=>{var Fe;return(Fe=i.state.logical.entities.find(xt=>xt.modelId===Be))==null?void 0:Fe.stereotype},ae=Z(w.source)==="JPA_EMBEDDABLE",se=Z(w.target)==="JPA_EMBEDDABLE";if(ae||se){if(ae&&se)return;const Be=ae?w.source:w.target,Fe=ae?w.target:w.source;i.addEmbedAssociation(Fe,Be);return}const V=(Le=w.sourceHandle)!=null&&Le.startsWith("r:")?w.sourceHandle.slice(2):void 0,z=(He=w.targetHandle)!=null&&He.startsWith("l:")?w.targetHandle.slice(2):void 0;i.addAssociation(w.source,w.target,V,z)}const E=n.ref(null);function A(w,k){var Z;const C=i.state.layout.entityLayouts.find(ae=>ae.entityRef===w);return nt((Z=C==null?void 0:C.attributeStyles)==null?void 0:Z[k])}function R(w,k){var Z;const C=i.state.layout.entityLayouts.find(ae=>ae.entityRef===w);return nt((Z=C==null?void 0:C.operationStyles)==null?void 0:Z[k])}function G(w){var k;return nt((k=i.state.layout.groupLayouts.find(C=>C.groupRef===w))==null?void 0:k.style)}function J(w){var k;return nt((k=i.state.layout.notes.find(C=>C.modelId===w))==null?void 0:k.style)}function fe(w){var Z,ae;if(w.preventDefault(),!i.editable.value)return;const k=()=>v({x:w.clientX,y:w.clientY}),C=[{caption:"엔티티 추가",icon:"add-entity",handler:()=>{const se=k();i.addEntity("NewEntity",{x:se.x,y:se.y})}},{caption:"노트 추가",icon:"note",handler:()=>{const se=k();i.addNote("메모",{x:se.x,y:se.y})}},{caption:"그룹 추가",icon:"folder",handler:()=>{const se=k();i.addEmptyGroup({x:se.x,y:se.y})}}];((Z=i.clipboard.value)==null?void 0:Z.kind)==="entity"&&C.push({caption:"붙여넣기",icon:"clipboard",handler:()=>i.paste()}),i.resolved.value.entities.length>0&&C.push({type:"separator"},{caption:"모두 접기",icon:"collapse-all",handler:()=>i.collapseAll()},{caption:"모두 펼치기",icon:"expand-all",handler:()=>i.expandAll()}),(ae=E.value)==null||ae.open(w,C)}function _e({event:w,node:k}){var F,oe,Ae,Le,He,Be,Fe,xt,Xt,jt,Je,Ao,we,Qe,To,Mo,Bo,Do;const C=w;if(C.preventDefault(),!i.editable.value){if(k.type==="group"||k.type==="note")return;const De=(oe=(F=C.target)==null?void 0:F.closest("[data-attr]"))==null?void 0:oe.dataset.attr;if(De){const Ge=i.selection.value;(Ge==null?void 0:Ge.kind)==="attribute"&&Ge.entityId===k.id&&Ge.ids.includes(De)||i.selectAttribute(k.id,De);const Xe=((Ae=i.selection.value)==null?void 0:Ae.kind)==="attribute"&&i.selection.value.entityId===k.id?[...i.selection.value.ids]:[De];(Le=E.value)==null||Le.open(C,[{caption:Xe.length>1?`복사 (${Xe.length})`:"복사",icon:"copy",handler:()=>i.copy()}]);return}(He=E.value)==null||He.open(C,[{caption:"상세 편집…",icon:"pencil",handler:()=>Mi(a,i,k.id)},{caption:"복사",icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:k.id},i.copy()}}]);return}if(k.type==="group"){const De=i.isGroupLocked(k.id),Ge=[];De||Ge.push({type:"swatches",caption:"색상",current:G(k.id),onPick:qe=>i.setGroupSwatch(k.id,qe)},{type:"separator"}),Ge.push({caption:De?"잠금 해제":"잠금",icon:De?"unlock":"lock",handler:()=>i.setGroupLocked(k.id,!De)}),De||Ge.push({type:"separator"},{caption:"그룹 해제",icon:"trash",danger:!0,handler:()=>i.removeGroup(k.id)}),(Be=E.value)==null||Be.open(C,Ge);return}if(k.type==="note"){(Fe=E.value)==null||Fe.open(C,[{type:"swatches",caption:"색상",current:J(k.id),onPick:De=>i.setNoteSwatch(k.id,De)},{type:"separator"},{caption:"노트 삭제",icon:"trash",danger:!0,handler:()=>i.removeNote(k.id)}]);return}const Z=(Xt=(xt=C.target)==null?void 0:xt.closest("[data-attr]"))==null?void 0:Xt.dataset.attr;if(Z){const De=i.selection.value;(De==null?void 0:De.kind)==="attribute"&&De.entityId===k.id&&De.ids.includes(Z)||i.selectAttribute(k.id,Z);const qe=((jt=i.selection.value)==null?void 0:jt.kind)==="attribute"&&i.selection.value.entityId===k.id?[...i.selection.value.ids]:[Z];if(i.isEntityLocked(k.id)){(Je=E.value)==null||Je.open(C,[{caption:qe.length>1?`복사 (${qe.length})`:"복사",icon:"copy",handler:()=>i.copy()}]);return}const Xe=qe.length>1,zl=[{caption:"속성 추가",icon:"field",handler:()=>i.addAttribute(k.id)},{type:"swatches",caption:Xe?`색상 (${qe.length})`:"색상",current:Xe?null:A(k.id,Z),onPick:rS=>i.setAttributeSwatches(k.id,qe,rS)},{type:"separator"},{caption:Xe?`복사 (${qe.length})`:"복사",icon:"copy",handler:()=>i.copy()}],Oo=i.clipboard.value;(Oo==null?void 0:Oo.kind)==="attribute"&&zl.push({caption:Oo.attributes.length>1?`속성 붙여넣기 (${Oo.attributes.length})`:"속성 붙여넣기",icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:k.id},i.paste()}}),zl.push({type:"separator"},{caption:Xe?`속성 삭제 (${qe.length})`:"속성 삭제",icon:"trash",danger:!0,handler:()=>i.removeAttributes(k.id,qe)}),(Ao=E.value)==null||Ao.open(C,zl);return}const ae=(Qe=(we=C.target)==null?void 0:we.closest("[data-op]"))==null?void 0:Qe.dataset.op;if(ae){if(i.isEntityLocked(k.id))return;(To=E.value)==null||To.open(C,[{caption:"오퍼레이션 추가",icon:"method",handler:()=>i.addOperation(k.id)},{type:"swatches",caption:"색상",current:R(k.id,ae),onPick:De=>i.setOperationSwatch(k.id,ae,De)},{type:"separator"},{caption:"오퍼레이션 삭제",icon:"trash",danger:!0,handler:()=>i.removeOperation(k.id,ae)}]);return}const se=i.resolved.value.entities.find(De=>De.entity.modelId===k.id),V=!!(se!=null&&se.locked),z=[{caption:V?"상세 보기…":"상세 편집…",icon:"pencil",handler:()=>Mi(a,i,k.id)}];if(!V){z.push({type:"separator"},{caption:"속성 추가",icon:"field",handler:()=>i.addAttribute(k.id)},{caption:"메서드 추가",icon:"method",handler:()=>i.addOperation(k.id)},{caption:"그룹으로 묶기",icon:"folder",handler:()=>{const Ge=T.value.filter(qe=>qe.type==="entity").map(qe=>qe.id);i.createGroup(Ge.includes(k.id)&&Ge.length?Ge:[k.id])}},{caption:"셀프 연관 추가",icon:"arrow-lr",handler:()=>i.addAssociation(k.id,k.id)});const De=i.embeddableCatalog.value;if(De.length){z.push({type:"separator"});for(const Ge of De){const qe=((Mo=Ge.label)==null?void 0:Mo.ko)??((Bo=Ge.label)==null?void 0:Bo.en)??Ge.type;z.push({caption:`임베더블 추가: ${qe}`,icon:"link",handler:()=>i.addPredefinedEmbed(k.id,Ge.type)})}}}if(z.push({type:"separator"}),z.push({caption:se!=null&&se.collapsed?"펼치기":"접기",icon:se!=null&&se.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(k.id,!(se!=null&&se.collapsed))}),se!=null&&se.groupRef&&!V&&z.push({caption:"그룹에서 빼기",icon:"folder",handler:()=>i.ungroupEntity(k.id)}),z.push({caption:V?"잠금 해제":"잠금",icon:V?"unlock":"lock",handler:()=>i.setEntityLocked(k.id,!V)}),z.push({caption:"복사",icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:k.id},i.copy()}}),!V){const De=i.clipboard.value;(De==null?void 0:De.kind)==="attribute"&&z.push({caption:De.attributes.length>1?`속성 붙여넣기 (${De.attributes.length})`:"속성 붙여넣기",icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:k.id},i.paste()}}),z.push({type:"separator"}),z.push({caption:"엔티티 삭제",icon:"trash",danger:!0,handler:()=>i.removeEntity(k.id)})}(Do=E.value)==null||Do.open(C,z)}function ke({event:w,edge:k}){var ae,se;const C=w;if(C.preventDefault(),!i.editable.value)return;const Z=g(k.id);if(Z){(ae=E.value)==null||ae.open(C,[{caption:"꺾은선 풀기",icon:"route",handler:()=>i.clearNoteConnectionWaypoints(Z.noteRef,Z.targetRef)},{type:"separator"},{caption:"연결 삭제",icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(Z.noteRef,Z.targetRef)}]);return}(se=E.value)==null||se.open(C,[{caption:"꺾은선 풀기",icon:"route",handler:()=>i.clearWaypoints(k.id)},{type:"separator"},{caption:"관계 삭제",icon:"trash",danger:!0,handler:()=>i.removeAssociation(k.id)}])}function be(w){return w==="group"?"group":w==="note"?"note":"entity"}function xe({node:w}){if(T.value.length>1){i.selection.value=null;return}i.selection.value={kind:be(w.type),id:w.id}}function Ve({nodes:w}){w.length>1&&(i.selection.value=null)}function Te({edge:w}){const k=g(w.id);i.selection.value=k?{kind:"note",id:k.noteRef}:{kind:"association",id:w.id}}function x(w){const k=i.selection.value;return!!k&&k.kind!=="attribute"&&k.id===w.id}function B(w){var k,C;return x(w)?w.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":w.type==="note"?"var(--em-note-soft)":w.type==="group"?hd(nt((k=w.data)==null?void 0:k.style),!0)??"var(--em-mm-group)":hd(nt((C=w.data)==null?void 0:C.style))??"var(--em-mm-entity)"}function S(w){return x(w)?"var(--em-selection)":w.type==="note"?"var(--em-note-accent)":w.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function D(w,k){L(w,k,{zoom:Q().zoom,duration:350})}n.watch(()=>i.focusRequest.value,w=>{if(!w)return;const k=q(w.id);if(!k)return;const C=k.computedPosition??k.position,Z=k.dimensions??{width:0,height:0};D(C.x+Z.width/2,C.y+Z.height/2)});function O({position:w}){D(w.x,w.y)}function de({node:w}){i.selection.value={kind:be(w.type),id:w.id};const k=w.computedPosition??w.position,C=w.dimensions??{width:0,height:0};D(k.x+C.width/2,k.y+C.height/2)}function ge({node:w}){re({nodes:[w.id],duration:350,maxZoom:1.2,padding:.6})}return(w,k)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-canvas",{"is-connecting":s.value,"is-panning":c.value}])},[n.createVNode(n.unref(O0),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!P.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(Tt).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:ve,onMoveEnd:Se,onConnect:Y,onConnectStart:k[1]||(k[1]=C=>s.value=!0),onConnectEnd:k[2]||(k[2]=C=>s.value=!1),onNodeDrag:pe,onNodeDragStop:j,onNodeClick:xe,onEdgeClick:Te,onSelectionChange:Ve,onPaneClick:k[3]||(k[3]=C=>n.unref(i).selection.value=null),onPaneContextMenu:fe,onNodeContextMenu:_e,onEdgeContextMenu:ke},{"node-group":n.withCtx(C=>[n.createVNode(xd,n.normalizeProps(n.guardReactiveProps(C)),null,16)]),"node-entity":n.withCtx(C=>[n.createVNode($d,n.normalizeProps(n.guardReactiveProps(C)),null,16)]),"node-note":n.withCtx(C=>[n.createVNode(Id,n.normalizeProps(n.guardReactiveProps(C)),null,16)]),"edge-association":n.withCtx(C=>[n.createVNode(Ud,n.normalizeProps(n.guardReactiveProps(C)),null,16)]),"edge-note-connection":n.withCtx(C=>[n.createVNode(e$,n.normalizeProps(n.guardReactiveProps(C)),null,16)]),default:n.withCtx(()=>[n.unref(i).showGrid.value?(n.openBlock(),n.createBlock(n.unref(Hw),{key:0,gap:16,"pattern-color":"var(--em-border)"})):n.createCommentVNode("",!0),n.createVNode(n.unref(pv),{"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(hn),{class:"em-palette__group-start",title:"엔티티 추가",onClick:M},{default:n.withCtx(()=>[n.createVNode(Re,{name:"add-entity",size:14})]),_:1}),n.createVNode(n.unref(hn),{title:"노트 추가",onClick:ee},{default:n.withCtx(()=>[n.createVNode(Re,{name:"note",size:14})]),_:1}),n.createVNode(n.unref(hn),{title:"자동 배치",onClick:k[0]||(k[0]=C=>n.unref(i).autoLayout())},{default:n.withCtx(()=>[n.createVNode(Re,{name:"auto-layout",size:14})]),_:1})],64)):n.createCommentVNode("",!0)]),_:1}),n.unref(i).showMinimap.value?(n.openBlock(),n.createBlock(n.unref(jN),{key:1,pannable:"",width:224,height:160,"node-color":B,"node-stroke-color":S,"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:O,onNodeClick:de,onNodeDblclick:ge})):n.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),n.createVNode(u$,{ref_key:"menuRef",ref:E},null,512),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,{name:"em-toast-fade"},{default:n.withCtx(()=>[l.value?(n.openBlock(),n.createElementBlock("div",g$,n.toDisplayString(l.value),1)):n.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-635a23f2"]]),b$={class:"em-explorer em-scroll-overlay"},_$={class:"em-explorer__rows"},w$=["data-key","onClick","onDblclick"],v$=["onClick"],k$=["title"],E$={class:"em-key-slot"},N$={class:"em-key-slot"},$$={class:"em-explorer__label"},Lu=Pe(n.defineComponent({__name:"DiagramExplorer",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),l=n.computed(()=>{var v;const g=i.resolved.value,I=i.displayMode.value,y=T=>{var $,P,H;return Lo(I,T.name,(P=($=T.table)==null?void 0:$.logicalName)==null?void 0:P.ko,(H=T.table)==null?void 0:H.physicalName)},N=I==="PHYSICAL"||I==="LOGICAL_PHYSICAL",q=T=>{const $=T.attrType.startsWith("RELATION")&&T.dbAttrs.length>0;return{icon:T.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:T.identifier,fk:$&&N}}},U=T=>T.attrType.startsWith("EMBED")&&T.dbAttrs.length>0,X=I==="PHYSICAL"||I==="LOGICAL_PHYSICAL",K=T=>{if(T.attrType!=="EMBED_PREDEF")return T.dbAttrs;const $=i.embeddableCatalog.value.find(P=>P.type===T.type);return $?T.dbAttrs.map((P,H)=>{const te=$.fields[H];return te?{...P,physicalName:P.physicalName||te.physicalName,logicalName:P.logicalName??te.logicalName,dataType:P.dataType||te.dataType,length:P.length??te.length}:P}):T.dbAttrs},W=(T,$)=>{var M,ee,le;const P={entityId:$,attrId:T.modelId};if(U(T)){const me=pa(I,T);return{key:`attr:${T.modelId}`,label:T.name+(me?` : ${me}`:""),icon:"table",attrRef:P,focusId:$,children:X?K(T).map(ye=>{var ce;return{key:`attr:${T.modelId}:col:${ye.modelId}`,label:Lo(I,ye.physicalName,(ce=ye.logicalName)==null?void 0:ce.ko,ye.physicalName)+(ye.dataType?` : ${ye.dataType}`:""),icon:"field",attrRef:P,focusId:$,children:[]}}):[]}}const H=er(T,i.state.logical.associations),te=pa(I,T,H);return{key:`attr:${T.modelId}`,label:Lo(I,T.name,(ee=(M=T.dbAttrs[0])==null?void 0:M.logicalName)==null?void 0:ee.ko,(le=T.dbAttrs[0])==null?void 0:le.physicalName)+(te?` : ${te}`:""),...q(T),attrRef:P,focusId:$,children:[]}},ne=T=>{const $=T.entity,P=[...$.attributes].sort((H,te)=>H.order-te.order);return{key:`entity:${$.modelId}`,label:y($),icon:"table",selectKind:"entity",selectId:$.modelId,focusId:$.modelId,children:P.map(H=>W(H,$.modelId))}},re=new Map,L=[];for(const T of g.entities)if(T.groupRef){const $=re.get(T.groupRef)??[];$.push(T),re.set(T.groupRef,$)}else L.push(T);const Q=[];for(const T of g.groups){const $=T.group;Q.push({key:`group:${$.modelId}`,label:((v=$.name)==null?void 0:v.ko)||$.packageName||"(그룹)",icon:"folder",focusId:$.modelId,children:(re.get($.modelId)??[]).map(ne)})}for(const T of L)Q.push(ne(T));if(g.associations.length){const T=new Map(g.entities.map($=>[$.entity.modelId,y($.entity)]));Q.push({key:"section:associations",label:`관계 (${g.associations.length})`,icon:"arrow-lr",children:g.associations.map($=>{const P=$.association,H=T.get(P.end1.entityRef)??P.end1.entityRef,te=T.get(P.end2.entityRef)??P.end2.entityRef;return{key:`assoc:${P.modelId}`,label:`${H} — ${te}`,icon:"arrow-lr",selectKind:"association",selectId:P.modelId,children:[]}})})}return g.notes.length&&Q.push({key:"section:notes",label:`노트 (${g.notes.length})`,icon:"note",children:g.notes.map(({note:T})=>{var $;return{key:`note:${T.modelId}`,label:(($=T.memo.split(`
|
|
41
|
+
`)[0])==null?void 0:$.slice(0,30))||"(빈 노트)",icon:"note",selectKind:"note",selectId:T.modelId,focusId:T.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||"다이어그램",icon:"network",children:Q}});function r(g){return g?g.pk&&g.fk?"PFK (식별 외래키)":g.pk?"PK (기본키)":g.fk?"FK (외래키)":"":""}const s=n.ref(new Set);function c(g){const I=new Set(s.value);I.has(g)?I.delete(g):I.add(g),s.value=I}const d=n.computed(()=>{const g=[],I=(y,N)=>{if(g.push({node:y,depth:N}),!s.value.has(y.key))for(const q of y.children)I(q,N+1)};return I(l.value,0),g}),u=n.computed(()=>{const g=[],I=y=>{if(y.children.length){y.key!=="root"&&g.push(y.key);for(const N of y.children)I(N)}};return I(l.value),g}),f=n.computed(()=>!u.value.some(g=>s.value.has(g)));function p(){s.value=f.value?new Set(u.value):new Set}t({toggleAll:p,allExpanded:f,hasExpandable:n.computed(()=>u.value.length>0)});function m(g){const I=i.selection.value;return g.attrRef?(I==null?void 0:I.kind)==="attribute"&&I.entityId===g.attrRef.entityId&&I.ids.includes(g.attrRef.attrId):!!I&&I.kind!=="attribute"&&!!g.selectId&&g.selectKind===I.kind&&g.selectId===I.id}function h(g){const I=i.selection.value;return g.selectKind==="entity"&&(I==null?void 0:I.kind)==="attribute"&&I.entityId===g.selectId}function _(g,I){if(g.attrRef){const y=I.shiftKey?"range":I.metaKey||I.ctrlKey?"toggle":"replace";i.selectAttribute(g.attrRef.entityId,g.attrRef.attrId,y)}else g.selectKind&&g.selectId&&(i.selection.value={kind:g.selectKind,id:g.selectId});g.focusId&&i.requestFocus(g.focusId)}function b(g){g.selectKind==="entity"&&g.selectId&&Mi(a,i,g.selectId)}return(g,I)=>(n.openBlock(),n.createElementBlock("section",b$,[n.createElementVNode("div",_$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,({node:y,depth:N})=>(n.openBlock(),n.createElementBlock("div",{key:y.key,class:n.normalizeClass(["em-explorer__row",{"is-active":m(y),"is-focus-parent":h(y),"is-selectable":!!y.selectKind||!!y.attrRef||!!y.focusId}]),"data-key":y.key,style:n.normalizeStyle({paddingLeft:4+N*14+"px"}),onClick:q=>_(y,q),onDblclick:q=>b(y)},[n.createElementVNode("span",{class:n.normalizeClass(["em-explorer__chevron",{"is-leaf":!y.children.length,"is-open":!s.value.has(y.key)}]),onClick:n.withModifiers(q=>y.children.length&&c(y.key),["stop"])},[y.children.length?(n.openBlock(),n.createBlock(Re,{key:0,name:"chevron",size:14})):n.createCommentVNode("",!0)],10,v$),y.keyMarks?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-explorer__keys",title:r(y.keyMarks),"aria-hidden":"true"},[n.createElementVNode("span",E$,[y.keyMarks.pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:14,class:"em-key is-pk"})):y.keyMarks.fk?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Re,{key:1,class:"em-explorer__icon",name:y.icon,size:14},null,8,["name"]))]),n.createElementVNode("span",N$,[y.keyMarks.fk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:14,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,k$)):(n.openBlock(),n.createBlock(Re,{key:1,class:"em-explorer__icon",name:y.icon,size:15},null,8,["name"])),n.createElementVNode("span",$$,n.toDisplayString(y.label),1)],46,w$))),128))])]))}}),[["__scopeId","data-v-4fcb6509"]]),x$={class:"em-text-preview"},I$={class:"em-text-preview__pre"},S$={class:"em-text-preview__actions"},C$=Pe(n.defineComponent({__name:"EntityTextPreview",props:{text:{}},setup(e){const t=e,o=ie.useModalHandle();async function i(){try{await navigator.clipboard.writeText(t.text),ie.showNotification("클립보드에 복사되었습니다.","info")}catch{ie.showNotification("복사에 실패했습니다.","error")}}return(a,l)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:"코드생성 입력 (논리 모델 텍스트)"},{default:n.withCtx(()=>[n.createElementVNode("div",x$,[n.createElementVNode("pre",I$,n.toDisplayString(t.text),1),n.createElementVNode("div",S$,[n.createVNode(n.unref(ie.BSButton),{caption:"복사",onClick:i}),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"닫기",onClick:l[0]||(l[0]=r=>n.unref(o).close())})])])]),_:1}))}}),[["__scopeId","data-v-b6e12b4b"]]),R$={class:"em-toolbar"},V$={class:"em-toolbar__mode"},Pu=Pe(n.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","toggleHistory"],setup(e,{emit:t}){const i=e.controller,a=t,l=ie.useModal(),r=[{v:"LOGICAL",label:"논리"},{v:"PHYSICAL",label:"물리"},{v:"LOGICAL_PHYSICAL",label:"논리·물리"},{v:"CLASS",label:"클래스"}],s=n.computed({get:()=>i.displayMode.value,set:p=>i.displayMode.value=p});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=n.computed(()=>{const p=i.resolved.value.entities;return p.length>0&&p.every(m=>m.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function f(){l.openModal({component:C$,bind:{text:ql(i.state.logical)}})}return(p,m)=>(n.openBlock(),n.createElementBlock("div",R$,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"실행 취소",disabled:!n.unref(i).canUndo.value||!n.unref(i).editable.value,onClick:m[0]||(m[0]=h=>n.unref(i).undo())},{left:n.withCtx(()=>[n.createVNode(Re,{name:"undo",size:16})]),_:1},8,["disabled"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"다시 실행",disabled:!n.unref(i).canRedo.value||!n.unref(i).editable.value,onClick:m[1]||(m[1]=h=>n.unref(i).redo())},{left:n.withCtx(()=>[n.createVNode(Re,{name:"redo",size:16})]),_:1},8,["disabled"]),m[9]||(m[9]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createElementVNode("label",V$,[m[7]||(m[7]=n.createTextVNode(" 표시 ",-1)),n.createVNode(n.unref(ie.BSSelect),{modelValue:s.value,"onUpdate:modelValue":m[2]||(m[2]=h=>s.value=h),items:r,"value-provider":h=>h.v,"label-provider":h=>h.label},null,8,["modelValue","value-provider","label-provider"])]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(i).routingMode.value==="orthogonal"?"직각":"직선",tooltip:"연결선 모드 전환",onClick:c},{left:n.withCtx(()=>[n.createVNode(Re,{name:"route",size:16})]),_:1},8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showGrid.value}]),caption:"그리드",tooltip:n.unref(i).showGrid.value?"그리드 끄기":"그리드 켜기",onClick:m[3]||(m[3]=h=>n.unref(i).showGrid.value=!n.unref(i).showGrid.value)},{left:n.withCtx(()=>[n.createVNode(Re,{name:"grid",size:16})]),_:1},8,["class","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showMinimap.value}]),caption:"미니맵",tooltip:n.unref(i).showMinimap.value?"미니맵 끄기":"미니맵 켜기",onClick:m[4]||(m[4]=h=>n.unref(i).showMinimap.value=!n.unref(i).showMinimap.value)},{left:n.withCtx(()=>[n.createVNode(Re,{name:"map",size:16})]),_:1},8,["class","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:d.value?"모두 펼치기":"모두 접기",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"]),m[10]||(m[10]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"텍스트 보기",onClick:f},{left:n.withCtx(()=>[n.createVNode(Re,{name:"file-text",size:16})]),_:1}),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:"SVG 내보내기",onClick:m[5]||(m[5]=h=>a("exportSvg"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:"image",size:16})]),_:1}),n.unref(i).historyAvailable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[m[8]||(m[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:"이력",tooltip:e.historyOpen?"변경 이력 닫기":"변경 이력 열기",onClick:m[6]||(m[6]=h=>a("toggleHistory"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:"undo",size:16})]),_:1},8,["class","tooltip"])],64)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-13589c57"]]),A$=Pe(n.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=t;return(i,a)=>(n.openBlock(),n.createBlock(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-mode-toggle",{"is-view":!e.editable}]),disabled:!e.opMode,caption:e.editable?"편집 모드":"조회 모드",title:e.opMode?e.editable?"클릭하면 조회 모드로 전환":"클릭하면 편집 모드로 전환":"이 다이어그램은 조회 전용입니다",onClick:a[0]||(a[0]=l=>o("toggle"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:e.editable?"pencil":"eye",size:14},null,8,["name"])]),_:1},8,["class","disabled","caption","title"]))}}),[["__scopeId","data-v-ae148426"]]),T$=["disabled"],M$={class:"em-panel__sub"},B$={class:"em-nav"},D$={key:0,class:"em-nav__divider","aria-hidden":"true"},O$={key:1},L$=["onClick","onKeydown"],P$={class:"em-nav__name"},z$=["title"],U$={key:0,class:"em-panel__note"},H$=["data-attr-block"],F$={class:"em-attr__row"},G$=["title"],Y$={key:0,class:"em-attr__row"},W$={class:"em-attr__row"},K$={class:"em-attr__row"},q$={class:"em-attr__flags"},X$={class:"em-attr__pii"},j$={class:"em-attr__pii"},Z$={class:"em-attr__pii"},J$={key:0,class:"em-attr__pii em-attr__codetop"},Q$={class:"em-multilang"},ex={key:2,class:"em-embed-cols"},tx={class:"em-embed-col__label"},nx={class:"em-attr__row"},ox={class:"em-attr__row"},ix={key:0,class:"em-embed-upd"},ax={class:"em-embed-upd"},lx={class:"em-embed-upd"},rx={class:"em-swatch__row em-attr__swatch"},sx=["onClick"],cx=["title","onClick"],dx={key:0,class:"em-attr__swatch-hint"},ux="외래키는 연관관계에서 파생됩니다 — 연관관계선을 삭제하세요",oa="__OWN__",fx=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),l=n.computed(()=>{var V;return((V=i.value)==null?void 0:V.stereotype)==="JPA_EMBEDDABLE"}),r=n.computed(()=>new Set(o.selectedAttrIds.value)),s=n.computed(()=>{var V;return((V=i.value)==null?void 0:V.attributes.filter(z=>z.attrType!=="DIVIDER"))??[]}),c=n.computed(()=>{var V;return((V=i.value)==null?void 0:V.attributes)??[]}),d=n.computed(()=>s.value.filter(V=>r.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 f(V){return!!i.value&&!!jo(o.state.logical,i.value.modelId,V.modelId)}function p(V){const z=u(V),F=[z.pk&&"PK",z.fk&&"FK",z.required&&"NOT NULL"].filter(Boolean);return F.length?F.join(" · "):void 0}function m(V,z){i.value&&o.selectAttribute(i.value.modelId,V.modelId,z.shiftKey?"range":z.metaKey||z.ctrlKey?"toggle":"replace")}const h=["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 _(V){return V==="none"?"(없음)":V}const b=V=>V;function g(V){var z,F;return nt((F=(z=a.value)==null?void 0:z.attributeStyles)==null?void 0:F[V.modelId])}function I(V){return r.value.size>1&&r.value.has(V.modelId)}function y(V,z){if(!i.value)return;const F=I(V)?o.selectedAttrIds.value:[V.modelId];o.setAttributeSwatches(i.value.modelId,F,z)}function N(V,z){i.value&&o.updateAttribute(i.value.modelId,V.modelId,z)}function q(V,z){N(V,{naturalId:z||void 0,naturalIdMutable:z?V.naturalIdMutable:void 0})}function U(){return{naturalId:void 0,naturalIdMutable:void 0}}function X(V,z){N(V,{identifier:z,...z?U():{}})}function K(V,z){N(V,{transient:z||void 0,...z?U():{}})}function W(V){return!!V.transient}const ne=V=>V.value,re=V=>V.label;function L(V,z){if(!z)return;const F=M.value.find(oe=>oe.type===z);if(F){const oe=V.dbAttrs[0]??{modelId:V.modelId+".c",physicalName:V.name,dataType:"VARCHAR"};N(V,{type:z,customType:void 0,dbAttrs:[{...oe,dataType:F.dataType,length:F.length,scale:F.scale}]});return}N(V,z===Lt?{type:z}:{type:z,customType:void 0})}function Q(V,z){N(V,{customType:z.trim()===""?void 0:z})}function v(V,z){const oe={...V.dbAttrs[0]??{modelId:V.modelId+".c",physicalName:V.name,dataType:"VARCHAR"},...z};z.dataType!==void 0&&!Po.has(oe.dataType)&&(oe.scale=void 0),N(V,{dbAttrs:[oe]})}function T(V){var z;return Po.has(((z=V.dbAttrs[0])==null?void 0:z.dataType)??"")}function $(V,z,F){var oe;v(V,{logicalName:{...(oe=V.dbAttrs[0])==null?void 0:oe.logicalName,[z]:F}})}function P(V,z){N(V,{description:Object.keys(z).length?z:void 0})}function H(V){return V.personalInfoAttributeType??"none"}function te(V,z){N(V,{personalInfoAttributeType:z==="none"?void 0:z})}const M=n.computed(()=>o.predefinedCustomTypeCatalog.value),ee=n.computed(()=>o.embeddableCatalog.value),le=n.ref(void 0);function me(V){var z,F;return((z=V.label)==null?void 0:z.ko)??((F=V.label)==null?void 0:F.en)??V.type}function ye(V){if(!V||!i.value)return;const z=o.addPredefinedEmbed(i.value.modelId,V);z&&o.selectAttribute(i.value.modelId,z),le.value=void 0}function ce(){if(!i.value)return;const V=o.addAttribute(i.value.modelId);o.selectAttribute(i.value.modelId,V)}const ue=n.computed(()=>o.groupCodeCatalog.value);function he(V){var z;return((z=ue.value.find(F=>F.groupCode===V.groupCode))==null?void 0:z.codes)??[]}function ve(V){return["none",...he(V)]}function Se(V){return V==="none"?"none":V.code}function Ie(V){var F,oe;if(V==="none")return"(없음)";const z=((F=V.label)==null?void 0:F.ko)??((oe=V.label)==null?void 0:oe.en);return z?`${V.code} (${z})`:V.code}function pe(V,z){i.value&&o.setAttributeGroupCode(i.value.modelId,V.modelId,z)}function j(V,z){N(V,{defaultValue:z==="none"?void 0:z})}function Y(V,z){N(V,{defaultValue:z.trim()===""?void 0:z})}function E(V){return V.attrType.startsWith("EMBED")&&V.dbAttrs.length>0}function A(V,z,F){const oe=V.dbAttrs.map((Ae,Le)=>{if(Le!==z)return Ae;const He={...Ae,...F};for(const Be of Object.keys(F))F[Be]===void 0&&delete He[Be];return He});i.value&&o.setEmbedColumns(i.value.modelId,V.modelId,oe)}function R(V,z,F,oe){var Ae;A(V,z,{logicalName:{...(Ae=V.dbAttrs[z])==null?void 0:Ae.logicalName,[F]:oe}})}function G(V,z){var Ae,Le,He;if(V.attrType==="EMBED_PREDEF"){const Be=(Ae=o.embeddableCatalog.value.find(Fe=>Fe.type===V.type))==null?void 0:Ae.fields[z];return Be?{name:Be.name,physicalName:Be.physicalName,dataType:Be.dataType,length:Be.length,shareable:Be.shareable,logicalName:Be.logicalName}:void 0}const F=(Le=V.embedded)==null?void 0:Le.embeddableRef;if(!F)return;const oe=(He=o.state.logical.entities.find(Be=>Be.modelId===F))==null?void 0:He.attributes.flatMap(Be=>Be.dbAttrs)[z];return oe?{physicalName:oe.physicalName,dataType:oe.dataType,length:oe.length,scale:oe.scale,logicalName:oe.logicalName}:void 0}function J(V,z){var F,oe;return((F=G(V,z))==null?void 0:F.dataType)||((oe=V.dbAttrs[z])==null?void 0:oe.dataType)||""}function fe(V,z){var F,oe;return((F=G(V,z))==null?void 0:F.length)??((oe=V.dbAttrs[z])==null?void 0:oe.length)}function _e(V,z){var F,oe;return((F=G(V,z))==null?void 0:F.scale)??((oe=V.dbAttrs[z])==null?void 0:oe.scale)}const ke=["inherit","true","false"];function be(V){return V==="inherit"?"기본(따름)":V}function xe(V){return(V==null?void 0:V.updatable)===void 0?"inherit":V.updatable?"true":"false"}function Ve(V,z,F){A(V,z,{updatable:F==="inherit"?void 0:F==="true"})}function Te(V,z){v(V,{updatable:z==="inherit"?void 0:z==="true"})}const x=["inherit","true","false"];function B(V){return V==="inherit"?"기본(따름)":V}function S(V){return(V==null?void 0:V.insertable)===void 0?"inherit":V.insertable?"true":"false"}function D(V,z,F){A(V,z,{insertable:F==="inherit"?void 0:F==="true"})}function O(V,z){v(V,{insertable:z==="inherit"?void 0:z==="true"})}const de=n.computed(()=>{var V;return Wn(((V=i.value)==null?void 0:V.attributes.flatMap(z=>z.dbAttrs))??[])}),ge=n.computed(()=>{var V;return(((V=i.value)==null?void 0:V.attributes)??[]).filter(z=>z.attrType==="NORMAL"&&z.dbAttrs.length===1&&z.dbAttrs[0]).map(z=>({modelId:z.dbAttrs[0].modelId,label:z.dbAttrs[0].physicalName||z.name}))});function w(){return[oa,...ge.value.map(V=>V.modelId)]}function k(V){if(V===oa)return"전용 컬럼(OWN)";const z=ge.value.find(F=>F.modelId===V);return z?`↗ ${z.label} (공유)`:V}function C(V){return(V==null?void 0:V.sharedColumnRef)??oa}function Z(V,z,F){A(V,z,{sharedColumnRef:F===oa?void 0:F})}function ae(V){return(V==null?void 0:V.sharedColumnRef)!=null}function se(V){var z;return((z=zo(V,de.value))==null?void 0:z.physicalName)??""}return(V,z)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(o).editable.value},[n.createElementVNode("h4",M$,[n.createTextVNode("속성 ("+n.toDisplayString(s.value.length)+") ",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:ce}),ee.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"120px",placeholder:"임베더블 추가","model-value":le.value,items:ee.value,"value-provider":F=>F.type,"label-provider":me,"onUpdate:modelValue":ye},null,8,["model-value","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",B$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,F=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:F.modelId},[F.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("li",D$,[...z[0]||(z[0]=[n.createElementVNode("hr",null,null,-1)])])):(n.openBlock(),n.createElementBlock("li",O$,[n.createElementVNode("div",{class:n.normalizeClass(["em-nav__item",{"is-selected":r.value.has(F.modelId)}]),role:"button",tabindex:"0",onClick:oe=>m(F,oe),onKeydown:[n.withKeys(n.withModifiers(oe=>m(F,oe),["prevent"]),["enter"]),n.withKeys(n.withModifiers(oe=>m(F,oe),["prevent"]),["space"])]},[n.createElementVNode("span",P$,n.toDisplayString(F.name||"(이름 없음)"),1),n.createElementVNode("span",{class:"em-nav__marks",title:p(F)},[u(F).pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):u(F).required?(n.openBlock(),n.createBlock(Re,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):n.createCommentVNode("",!0),u(F).fk?(n.openBlock(),n.createBlock(Re,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):n.createCommentVNode("",!0)],8,z$)],42,L$)]))],64))),128))]),s.value.length&&!d.value.length?(n.openBlock(),n.createElementBlock("p",U$," 위 목록에서 속성을 선택하면 편집 폼이 표시됩니다. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,F=>{var oe,Ae,Le,He,Be,Fe,xt,Xt,jt,Je,Ao;return n.openBlock(),n.createElementBlock("div",{key:F.modelId,class:n.normalizeClass(["em-attr",{"is-focused":r.value.has(F.modelId)}]),"data-attr-block":F.modelId},[n.createElementVNode("div",F$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-name-${F.modelId}`,width:"100%",placeholder:"이름","model-value":F.name,"onUpdate:modelValue":we=>N(F,{name:we})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-type-${F.modelId}`,width:"84px",placeholder:"타입",disabled:F.attrType.startsWith("EMBED")||!!F.groupCode,items:n.unref(Ql)(F.type,M.value),"value-provider":ne,"label-provider":re,"model-value":F.type,"onUpdate:modelValue":we=>L(F,we)},null,8,["name","disabled","items","model-value","onUpdate:modelValue"]),n.createElementVNode("span",{title:f(F)?ux:void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:we=>n.unref(o).removeAttribute(i.value.modelId,F.modelId)},null,8,["onClick"])],8,G$)]),F.type===n.unref(Lt)?(n.openBlock(),n.createElementBlock("div",Y$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-customtype-${F.modelId}`,width:"100%",placeholder:"커스텀 타입명","model-value":F.customType??"","onUpdate:modelValue":we=>Q(F,we)},null,8,["name","model-value","onUpdate:modelValue"])])):n.createCommentVNode("",!0),E(F)?(n.openBlock(),n.createElementBlock("div",ex,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(F.dbAttrs,(we,Qe)=>{var To,Mo,Bo,Do,De,Ge,qe;return n.openBlock(),n.createElementBlock("div",{key:we.modelId,class:"em-embed-col"},[n.createElementVNode("span",tx,n.toDisplayString(((To=G(F,Qe))==null?void 0:To.name)??((Mo=G(F,Qe))==null?void 0:Mo.physicalName)??`컬럼 ${Qe+1}`),1),n.createElementVNode("div",nx,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`embed-col-${we.modelId}`,width:"100%",disabled:ae(we),placeholder:((Bo=G(F,Qe))==null?void 0:Bo.physicalName)??"컬럼","model-value":ae(we)?se(we):we.physicalName,"onUpdate:modelValue":Xe=>A(F,Qe,{physicalName:Xe})},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":J(F,Qe)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-len-${we.modelId}`,width:"48px",disabled:"","model-value":fe(F,Qe)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-scale-${we.modelId}`,width:"48px",disabled:"","model-value":_e(F,Qe)},null,8,["name","model-value"])]),n.createVNode(mn,{controller:n.unref(o),"ref-id":we.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",ox,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`embed-logical-${we.modelId}`,width:"100%",placeholder:((De=(Do=G(F,Qe))==null?void 0:Do.logicalName)==null?void 0:De.ko)??"논리명","model-value":((Ge=we.logicalName)==null?void 0:Ge.ko)??"","onUpdate:modelValue":Xe=>R(F,Qe,"ko",Xe)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),(qe=G(F,Qe))!=null&&qe.shareable?(n.openBlock(),n.createElementBlock("label",ix,[z[7]||(z[7]=n.createElementVNode("span",null,"통화 컬럼",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px","model-value":C(we),items:w(),"value-provider":b,"label-provider":k,"onUpdate:modelValue":Xe=>Xe&&Z(F,Qe,Xe)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",ax,[z[8]||(z[8]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:ae(we),"model-value":ae(we)?"false":S(we),items:x,"value-provider":b,"label-provider":B,"onUpdate:modelValue":Xe=>Xe&&D(F,Qe,Xe)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",lx,[z[9]||(z[9]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:ae(we),"model-value":ae(we)?"false":xe(we),items:ke,"value-provider":b,"label-provider":be,"onUpdate:modelValue":Xe=>Xe&&Ve(F,Qe,Xe)},null,8,["disabled","model-value","onUpdate:modelValue"])])])}),128))])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",W$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-logical-${F.modelId}`,width:"100%",placeholder:"논리명","model-value":((Ae=(oe=F.dbAttrs[0])==null?void 0:oe.logicalName)==null?void 0:Ae.ko)??"","onUpdate:modelValue":we=>$(F,"ko",we)},null,8,["name","model-value","onUpdate:modelValue"])]),n.createElementVNode("div",K$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-col-${F.modelId}`,width:"100%",placeholder:"컬럼",disabled:W(F),"model-value":((Le=F.dbAttrs[0])==null?void 0:Le.physicalName)??"","onUpdate:modelValue":we=>v(F,{physicalName:we})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-dtype-${F.modelId}`,width:"84px",placeholder:"dataType",disabled:W(F),items:n.unref(Zl)(((He=F.dbAttrs[0])==null?void 0:He.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":b,"label-provider":n.unref(ua),"model-value":((Be=F.dbAttrs[0])==null?void 0:Be.dataType)??"","onUpdate:modelValue":we=>we&&v(F,{dataType:we})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-len-${F.modelId}`,width:"48px",placeholder:"len",disabled:W(F),"model-value":(Fe=F.dbAttrs[0])==null?void 0:Fe.length,"onUpdate:modelValue":we=>v(F,{length:we||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-scale-${F.modelId}`,width:"48px",placeholder:"scale",disabled:W(F)||!T(F),"model-value":(xt=F.dbAttrs[0])==null?void 0:xt.scale,"onUpdate:modelValue":we=>v(F,{scale:we||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(mn,{controller:n.unref(o),"ref-id":(Xt=F.dbAttrs[0])==null?void 0:Xt.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",q$,[n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-pk-${F.modelId}`,label:"Primary Key","model-value":F.identifier,disabled:l.value||W(F),"onUpdate:modelValue":we=>X(F,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nn-${F.modelId}`,label:"Not Null","model-value":F.notNull,disabled:W(F),"onUpdate:modelValue":we=>N(F,{notNull:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-uq-${F.modelId}`,label:"Unique","model-value":!!((jt=F.dbAttrs[0])!=null&&jt.unique),disabled:W(F),"onUpdate:modelValue":we=>v(F,{unique:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-ai-${F.modelId}`,label:"Auto Increment","model-value":!!((Je=F.dbAttrs[0])!=null&&Je.autoIncrement),disabled:W(F)||!F.identifier,"onUpdate:modelValue":we=>v(F,{autoIncrement:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-tr-${F.modelId}`,label:"@Transient","model-value":!!F.transient,disabled:F.identifier,"onUpdate:modelValue":we=>K(F,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nid-${F.modelId}`,label:"@NaturalId","model-value":!!F.naturalId,disabled:F.identifier||W(F),"onUpdate:modelValue":we=>q(F,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${F.modelId}`,label:"mutable","model-value":!!F.naturalIdMutable,disabled:W(F)||!F.naturalId,"onUpdate:modelValue":we=>N(F,{naturalIdMutable:we||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-mv-${F.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ao=F.dbAttrs[0])!=null&&Ao.multiValue),disabled:W(F),"onUpdate:modelValue":we=>v(F,{multiValue:we||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("label",X$,[z[1]||(z[1]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:W(F),"model-value":S(F.dbAttrs[0]),items:x,"value-provider":b,"label-provider":B,"onUpdate:modelValue":we=>we&&O(F,we)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",j$,[z[2]||(z[2]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:W(F),"model-value":xe(F.dbAttrs[0]),items:ke,"value-provider":b,"label-provider":be,"onUpdate:modelValue":we=>we&&Te(F,we)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",Z$,[z[3]||(z[3]=n.createElementVNode("span",null,"개인정보",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":H(F),items:h,"value-provider":b,"label-provider":_,"onUpdate:modelValue":we=>we&&te(F,we)},null,8,["model-value","onUpdate:modelValue"])]),ue.value.length?(n.openBlock(),n.createElementBlock("label",J$,[z[4]||(z[4]=n.createElementVNode("span",null,"코드그룹",-1)),n.createVNode(bd,{"model-value":F.groupCode,items:ue.value,"onUpdate:modelValue":we=>pe(F,we)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",{class:n.normalizeClass(["em-attr__pii",{"em-attr__codetop":!ue.value.length}])},[z[5]||(z[5]=n.createElementVNode("span",null,"기본값",-1)),he(F).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"100%","model-value":F.defaultValue??"none",items:ve(F),"value-provider":Se,"label-provider":Ie,"onUpdate:modelValue":we=>we&&j(F,we)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`attr-default-${F.modelId}`,width:"100%",placeholder:"기본값","model-value":F.defaultValue??"","onUpdate:modelValue":we=>Y(F,we)},null,8,["name","model-value","onUpdate:modelValue"]))],2),n.createElementVNode("fieldset",Q$,[z[6]||(z[6]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(fl,{multiline:"",name:`attr-desc-${F.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,"model-value":F.description,"onUpdate:modelValue":we=>P(F,we)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),n.createElementVNode("div",rx,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":g(F)===null}]),title:"없음",onClick:we=>y(F,null)},"∅",10,sx),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),we=>(n.openBlock(),n.createElementBlock("button",{key:we,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":g(F)===we}]),style:n.normalizeStyle({background:n.unref(Dn)(we)}),title:n.unref(Bn)(we),onClick:Qe=>y(F,we)},null,14,cx))),128)),I(F)?(n.openBlock(),n.createElementBlock("span",dx,"선택 "+n.toDisplayString(r.value.size)+"개 일괄",1)):n.createCommentVNode("",!0)])],10,H$)}),128))],8,T$)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-52beb53b"]]),mx=["disabled"],px={class:"em-panel__sub-label"},hx={class:"em-attr__row"},yx={class:"em-field em-idx-params"},gx=["value","onChange"],bx=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,l=n.computed(()=>a.state.logical.entities.find(m=>m.modelId===o.entityId)??null);function r(){var h;if(!l.value)return;const m=l.value.attributes[0];a.addIndex(l.value.modelId,{modelId:Me(),name:`idx_${(((h=l.value.indexes)==null?void 0:h.length)??0)+1}`,unique:!1,columns:m?[{columnRef:m.modelId,descending:!1}]:[]})}function s(m,h){l.value&&a.updateIndex(l.value.modelId,m,h)}function c(m){var _;const h=(_=l.value)==null?void 0:_.attributes[0];h&&s(m.modelId,{columns:[...m.columns,{columnRef:h.modelId,descending:!1}]})}function d(m,h,_){s(m.modelId,{columns:m.columns.map((b,g)=>g===h?{...b,columnRef:_}:b)})}function u(m,h,_){s(m.modelId,{columns:m.columns.map((b,g)=>g===h?{...b,descending:_}:b)})}function f(m,h){s(m.modelId,{columns:m.columns.filter((_,b)=>b!==h)})}function p(m,h){s(m.modelId,{parameters:h.trim()===""?void 0:h})}return(m,h)=>{var _;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:h[0]||(h[0]=b=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",px,[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(((_=l.value.indexes)==null?void 0:_.length)??0)+") ",1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:n.withModifiers(r,["stop"])})],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(l.value.indexes??[],b=>(n.openBlock(),n.createElementBlock("div",{key:b.modelId,class:"em-attr"},[n.createElementVNode("div",hx,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`idx-name-${b.modelId}`,width:"100%",placeholder:"인덱스명","model-value":b.name,"onUpdate:modelValue":g=>s(b.modelId,{name:g})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-uq-${b.modelId}`,class:"em-check",label:"UQ","model-value":b.unique,"onUpdate:modelValue":g=>s(b.modelId,{unique:g})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:g=>n.unref(a).removeIndex(l.value.modelId,b.modelId)},null,8,["onClick"])]),n.createVNode(mn,{controller:n.unref(a),"ref-id":b.modelId},null,8,["controller","ref-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.columns,(g,I)=>(n.openBlock(),n.createElementBlock("div",{key:I,class:"em-attr__row"},[n.createVNode(n.unref(ie.BSSelect),{class:"grow","model-value":g.columnRef,items:l.value.attributes,"value-provider":y=>y.modelId,"label-provider":y=>y.name,"onUpdate:modelValue":y=>y&&d(b,I,y)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-${b.modelId}-desc-${I}`,class:"em-check",label:"DESC","model-value":g.descending,"onUpdate:modelValue":y=>u(b,I,y)},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"−",onClick:y=>f(b,I)},null,8,["onClick"])]))),128)),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"컬럼",onClick:g=>c(b)},null,8,["onClick"]),n.createElementVNode("label",yx,[h[1]||(h[1]=n.createElementVNode("span",null,"조건 (partial index)",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:b.parameters??"",rows:"2",placeholder:"예: WHERE status = 'A'",onChange:g=>p(b,g.target.value)},null,40,gx)])]))),128)):n.createCommentVNode("",!0)],8,mx)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-dcc068ac"]]),_x=["disabled"],wx={class:"em-panel__sub-label"},vx={class:"em-attr__row"},kx={class:"em-attr__row"},Ex={class:"em-multilang"},Nx={class:"em-attr__pii"},$x={class:"em-swatch__row em-attr__swatch"},xx=["onClick"],Ix=["title","onClick"],Sx=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,l=ie.useModal(),r=n.computed(()=>a.state.logical.entities.find(y=>y.modelId===o.entityId)??null),s=n.computed(()=>r.value?a.state.layout.entityLayouts.find(y=>y.entityRef===r.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(y){return y==="none"?"(없음)":y}const f=y=>y;function p(y,N){r.value&&a.updateOperation(r.value.modelId,y.modelId,N)}function m(y,N){p(y,{description:Object.keys(N).length?N:void 0})}function h(y){return y.personalInfoAttributeType??"none"}function _(y,N){p(y,{personalInfoAttributeType:N==="none"?void 0:N})}function b(y){var N,q;return nt((q=(N=s.value)==null?void 0:N.operationStyles)==null?void 0:q[y.modelId])}function g(y,N){r.value&&a.setOperationSwatch(r.value.modelId,y.modelId,N)}function I(y){l.openModal({component:_d,bind:{operationName:y.name,sourceCode:y.sourceCode??"",onSave:N=>p(y,{sourceCode:N})}})}return(y,N)=>{var q;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:N[1]||(N[1]=U=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",wx,[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(((q=r.value.operations)==null?void 0:q.length)??0)+") ",1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"추가",onClick:N[0]||(N[0]=n.withModifiers(U=>n.unref(a).addOperation(r.value.modelId),["stop"]))})],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(r.value.operations??[],U=>(n.openBlock(),n.createElementBlock("div",{key:U.modelId,class:"em-attr"},[n.createElementVNode("div",vx,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`op-name-${U.modelId}`,width:"100%",placeholder:"오퍼레이션명","model-value":U.name,"onUpdate:modelValue":X=>p(U,{name:X})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{width:"96px","model-value":U.visibility??"PACKAGE",items:c,"value-provider":f,"label-provider":f,"onUpdate:modelValue":X=>X&&p(U,{visibility:X})},null,8,["model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:X=>n.unref(a).removeOperation(r.value.modelId,U.modelId)},null,8,["onClick"])]),n.createElementVNode("div",kx,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:U.sourceCode?"본문 편집 ●":"본문 편집",onClick:X=>I(U)},null,8,["caption","onClick"])]),n.createElementVNode("fieldset",Ex,[N[2]||(N[2]=n.createElementVNode("legend",null,"설명",-1)),n.createVNode(fl,{multiline:"",name:`op-desc-${U.modelId}`,languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":U.description,"onUpdate:modelValue":X=>m(U,X)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",Nx,[N[3]||(N[3]=n.createElementVNode("span",null,"개인정보",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":h(U),items:d,"value-provider":f,"label-provider":u,"onUpdate:modelValue":X=>X&&_(U,X)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("div",$x,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":b(U)===null}]),title:"없음",onClick:X=>g(U,null)},"∅",10,xx),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),X=>(n.openBlock(),n.createElementBlock("button",{key:X,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":b(U)===X}]),style:n.normalizeStyle({background:n.unref(Dn)(X)}),title:n.unref(Bn)(X),onClick:K=>g(U,X)},null,14,Ix))),128))])]))),128)):n.createCommentVNode("",!0)],8,_x)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-9c684fb9"]]),Cx={class:"em-panel__head"},Rx={class:"em-panel__head-row"},Vx={class:"em-panel__context"},Ax={key:0,class:"em-panel__lock"},Tx=["disabled"],Mx={key:0,class:"em-panel__note"},Bx={key:1,class:"em-panel__note"},Dx={key:2,class:"em-jpa"},Ox={class:"em-field"},Lx={class:"em-field"},Px={key:0,class:"em-field"},zx={class:"em-panel__sub"},Ux={class:"em-field"},Hx={class:"em-jpa"},Fx={key:0,class:"em-panel__note"},Gx={class:"em-jpa"},Yx={class:"em-field"},Wx={key:0,class:"em-panel__note"},Kx={class:"em-field"},qx={class:"em-multilang"},Xx={class:"em-field"},jx=["value"],Zx={class:"em-field"},Jx={class:"em-swatch"},Qx={class:"em-swatch__row"},eI=["title","onClick"],tI={class:"em-panel__note"},nI={class:"em-field"},oI=["value"],iI={class:"em-swatch"},aI={class:"em-swatch__row"},lI=["title","onClick"],zu=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,l=n.computed(()=>a.selection.value),r=n.computed(()=>a.inspectedEntityId.value),s=n.computed(()=>{const j=r.value;return j?a.state.logical.entities.find(Y=>Y.modelId===j)??null:null}),c=n.computed(()=>{const j=l.value;if((j==null?void 0:j.kind)==="association"){const E=a.state.logical.associations.find(A=>A.modelId===j.id);return!!E&&(a.isEntityLocked(E.end1.entityRef)||a.isEntityLocked(E.end2.entityRef))}const Y=r.value;return!!Y&&a.isEntityLocked(Y)}),d=n.computed(()=>{var j;return((j=a.selectedAttr.value)==null?void 0:j.attrId)??null}),u=n.computed(()=>new Set(a.selectedAttrIds.value)),f=n.computed(()=>d.value!==null),p=n.ref({});n.watch(f,()=>{p.value={}});function m(j){return p.value[j]??f.value}function h(j){p.value={...p.value,[j]:!m(j)}}const _=n.computed(()=>{var E;const j=s.value;if(!j)return"엔티티";const Y=(E=j.table)==null?void 0:E.physicalName;return Y?`${j.name} (${Y})`:j.name}),b=n.computed(()=>{const j=l.value;return(j==null?void 0:j.kind)==="association"?a.state.logical.associations.find(Y=>Y.modelId===j.id)??null:null}),g=n.computed(()=>{const j=l.value;return(j==null?void 0:j.kind)==="group"?a.state.logical.groups.find(Y=>Y.modelId===j.id)??null:null}),I=n.computed(()=>{const j=l.value;return(j==null?void 0:j.kind)==="note"?a.state.layout.notes.find(Y=>Y.modelId===j.id)??null:null}),y=n.computed(()=>{var Y,E;const j=(Y=g.value)==null?void 0:Y.name;return(j==null?void 0:j.ko)||(j==null?void 0:j.en)||(j==null?void 0:j.ja)||(j==null?void 0:j.zh)||((E=g.value)==null?void 0:E.packageName)||"그룹"}),N=n.computed(()=>{if(s.value){const j=u.value.size;if(j>1)return`엔티티 · ${s.value.name} › 속성 · ${j}개`;if(d.value){const Y=s.value.attributes.find(E=>E.modelId===d.value);return(Y==null?void 0:Y.attrType)==="DIVIDER"?`엔티티 · ${s.value.name} › 구분선`:`엔티티 · ${s.value.name} › 속성 · ${(Y==null?void 0:Y.name)??""}`}return`엔티티 · ${s.value.name}`}if(b.value){const j=Y=>{var E;return((E=a.state.logical.entities.find(A=>A.modelId===Y))==null?void 0:E.name)??Y};return`관계 · ${j(b.value.end1.entityRef)} — ${j(b.value.end2.entityRef)}`}return g.value?`그룹 · ${y.value}`:I.value?"노트":"선택된 항목 없음"}),q=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],U=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],X=["LIST","SET"],K=["inherit","LAZY","EAGER"],W=j=>j;function ne(j){return j==="inherit"?"기본(따름)":j}const re=n.computed(()=>!!b.value&&b.value.end1.entityRef===b.value.end2.entityRef);function L(j,Y){b.value&&a.updateAssociationEnd(b.value.modelId,j,Y)}function Q(j){b.value&&!re.value&&a.setAssociationIdentifying(b.value.modelId,j)}function v(j){var Y,E,A;return!!((A=(E=(Y=b.value)==null?void 0:Y[j].jpa)==null?void 0:E.cascadeTypes)!=null&&A.includes("ALL"))}function T(j,Y,E){var G,J;const A=(G=b.value)==null?void 0:G[j];if(Y==="ALL"&&E){L(j,{jpa:{...A==null?void 0:A.jpa,cascadeTypes:["ALL"]}});return}const R=new Set(((J=A==null?void 0:A.jpa)==null?void 0:J.cascadeTypes)??[]);E?R.add(Y):R.delete(Y),L(j,{jpa:{...A==null?void 0:A.jpa,cascadeTypes:[...R]}})}function $(j,Y){var A;const E=(A=b.value)==null?void 0:A[j];L(j,{jpa:{...E==null?void 0:E.jpa,...Y}})}function P(j){var Y,E;return((E=(Y=b.value)==null?void 0:Y[j].jpa)==null?void 0:E.fetchType)??"inherit"}function H(j,Y){$(j,{fetchType:Y==="inherit"?void 0:Y})}function te(j){var E;const Y=(E=b.value)==null?void 0:E[j==="end1"?"end2":"end1"];return(Y==null?void 0:Y.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(Y==null?void 0:Y.multiplicity)==="ONE_OR_MORE_INSTANCES"}const M=n.computed(()=>{const j=b.value;if(!j)return null;for(const Y of a.state.logical.entities){const E=Y.attributes.find(G=>{var J;return((J=G.embedded)==null?void 0:J.associationRef)===j.modelId&&G.attrType==="EMBED_OWN"});if(!E)continue;const A=j.end2.entityRef===E.embedded.embeddableRef?"end2":"end1",R=j[A].jpa;return{which:A,isCollection:j[A].multiplicity!=="EXACTLY_ONE_INSTANCE",collectionType:(R==null?void 0:R.collectionType)??"LIST",collectionTable:(R==null?void 0:R.collectionTable)??"",orderColumn:(R==null?void 0:R.orderColumn)??""}}return null});function ee(j){b.value&&a.setEmbedCollectionMode(b.value.modelId,j?"COLLECTION":"SINGLE")}function le(j){const Y=M.value;Y&&$(Y.which,j==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function me(j){const Y=M.value;Y&&$(Y.which,{collectionTable:j.trim()||void 0})}function ye(j){const Y=M.value;Y&&$(Y.which,{orderColumn:j.trim()||void 0})}function ce(j){g.value&&a.updateGroup(g.value.modelId,j)}function ue(j,Y){var E;ce({name:{...(E=g.value)==null?void 0:E.name,[j]:Y}})}const he=n.computed(()=>{var j;return g.value?nt((j=a.state.layout.groupLayouts.find(Y=>Y.groupRef===g.value.modelId))==null?void 0:j.style):null});function ve(j){g.value&&a.setGroupSwatch(g.value.modelId,j)}function Se(j){I.value&&a.setNoteMemo(I.value.modelId,j)}const Ie=n.computed(()=>{var j;return nt((j=I.value)==null?void 0:j.style)});function pe(j){I.value&&a.setNoteSwatch(I.value.modelId,j)}return(j,Y)=>(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:"너비 조절",onPointerdown:Y[0]||(Y[0]=(...E)=>e.startResize&&e.startResize(...E))},null,34),n.createElementVNode("header",Cx,[n.createElementVNode("div",Rx,[Y[13]||(Y[13]=n.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),n.createElementVNode("button",{type:"button",class:"em-panel__btn",title:"접기",onClick:Y[1]||(Y[1]=E=>i("collapse"))},[n.createVNode(Re,{name:"panel-right-close",size:16})])]),n.createElementVNode("p",Vx,n.toDisplayString(N.value),1),c.value&&r.value?(n.openBlock(),n.createElementBlock("div",Ax,[n.createVNode(Re,{name:"lock",size:13}),Y[14]||(Y[14]=n.createElementVNode("span",null,"편집 잠김 — 이동·수정·삭제 차단",-1)),n.unref(a).editable.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:Y[2]||(Y[2]=E=>n.unref(a).setEntityLocked(r.value,!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(yd,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("basics"),title:_.value,onToggle:Y[3]||(Y[3]=E=>h("basics"))},null,8,["controller","entity-id","collapsed","title"]),n.createVNode(fx,{controller:n.unref(a),"entity-id":s.value.modelId},null,8,["controller","entity-id"]),n.createVNode(bx,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("index"),onToggle:Y[4]||(Y[4]=E=>h("index"))},null,8,["controller","entity-id","collapsed"]),n.createVNode(Sx,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:m("ops"),onToggle:Y[5]||(Y[5]=E=>h("ops"))},null,8,["controller","entity-id","collapsed"])],64)):n.createCommentVNode("",!0),b.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(n.unref(ie.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:"identifying (식별 관계)","model-value":!!b.value.identifying,disabled:re.value||!!M.value,"onUpdate:modelValue":Q},null,8,["model-value","disabled"]),re.value?(n.openBlock(),n.createElementBlock("p",Mx,"셀프 연관은 식별 관계로 둘 수 없습니다 (비식별 FK 강제).")):M.value?(n.openBlock(),n.createElementBlock("p",Bx,"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 (임베더블은 독립 식별자가 없음).")):n.createCommentVNode("",!0),M.value?(n.openBlock(),n.createElementBlock("fieldset",Dx,[Y[18]||(Y[18]=n.createElementVNode("legend",null,"임베드",-1)),n.createVNode(n.unref(ie.BSCheckbox),{name:"embed-collection",class:"em-check",label:"컬렉션 (@ElementCollection)","model-value":M.value.isCollection,"onUpdate:modelValue":ee},null,8,["model-value"]),M.value.isCollection?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",Ox,[Y[15]||(Y[15]=n.createElementVNode("span",null,"collectionType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":M.value.collectionType,items:X,"value-provider":W,"label-provider":W,"onUpdate:modelValue":Y[6]||(Y[6]=E=>E&&le(E))},null,8,["model-value"])]),n.createElementVNode("label",Lx,[Y[16]||(Y[16]=n.createElementVNode("span",null,"collectionTable",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:"미지정 시 코드젠 폴백","model-value":M.value.collectionTable,"onUpdate:modelValue":me},null,8,["model-value"])]),M.value.collectionType==="LIST"?(n.openBlock(),n.createElementBlock("label",Px,[Y[17]||(Y[17]=n.createElementVNode("span",null,"orderColumn",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:"미지정 시 순서 비보존","model-value":M.value.orderColumn,"onUpdate:modelValue":ye},null,8,["model-value"])])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),Y[19]||(Y[19]=n.createElementVNode("p",{class:"em-panel__note"},"카디널리티는 이 토글로 변경됩니다 (임베더블 end 다중성 직접 편집 대신).",-1))])):n.createCommentVNode("",!0),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["end1","end2"],E=>{var A,R,G,J;return n.createElementVNode("div",{key:E,class:"em-end"},[n.createElementVNode("h4",zx,n.toDisplayString(E)+" → "+n.toDisplayString(b.value[E].entityRef),1),n.createElementVNode("label",Ux,[Y[20]||(Y[20]=n.createElementVNode("span",null,"다중성",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":b.value[E].multiplicity,items:q,"value-provider":W,"label-provider":W,disabled:((A=M.value)==null?void 0:A.which)===E,"onUpdate:modelValue":fe=>L(E,{multiplicity:fe})},null,8,["model-value","disabled","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${E}-navigable`,class:"em-check",label:"navigable","model-value":b.value[E].navigable,"onUpdate:modelValue":fe=>L(E,{navigable:fe})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${E}-composition`,class:"em-check",label:"composition","model-value":b.value[E].composition,"onUpdate:modelValue":fe=>L(E,{composition:fe})},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("fieldset",Hx,[Y[21]||(Y[21]=n.createElementVNode("legend",null,"cascade",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(U,fe=>{var _e,ke;return n.createVNode(n.unref(ie.BSCheckbox),{key:fe,name:`${E}-cascade-${fe}`,class:"em-check",label:fe,"model-value":!!((ke=(_e=b.value[E].jpa)==null?void 0:_e.cascadeTypes)!=null&&ke.includes(fe)),disabled:fe!=="ALL"&&v(E),"onUpdate:modelValue":be=>T(E,fe,be)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),v(E)?(n.openBlock(),n.createElementBlock("p",Fx,"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).")):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",Gx,[Y[24]||(Y[24]=n.createElementVNode("legend",null,"JPA 상세",-1)),n.createElementVNode("label",Yx,[Y[22]||(Y[22]=n.createElementVNode("span",null,"fetchType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":P(E),items:K,"value-provider":W,"label-provider":ne,"onUpdate:modelValue":fe=>fe&&H(E,fe)},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${E}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((R=b.value[E].jpa)!=null&&R.orphanRemoval),disabled:te(E),"onUpdate:modelValue":fe=>$(E,{orphanRemoval:fe})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),te(E)&&((G=b.value[E].jpa)!=null&&G.orphanRemoval)?(n.openBlock(),n.createElementBlock("p",Wx,"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).")):n.createCommentVNode("",!0),n.createElementVNode("label",Kx,[Y[23]||(Y[23]=n.createElementVNode("span",null,"orderBy",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:`${E}-orderby`,width:"100%",placeholder:"예: name ASC","model-value":((J=b.value[E].jpa)==null?void 0:J.orderBy)??"","onUpdate:modelValue":fe=>$(E,{orderBy:fe.trim()||void 0})},null,8,["name","model-value","onUpdate:modelValue"])])])])}),64))],64)):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("fieldset",qx,[Y[25]||(Y[25]=n.createElementVNode("legend",null,"그룹명",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,E=>{var A;return n.openBlock(),n.createElementBlock("label",{key:E,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(E),1),n.createVNode(n.unref(ie.BSTextInput),{name:`grp-name-${E}`,width:"100%","model-value":((A=g.value.name)==null?void 0:A[E])??"","onUpdate:modelValue":R=>ue(E,R)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("label",Xx,[Y[26]||(Y[26]=n.createElementVNode("span",null,"설명",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:g.value.description??"",rows:"3",onChange:Y[7]||(Y[7]=E=>ce({description:E.target.value}))},null,40,jx)]),n.createElementVNode("label",Zx,[Y[27]||(Y[27]=n.createElementVNode("span",null,"패키지",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"grp-package",width:"100%","model-value":g.value.packageName??"","onUpdate:modelValue":Y[8]||(Y[8]=E=>ce({packageName:E}))},null,8,["model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:"DDL 생성 제외","model-value":g.value.excludeDDLGeneration,"onUpdate:modelValue":Y[9]||(Y[9]=E=>ce({excludeDDLGeneration:E}))},null,8,["model-value"]),n.createElementVNode("fieldset",Jx,[Y[28]||(Y[28]=n.createElementVNode("legend",null,"색상",-1)),n.createElementVNode("div",Qx,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":he.value===null}]),title:"없음",onClick:Y[10]||(Y[10]=E=>ve(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),E=>(n.openBlock(),n.createElementBlock("button",{key:E,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":he.value===E}]),style:n.normalizeStyle({background:n.unref(Dn)(E)}),title:n.unref(Bn)(E),onClick:A=>ve(E)},null,14,eI))),128))])]),n.createElementVNode("p",tI,"멤버 엔티티 "+n.toDisplayString(g.value.memberEntityRefs.length)+"개",1)],64)):n.createCommentVNode("",!0),I.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("label",nI,[Y[29]||(Y[29]=n.createElementVNode("span",null,"메모",-1)),n.createElementVNode("textarea",{class:"em-textarea",value:I.value.memo,rows:"6",onChange:Y[11]||(Y[11]=E=>Se(E.target.value))},null,40,oI)]),n.createElementVNode("fieldset",iI,[Y[30]||(Y[30]=n.createElementVNode("legend",null,"색상",-1)),n.createElementVNode("div",aI,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ie.value===null}]),title:"없음",onClick:Y[12]||(Y[12]=E=>pe(null))},"∅",2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fn),E=>(n.openBlock(),n.createElementBlock("button",{key:E,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":Ie.value===E}]),style:n.normalizeStyle({background:n.unref(Dn)(E)}),title:n.unref(Bn)(E),onClick:A=>pe(E)},null,14,lI))),128))])])],64)):n.createCommentVNode("",!0)],8,Tx)],4))}}),[["__scopeId","data-v-2bdf0dab"]]),rI={NAME:"이름",JPA:"JPA",TYPE:"타입",DSN:"설계"};function sI(e){const t=e.split("-")[1];return t?rI[t]??t:e}function cI(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const dI=["title"],uI=["title","onClick"],fI={key:0,class:"em-validation__body"},mI={class:"em-validation__opt"},pI={key:0,class:"em-validation__empty"},hI={key:1,class:"em-validation__empty"},yI={key:2,class:"em-validation__list"},gI=["onClick"],bI={class:"em-validation__item-msg"},_I={key:0,class:"em-validation__item-entity"},wI=["title"],vI=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 _=new Map;for(const b of o.state.logical.entities)_.set(b.modelId,b.name);return _});function l(_){const b=cI(_);if(!b)return null;const g=a.value.get(b);return g===void 0?null:g.trim()===""?"(이름 없음)":g}const r={error:{order:0,icon:"alert-circle",label:"오류"},warning:{order:1,icon:"alert-triangle",label:"경고"},info:{order:2,icon:"info",label:"정보"}},s=n.computed(()=>{const _={error:0,warning:0,info:0};for(const b of i.value)_[b.severity]++;return _}),c=n.ref({error:!0,warning:!0,info:!0}),d=n.computed(()=>i.value.filter(_=>c.value[_.severity]).slice().sort((_,b)=>r[_.severity].order-r[b.severity].order)),u=n.computed(()=>d.value.map(_=>({issue:_,entityName:l(_),category:sI(_.ruleId)}))),f=n.ref(!1);function p(_){c.value[_]=!c.value[_]}function m(_){if(!f.value){f.value=!0;return}p(_)}function h(_){_.targetRef&&o.requestFocus(_.targetRef)}return(_,b)=>(n.openBlock(),n.createElementBlock("section",{class:n.normalizeClass(["em-validation",{"is-open":f.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:n.normalizeStyle(f.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[n.createElementVNode("header",{class:"em-validation__head",onClick:b[1]||(b[1]=g=>f.value=!f.value)},[n.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:f.value?"접기":"펼치기"},[n.createVNode(Re,{name:"chevron",size:14,class:n.normalizeClass([{"is-open":f.value},"em-validation__chevron"])},null,8,["class"]),b[3]||(b[3]=n.createElementVNode("span",{class:"em-validation__title"},"검증",-1))],8,dI),n.createElementVNode("div",{class:"em-validation__counts",onClick:b[0]||(b[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:f.value?`${r[g].label} ${c.value[g]?"숨기기":"표시"}`:"검증 패널 펼치기",onClick:I=>m(g)},[n.createVNode(Re,{name:r[g].icon,size:14},null,8,["name"]),n.createElementVNode("span",null,n.toDisplayString(s.value[g]),1)],10,uI)),64))])]),f.value?(n.openBlock(),n.createElementBlock("div",fI,[n.createElementVNode("label",mI,[n.createVNode(n.unref(ie.BSCheckbox),{name:"val-flag-norel",label:"관계 없는 엔티티 검사","model-value":n.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":b[2]||(b[2]=g=>n.unref(o).flagEntitiesWithoutRelations.value=g)},null,8,["model-value"])]),i.value.length===0?(n.openBlock(),n.createElementBlock("p",pI,"검증 이슈가 없습니다.")):d.value.length===0?(n.openBlock(),n.createElementBlock("p",hI," 표시할 이슈가 없습니다 (필터 적용 중). ")):(n.openBlock(),n.createElementBlock("ul",yI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,({issue:g,entityName:I,category:y},N)=>(n.openBlock(),n.createElementBlock("li",{key:`${g.ruleId}:${g.targetRef??"model"}:${N}`,class:n.normalizeClass(["em-validation__item",[`is-${g.severity}`,{"is-clickable":!!g.targetRef}]]),onClick:q=>h(g)},[n.createVNode(Re,{name:r[g.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),n.createElementVNode("span",bI,[I?(n.openBlock(),n.createElementBlock("span",_I,n.toDisplayString(I),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(g.message),1)]),n.createElementVNode("span",{class:"em-validation__item-cat",title:g.ruleId},n.toDisplayString(y),9,wI)],10,gI))),128))]))])):n.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-21432077"]]),kI={class:"em-history"},EI={class:"em-history__head"},NI={class:"em-history__title"},$I={class:"em-history__head-actions"},xI=["disabled"],II={class:"em-history__filters"},SI={class:"em-history__filter"},CI={class:"em-history__body"},RI={key:0,class:"em-history__empty"},VI={key:1,class:"em-history__empty is-error"},AI={key:2,class:"em-history__empty"},TI={key:3,class:"em-history__list"},MI=["onClick"],BI={class:"em-history__summary"},DI={class:"em-history__seq"},OI={class:"em-history__gmeta"},LI={class:"em-history__who"},PI={key:0,class:"em-history__time"},zI={key:1,class:"em-history__restored-from"},UI={key:0,class:"em-history__detail"},HI={class:"em-history__action-head"},FI={class:"em-history__action-name"},GI={key:0,class:"em-history__fields"},YI={class:"em-history__fname"},WI={key:0,class:"em-history__old"},KI={class:"em-history__val"},qI={key:1,class:"em-history__restore"},XI=["disabled","onClick"],jI=["disabled"],ZI=["onClick"],JI=Pe(n.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,l=n.ref([]),r=n.ref(!1),s=n.ref(null),c=n.ref(!1);async function d(){if(a.historyTransport){r.value=!0,s.value=null;try{l.value=await a.historyTransport(),c.value=!0}catch(M){s.value=M instanceof Error?M.message:"이력을 불러오지 못했습니다."}finally{r.value=!1}}}async function u(){await a.whenOpsSettled(),await d()}n.watch(()=>o.open,M=>{M&&u()},{immediate:!0});let f=null;n.watch(()=>a.revision.value,()=>{o.open&&(f&&clearTimeout(f),f=setTimeout(()=>void u(),500))}),n.watch(()=>a.reloadRequest.value,()=>{o.open&&u()});const p=n.computed(()=>new Map(a.state.logical.entities.map(M=>[M.modelId,M]))),m=n.computed(()=>new Map(a.state.logical.associations.map(M=>[M.modelId,M]))),h=n.computed(()=>new Map((a.state.logical.groups??[]).map(M=>{var ee;return[M.modelId,M.packageName||((ee=M.name)==null?void 0:ee.ko)||M.modelId]})));function _(M){var ye,ce,ue,he,ve,Se,Ie;const ee=m.value.get(M);if(!ee)return"연관";if((ye=ee.description)!=null&&ye.trim())return ee.description.trim();const le=(he=(ue=p.value.get((ce=ee.end1)==null?void 0:ce.entityRef))==null?void 0:ue.name)==null?void 0:he.trim(),me=(Ie=(Se=p.value.get((ve=ee.end2)==null?void 0:ve.entityRef))==null?void 0:Se.name)==null?void 0:Ie.trim();return le&&me?`${le}→${me}`:"연관"}function b(M){var ee,le,me,ye;if(M.kind==="entity")return((le=(ee=p.value.get(M.ref))==null?void 0:ee.name)==null?void 0:le.trim())||"(이름 없음)";if(M.kind==="attribute"||M.kind==="operation"||M.kind==="index"){const ce=M.entityRef?p.value.get(M.entityRef):void 0,he=((M.kind==="attribute"?ce==null?void 0:ce.attributes:M.kind==="operation"?ce==null?void 0:ce.operations:ce==null?void 0:ce.indexes)??[]).find(Se=>Se.modelId===M.ref),ve=(me=ce==null?void 0:ce.name)==null?void 0:me.trim();return`${ve?ve+".":""}${((ye=he==null?void 0:he.name)==null?void 0:ye.trim())||M.ref}`}return M.kind==="association"?_(M.ref):M.kind==="associationEnd"?`${_(M.ref)}(${M.end})`:M.kind==="group"?`그룹 ${h.value.get(M.ref)??M.ref}`:M.ref}const g={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},I={add:"추가",update:"수정",remove:"삭제"},y=n.ref("all"),N=[{v:"all",label:"전체"},{v:"edit",label:"편집"},{v:"restore",label:"복원"}],q=n.computed({get:()=>y.value,set:M=>{M&&(y.value=M)}}),U=n.computed(()=>lr(l.value)),X=n.computed(()=>U.value.length?U.value[0].seq:null),K=n.computed(()=>y.value==="all"?U.value:U.value.filter(M=>(M.kind??"edit")===y.value));function W(M){return M===void 0?"—":M===null?"(비움)":typeof M=="object"?JSON.stringify(M):String(M)}function ne(M){const ee=b(M.subject);if(M.verb==="add")return`${ee} 추가`;if(M.verb==="remove")return`${ee} 삭제`;if(M.fields.length===1){const le=M.fields[0];return`${ee}.${le.field} ${le.oldValue!==void 0?W(le.oldValue)+"→":""}${W(le.value)}`}return`${ee} ${M.fields.length}개 변경`}function re(M){return M.actions.length===0?"변경 없음":M.actions.length===1?ne(M.actions[0]):`${ne(M.actions[0])} 외 ${M.actions.length-1}건`}const L=n.ref(new Set);function Q(M){const ee=new Set(L.value);ee.has(M)?ee.delete(M):ee.add(M),L.value=ee}function v(M){if(M==null)return"";const ee=new Date(M);return isNaN(ee.getTime())?String(M):ee.toLocaleString()}function T(M){const ee=M.author,le=M.origin;return ee&&le?`${ee}(${le})`:ee||(le?`(${le})`:"—")}const $=n.ref(null),P=n.ref(!1);function H(M){$.value=M}async function te(M){P.value=!0;try{const ee=await a.restoreToSeq(M);ee.ok||(s.value=`복원 실패: ${ee.reason??"알 수 없음"}`)}finally{P.value=!1,$.value=null}}return(M,ee)=>(n.openBlock(),n.createBlock(n.Transition,{name:"em-history"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("section",kI,[n.createElementVNode("header",EI,[n.createElementVNode("div",NI,[n.createVNode(Re,{name:"undo",size:15}),ee[4]||(ee[4]=n.createElementVNode("span",null,"변경 이력",-1))]),n.createElementVNode("div",$I,[n.createElementVNode("button",{type:"button",class:"em-history__btn",title:"새로고침",disabled:r.value,onClick:ee[0]||(ee[0]=le=>d())},[n.createVNode(Re,{name:"redo",size:15})],8,xI),n.createElementVNode("button",{type:"button",class:"em-history__btn",title:"닫기",onClick:ee[1]||(ee[1]=le=>i("close"))},[n.createVNode(Re,{name:"panel-close",size:15})])])]),n.createElementVNode("div",II,[n.createElementVNode("label",SI,[ee[5]||(ee[5]=n.createElementVNode("span",null,"표시",-1)),n.createVNode(n.unref(ie.BSSelect),{modelValue:q.value,"onUpdate:modelValue":ee[2]||(ee[2]=le=>q.value=le),items:N,"value-provider":le=>le.v,"label-provider":le=>le.label},null,8,["modelValue","value-provider","label-provider"])])]),n.createElementVNode("div",CI,[r.value&&!c.value?(n.openBlock(),n.createElementBlock("p",RI,"이력을 불러오는 중…")):s.value?(n.openBlock(),n.createElementBlock("p",VI,n.toDisplayString(s.value),1)):K.value.length===0?(n.openBlock(),n.createElementBlock("p",AI,n.toDisplayString(c.value?"표시할 변경 이력이 없습니다.":"이력을 불러오세요."),1)):(n.openBlock(),n.createElementBlock("ul",TI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(K.value,le=>(n.openBlock(),n.createElementBlock("li",{key:le.seq,class:n.normalizeClass(["em-history__group",[`is-${le.kind??"edit"}`]])},[n.createElementVNode("div",{class:"em-history__ghead",onClick:me=>Q(le.seq)},[n.createVNode(Re,{name:"chevron",size:13,class:n.normalizeClass(["em-history__chevron",{"is-open":L.value.has(le.seq)}])},null,8,["class"]),n.createElementVNode("span",{class:n.normalizeClass(["em-history__kind",`is-${le.kind??"edit"}`])},n.toDisplayString(le.kind==="restore"?"복원":"편집"),3),n.createElementVNode("span",BI,n.toDisplayString(re(le)),1),n.createElementVNode("span",DI,"#"+n.toDisplayString(le.seq),1)],8,MI),n.createElementVNode("div",OI,[n.createElementVNode("span",LI,n.toDisplayString(T(le)),1),le.ts?(n.openBlock(),n.createElementBlock("span",PI,n.toDisplayString(v(le.ts)),1)):n.createCommentVNode("",!0),le.kind==="restore"&&le.restoredFromSeq!=null?(n.openBlock(),n.createElementBlock("span",zI,"← #"+n.toDisplayString(le.restoredFromSeq),1)):n.createCommentVNode("",!0)]),L.value.has(le.seq)?(n.openBlock(),n.createElementBlock("div",UI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(le.actions,(me,ye)=>(n.openBlock(),n.createElementBlock("div",{key:ye,class:"em-history__action"},[n.createElementVNode("div",HI,[n.createVNode(Re,{name:g[me.subject.kind],size:12},null,8,["name"]),n.createElementVNode("span",FI,n.toDisplayString(b(me.subject)),1),n.createElementVNode("span",{class:n.normalizeClass(["em-history__verb",`is-${me.verb}`])},n.toDisplayString(I[me.verb]),3)]),me.fields.length?(n.openBlock(),n.createElementBlock("ul",GI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(me.fields,(ce,ue)=>(n.openBlock(),n.createElementBlock("li",{key:ue,class:"em-history__field"},[n.createElementVNode("span",YI,n.toDisplayString(ce.field),1),ce.oldValue!==void 0?(n.openBlock(),n.createElementBlock("span",WI,n.toDisplayString(W(ce.oldValue)),1)):n.createCommentVNode("",!0),ce.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",KI,n.toDisplayString(W(ce.value)),1)]))),128))])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0),n.unref(a).restoreAvailable.value&&le.seq!==X.value?(n.openBlock(),n.createElementBlock("div",qI,[$.value===le.seq?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[ee[6]||(ee[6]=n.createElementVNode("span",{class:"em-history__confirm-msg"},"이 시점으로 되돌립니다.",-1)),n.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:P.value,onClick:me=>te(le.seq)},"복원",8,XI),n.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:P.value,onClick:ee[3]||(ee[3]=me=>$.value=null)},"취소",8,jI)],64)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:me=>H(le.seq)},[n.createVNode(Re,{name:"undo",size:12}),ee[7]||(ee[7]=n.createTextVNode(" 이 시점으로 복원 ",-1))],8,ZI))])):n.createCommentVNode("",!0)],2))),128))]))])],512),[[n.vShow,e.open]])]),_:1}))}}),[["__scopeId","data-v-23ba7bba"]]);function QI(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 Uu(e){const t=n.ref(QI(e.storageKey,e.min)??e.initial),o=n.ref(!1);function i(a){a.preventDefault();const l=a.clientX,r=t.value;o.value=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const s=d=>{const u=e.edge==="left"?l-d.clientX:d.clientX-l;let f=r+u;f=Math.max(e.min,f),e.max!=null&&(f=Math.min(e.max,f)),t.value=f},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 eS={class:"em-modeler"},tS={class:"em-modeler__body"},nS={class:"em-drawer__inner"},oS={class:"em-drawer__head"},iS={class:"em-drawer__actions"},aS=["title"],lS=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:l,startResize:r}=Uu({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:s,dragging:c,startResize:d}=Uu({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),u=n.ref(null),f=n.ref(null);return(p,m)=>{var h,_,b;return n.openBlock(),n.createElementBlock("div",eS,[n.createVNode(Pu,{controller:e.controller,"history-open":i.value,onExportSvg:m[0]||(m[0]=g=>{var I;return(I=u.value)==null?void 0:I.exportSvg()}),onToggleHistory:m[1]||(m[1]=g=>i.value=!i.value)},null,8,["controller","history-open"]),n.createElementVNode("div",tS,[n.createElementVNode("aside",{class:n.normalizeClass(["em-drawer",{"is-collapsed":!t.value}]),style:n.normalizeStyle({width:n.unref(a)+"px"})},[n.createElementVNode("div",nS,[n.createElementVNode("header",oS,[m[9]||(m[9]=n.createElementVNode("span",null,"Diagram Explorer",-1)),n.createElementVNode("div",iS,[(h=f.value)!=null&&h.hasExpandable?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:(_=f.value)!=null&&_.allExpanded?"모두 접기":"모두 펼치기",onClick:m[2]||(m[2]=g=>{var I;return(I=f.value)==null?void 0:I.toggleAll()})},[n.createVNode(Re,{name:(b=f.value)!=null&&b.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,aS)):n.createCommentVNode("",!0),n.createElementVNode("button",{type:"button",class:"em-drawer__btn",title:"접기",onClick:m[3]||(m[3]=g=>t.value=!1)},[n.createVNode(Re,{name:"panel-close",size:16})])])]),n.createVNode(Lu,{ref_key:"explorer",ref:f,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(l)}]),title:"너비 조절",onPointerdown:m[4]||(m[4]=(...g)=>n.unref(r)&&n.unref(r)(...g))},null,34),[[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:"Diagram Explorer 열기",onClick:m[5]||(m[5]=g=>t.value=!0)},[n.createVNode(Re,{name:"panel-open",size:18})],512),[[n.vShow,!t.value]])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["em-modeler__canvas",{"is-drawer-open":t.value,"is-resizing":n.unref(l),"is-inspector-collapsed":!o.value}]),style:n.normalizeStyle({"--em-drawer-shift":n.unref(a)-6+"px"})},[n.createVNode(Ou,{ref_key:"canvas",ref:u,controller:e.controller},null,8,["controller"])],6),n.withDirectives(n.createVNode(zu,{controller:e.controller,width:n.unref(s),resizing:n.unref(c),"start-resize":n.unref(d),onCollapse:m[6]||(m[6]=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:"Inspector 열기",onClick:m[7]||(m[7]=g=>o.value=!0)},[n.createVNode(Re,{name:"panel-right-open",size:18})],512),[[n.vShow,!o.value]])]),_:1}),n.createVNode(JI,{controller:e.controller,open:i.value,onClose:m[8]||(m[8]=g=>i.value=!1)},null,8,["controller","open"])]),n.createVNode(vI,{controller:e.controller,"panel-width":n.unref(s),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-dc519653"]]);Ee.APPLY_MODEL_OPS_INPUT_SCHEMA=dm,Ee.AssociationEdge=Ud,Ee.CUSTOM_TYPE_VALUE=Lt,Ee.CommandStack=_a,Ee.DEFAULT_JAVA_TYPE=fa,Ee.DiagramCanvas=Ou,Ee.DiagramExplorer=Lu,Ee.EDITOR=pn,Ee.EditModeToggle=A$,Ee.EditorToolbar=Pu,Ee.EntityModeler=lS,Ee.EntityNode=$d,Ee.GROUP_CODE_ENUM_VALUE=Yn,Ee.GroupNode=xd,Ee.JAVA_TYPES=ma,Ee.NoteNode=Id,Ee.OpSyncAdapter=jr,Ee.PHYSICAL_NAME_MAX_LENGTH=ha,Ee.PropertyPanel=zu,Ee.RevCache=Xr,Ee.SELECTABLE_JAVA_TYPES=Jl,Ee.SYMBOLIC_OP_KINDS=Zr,Ee.SYMBOLIC_OP_SCHEMA=ss,Ee.anchoredEdgePoint=sa,Ee.buildAgentBatch=um,Ee.buildDiagramSvg=Bu,Ee.buildOrthogonalPath=ia,Ee.buildSelfLoopPath=Fl,Ee.buildStraightPath=la,Ee.commands=Mf,Ee.computeAutoLayout=Gl,Ee.createEditorController=W_,Ee.displayLabel=Lo,Ee.emptyState=vd,Ee.entityModelToText=ql,Ee.estimateEntityHeight=Wl,Ee.exportDiagramSvg=Du,Ee.fromPersisted=Nm,Ee.indexColumnsByModelId=Wn,Ee.javaTypeLabel=wn,Ee.migrateLegacyMoney=hf,Ee.newId=Me,Ee.orthogonalMidpoints=aa,Ee.packEntityBoxes=qu,Ee.physicalNameWarning=Uo,Ee.projectActionLog=lr,Ee.projectEntityAudit=ir,Ee.projectFieldAudit=Pt,Ee.rectExitPoint=ra,Ee.renderDiagramSvg=jl,Ee.resolveDiagram=Ul,Ee.resolveSharedColumn=zo,Ee.resolveSymbolicOps=em,Ee.restoreDeepEqual=vn,Ee.segmentMidpoints=ca,Ee.sideDir=Gn,Ee.synthesizeRestoreOps=$f,Ee.toPersisted=Lm,Ee.toPersistedV2=Pm,Ee.validateModel=nr,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})}));
|