@mlightcad/cad-diff-viewer 1.8.0-preview.3 → 1.8.0-preview.5
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/cad-diff-viewer.js +189 -188
- package/dist/cad-diff-viewer.umd.cjs +12 -12
- package/lib/AcApDiffSettingsDialog.d.ts +1 -1
- package/lib/AcApDiffSettingsDialog.d.ts.map +1 -1
- package/lib/AcApDiffSettingsDialog.js +2 -2
- package/lib/AcApDiffSettingsDialog.js.map +1 -1
- package/lib/AcApDiffViewer.d.ts +1 -1
- package/lib/AcApDiffViewer.d.ts.map +1 -1
- package/lib/AcApDiffViewer.js +6 -5
- package/lib/AcApDiffViewer.js.map +1 -1
- package/lib/compare/acapCompareChangeSets.d.ts +1 -1
- package/lib/compare/acapCompareChangeSets.d.ts.map +1 -1
- package/lib/compare/acapCompareDrawings.d.ts +1 -1
- package/lib/compare/acapCompareDrawings.d.ts.map +1 -1
- package/lib/compare/acapCompareDrawings.js +2 -2
- package/lib/compare/acapCompareDrawings.js.map +1 -1
- package/lib/compare/index.d.ts +3 -3
- package/lib/compare/index.d.ts.map +1 -1
- package/lib/compare/index.js +3 -3
- package/lib/compare/index.js.map +1 -1
- package/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +7 -5
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/messages.d.ts +212 -0
- package/lib/i18n/messages.d.ts.map +1 -1
- package/lib/i18n/messages.js +13 -0
- package/lib/i18n/messages.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(P,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("@mlightcad/cad-simple-viewer"),require("@mlightcad/cad-simple-viewer/icons"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/cad-simple-viewer","@mlightcad/cad-simple-viewer/icons","@mlightcad/data-model"],b):(P=typeof globalThis<"u"?globalThis:P||self,b(P["cad-diff-viewer"]={},P.cadSimpleViewer,P.icons,P.dataModel))})(this,(function(P,b,D,v){"use strict";function ce(a){const e=[];for(const t of a.kinds)t!=="added"&&t!=="deleted"&&t!=="modified"||e.includes(t)||e.push(t);return e.length===1?e[0]:"modified"}function Ee(a,e){e!=="unchanged"&&(a.includes(e)||a.push(e))}function Ae(a,e){const t=Math.max(1,Math.min(25,Math.trunc(e)));return Math.max(a,1)*(t/250)}function q(a,e){return{minX:a.minX-e,minY:a.minY-e,maxX:a.maxX+e,maxY:a.maxY+e}}function Le(a,e){return a.minX<=e.maxX&&a.maxX>=e.minX&&a.minY<=e.maxY&&a.maxY>=e.minY}function Me(a,e){return{minX:Math.min(a.minX,e.minX),minY:Math.min(a.minY,e.minY),maxX:Math.max(a.maxX,e.maxX),maxY:Math.max(a.maxY,e.maxY)}}function fe(a,e,t){const i=[];for(const c of a){if(c.kind==="unchanged")continue;const l=c.extents;l&&i.push({box:{minX:l.minX,minY:l.minY,maxX:l.maxX,maxY:l.maxY},objectId:c.objectId,side:c.side,kind:c.kind})}if(i.length===0)return[];const s=Ae(e,t),o=i.map(c=>q(c.box,s)),n=i.map((c,l)=>l),r=c=>{let l=c;for(;n[l]!==l;)l=n[l];let f=c;for(;n[f]!==l;){const p=n[f];n[f]=l,f=p}return l};for(let c=0;c<i.length;c++)for(let l=c+1;l<i.length;l++)if(Le(o[c],o[l])){const f=r(c),p=r(l);f!==p&&(n[p]=f)}const d=new Map;for(let c=0;c<i.length;c++){const l=r(c),f=i[c],p=d.get(l);if(!p){d.set(l,{extents:q(f.box,s),objectIds:[f.objectId],hasLeft:f.side==="left",hasRight:f.side==="right",kinds:[f.kind]});continue}p.extents=Me(p.extents,q(f.box,s)),p.objectIds.push(f.objectId),f.side==="left"?p.hasLeft=!0:p.hasRight=!0,Ee(p.kinds,f.kind)}return[...d.values()]}function T(a,e){const t=typeof a=="number"?a:Number(a);return Number.isFinite(t)?Math.trunc(t):e}const Z=T(v.ACDB_COMPAREPROPS_COLOR,1),$=T(v.ACDB_COMPAREPROPS_LAYER,2),J=T(v.ACDB_COMPAREPROPS_LINETYPE,4),Q=T(v.ACDB_COMPAREPROPS_LINETYPESCALE,8),ee=T(v.ACDB_COMPAREPROPS_LINEWEIGHT,16),te=T(v.ACDB_COMPAREPROPS_TRANSPARENCY,32),ie=T(v.ACDB_COMPAREPROPS_THICKNESS,64),se=T(v.ACDB_COMPAREPROPS_DEFAULT,0),ne=T(v.ACDB_COMPAREHATCH_DEFAULT,0),oe=T(v.ACDB_COMPARERCMARGIN_DEFAULT,5),De=T(v.ACDB_COMPARERCMARGIN_MIN,1),Re=T(v.ACDB_COMPARERCMARGIN_MAX,25),re=T(v.ACDB_COMPARETEXT_DEFAULT,1),X=T(v.ACDB_COMPARETOLERANCE_DEFAULT,6),me=T(v.ACDB_COMPARETOLERANCE_MIN,0),pe=T(v.ACDB_COMPARETOLERANCE_MAX,14);function V(a,e){const t=typeof a=="number"?a:Number(a);return Number.isFinite(t)?Math.trunc(t):e}function Y(){const a=v.AcDbSysVarManager.instance();return{compareprops:V(a.getDefaultValue(v.AcDbSystemVariables.COMPAREPROPS),se),comparehatch:V(a.getDefaultValue(v.AcDbSystemVariables.COMPAREHATCH),ne),comparercmargin:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARERCMARGIN),oe),comparetext:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARETEXT),re),comparetolerance:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARETOLERANCE),X)}}function he(a,e){const t=v.AcDbSysVarManager.instance(),i=Y(),s=a??e,o=a??e;return{compareprops:s?V(t.getVar(v.AcDbSystemVariables.COMPAREPROPS,s),i.compareprops):i.compareprops,comparehatch:o?V(t.getVar(v.AcDbSystemVariables.COMPAREHATCH,o),i.comparehatch):i.comparehatch,comparercmargin:o?V(t.getVar(v.AcDbSystemVariables.COMPARERCMARGIN,o),i.comparercmargin):i.comparercmargin,comparetext:o?V(t.getVar(v.AcDbSystemVariables.COMPARETEXT,o),i.comparetext):i.comparetext,comparetolerance:o?V(t.getVar(v.AcDbSystemVariables.COMPARETOLERANCE,o),i.comparetolerance):i.comparetolerance}}function ae(a,e){if(e.length===0)return;const t=v.AcDbSysVarManager.instance(),i=e[0];t.setVar(v.AcDbSystemVariables.COMPAREPROPS,a.compareprops,i);for(const s of e)t.setVar(v.AcDbSystemVariables.COMPAREHATCH,a.comparehatch,s),t.setVar(v.AcDbSystemVariables.COMPARERCMARGIN,a.comparercmargin,s),t.setVar(v.AcDbSystemVariables.COMPARETEXT,a.comparetext,s),t.setVar(v.AcDbSystemVariables.COMPARETOLERANCE,a.comparetolerance,s)}function ue(a){const e=T(a,X);return 10**-Math.max(me,Math.min(pe,e))}const Oe={color:Z,layer:$,lineType:J,lineTypeScale:Q,lineWeight:ee,transparency:te,thickness:ie},Ve=new Set(["HATCH"]),Ne=new Set(["TEXT","MTEXT","ATTRIB","ATTDEF"]);function C(a,e){return Number.isFinite(a)?Math.round(a/e)*e:0}function le(a){try{const e=a.geometricExtents;return!(e!=null&&e.min)||!(e!=null&&e.max)?void 0:{minX:e.min.x,minY:e.min.y,maxX:e.max.x,maxY:e.max.y}}catch{return}}function N(a,e){return a?`${C(a.x??0,e)},${C(a.y??0,e)},${C(a.z??0,e)}`:""}function R(a){return Number.isFinite(a)?String(Number(a.toFixed(6))):String(a)}function j(a){const e=R(a.x??0),t=R(a.y??0),i=a.z??0;return Math.abs(i)<1e-9?`(${e}, ${t})`:`(${e}, ${t}, ${R(i)})`}function de(a){return`${R(a*180/Math.PI)}°`}function Ie(a,e){var l,f,p,u;const t=a,i=[],s=(h,g,k)=>{i.push({id:h,display:g,key:k})};s("layer",String(t.layer??""),String(t.layer??""));const o=((f=(l=t.color)==null?void 0:l.toString)==null?void 0:f.call(l))??"";s("color",o,o);const n=t.lineType??"";s("lineType",n,n),s("lineWeight",t.lineWeight!=null?String(t.lineWeight):"",String(t.lineWeight??"")),typeof t.linetypeScale=="number"&&s("lineTypeScale",R(t.linetypeScale),String(C(t.linetypeScale,e)));const r=(u=(p=t.transparency)==null?void 0:p.toString)==null?void 0:u.call(p);r!=null&&r!==""&&s("transparency",r,r),typeof t.thickness=="number"&&s("thickness",R(t.thickness),String(C(t.thickness,e)));const d=i.length;if(t.startPoint&&t.endPoint){const h=t.startPoint,g=t.endPoint;s("startPoint",j(h),N(h,e)),s("endPoint",j(g),N(g,e))}if(t.center){const h=t.center;s("center",j(h),N(h,e))}if(typeof t.radius=="number"&&s("radius",R(t.radius),String(C(t.radius,e))),typeof t.startAngle=="number"&&typeof t.endAngle=="number"&&(s("startAngle",de(t.startAngle),String(C(t.startAngle,e))),s("endAngle",de(t.endAngle),String(C(t.endAngle,e)))),t.position){const h=t.position;s("position",j(h),N(h,e))}if(t.location){const h=t.location;s("location",j(h),N(h,e))}if(typeof t.rotation=="number"&&s("rotation",de(t.rotation),String(C(t.rotation,e))),typeof t.height=="number"&&s("height",R(t.height),String(C(t.height,e))),typeof t.blockName=="string"&&s("blockName",t.blockName,t.blockName),t.scaleFactors){const h=t.scaleFactors;s("scale",`${R(h.x??1)}, ${R(h.y??1)}, ${R(h.z??1)}`,`${C(h.x??1,e)},${C(h.y??1,e)},${C(h.z??1,e)}`)}typeof t.textString=="string"&&s("text",t.textString,t.textString),typeof t.contents=="string"&&s("mtext",t.contents,t.contents);const c=le(a);return c&&i.length===d&&s("extents",`${j({x:c.minX,y:c.minY})} – ${j({x:c.maxX,y:c.maxY})}`,`${C(c.minX,e)},${C(c.minY,e)},${C(c.maxX,e)},${C(c.maxY,e)}`),s("objectId",String(a.objectId??""),String(a.objectId??"")),i}function Be(a,e,t){const i=new Map(a.fields.map(u=>[u.id,u])),s=new Map(e.fields.map(u=>[u.id,u])),o=[],n=new Set;for(const u of[...a.fields,...e.fields])n.has(u.id)||(n.add(u.id),o.push(u.id));const r=i.get("startPoint"),d=i.get("endPoint"),c=s.get("startPoint"),l=s.get("endPoint"),f=r!=null&&d!=null&&c!=null&&l!=null&&[r.key,d.key].sort().join("|")===[c.key,l.key].sort().join("|"),p=[];for(const u of o){if(f&&(u==="startPoint"||u==="endPoint"))continue;const h=Oe[u];if(h!=null&&(t&h)===0)continue;const g=i.get(u),k=s.get(u);((g==null?void 0:g.key)??"")!==((k==null?void 0:k.key)??"")&&p.push({field:u,oldValue:(g==null?void 0:g.display)??"",newValue:(k==null?void 0:k.display)??""})}return p.length===0&&a.fingerprint!==e.fingerprint&&p.push({field:"geometry",oldValue:"",newValue:""}),p}function Fe(a,e){const t=a,i=[String(t.dxfTypeName??t.type??"")];if(t.startPoint&&t.endPoint){const o=N(t.startPoint,e),n=N(t.endPoint,e);i.push(o<n?`${o}|${n}`:`${n}|${o}`)}if(t.center&&i.push(`c:${N(t.center,e)}`),typeof t.radius=="number"&&i.push(`r:${C(t.radius,e)}`),typeof t.startAngle=="number"&&typeof t.endAngle=="number"&&i.push(`a:${C(t.startAngle,e)}:${C(t.endAngle,e)}`),t.position&&i.push(`p:${N(t.position,e)}`),t.location&&i.push(`l:${N(t.location,e)}`),typeof t.rotation=="number"&&i.push(`rot:${C(t.rotation,e)}`),typeof t.height=="number"&&i.push(`h:${C(t.height,e)}`),typeof t.blockName=="string"&&i.push(`blk:${t.blockName}`),t.scaleFactors){const o=t.scaleFactors;i.push(`s:${C(o.x??1,e)},${C(o.y??1,e)},${C(o.z??1,e)}`)}typeof t.textString=="string"&&i.push(`t:${t.textString}`),typeof t.contents=="string"&&i.push(`m:${t.contents}`);const s=le(a);return s&&i.length<=1&&i.push(`ext:${C(s.minX,e)},${C(s.minY,e)},${C(s.maxX,e)},${C(s.maxY,e)}`),i.join(";")}function _e(a,e){var s,o,n,r;if(e===0)return"";const t=a,i=[];return e&Z&&i.push(((o=(s=t.color)==null?void 0:s.toString)==null?void 0:o.call(s))??""),e&$&&i.push(String(t.layer??"")),e&J&&i.push(t.lineType??""),e&Q&&i.push(String(t.linetypeScale??"")),e&ee&&i.push(String(t.lineWeight??"")),e&te&&i.push(((r=(n=t.transparency)==null?void 0:n.toString)==null?void 0:r.call(n))??""),e&ie&&i.push(String(t.thickness??"")),i.join("|")}function He(a){return Ve.has(a.toUpperCase())}function je(a){return Ne.has(a.toUpperCase())}function ze(a,e,t,i,s){const o=[],n=a.tables.blockTable.modelSpace;for(const r of n.newIterator()){const d=String(r.objectId??"");if(!d)continue;const c=String(r.dxfTypeName??r.type??"UNKNOWN");!i&&He(c)||!s&&je(c)||o.push({entity:r,objectId:d,dxfType:c,layer:String(r.layer??"0"),fingerprint:Fe(r,e),propKey:_e(r,t),extents:le(r),fields:Ie(r,e)})}return o}function Ue(a,e){let t=1/0,i=1/0,s=-1/0,o=-1/0;for(const n of[...a,...e]){const r=n.extents;r&&(t=Math.min(t,r.minX),i=Math.min(i,r.minY),s=Math.max(s,r.maxX),o=Math.max(o,r.maxY))}return Number.isFinite(t)?Math.max(s-t,o-i,1):1}function F(a,e,t,i,s){return{side:e,objectId:a.objectId,dxfType:a.dxfType,layer:a.layer,kind:t,pairedId:i,extents:a.extents,changes:s}}function ge(a,e,t,i){const s=Be(e,t,i);a.push(F(e,"left","modified",t.objectId,s)),a.push(F(t,"right","modified",e.objectId,s))}function ye(a,e,t={}){const i=t.compareProps??se,s=(t.compareHatch??ne)!==0,o=(t.compareText??re)!==0,n=t.compareTolerance??X,r=t.compareRcMargin??oe,d=t.tolerance!=null&&t.tolerance>0?t.tolerance:ue(n),c=y=>ze(y,d,i,s,o),l=c(a),f=c(e),p=new Map(f.map(y=>[y.objectId,y])),u=new Set,h=[],g=[],k=[],x=[],O=[];for(const y of l){const w=p.get(y.objectId);if(w&&y.dxfType===w.dxfType){u.add(w.objectId);const L=y.fingerprint===w.fingerprint,A=y.propKey===w.propKey;L&&A?t.includeUnchanged&&(x.push(F(y,"left","unchanged",w.objectId)),x.push(F(w,"right","unchanged",y.objectId))):ge(k,y,w,i)}else O.push(y)}const M=f.filter(y=>!u.has(y.objectId)),K=(i&$)!==0,H=y=>K?`${y.dxfType}\0${y.layer}`:y.dxfType,I=new Map;for(const y of M){const w=H(y),L=I.get(w);L?L.push(y):I.set(w,[y])}for(const y of O){const w=I.get(H(y));let L=-1;if(w&&(L=w.findIndex(A=>A.fingerprint===y.fingerprint)),L>=0&&w){const A=w.splice(L,1)[0];u.add(A.objectId),y.propKey===A.propKey?t.includeUnchanged&&(x.push(F(y,"left","unchanged",A.objectId)),x.push(F(A,"right","unchanged",y.objectId))):ge(k,y,A,i)}else g.push(F(y,"left","deleted"))}for(const y of M)u.has(y.objectId)||h.push(F(y,"right","added"));const G=[...g,...k.filter(y=>y.side==="left"),...h],z=fe([...g,...k,...h],Ue(l,f),r);return{added:h,deleted:g,modified:k,unchanged:x,navigation:G,changeSets:z}}const be={openFile:"Open file",noDrawing:"No drawing",emptyTitle:"Drop a drawing here",emptyHint:"or click to open a DWG / DXF",invalidFile:"Please choose a .dwg or .dxf file",toolbarSideBySide:"Side by side",toolbarOverlay:"Overlay",toolbarSyncViews:"Sync views",toolbarTogglePanel:"Results panel",toolbarPrev:"Previous difference",toolbarNext:"Next difference",toolbarSettings:"Settings",toolbarLanguage:"Language",toolbarThemeLight:"Switch to dark theme",toolbarThemeDark:"Switch to light theme",toolbarMarkup:"Markup",markupGenerateClouds:"Generate cloud markups",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rectangle",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupLine:"Line",markupHighlight:"Highlight",markupShow:"Show markups",markupHide:"Hide markups",markupClear:"Clear markups",panelTitle:"Compare",panelClose:"Close panel",tabResults:"Results",tabMarkups:"Markups",groupByType:"By entity type",groupByKind:"By change",kindAdded:"Added",kindDeleted:"Deleted",kindModified:"Modified",diffDetails:"Show differences",diffColProperty:"Property",diffColOld:"Old",diffColNew:"New",diffGeometryChanged:"Geometry changed",diffVisible:"Visible",diffHidden:"Hidden",fieldObjectId:"Handle",fieldLayer:"Layer",fieldColor:"Color",fieldLineType:"Linetype",fieldLineWeight:"Lineweight",fieldLineTypeScale:"Linetype scale",fieldTransparency:"Transparency",fieldThickness:"Thickness",fieldVisibility:"Visibility",fieldStartPoint:"Start point",fieldEndPoint:"End point",fieldCenter:"Center",fieldRadius:"Radius",fieldStartAngle:"Start angle",fieldEndAngle:"End angle",fieldPosition:"Position",fieldLocation:"Location",fieldRotation:"Rotation",fieldHeight:"Height",fieldBlockName:"Block",fieldScale:"Scale",fieldText:"Text",fieldMtext:"MText",fieldExtents:"Extents",fieldGeometry:"Geometry",noResults:"Open two drawings to compare",noMarkups:"No markups yet",markupFromLeft:"Left",markupFromRight:"Right",comparing:"Comparing…",settingsTitle:"Settings",settingsTabColors:"Colors",settingsTabObjects:"Objects",settingsTabGeometry:"Geometry",settingsUnchanged:"Unchanged objects",settingsDeleted:"Deleted objects",settingsAdded:"Added objects",settingsModified:"Modified objects",settingsSectionColors:"Colors",settingsSectionObjects:"Objects",settingsIncludeHatch:"Include hatch objects",settingsIncludeText:"Include text objects",settingsSectionProps:"Object properties",settingsPropsHint:"Property changes are ignored unless selected (COMPAREPROPS). Layer-table color or linetype changes are never compared.",settingsPropColor:"Color",settingsPropLayer:"Layer",settingsPropLinetype:"Linetype",settingsPropLinetypeScale:"Linetype scale",settingsPropLineweight:"Lineweight",settingsPropTransparency:"Transparency",settingsPropThickness:"Thickness",settingsSectionClouds:"Revision clouds",settingsRcMargin:"Margin",settingsSectionTolerance:"Tolerance",settingsTolerance:"Decimal places",settingsOk:"OK",settingsCancel:"Cancel",settingsReset:"Reset",settingsClose:"Close"},Ke={openFile:"打开文件",noDrawing:"未打开图纸",emptyTitle:"拖拽图纸到此处",emptyHint:"或点击打开 DWG / DXF",invalidFile:"请选择 .dwg 或 .dxf 文件",toolbarSideBySide:"左右分屏",toolbarOverlay:"叠图",toolbarSyncViews:"同步左右视图",toolbarTogglePanel:"结果面板",toolbarPrev:"上一个差异",toolbarNext:"下一个差异",toolbarSettings:"设置",toolbarLanguage:"语言",toolbarThemeLight:"切换为深色主题",toolbarThemeDark:"切换为浅色主题",toolbarMarkup:"批注",markupGenerateClouds:"生成云线批注",markupCloud:"云线",markupCallout:"引出标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupLine:"直线",markupHighlight:"高亮",markupShow:"显示批注",markupHide:"隐藏批注",markupClear:"清除批注",panelTitle:"比对",panelClose:"关闭面板",tabResults:"比对结果",tabMarkups:"批注",groupByType:"按图元类型",groupByKind:"按增删改",kindAdded:"新增",kindDeleted:"删除",kindModified:"修改",diffDetails:"查看差异",diffColProperty:"属性",diffColOld:"旧版",diffColNew:"新版",diffGeometryChanged:"几何已变化",diffVisible:"可见",diffHidden:"隐藏",fieldObjectId:"句柄",fieldLayer:"图层",fieldColor:"颜色",fieldLineType:"线型",fieldLineWeight:"线宽",fieldLineTypeScale:"线型比例",fieldTransparency:"透明度",fieldThickness:"厚度",fieldVisibility:"可见性",fieldStartPoint:"起点",fieldEndPoint:"终点",fieldCenter:"圆心",fieldRadius:"半径",fieldStartAngle:"起始角度",fieldEndAngle:"终止角度",fieldPosition:"位置",fieldLocation:"插入点",fieldRotation:"旋转",fieldHeight:"高度",fieldBlockName:"块名",fieldScale:"缩放",fieldText:"文字",fieldMtext:"多行文字",fieldExtents:"范围",fieldGeometry:"几何",noResults:"请打开两张图纸进行比对",noMarkups:"暂无批注",markupFromLeft:"左侧",markupFromRight:"右侧",comparing:"正在比对…",settingsTitle:"设置",settingsTabColors:"颜色",settingsTabObjects:"对象",settingsTabGeometry:"几何",settingsUnchanged:"相同对象",settingsDeleted:"删除的对象",settingsAdded:"新增的对象",settingsModified:"修改的对象",settingsSectionColors:"颜色",settingsSectionObjects:"对象",settingsIncludeHatch:"包含填充对象",settingsIncludeText:"包含文字对象",settingsSectionProps:"对象属性",settingsPropsHint:"未勾选的属性变化不会计入差异(COMPAREPROPS)。图层表中的颜色或线型变化不会比较。",settingsPropColor:"颜色",settingsPropLayer:"图层",settingsPropLinetype:"线型",settingsPropLinetypeScale:"线型比例",settingsPropLineweight:"线宽",settingsPropTransparency:"透明度",settingsPropThickness:"厚度",settingsSectionClouds:"修订云线",settingsRcMargin:"边距",settingsSectionTolerance:"公差",settingsTolerance:"小数位数",settingsOk:"确定",settingsCancel:"取消",settingsReset:"恢复默认",settingsClose:"关闭"},Ge={openFile:"Dosya aç",noDrawing:"Çizim yok",emptyTitle:"Bir çizimi buraya bırakın",emptyHint:"veya DWG / DXF açmak için tıklayın",invalidFile:"Lütfen bir .dwg veya .dxf dosyası seçin",toolbarSideBySide:"Yan yana",toolbarOverlay:"Üst üste",toolbarSyncViews:"Görünümleri eşitle",toolbarTogglePanel:"Sonuç paneli",toolbarPrev:"Önceki fark",toolbarNext:"Sonraki fark",toolbarSettings:"Ayarlar",toolbarLanguage:"Dil",toolbarThemeLight:"Koyu temaya geç",toolbarThemeDark:"Açık temaya geç",toolbarMarkup:"İşaretleme",markupGenerateClouds:"Bulut işaretlemeleri oluştur",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dikdörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupLine:"Çizgi",markupHighlight:"Vurgu",markupShow:"İşaretleri Göster",markupHide:"İşaretleri Gizle",markupClear:"İşaretleri Temizle",panelTitle:"Karşılaştır",panelClose:"Paneli kapat",tabResults:"Sonuçlar",tabMarkups:"İşaretlemeler",groupByType:"Varlık türüne göre",groupByKind:"Değişime göre",kindAdded:"Eklenen",kindDeleted:"Silinen",kindModified:"Değiştirilen",diffDetails:"Farkları göster",diffColProperty:"Özellik",diffColOld:"Eski",diffColNew:"Yeni",diffGeometryChanged:"Geometri değişti",diffVisible:"Görünür",diffHidden:"Gizli",fieldObjectId:"Tutamak",fieldLayer:"Katman",fieldColor:"Renk",fieldLineType:"Çizgi tipi",fieldLineWeight:"Çizgi kalınlığı",fieldLineTypeScale:"Çizgi tipi ölçeği",fieldTransparency:"Saydamlık",fieldThickness:"Kalınlık",fieldVisibility:"Görünürlük",fieldStartPoint:"Başlangıç noktası",fieldEndPoint:"Bitiş noktası",fieldCenter:"Merkez",fieldRadius:"Yarıçap",fieldStartAngle:"Başlangıç açısı",fieldEndAngle:"Bitiş açısı",fieldPosition:"Konum",fieldLocation:"Konum",fieldRotation:"Döndürme",fieldHeight:"Yükseklik",fieldBlockName:"Blok",fieldScale:"Ölçek",fieldText:"Metin",fieldMtext:"Çok satırlı metin",fieldExtents:"Sınırlar",fieldGeometry:"Geometri",noResults:"Karşılaştırmak için iki çizim açın",noMarkups:"Henüz işaretleme yok",markupFromLeft:"Sol",markupFromRight:"Sağ",comparing:"Karşılaştırılıyor…",settingsTitle:"Ayarlar",settingsTabColors:"Renkler",settingsTabObjects:"Nesneler",settingsTabGeometry:"Geometri",settingsUnchanged:"Aynı nesneler",settingsDeleted:"Silinen nesneler",settingsAdded:"Eklenen nesneler",settingsModified:"Değiştirilen nesneler",settingsSectionColors:"Renkler",settingsSectionObjects:"Nesneler",settingsIncludeHatch:"Tarama nesnelerini dahil et",settingsIncludeText:"Metin nesnelerini dahil et",settingsSectionProps:"Nesne özellikleri",settingsPropsHint:"Seçilmeyen özellik değişiklikleri karşılaştırılmaz (COMPAREPROPS). Katman tablosundaki renk veya çizgi tipi değişiklikleri karşılaştırılmaz.",settingsPropColor:"Renk",settingsPropLayer:"Katman",settingsPropLinetype:"Çizgi tipi",settingsPropLinetypeScale:"Çizgi tipi ölçeği",settingsPropLineweight:"Çizgi kalınlığı",settingsPropTransparency:"Saydamlık",settingsPropThickness:"Kalınlık",settingsSectionClouds:"Revizyon bulutları",settingsRcMargin:"Kenar boşluğu",settingsSectionTolerance:"Tolerans",settingsTolerance:"Ondalık basamak",settingsOk:"Tamam",settingsCancel:"İptal",settingsReset:"Sıfırla",settingsClose:"Kapat"},$e={openFile:"Otevřít soubor",noDrawing:"Žádný výkres",emptyTitle:"Přetáhněte výkres sem",emptyHint:"nebo klikněte pro otevření DWG / DXF",invalidFile:"Vyberte soubor .dwg nebo .dxf",toolbarSideBySide:"Vedle sebe",toolbarOverlay:"Překrytí",toolbarSyncViews:"Synchronizovat pohledy",toolbarTogglePanel:"Panel výsledků",toolbarPrev:"Předchozí rozdíl",toolbarNext:"Další rozdíl",toolbarSettings:"Nastavení",toolbarLanguage:"Jazyk",toolbarThemeLight:"Přepnout na tmavý motiv",toolbarThemeDark:"Přepnout na světlý motiv",toolbarMarkup:"Poznámky",markupGenerateClouds:"Vytvořit obláčky",markupCloud:"Oblak",markupCallout:"Popisek",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupLine:"Úsečka",markupHighlight:"Zvýraznění",markupShow:"Zobrazit poznámky",markupHide:"Skrýt poznámky",markupClear:"Vymazat poznámky",panelTitle:"Porovnání",panelClose:"Zavřít panel",tabResults:"Výsledky",tabMarkups:"Poznámky",groupByType:"Podle typu entity",groupByKind:"Podle změny",kindAdded:"Přidané",kindDeleted:"Smazané",kindModified:"Upravené",diffDetails:"Zobrazit rozdíly",diffColProperty:"Vlastnost",diffColOld:"Staré",diffColNew:"Nové",diffGeometryChanged:"Geometrie se změnila",diffVisible:"Viditelné",diffHidden:"Skryté",fieldObjectId:"Handle",fieldLayer:"Hladina",fieldColor:"Barva",fieldLineType:"Typ čáry",fieldLineWeight:"Tloušťka čáry",fieldLineTypeScale:"Měřítko typu čáry",fieldTransparency:"Průhlednost",fieldThickness:"Tloušťka",fieldVisibility:"Viditelnost",fieldStartPoint:"Počáteční bod",fieldEndPoint:"Koncový bod",fieldCenter:"Střed",fieldRadius:"Poloměr",fieldStartAngle:"Počáteční úhel",fieldEndAngle:"Koncový úhel",fieldPosition:"Pozice",fieldLocation:"Umístění",fieldRotation:"Rotace",fieldHeight:"Výška",fieldBlockName:"Blok",fieldScale:"Měřítko",fieldText:"Text",fieldMtext:"MText",fieldExtents:"Rozsah",fieldGeometry:"Geometrie",noResults:"Otevřete dva výkresy pro porovnání",noMarkups:"Zatím žádné poznámky",markupFromLeft:"Levý",markupFromRight:"Pravý",comparing:"Porovnávání…",settingsTitle:"Nastavení",settingsTabColors:"Barvy",settingsTabObjects:"Objekty",settingsTabGeometry:"Geometrie",settingsUnchanged:"Stejné objekty",settingsDeleted:"Smazané objekty",settingsAdded:"Přidané objekty",settingsModified:"Upravené objekty",settingsSectionColors:"Barvy",settingsSectionObjects:"Objekty",settingsIncludeHatch:"Zahrnout šrafy",settingsIncludeText:"Zahrnout textové objekty",settingsSectionProps:"Vlastnosti objektů",settingsPropsHint:"Nezaškrtnuté změny vlastností se neporovnávají (COMPAREPROPS). Změny barvy nebo typu čáry v tabulce hladin se neporovnávají.",settingsPropColor:"Barva",settingsPropLayer:"Hladina",settingsPropLinetype:"Typ čáry",settingsPropLinetypeScale:"Měřítko typu čáry",settingsPropLineweight:"Tloušťka čáry",settingsPropTransparency:"Průhlednost",settingsPropThickness:"Tloušťka",settingsSectionClouds:"Revizní obláčky",settingsRcMargin:"Okraj",settingsSectionTolerance:"Tolerance",settingsTolerance:"Desetinná místa",settingsOk:"OK",settingsCancel:"Zrušit",settingsReset:"Obnovit výchozí",settingsClose:"Zavřít"},Xe={openFile:"فتح ملف",noDrawing:"لا يوجد رسم",emptyTitle:"أسقط رسمًا هنا",emptyHint:"أو انقر لفتح ملف DWG / DXF",invalidFile:"يرجى اختيار ملف .dwg أو .dxf",toolbarSideBySide:"جنبًا إلى جنب",toolbarOverlay:"تراكب",toolbarTogglePanel:"لوحة النتائج",toolbarPrev:"الاختلاف السابق",toolbarNext:"الاختلاف التالي",toolbarLanguage:"اللغة",toolbarMarkup:"علامات المراجعة",markupGenerateClouds:"إنشاء سحب المراجعة",markupCloud:"سحابة",markupCallout:"تعليق توضيحي",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupLine:"خط",markupHighlight:"تمييز",markupShow:"إظهار علامات المراجعة",markupHide:"إخفاء علامات المراجعة",markupClear:"مسح علامات المراجعة",panelTitle:"مقارنة",panelClose:"إغلاق اللوحة",tabResults:"النتائج",tabMarkups:"علامات المراجعة",groupByType:"حسب نوع العنصر",groupByKind:"حسب التغيير",kindAdded:"مضاف",kindDeleted:"محذوف",kindModified:"معدّل",diffDetails:"إظهار الاختلافات",diffColProperty:"الخاصية",diffColOld:"القديم",diffColNew:"الجديد",diffGeometryChanged:"تغيرت الهندسة",diffVisible:"مرئي",diffHidden:"مخفي",fieldObjectId:"المقبض",fieldLayer:"الطبقة",fieldColor:"اللون",fieldLineType:"نوع الخط",fieldLineWeight:"سُمك الخط",fieldLineTypeScale:"مقياس نوع الخط",fieldTransparency:"الشفافية",fieldThickness:"السماكة",fieldVisibility:"الرؤية",fieldStartPoint:"نقطة البداية",fieldEndPoint:"نقطة النهاية",fieldCenter:"المركز",fieldRadius:"نصف القطر",fieldStartAngle:"زاوية البداية",fieldEndAngle:"زاوية النهاية",fieldPosition:"الموضع",fieldLocation:"الموقع",fieldRotation:"الدوران",fieldHeight:"الارتفاع",fieldBlockName:"الكتلة",fieldScale:"المقياس",fieldText:"نص",fieldMtext:"نص متعدد الأسطر",fieldExtents:"الحدود",fieldGeometry:"الهندسة",noResults:"افتح رسمين للمقارنة",noMarkups:"لا توجد علامات مراجعة بعد",markupFromLeft:"اليسار",markupFromRight:"اليمين",comparing:"جارٍ المقارنة…",settingsTitle:"الإعدادات",settingsTabColors:"الألوان",settingsTabObjects:"الكائنات",settingsTabGeometry:"الهندسة",settingsUnchanged:"كائنات دون تغيير",settingsDeleted:"كائنات محذوفة",settingsAdded:"كائنات مضافة",settingsModified:"كائنات معدّلة",settingsSectionColors:"الألوان",settingsSectionObjects:"الكائنات",settingsIncludeHatch:"تضمين كائنات التظليل",settingsIncludeText:"تضمين كائنات النص",settingsSectionProps:"خصائص الكائن",settingsPropsHint:"لا تُحتسب تغييرات الخصائص غير المحددة (COMPAREPROPS). لا تُقارن تغيرات لون أو نوع خط جدول الطبقات.",settingsPropColor:"اللون",settingsPropLayer:"الطبقة",settingsPropLinetype:"نوع الخط",settingsPropLinetypeScale:"مقياس نوع الخط",settingsPropLineweight:"سُمك الخط",settingsPropTransparency:"الشفافية",settingsPropThickness:"السماكة",settingsSectionClouds:"غيوم المراجعة",settingsRcMargin:"الهامش",settingsSectionTolerance:"التسامح",settingsTolerance:"المنازل العشرية",settingsOk:"موافق",settingsCancel:"إلغاء",settingsReset:"إعادة تعيين",settingsClose:"إغلاق"},U="diffViewer";let ve=!1;function ke(){ve||(b.AcApI18n.mergeLocaleMessage("en",{[U]:be}),b.AcApI18n.mergeLocaleMessage("zh",{[U]:Ke}),b.AcApI18n.mergeLocaleMessage("tr",{[U]:Ge}),b.AcApI18n.mergeLocaleMessage("cs",{[U]:$e}),b.AcApI18n.mergeLocaleMessage("ar",{[U]:Xe}),ve=!0)}function m(a){return b.AcApI18n.t(`${U}.${a}`,{fallback:be[a]})}const Ye=[{role:"unchanged",labelKey:"settingsUnchanged"},{role:"deleted",labelKey:"settingsDeleted"},{role:"added",labelKey:"settingsAdded"},{role:"modified",labelKey:"settingsModified"}],We=[{bit:Z,labelKey:"settingsPropColor"},{bit:$,labelKey:"settingsPropLayer"},{bit:J,labelKey:"settingsPropLinetype"},{bit:Q,labelKey:"settingsPropLinetypeScale"},{bit:ee,labelKey:"settingsPropLineweight"},{bit:te,labelKey:"settingsPropTransparency"},{bit:ie,labelKey:"settingsPropThickness"}];function _(a){return`#${(a&16777215).toString(16).padStart(6,"0")}`}function qe(a){const e=/^#?([0-9a-f]{6})$/i.exec(a.trim());if(e)return parseInt(e[1],16)}const E=class E extends b.AcUiDialog{constructor(e){super({host:e.host??document.body,title:m("settingsTitle"),closeLabel:m("settingsClose"),titleId:"ml-diff-settings-title",dialogClassName:"ml-diff-settings-dialog",theme:e.theme}),this.pickers=new Map,this.hexLabels=new Map,this.propChecks=new Map,this.tabButtons=[],this.tabPanels=[],this._confirmed=!1,this.initial={colors:{...e.colors},sysVars:{...e.sysVars}},this.draft={colors:{...e.colors},sysVars:{...e.sysVars}},this.onChange=e.onChange,E.ensureSettingsStyles(),this.buildContent()}static open(e){var i;(i=E.openInstance)==null||i.close();const t=new E(e);return E.openInstance=t,t.show().then(()=>({confirmed:t._confirmed,colors:t._confirmed?{...t.draft.colors}:{...t.initial.colors},sysVars:t._confirmed?{...t.draft.sysVars}:{...t.initial.sysVars}}))}static dismiss(){var e;(e=E.openInstance)==null||e.close()}close(){E.openInstance===this&&(E.openInstance=null),super.close()}buildContent(){const e=[{id:"colors",label:m("settingsTabColors"),panel:this.buildColorsPanel()},{id:"objects",label:m("settingsTabObjects"),panel:this.buildObjectsPanel()},{id:"geometry",label:m("settingsTabGeometry"),panel:this.buildGeometryPanel()}],t=document.createElement("div");t.className="ml-diff-settings-tabs",t.setAttribute("role","tablist"),t.setAttribute("aria-label",m("settingsTitle"));const i=document.createElement("div");i.className="ml-diff-settings-panels",e.forEach((r,d)=>{const c=`ml-diff-settings-tab-${r.id}`,l=`ml-diff-settings-panel-${r.id}`,f=document.createElement("button");f.type="button",f.id=c,f.className="ml-diff-settings-tab",f.setAttribute("role","tab"),f.setAttribute("aria-controls",l),f.textContent=r.label,f.addEventListener("click",()=>this.selectTab(d)),f.addEventListener("keydown",p=>this.onTabKeyDown(p,d)),this.tabButtons.push(f),t.appendChild(f),r.panel.id=l,r.panel.classList.add("ml-diff-settings-panel"),r.panel.setAttribute("role","tabpanel"),r.panel.setAttribute("aria-labelledby",c),this.tabPanels.push(r.panel),i.appendChild(r.panel)}),this.bodyEl.append(t,i),this.selectTab(0);const s=document.createElement("button");s.type="button",s.className="ml-ui-dialog-btn ml-diff-settings-btn-secondary ml-diff-settings-reset",s.textContent=m("settingsReset"),s.addEventListener("click",()=>this.resetToDefaults());const o=document.createElement("button");o.type="button",o.className="ml-ui-dialog-btn ml-diff-settings-btn-secondary",o.textContent=m("settingsCancel"),o.addEventListener("click",()=>this.close());const n=document.createElement("button");n.type="button",n.className="ml-ui-dialog-btn",n.textContent=m("settingsOk"),n.addEventListener("click",()=>{this._confirmed=!0,this.close()}),this.footerEl.classList.add("ml-diff-settings-footer"),this.footerEl.append(s,o,n),this.focusAfterOpen(n)}buildColorsPanel(){const e=document.createElement("div");e.className="ml-diff-settings-list";for(const t of Ye)e.appendChild(this.createColorRow(t.role,m(t.labelKey)));return e}buildObjectsPanel(){const e=document.createElement("div"),t=document.createElement("div");t.className="ml-diff-settings-check-grid",this.hatchCheck=this.createCheckRow(t,m("settingsIncludeHatch"),this.draft.sysVars.comparehatch!==0,n=>{this.draft.sysVars.comparehatch=n?1:0,this.emitChange()}),this.textCheck=this.createCheckRow(t,m("settingsIncludeText"),this.draft.sysVars.comparetext!==0,n=>{this.draft.sysVars.comparetext=n?1:0,this.emitChange()});const i=document.createElement("div"),s=document.createElement("p");s.className="ml-diff-settings-hint",s.textContent=m("settingsPropsHint");const o=document.createElement("div");o.className="ml-diff-settings-check-grid";for(const n of We){const r=this.createCheckRow(o,m(n.labelKey),(this.draft.sysVars.compareprops&n.bit)!==0,d=>{d?this.draft.sysVars.compareprops|=n.bit:this.draft.sysVars.compareprops&=~n.bit,this.emitChange()});this.propChecks.set(n.bit,r)}return i.append(s,o),e.append(t,this.createSection(m("settingsSectionProps"),()=>i)),e}buildGeometryPanel(){const e=document.createElement("div"),t=this.createSliderRow(m("settingsTolerance"),this.draft.sysVars.comparetolerance,me,pe,n=>{this.draft.sysVars.comparetolerance=n,this.emitChange()});this.toleranceInput=t.input,this.toleranceValue=t.valueEl;const i=this.createSliderRow(m("settingsRcMargin"),this.draft.sysVars.comparercmargin,De,Re,n=>{this.draft.sysVars.comparercmargin=n,this.emitChange()});this.marginInput=i.input,this.marginValue=i.valueEl;const s=document.createElement("div");s.appendChild(t.row);const o=document.createElement("div");return o.appendChild(i.row),e.append(this.createSection(m("settingsSectionTolerance"),()=>s),this.createSection(m("settingsSectionClouds"),()=>o)),e}selectTab(e){this.tabButtons.forEach((t,i)=>{const s=i===e;t.classList.toggle("is-active",s),t.setAttribute("aria-selected",s?"true":"false"),t.tabIndex=s?0:-1;const o=this.tabPanels[i];o&&(o.hidden=!s)})}onTabKeyDown(e,t){var o;const i=this.tabButtons.length-1;let s=t;if(e.key==="ArrowRight"||e.key==="ArrowDown")s=t===i?0:t+1;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")s=t===0?i:t-1;else if(e.key==="Home")s=0;else if(e.key==="End")s=i;else return;e.preventDefault(),this.selectTab(s),(o=this.tabButtons[s])==null||o.focus()}createSection(e,t){const i=document.createElement("section");i.className="ml-diff-settings-section";const s=document.createElement("h3");return s.className="ml-diff-settings-heading",s.textContent=e,i.append(s,t()),i}createColorRow(e,t){const i=document.createElement("label");i.className="ml-diff-settings-row";const s=document.createElement("span");s.className="ml-diff-settings-label",s.textContent=t;const o=document.createElement("span");o.className="ml-diff-settings-control";const n=document.createElement("span");n.className="ml-diff-settings-hex",n.textContent=_(this.draft.colors[e]),this.hexLabels.set(e,n);const r=document.createElement("input");return r.type="color",r.className="ml-diff-settings-color",r.value=_(this.draft.colors[e]),r.setAttribute("aria-label",t),r.addEventListener("input",()=>{const d=qe(r.value);d!=null&&(this.draft.colors[e]=d,n.textContent=_(d),this.emitChange())}),this.pickers.set(e,r),o.append(n,r),i.append(s,o),i}createCheckRow(e,t,i,s){const o=document.createElement("label");o.className="ml-diff-settings-check-item";const n=document.createElement("input");n.type="checkbox",n.className="ml-diff-settings-check",n.checked=i,n.addEventListener("change",()=>s(n.checked));const r=document.createElement("span");return r.className="ml-diff-settings-label",r.textContent=t,o.append(n,r),e.appendChild(o),n}createSliderRow(e,t,i,s,o){const n=document.createElement("label");n.className="ml-diff-settings-slider-row";const r=document.createElement("span");r.className="ml-diff-settings-slider-head";const d=document.createElement("span");d.className="ml-diff-settings-label",d.textContent=e;const c=document.createElement("span");c.className="ml-diff-settings-slider-value",c.textContent=String(t),r.append(d,c);const l=document.createElement("input");return l.type="range",l.className="ml-diff-settings-slider",l.min=String(i),l.max=String(s),l.step="1",l.value=String(t),l.setAttribute("aria-label",e),l.addEventListener("input",()=>{const f=Number(l.value);c.textContent=String(f),o(f)}),n.append(r,l),{row:n,input:l,valueEl:c}}resetToDefaults(){Object.assign(this.draft.colors,b.ACAP_DEFAULT_COMPARE_COLORS);const e=Y();this.draft.sysVars.compareprops=e.compareprops??se,this.draft.sysVars.comparehatch=e.comparehatch??ne,this.draft.sysVars.comparercmargin=e.comparercmargin??oe,this.draft.sysVars.comparetext=e.comparetext??re,this.draft.sysVars.comparetolerance=e.comparetolerance??X;for(const t of this.pickers.keys()){const i=_(this.draft.colors[t]),s=this.pickers.get(t),o=this.hexLabels.get(t);s&&(s.value=i),o&&(o.textContent=i)}this.hatchCheck&&(this.hatchCheck.checked=this.draft.sysVars.comparehatch!==0),this.textCheck&&(this.textCheck.checked=this.draft.sysVars.comparetext!==0);for(const[t,i]of this.propChecks)i.checked=(this.draft.sysVars.compareprops&t)!==0;this.marginInput&&this.marginValue&&(this.marginInput.value=String(this.draft.sysVars.comparercmargin),this.marginValue.textContent=String(this.draft.sysVars.comparercmargin)),this.toleranceInput&&this.toleranceValue&&(this.toleranceInput.value=String(this.draft.sysVars.comparetolerance),this.toleranceValue.textContent=String(this.draft.sysVars.comparetolerance)),this.emitChange()}emitChange(){var e;(e=this.onChange)==null||e.call(this,{colors:{...this.draft.colors},sysVars:{...this.draft.sysVars}})}static ensureSettingsStyles(){if(E.settingsStylesInjected)return;if(document.getElementById(E.settingsStyleId)){E.settingsStylesInjected=!0;return}const e=document.createElement("style");e.id=E.settingsStyleId,e.textContent=`
|
|
1
|
+
(function(P,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("@mlightcad/cad-simple-viewer"),require("@mlightcad/cad-simple-viewer/icons"),require("@mlightcad/data-model")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/cad-simple-viewer","@mlightcad/cad-simple-viewer/icons","@mlightcad/data-model"],b):(P=typeof globalThis<"u"?globalThis:P||self,b(P["cad-diff-viewer"]={},P.cadSimpleViewer,P.icons,P.dataModel))})(this,(function(P,b,D,v){"use strict";function fe(a){const e=[];for(const t of a.kinds)t!=="added"&&t!=="deleted"&&t!=="modified"||e.includes(t)||e.push(t);return e.length===1?e[0]:"modified"}function Ee(a,e){e!=="unchanged"&&(a.includes(e)||a.push(e))}function Ae(a,e){const t=Math.max(1,Math.min(25,Math.trunc(e)));return Math.max(a,1)*(t/250)}function Z(a,e){return{minX:a.minX-e,minY:a.minY-e,maxX:a.maxX+e,maxY:a.maxY+e}}function Le(a,e){return a.minX<=e.maxX&&a.maxX>=e.minX&&a.minY<=e.maxY&&a.maxY>=e.minY}function Me(a,e){return{minX:Math.min(a.minX,e.minX),minY:Math.min(a.minY,e.minY),maxX:Math.max(a.maxX,e.maxX),maxY:Math.max(a.maxY,e.maxY)}}function me(a,e,t){const i=[];for(const c of a){if(c.kind==="unchanged")continue;const l=c.extents;l&&i.push({box:{minX:l.minX,minY:l.minY,maxX:l.maxX,maxY:l.maxY},objectId:c.objectId,side:c.side,kind:c.kind})}if(i.length===0)return[];const s=Ae(e,t),o=i.map(c=>Z(c.box,s)),n=i.map((c,l)=>l),r=c=>{let l=c;for(;n[l]!==l;)l=n[l];let f=c;for(;n[f]!==l;){const p=n[f];n[f]=l,f=p}return l};for(let c=0;c<i.length;c++)for(let l=c+1;l<i.length;l++)if(Le(o[c],o[l])){const f=r(c),p=r(l);f!==p&&(n[p]=f)}const d=new Map;for(let c=0;c<i.length;c++){const l=r(c),f=i[c],p=d.get(l);if(!p){d.set(l,{extents:Z(f.box,s),objectIds:[f.objectId],hasLeft:f.side==="left",hasRight:f.side==="right",kinds:[f.kind]});continue}p.extents=Me(p.extents,Z(f.box,s)),p.objectIds.push(f.objectId),f.side==="left"?p.hasLeft=!0:p.hasRight=!0,Ee(p.kinds,f.kind)}return[...d.values()]}function T(a,e){const t=typeof a=="number"?a:Number(a);return Number.isFinite(t)?Math.trunc(t):e}const J=T(v.ACDB_COMPAREPROPS_COLOR,1),$=T(v.ACDB_COMPAREPROPS_LAYER,2),Q=T(v.ACDB_COMPAREPROPS_LINETYPE,4),ee=T(v.ACDB_COMPAREPROPS_LINETYPESCALE,8),te=T(v.ACDB_COMPAREPROPS_LINEWEIGHT,16),ie=T(v.ACDB_COMPAREPROPS_TRANSPARENCY,32),se=T(v.ACDB_COMPAREPROPS_THICKNESS,64),ne=T(v.ACDB_COMPAREPROPS_DEFAULT,0),oe=T(v.ACDB_COMPAREHATCH_DEFAULT,0),re=T(v.ACDB_COMPARERCMARGIN_DEFAULT,5),De=T(v.ACDB_COMPARERCMARGIN_MIN,1),Re=T(v.ACDB_COMPARERCMARGIN_MAX,25),ae=T(v.ACDB_COMPARETEXT_DEFAULT,1),X=T(v.ACDB_COMPARETOLERANCE_DEFAULT,6),pe=T(v.ACDB_COMPARETOLERANCE_MIN,0),he=T(v.ACDB_COMPARETOLERANCE_MAX,14);function V(a,e){const t=typeof a=="number"?a:Number(a);return Number.isFinite(t)?Math.trunc(t):e}function Y(){const a=v.AcDbSysVarManager.instance();return{compareprops:V(a.getDefaultValue(v.AcDbSystemVariables.COMPAREPROPS),ne),comparehatch:V(a.getDefaultValue(v.AcDbSystemVariables.COMPAREHATCH),oe),comparercmargin:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARERCMARGIN),re),comparetext:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARETEXT),ae),comparetolerance:V(a.getDefaultValue(v.AcDbSystemVariables.COMPARETOLERANCE),X)}}function ue(a,e){const t=v.AcDbSysVarManager.instance(),i=Y(),s=a??e,o=a??e;return{compareprops:s?V(t.getVar(v.AcDbSystemVariables.COMPAREPROPS,s),i.compareprops):i.compareprops,comparehatch:o?V(t.getVar(v.AcDbSystemVariables.COMPAREHATCH,o),i.comparehatch):i.comparehatch,comparercmargin:o?V(t.getVar(v.AcDbSystemVariables.COMPARERCMARGIN,o),i.comparercmargin):i.comparercmargin,comparetext:o?V(t.getVar(v.AcDbSystemVariables.COMPARETEXT,o),i.comparetext):i.comparetext,comparetolerance:o?V(t.getVar(v.AcDbSystemVariables.COMPARETOLERANCE,o),i.comparetolerance):i.comparetolerance}}function le(a,e){if(e.length===0)return;const t=v.AcDbSysVarManager.instance(),i=e[0];t.setVar(v.AcDbSystemVariables.COMPAREPROPS,a.compareprops,i);for(const s of e)t.setVar(v.AcDbSystemVariables.COMPAREHATCH,a.comparehatch,s),t.setVar(v.AcDbSystemVariables.COMPARERCMARGIN,a.comparercmargin,s),t.setVar(v.AcDbSystemVariables.COMPARETEXT,a.comparetext,s),t.setVar(v.AcDbSystemVariables.COMPARETOLERANCE,a.comparetolerance,s)}function ge(a){const e=T(a,X);return 10**-Math.max(pe,Math.min(he,e))}const Oe={color:J,layer:$,lineType:Q,lineTypeScale:ee,lineWeight:te,transparency:ie,thickness:se},Ve=new Set(["HATCH"]),Ne=new Set(["TEXT","MTEXT","ATTRIB","ATTDEF"]);function C(a,e){return Number.isFinite(a)?Math.round(a/e)*e:0}function de(a){try{const e=a.geometricExtents;return!(e!=null&&e.min)||!(e!=null&&e.max)?void 0:{minX:e.min.x,minY:e.min.y,maxX:e.max.x,maxY:e.max.y}}catch{return}}function N(a,e){return a?`${C(a.x??0,e)},${C(a.y??0,e)},${C(a.z??0,e)}`:""}function R(a){return Number.isFinite(a)?String(Number(a.toFixed(6))):String(a)}function z(a){const e=R(a.x??0),t=R(a.y??0),i=a.z??0;return Math.abs(i)<1e-9?`(${e}, ${t})`:`(${e}, ${t}, ${R(i)})`}function ce(a){return`${R(a*180/Math.PI)}°`}function Ie(a,e){var l,f,p,u;const t=a,i=[],s=(h,g,k)=>{i.push({id:h,display:g,key:k})};s("layer",String(t.layer??""),String(t.layer??""));const o=((f=(l=t.color)==null?void 0:l.toString)==null?void 0:f.call(l))??"";s("color",o,o);const n=t.lineType??"";s("lineType",n,n),s("lineWeight",t.lineWeight!=null?String(t.lineWeight):"",String(t.lineWeight??"")),typeof t.linetypeScale=="number"&&s("lineTypeScale",R(t.linetypeScale),String(C(t.linetypeScale,e)));const r=(u=(p=t.transparency)==null?void 0:p.toString)==null?void 0:u.call(p);r!=null&&r!==""&&s("transparency",r,r),typeof t.thickness=="number"&&s("thickness",R(t.thickness),String(C(t.thickness,e)));const d=i.length;if(t.startPoint&&t.endPoint){const h=t.startPoint,g=t.endPoint;s("startPoint",z(h),N(h,e)),s("endPoint",z(g),N(g,e))}if(t.center){const h=t.center;s("center",z(h),N(h,e))}if(typeof t.radius=="number"&&s("radius",R(t.radius),String(C(t.radius,e))),typeof t.startAngle=="number"&&typeof t.endAngle=="number"&&(s("startAngle",ce(t.startAngle),String(C(t.startAngle,e))),s("endAngle",ce(t.endAngle),String(C(t.endAngle,e)))),t.position){const h=t.position;s("position",z(h),N(h,e))}if(t.location){const h=t.location;s("location",z(h),N(h,e))}if(typeof t.rotation=="number"&&s("rotation",ce(t.rotation),String(C(t.rotation,e))),typeof t.height=="number"&&s("height",R(t.height),String(C(t.height,e))),typeof t.blockName=="string"&&s("blockName",t.blockName,t.blockName),t.scaleFactors){const h=t.scaleFactors;s("scale",`${R(h.x??1)}, ${R(h.y??1)}, ${R(h.z??1)}`,`${C(h.x??1,e)},${C(h.y??1,e)},${C(h.z??1,e)}`)}typeof t.textString=="string"&&s("text",t.textString,t.textString),typeof t.contents=="string"&&s("mtext",t.contents,t.contents);const c=de(a);return c&&i.length===d&&s("extents",`${z({x:c.minX,y:c.minY})} – ${z({x:c.maxX,y:c.maxY})}`,`${C(c.minX,e)},${C(c.minY,e)},${C(c.maxX,e)},${C(c.maxY,e)}`),s("objectId",String(a.objectId??""),String(a.objectId??"")),i}function Be(a,e,t){const i=new Map(a.fields.map(u=>[u.id,u])),s=new Map(e.fields.map(u=>[u.id,u])),o=[],n=new Set;for(const u of[...a.fields,...e.fields])n.has(u.id)||(n.add(u.id),o.push(u.id));const r=i.get("startPoint"),d=i.get("endPoint"),c=s.get("startPoint"),l=s.get("endPoint"),f=r!=null&&d!=null&&c!=null&&l!=null&&[r.key,d.key].sort().join("|")===[c.key,l.key].sort().join("|"),p=[];for(const u of o){if(f&&(u==="startPoint"||u==="endPoint"))continue;const h=Oe[u];if(h!=null&&(t&h)===0)continue;const g=i.get(u),k=s.get(u);((g==null?void 0:g.key)??"")!==((k==null?void 0:k.key)??"")&&p.push({field:u,oldValue:(g==null?void 0:g.display)??"",newValue:(k==null?void 0:k.display)??""})}return p.length===0&&a.fingerprint!==e.fingerprint&&p.push({field:"geometry",oldValue:"",newValue:""}),p}function Fe(a,e){const t=a,i=[String(t.dxfTypeName??t.type??"")];if(t.startPoint&&t.endPoint){const o=N(t.startPoint,e),n=N(t.endPoint,e);i.push(o<n?`${o}|${n}`:`${n}|${o}`)}if(t.center&&i.push(`c:${N(t.center,e)}`),typeof t.radius=="number"&&i.push(`r:${C(t.radius,e)}`),typeof t.startAngle=="number"&&typeof t.endAngle=="number"&&i.push(`a:${C(t.startAngle,e)}:${C(t.endAngle,e)}`),t.position&&i.push(`p:${N(t.position,e)}`),t.location&&i.push(`l:${N(t.location,e)}`),typeof t.rotation=="number"&&i.push(`rot:${C(t.rotation,e)}`),typeof t.height=="number"&&i.push(`h:${C(t.height,e)}`),typeof t.blockName=="string"&&i.push(`blk:${t.blockName}`),t.scaleFactors){const o=t.scaleFactors;i.push(`s:${C(o.x??1,e)},${C(o.y??1,e)},${C(o.z??1,e)}`)}typeof t.textString=="string"&&i.push(`t:${t.textString}`),typeof t.contents=="string"&&i.push(`m:${t.contents}`);const s=de(a);return s&&i.length<=1&&i.push(`ext:${C(s.minX,e)},${C(s.minY,e)},${C(s.maxX,e)},${C(s.maxY,e)}`),i.join(";")}function _e(a,e){var s,o,n,r;if(e===0)return"";const t=a,i=[];return e&J&&i.push(((o=(s=t.color)==null?void 0:s.toString)==null?void 0:o.call(s))??""),e&$&&i.push(String(t.layer??"")),e&Q&&i.push(t.lineType??""),e&ee&&i.push(String(t.linetypeScale??"")),e&te&&i.push(String(t.lineWeight??"")),e&ie&&i.push(((r=(n=t.transparency)==null?void 0:n.toString)==null?void 0:r.call(n))??""),e&se&&i.push(String(t.thickness??"")),i.join("|")}function He(a){return Ve.has(a.toUpperCase())}function je(a){return Ne.has(a.toUpperCase())}function ze(a,e,t,i,s){const o=[],n=a.tables.blockTable.modelSpace;for(const r of n.newIterator()){const d=String(r.objectId??"");if(!d)continue;const c=String(r.dxfTypeName??r.type??"UNKNOWN");!i&&He(c)||!s&&je(c)||o.push({entity:r,objectId:d,dxfType:c,layer:String(r.layer??"0"),fingerprint:Fe(r,e),propKey:_e(r,t),extents:de(r),fields:Ie(r,e)})}return o}function Ue(a,e){let t=1/0,i=1/0,s=-1/0,o=-1/0;for(const n of[...a,...e]){const r=n.extents;r&&(t=Math.min(t,r.minX),i=Math.min(i,r.minY),s=Math.max(s,r.maxX),o=Math.max(o,r.maxY))}return Number.isFinite(t)?Math.max(s-t,o-i,1):1}function F(a,e,t,i,s){return{side:e,objectId:a.objectId,dxfType:a.dxfType,layer:a.layer,kind:t,pairedId:i,extents:a.extents,changes:s}}function ye(a,e,t,i){const s=Be(e,t,i);a.push(F(e,"left","modified",t.objectId,s)),a.push(F(t,"right","modified",e.objectId,s))}function be(a,e,t={}){const i=t.compareProps??ne,s=(t.compareHatch??oe)!==0,o=(t.compareText??ae)!==0,n=t.compareTolerance??X,r=t.compareRcMargin??re,d=t.tolerance!=null&&t.tolerance>0?t.tolerance:ge(n),c=y=>ze(y,d,i,s,o),l=c(a),f=c(e),p=new Map(f.map(y=>[y.objectId,y])),u=new Set,h=[],g=[],k=[],x=[],O=[];for(const y of l){const w=p.get(y.objectId);if(w&&y.dxfType===w.dxfType){u.add(w.objectId);const L=y.fingerprint===w.fingerprint,A=y.propKey===w.propKey;L&&A?t.includeUnchanged&&(x.push(F(y,"left","unchanged",w.objectId)),x.push(F(w,"right","unchanged",y.objectId))):ye(k,y,w,i)}else O.push(y)}const M=f.filter(y=>!u.has(y.objectId)),K=(i&$)!==0,j=y=>K?`${y.dxfType}\0${y.layer}`:y.dxfType,I=new Map;for(const y of M){const w=j(y),L=I.get(w);L?L.push(y):I.set(w,[y])}for(const y of O){const w=I.get(j(y));let L=-1;if(w&&(L=w.findIndex(A=>A.fingerprint===y.fingerprint)),L>=0&&w){const A=w.splice(L,1)[0];u.add(A.objectId),y.propKey===A.propKey?t.includeUnchanged&&(x.push(F(y,"left","unchanged",A.objectId)),x.push(F(A,"right","unchanged",y.objectId))):ye(k,y,A,i)}else g.push(F(y,"left","deleted"))}for(const y of M)u.has(y.objectId)||h.push(F(y,"right","added"));const G=[...g,...k.filter(y=>y.side==="left"),...h],U=me([...g,...k,...h],Ue(l,f),r);return{added:h,deleted:g,modified:k,unchanged:x,navigation:G,changeSets:U}}const W={openFile:"Open file",noDrawing:"No drawing",emptyTitle:"Drop a drawing here",emptyHint:"or click to open a DWG / DXF",invalidFile:"Please choose a .dwg or .dxf file",toolbarSideBySide:"Side by side",toolbarOverlay:"Overlay",toolbarSyncViews:"Sync views",toolbarTogglePanel:"Results panel",toolbarPrev:"Previous difference",toolbarNext:"Next difference",toolbarSettings:"Settings",toolbarLanguage:"Language",toolbarThemeLight:"Switch to dark theme",toolbarThemeDark:"Switch to light theme",toolbarMarkup:"Markup",markupGenerateClouds:"Generate cloud markups",markupCloud:"Cloud",markupCallout:"Callout",markupText:"Text",markupRect:"Rectangle",markupCircle:"Circle",markupArrow:"Arrow",markupStamp:"Stamp",markupLine:"Line",markupHighlight:"Highlight",markupShow:"Show markups",markupHide:"Hide markups",markupClear:"Clear markups",panelTitle:"Compare",panelClose:"Close panel",tabResults:"Results",tabMarkups:"Markups",groupByType:"By entity type",groupByKind:"By change",kindAdded:"Added",kindDeleted:"Deleted",kindModified:"Modified",diffDetails:"Show differences",diffColProperty:"Property",diffColOld:"Old",diffColNew:"New",diffGeometryChanged:"Geometry changed",diffVisible:"Visible",diffHidden:"Hidden",fieldObjectId:"Handle",fieldLayer:"Layer",fieldColor:"Color",fieldLineType:"Linetype",fieldLineWeight:"Lineweight",fieldLineTypeScale:"Linetype scale",fieldTransparency:"Transparency",fieldThickness:"Thickness",fieldVisibility:"Visibility",fieldStartPoint:"Start point",fieldEndPoint:"End point",fieldCenter:"Center",fieldRadius:"Radius",fieldStartAngle:"Start angle",fieldEndAngle:"End angle",fieldPosition:"Position",fieldLocation:"Location",fieldRotation:"Rotation",fieldHeight:"Height",fieldBlockName:"Block",fieldScale:"Scale",fieldText:"Text",fieldMtext:"MText",fieldExtents:"Extents",fieldGeometry:"Geometry",noResults:"Open two drawings to compare",noMarkups:"No markups yet",markupFromLeft:"Left",markupFromRight:"Right",comparing:"Comparing…",settingsTitle:"Settings",settingsTabColors:"Colors",settingsTabObjects:"Objects",settingsTabGeometry:"Geometry",settingsUnchanged:"Unchanged objects",settingsDeleted:"Deleted objects",settingsAdded:"Added objects",settingsModified:"Modified objects",settingsSectionColors:"Colors",settingsSectionObjects:"Objects",settingsIncludeHatch:"Include hatch objects",settingsIncludeText:"Include text objects",settingsSectionProps:"Object properties",settingsPropsHint:"Property changes are ignored unless selected (COMPAREPROPS). Layer-table color or linetype changes are never compared.",settingsPropColor:"Color",settingsPropLayer:"Layer",settingsPropLinetype:"Linetype",settingsPropLinetypeScale:"Linetype scale",settingsPropLineweight:"Lineweight",settingsPropTransparency:"Transparency",settingsPropThickness:"Thickness",settingsSectionClouds:"Revision clouds",settingsRcMargin:"Margin",settingsSectionTolerance:"Tolerance",settingsTolerance:"Decimal places",settingsOk:"OK",settingsCancel:"Cancel",settingsReset:"Reset",settingsClose:"Close"},Ke={openFile:"打开文件",noDrawing:"未打开图纸",emptyTitle:"拖拽图纸到此处",emptyHint:"或点击打开 DWG / DXF",invalidFile:"请选择 .dwg 或 .dxf 文件",toolbarSideBySide:"左右分屏",toolbarOverlay:"叠图",toolbarSyncViews:"同步左右视图",toolbarTogglePanel:"结果面板",toolbarPrev:"上一个差异",toolbarNext:"下一个差异",toolbarSettings:"设置",toolbarLanguage:"语言",toolbarThemeLight:"切换为深色主题",toolbarThemeDark:"切换为浅色主题",toolbarMarkup:"批注",markupGenerateClouds:"生成云线批注",markupCloud:"云线",markupCallout:"引出标注",markupText:"文字",markupRect:"矩形",markupCircle:"圆",markupArrow:"箭头",markupStamp:"图章",markupLine:"直线",markupHighlight:"高亮",markupShow:"显示批注",markupHide:"隐藏批注",markupClear:"清除批注",panelTitle:"比对",panelClose:"关闭面板",tabResults:"比对结果",tabMarkups:"批注",groupByType:"按图元类型",groupByKind:"按增删改",kindAdded:"新增",kindDeleted:"删除",kindModified:"修改",diffDetails:"查看差异",diffColProperty:"属性",diffColOld:"旧版",diffColNew:"新版",diffGeometryChanged:"几何已变化",diffVisible:"可见",diffHidden:"隐藏",fieldObjectId:"句柄",fieldLayer:"图层",fieldColor:"颜色",fieldLineType:"线型",fieldLineWeight:"线宽",fieldLineTypeScale:"线型比例",fieldTransparency:"透明度",fieldThickness:"厚度",fieldVisibility:"可见性",fieldStartPoint:"起点",fieldEndPoint:"终点",fieldCenter:"圆心",fieldRadius:"半径",fieldStartAngle:"起始角度",fieldEndAngle:"终止角度",fieldPosition:"位置",fieldLocation:"插入点",fieldRotation:"旋转",fieldHeight:"高度",fieldBlockName:"块名",fieldScale:"缩放",fieldText:"文字",fieldMtext:"多行文字",fieldExtents:"范围",fieldGeometry:"几何",noResults:"请打开两张图纸进行比对",noMarkups:"暂无批注",markupFromLeft:"左侧",markupFromRight:"右侧",comparing:"正在比对…",settingsTitle:"设置",settingsTabColors:"颜色",settingsTabObjects:"对象",settingsTabGeometry:"几何",settingsUnchanged:"相同对象",settingsDeleted:"删除的对象",settingsAdded:"新增的对象",settingsModified:"修改的对象",settingsSectionColors:"颜色",settingsSectionObjects:"对象",settingsIncludeHatch:"包含填充对象",settingsIncludeText:"包含文字对象",settingsSectionProps:"对象属性",settingsPropsHint:"未勾选的属性变化不会计入差异(COMPAREPROPS)。图层表中的颜色或线型变化不会比较。",settingsPropColor:"颜色",settingsPropLayer:"图层",settingsPropLinetype:"线型",settingsPropLinetypeScale:"线型比例",settingsPropLineweight:"线宽",settingsPropTransparency:"透明度",settingsPropThickness:"厚度",settingsSectionClouds:"修订云线",settingsRcMargin:"边距",settingsSectionTolerance:"公差",settingsTolerance:"小数位数",settingsOk:"确定",settingsCancel:"取消",settingsReset:"恢复默认",settingsClose:"关闭"},Ge={openFile:"Dosya aç",noDrawing:"Çizim yok",emptyTitle:"Bir çizimi buraya bırakın",emptyHint:"veya DWG / DXF açmak için tıklayın",invalidFile:"Lütfen bir .dwg veya .dxf dosyası seçin",toolbarSideBySide:"Yan yana",toolbarOverlay:"Üst üste",toolbarSyncViews:"Görünümleri eşitle",toolbarTogglePanel:"Sonuç paneli",toolbarPrev:"Önceki fark",toolbarNext:"Sonraki fark",toolbarSettings:"Ayarlar",toolbarLanguage:"Dil",toolbarThemeLight:"Koyu temaya geç",toolbarThemeDark:"Açık temaya geç",toolbarMarkup:"İşaretleme",markupGenerateClouds:"Bulut işaretlemeleri oluştur",markupCloud:"Bulut",markupCallout:"Çağrı",markupText:"Metin",markupRect:"Dikdörtgen",markupCircle:"Daire",markupArrow:"Ok",markupStamp:"Damga",markupLine:"Çizgi",markupHighlight:"Vurgu",markupShow:"İşaretleri Göster",markupHide:"İşaretleri Gizle",markupClear:"İşaretleri Temizle",panelTitle:"Karşılaştır",panelClose:"Paneli kapat",tabResults:"Sonuçlar",tabMarkups:"İşaretlemeler",groupByType:"Varlık türüne göre",groupByKind:"Değişime göre",kindAdded:"Eklenen",kindDeleted:"Silinen",kindModified:"Değiştirilen",diffDetails:"Farkları göster",diffColProperty:"Özellik",diffColOld:"Eski",diffColNew:"Yeni",diffGeometryChanged:"Geometri değişti",diffVisible:"Görünür",diffHidden:"Gizli",fieldObjectId:"Tutamak",fieldLayer:"Katman",fieldColor:"Renk",fieldLineType:"Çizgi tipi",fieldLineWeight:"Çizgi kalınlığı",fieldLineTypeScale:"Çizgi tipi ölçeği",fieldTransparency:"Saydamlık",fieldThickness:"Kalınlık",fieldVisibility:"Görünürlük",fieldStartPoint:"Başlangıç noktası",fieldEndPoint:"Bitiş noktası",fieldCenter:"Merkez",fieldRadius:"Yarıçap",fieldStartAngle:"Başlangıç açısı",fieldEndAngle:"Bitiş açısı",fieldPosition:"Konum",fieldLocation:"Konum",fieldRotation:"Döndürme",fieldHeight:"Yükseklik",fieldBlockName:"Blok",fieldScale:"Ölçek",fieldText:"Metin",fieldMtext:"Çok satırlı metin",fieldExtents:"Sınırlar",fieldGeometry:"Geometri",noResults:"Karşılaştırmak için iki çizim açın",noMarkups:"Henüz işaretleme yok",markupFromLeft:"Sol",markupFromRight:"Sağ",comparing:"Karşılaştırılıyor…",settingsTitle:"Ayarlar",settingsTabColors:"Renkler",settingsTabObjects:"Nesneler",settingsTabGeometry:"Geometri",settingsUnchanged:"Aynı nesneler",settingsDeleted:"Silinen nesneler",settingsAdded:"Eklenen nesneler",settingsModified:"Değiştirilen nesneler",settingsSectionColors:"Renkler",settingsSectionObjects:"Nesneler",settingsIncludeHatch:"Tarama nesnelerini dahil et",settingsIncludeText:"Metin nesnelerini dahil et",settingsSectionProps:"Nesne özellikleri",settingsPropsHint:"Seçilmeyen özellik değişiklikleri karşılaştırılmaz (COMPAREPROPS). Katman tablosundaki renk veya çizgi tipi değişiklikleri karşılaştırılmaz.",settingsPropColor:"Renk",settingsPropLayer:"Katman",settingsPropLinetype:"Çizgi tipi",settingsPropLinetypeScale:"Çizgi tipi ölçeği",settingsPropLineweight:"Çizgi kalınlığı",settingsPropTransparency:"Saydamlık",settingsPropThickness:"Kalınlık",settingsSectionClouds:"Revizyon bulutları",settingsRcMargin:"Kenar boşluğu",settingsSectionTolerance:"Tolerans",settingsTolerance:"Ondalık basamak",settingsOk:"Tamam",settingsCancel:"İptal",settingsReset:"Sıfırla",settingsClose:"Kapat"},$e={openFile:"Otevřít soubor",noDrawing:"Žádný výkres",emptyTitle:"Přetáhněte výkres sem",emptyHint:"nebo klikněte pro otevření DWG / DXF",invalidFile:"Vyberte soubor .dwg nebo .dxf",toolbarSideBySide:"Vedle sebe",toolbarOverlay:"Překrytí",toolbarSyncViews:"Synchronizovat pohledy",toolbarTogglePanel:"Panel výsledků",toolbarPrev:"Předchozí rozdíl",toolbarNext:"Další rozdíl",toolbarSettings:"Nastavení",toolbarLanguage:"Jazyk",toolbarThemeLight:"Přepnout na tmavý motiv",toolbarThemeDark:"Přepnout na světlý motiv",toolbarMarkup:"Poznámky",markupGenerateClouds:"Vytvořit obláčky",markupCloud:"Oblak",markupCallout:"Popisek",markupText:"Text",markupRect:"Obdélník",markupCircle:"Kružnice",markupArrow:"Šipka",markupStamp:"Razítko",markupLine:"Úsečka",markupHighlight:"Zvýraznění",markupShow:"Zobrazit poznámky",markupHide:"Skrýt poznámky",markupClear:"Vymazat poznámky",panelTitle:"Porovnání",panelClose:"Zavřít panel",tabResults:"Výsledky",tabMarkups:"Poznámky",groupByType:"Podle typu entity",groupByKind:"Podle změny",kindAdded:"Přidané",kindDeleted:"Smazané",kindModified:"Upravené",diffDetails:"Zobrazit rozdíly",diffColProperty:"Vlastnost",diffColOld:"Staré",diffColNew:"Nové",diffGeometryChanged:"Geometrie se změnila",diffVisible:"Viditelné",diffHidden:"Skryté",fieldObjectId:"Handle",fieldLayer:"Hladina",fieldColor:"Barva",fieldLineType:"Typ čáry",fieldLineWeight:"Tloušťka čáry",fieldLineTypeScale:"Měřítko typu čáry",fieldTransparency:"Průhlednost",fieldThickness:"Tloušťka",fieldVisibility:"Viditelnost",fieldStartPoint:"Počáteční bod",fieldEndPoint:"Koncový bod",fieldCenter:"Střed",fieldRadius:"Poloměr",fieldStartAngle:"Počáteční úhel",fieldEndAngle:"Koncový úhel",fieldPosition:"Pozice",fieldLocation:"Umístění",fieldRotation:"Rotace",fieldHeight:"Výška",fieldBlockName:"Blok",fieldScale:"Měřítko",fieldText:"Text",fieldMtext:"MText",fieldExtents:"Rozsah",fieldGeometry:"Geometrie",noResults:"Otevřete dva výkresy pro porovnání",noMarkups:"Zatím žádné poznámky",markupFromLeft:"Levý",markupFromRight:"Pravý",comparing:"Porovnávání…",settingsTitle:"Nastavení",settingsTabColors:"Barvy",settingsTabObjects:"Objekty",settingsTabGeometry:"Geometrie",settingsUnchanged:"Stejné objekty",settingsDeleted:"Smazané objekty",settingsAdded:"Přidané objekty",settingsModified:"Upravené objekty",settingsSectionColors:"Barvy",settingsSectionObjects:"Objekty",settingsIncludeHatch:"Zahrnout šrafy",settingsIncludeText:"Zahrnout textové objekty",settingsSectionProps:"Vlastnosti objektů",settingsPropsHint:"Nezaškrtnuté změny vlastností se neporovnávají (COMPAREPROPS). Změny barvy nebo typu čáry v tabulce hladin se neporovnávají.",settingsPropColor:"Barva",settingsPropLayer:"Hladina",settingsPropLinetype:"Typ čáry",settingsPropLinetypeScale:"Měřítko typu čáry",settingsPropLineweight:"Tloušťka čáry",settingsPropTransparency:"Průhlednost",settingsPropThickness:"Tloušťka",settingsSectionClouds:"Revizní obláčky",settingsRcMargin:"Okraj",settingsSectionTolerance:"Tolerance",settingsTolerance:"Desetinná místa",settingsOk:"OK",settingsCancel:"Zrušit",settingsReset:"Obnovit výchozí",settingsClose:"Zavřít"},Xe={openFile:"فتح ملف",noDrawing:"لا يوجد رسم",emptyTitle:"أسقط رسمًا هنا",emptyHint:"أو انقر لفتح ملف DWG / DXF",invalidFile:"يرجى اختيار ملف .dwg أو .dxf",toolbarSideBySide:"جنبًا إلى جنب",toolbarOverlay:"تراكب",toolbarTogglePanel:"لوحة النتائج",toolbarPrev:"الاختلاف السابق",toolbarNext:"الاختلاف التالي",toolbarLanguage:"اللغة",toolbarMarkup:"علامات المراجعة",markupGenerateClouds:"إنشاء سحب المراجعة",markupCloud:"سحابة",markupCallout:"تعليق توضيحي",markupText:"نص",markupRect:"مستطيل",markupCircle:"دائرة",markupArrow:"سهم",markupStamp:"ختم",markupLine:"خط",markupHighlight:"تمييز",markupShow:"إظهار علامات المراجعة",markupHide:"إخفاء علامات المراجعة",markupClear:"مسح علامات المراجعة",panelTitle:"مقارنة",panelClose:"إغلاق اللوحة",tabResults:"النتائج",tabMarkups:"علامات المراجعة",groupByType:"حسب نوع العنصر",groupByKind:"حسب التغيير",kindAdded:"مضاف",kindDeleted:"محذوف",kindModified:"معدّل",diffDetails:"إظهار الاختلافات",diffColProperty:"الخاصية",diffColOld:"القديم",diffColNew:"الجديد",diffGeometryChanged:"تغيرت الهندسة",diffVisible:"مرئي",diffHidden:"مخفي",fieldObjectId:"المقبض",fieldLayer:"الطبقة",fieldColor:"اللون",fieldLineType:"نوع الخط",fieldLineWeight:"سُمك الخط",fieldLineTypeScale:"مقياس نوع الخط",fieldTransparency:"الشفافية",fieldThickness:"السماكة",fieldVisibility:"الرؤية",fieldStartPoint:"نقطة البداية",fieldEndPoint:"نقطة النهاية",fieldCenter:"المركز",fieldRadius:"نصف القطر",fieldStartAngle:"زاوية البداية",fieldEndAngle:"زاوية النهاية",fieldPosition:"الموضع",fieldLocation:"الموقع",fieldRotation:"الدوران",fieldHeight:"الارتفاع",fieldBlockName:"الكتلة",fieldScale:"المقياس",fieldText:"نص",fieldMtext:"نص متعدد الأسطر",fieldExtents:"الحدود",fieldGeometry:"الهندسة",noResults:"افتح رسمين للمقارنة",noMarkups:"لا توجد علامات مراجعة بعد",markupFromLeft:"اليسار",markupFromRight:"اليمين",comparing:"جارٍ المقارنة…",settingsTitle:"الإعدادات",settingsTabColors:"الألوان",settingsTabObjects:"الكائنات",settingsTabGeometry:"الهندسة",settingsUnchanged:"كائنات دون تغيير",settingsDeleted:"كائنات محذوفة",settingsAdded:"كائنات مضافة",settingsModified:"كائنات معدّلة",settingsSectionColors:"الألوان",settingsSectionObjects:"الكائنات",settingsIncludeHatch:"تضمين كائنات التظليل",settingsIncludeText:"تضمين كائنات النص",settingsSectionProps:"خصائص الكائن",settingsPropsHint:"لا تُحتسب تغييرات الخصائص غير المحددة (COMPAREPROPS). لا تُقارن تغيرات لون أو نوع خط جدول الطبقات.",settingsPropColor:"اللون",settingsPropLayer:"الطبقة",settingsPropLinetype:"نوع الخط",settingsPropLinetypeScale:"مقياس نوع الخط",settingsPropLineweight:"سُمك الخط",settingsPropTransparency:"الشفافية",settingsPropThickness:"السماكة",settingsSectionClouds:"غيوم المراجعة",settingsRcMargin:"الهامش",settingsSectionTolerance:"التسامح",settingsTolerance:"المنازل العشرية",settingsOk:"موافق",settingsCancel:"إلغاء",settingsReset:"إعادة تعيين",settingsClose:"إغلاق"},Ye={...W},We={...W},_="diffViewer";let ve=!1;function ke(){ve||(b.AcApI18n.mergeLocaleMessage("en",{[_]:W}),b.AcApI18n.mergeLocaleMessage("zh",{[_]:Ke}),b.AcApI18n.mergeLocaleMessage("ja",{[_]:Ye}),b.AcApI18n.mergeLocaleMessage("ko",{[_]:We}),b.AcApI18n.mergeLocaleMessage("tr",{[_]:Ge}),b.AcApI18n.mergeLocaleMessage("cs",{[_]:$e}),b.AcApI18n.mergeLocaleMessage("ar",{[_]:Xe}),ve=!0)}function m(a){return b.AcApI18n.t(`${_}.${a}`,{fallback:W[a]})}const qe=[{role:"unchanged",labelKey:"settingsUnchanged"},{role:"deleted",labelKey:"settingsDeleted"},{role:"added",labelKey:"settingsAdded"},{role:"modified",labelKey:"settingsModified"}],Ze=[{bit:J,labelKey:"settingsPropColor"},{bit:$,labelKey:"settingsPropLayer"},{bit:Q,labelKey:"settingsPropLinetype"},{bit:ee,labelKey:"settingsPropLinetypeScale"},{bit:te,labelKey:"settingsPropLineweight"},{bit:ie,labelKey:"settingsPropTransparency"},{bit:se,labelKey:"settingsPropThickness"}];function H(a){return`#${(a&16777215).toString(16).padStart(6,"0")}`}function Je(a){const e=/^#?([0-9a-f]{6})$/i.exec(a.trim());if(e)return parseInt(e[1],16)}const E=class E extends b.AcUiDialog{constructor(e){super({host:e.host??document.body,title:m("settingsTitle"),closeLabel:m("settingsClose"),titleId:"ml-diff-settings-title",dialogClassName:"ml-diff-settings-dialog",theme:e.theme}),this.pickers=new Map,this.hexLabels=new Map,this.propChecks=new Map,this.tabButtons=[],this.tabPanels=[],this._confirmed=!1,this.initial={colors:{...e.colors},sysVars:{...e.sysVars}},this.draft={colors:{...e.colors},sysVars:{...e.sysVars}},this.onChange=e.onChange,E.ensureSettingsStyles(),this.buildContent()}static open(e){var i;(i=E.openInstance)==null||i.close();const t=new E(e);return E.openInstance=t,t.show().then(()=>({confirmed:t._confirmed,colors:t._confirmed?{...t.draft.colors}:{...t.initial.colors},sysVars:t._confirmed?{...t.draft.sysVars}:{...t.initial.sysVars}}))}static dismiss(){var e;(e=E.openInstance)==null||e.close()}close(){E.openInstance===this&&(E.openInstance=null),super.close()}buildContent(){const e=[{id:"colors",label:m("settingsTabColors"),panel:this.buildColorsPanel()},{id:"objects",label:m("settingsTabObjects"),panel:this.buildObjectsPanel()},{id:"geometry",label:m("settingsTabGeometry"),panel:this.buildGeometryPanel()}],t=document.createElement("div");t.className="ml-diff-settings-tabs",t.setAttribute("role","tablist"),t.setAttribute("aria-label",m("settingsTitle"));const i=document.createElement("div");i.className="ml-diff-settings-panels",e.forEach((r,d)=>{const c=`ml-diff-settings-tab-${r.id}`,l=`ml-diff-settings-panel-${r.id}`,f=document.createElement("button");f.type="button",f.id=c,f.className="ml-diff-settings-tab",f.setAttribute("role","tab"),f.setAttribute("aria-controls",l),f.textContent=r.label,f.addEventListener("click",()=>this.selectTab(d)),f.addEventListener("keydown",p=>this.onTabKeyDown(p,d)),this.tabButtons.push(f),t.appendChild(f),r.panel.id=l,r.panel.classList.add("ml-diff-settings-panel"),r.panel.setAttribute("role","tabpanel"),r.panel.setAttribute("aria-labelledby",c),this.tabPanels.push(r.panel),i.appendChild(r.panel)}),this.bodyEl.append(t,i),this.selectTab(0);const s=document.createElement("button");s.type="button",s.className="ml-ui-dialog-btn ml-diff-settings-btn-secondary ml-diff-settings-reset",s.textContent=m("settingsReset"),s.addEventListener("click",()=>this.resetToDefaults());const o=document.createElement("button");o.type="button",o.className="ml-ui-dialog-btn ml-diff-settings-btn-secondary",o.textContent=m("settingsCancel"),o.addEventListener("click",()=>this.close());const n=document.createElement("button");n.type="button",n.className="ml-ui-dialog-btn",n.textContent=m("settingsOk"),n.addEventListener("click",()=>{this._confirmed=!0,this.close()}),this.footerEl.classList.add("ml-diff-settings-footer"),this.footerEl.append(s,o,n),this.focusAfterOpen(n)}buildColorsPanel(){const e=document.createElement("div");e.className="ml-diff-settings-list";for(const t of qe)e.appendChild(this.createColorRow(t.role,m(t.labelKey)));return e}buildObjectsPanel(){const e=document.createElement("div"),t=document.createElement("div");t.className="ml-diff-settings-check-grid",this.hatchCheck=this.createCheckRow(t,m("settingsIncludeHatch"),this.draft.sysVars.comparehatch!==0,n=>{this.draft.sysVars.comparehatch=n?1:0,this.emitChange()}),this.textCheck=this.createCheckRow(t,m("settingsIncludeText"),this.draft.sysVars.comparetext!==0,n=>{this.draft.sysVars.comparetext=n?1:0,this.emitChange()});const i=document.createElement("div"),s=document.createElement("p");s.className="ml-diff-settings-hint",s.textContent=m("settingsPropsHint");const o=document.createElement("div");o.className="ml-diff-settings-check-grid";for(const n of Ze){const r=this.createCheckRow(o,m(n.labelKey),(this.draft.sysVars.compareprops&n.bit)!==0,d=>{d?this.draft.sysVars.compareprops|=n.bit:this.draft.sysVars.compareprops&=~n.bit,this.emitChange()});this.propChecks.set(n.bit,r)}return i.append(s,o),e.append(t,this.createSection(m("settingsSectionProps"),()=>i)),e}buildGeometryPanel(){const e=document.createElement("div"),t=this.createSliderRow(m("settingsTolerance"),this.draft.sysVars.comparetolerance,pe,he,n=>{this.draft.sysVars.comparetolerance=n,this.emitChange()});this.toleranceInput=t.input,this.toleranceValue=t.valueEl;const i=this.createSliderRow(m("settingsRcMargin"),this.draft.sysVars.comparercmargin,De,Re,n=>{this.draft.sysVars.comparercmargin=n,this.emitChange()});this.marginInput=i.input,this.marginValue=i.valueEl;const s=document.createElement("div");s.appendChild(t.row);const o=document.createElement("div");return o.appendChild(i.row),e.append(this.createSection(m("settingsSectionTolerance"),()=>s),this.createSection(m("settingsSectionClouds"),()=>o)),e}selectTab(e){this.tabButtons.forEach((t,i)=>{const s=i===e;t.classList.toggle("is-active",s),t.setAttribute("aria-selected",s?"true":"false"),t.tabIndex=s?0:-1;const o=this.tabPanels[i];o&&(o.hidden=!s)})}onTabKeyDown(e,t){var o;const i=this.tabButtons.length-1;let s=t;if(e.key==="ArrowRight"||e.key==="ArrowDown")s=t===i?0:t+1;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")s=t===0?i:t-1;else if(e.key==="Home")s=0;else if(e.key==="End")s=i;else return;e.preventDefault(),this.selectTab(s),(o=this.tabButtons[s])==null||o.focus()}createSection(e,t){const i=document.createElement("section");i.className="ml-diff-settings-section";const s=document.createElement("h3");return s.className="ml-diff-settings-heading",s.textContent=e,i.append(s,t()),i}createColorRow(e,t){const i=document.createElement("label");i.className="ml-diff-settings-row";const s=document.createElement("span");s.className="ml-diff-settings-label",s.textContent=t;const o=document.createElement("span");o.className="ml-diff-settings-control";const n=document.createElement("span");n.className="ml-diff-settings-hex",n.textContent=H(this.draft.colors[e]),this.hexLabels.set(e,n);const r=document.createElement("input");return r.type="color",r.className="ml-diff-settings-color",r.value=H(this.draft.colors[e]),r.setAttribute("aria-label",t),r.addEventListener("input",()=>{const d=Je(r.value);d!=null&&(this.draft.colors[e]=d,n.textContent=H(d),this.emitChange())}),this.pickers.set(e,r),o.append(n,r),i.append(s,o),i}createCheckRow(e,t,i,s){const o=document.createElement("label");o.className="ml-diff-settings-check-item";const n=document.createElement("input");n.type="checkbox",n.className="ml-diff-settings-check",n.checked=i,n.addEventListener("change",()=>s(n.checked));const r=document.createElement("span");return r.className="ml-diff-settings-label",r.textContent=t,o.append(n,r),e.appendChild(o),n}createSliderRow(e,t,i,s,o){const n=document.createElement("label");n.className="ml-diff-settings-slider-row";const r=document.createElement("span");r.className="ml-diff-settings-slider-head";const d=document.createElement("span");d.className="ml-diff-settings-label",d.textContent=e;const c=document.createElement("span");c.className="ml-diff-settings-slider-value",c.textContent=String(t),r.append(d,c);const l=document.createElement("input");return l.type="range",l.className="ml-diff-settings-slider",l.min=String(i),l.max=String(s),l.step="1",l.value=String(t),l.setAttribute("aria-label",e),l.addEventListener("input",()=>{const f=Number(l.value);c.textContent=String(f),o(f)}),n.append(r,l),{row:n,input:l,valueEl:c}}resetToDefaults(){Object.assign(this.draft.colors,b.ACAP_DEFAULT_COMPARE_COLORS);const e=Y();this.draft.sysVars.compareprops=e.compareprops??ne,this.draft.sysVars.comparehatch=e.comparehatch??oe,this.draft.sysVars.comparercmargin=e.comparercmargin??re,this.draft.sysVars.comparetext=e.comparetext??ae,this.draft.sysVars.comparetolerance=e.comparetolerance??X;for(const t of this.pickers.keys()){const i=H(this.draft.colors[t]),s=this.pickers.get(t),o=this.hexLabels.get(t);s&&(s.value=i),o&&(o.textContent=i)}this.hatchCheck&&(this.hatchCheck.checked=this.draft.sysVars.comparehatch!==0),this.textCheck&&(this.textCheck.checked=this.draft.sysVars.comparetext!==0);for(const[t,i]of this.propChecks)i.checked=(this.draft.sysVars.compareprops&t)!==0;this.marginInput&&this.marginValue&&(this.marginInput.value=String(this.draft.sysVars.comparercmargin),this.marginValue.textContent=String(this.draft.sysVars.comparercmargin)),this.toleranceInput&&this.toleranceValue&&(this.toleranceInput.value=String(this.draft.sysVars.comparetolerance),this.toleranceValue.textContent=String(this.draft.sysVars.comparetolerance)),this.emitChange()}emitChange(){var e;(e=this.onChange)==null||e.call(this,{colors:{...this.draft.colors},sysVars:{...this.draft.sysVars}})}static ensureSettingsStyles(){if(E.settingsStylesInjected)return;if(document.getElementById(E.settingsStyleId)){E.settingsStylesInjected=!0;return}const e=document.createElement("style");e.id=E.settingsStyleId,e.textContent=`
|
|
2
2
|
.ml-ui-dialog.ml-diff-settings-dialog {
|
|
3
3
|
width: min(460px, calc(100vw - 32px));
|
|
4
4
|
max-height: min(560px, calc(100vh - 32px));
|
|
@@ -203,47 +203,47 @@
|
|
|
203
203
|
color: var(--ml-ui-text, #e5eaf3);
|
|
204
204
|
border-color: var(--ml-ui-border, #4c4d4f);
|
|
205
205
|
}
|
|
206
|
-
`.trim(),document.head.appendChild(e),E.settingsStylesInjected=!0}};E.settingsStyleId="ml-diff-settings-dialog-styles-v3",E.settingsStylesInjected=!1,E.openInstance=null;let
|
|
206
|
+
`.trim(),document.head.appendChild(e),E.settingsStylesInjected=!0}};E.settingsStyleId="ml-diff-settings-dialog-styles-v3",E.settingsStylesInjected=!1,E.openInstance=null;let q=E;const Qe=`
|
|
207
207
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
208
208
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776" />
|
|
209
209
|
</svg>
|
|
210
|
-
`.trim(),
|
|
210
|
+
`.trim(),et=`
|
|
211
211
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
212
212
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z" />
|
|
213
213
|
</svg>
|
|
214
|
-
`.trim(),
|
|
214
|
+
`.trim(),tt=`
|
|
215
215
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
216
216
|
<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6" />
|
|
217
217
|
</svg>
|
|
218
|
-
`.trim(),
|
|
218
|
+
`.trim(),it=`
|
|
219
219
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
220
220
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 5.625C3 5.004 3.504 4.5 4.125 4.5h15.75c.621 0 1.125.504 1.125 1.125v12.75c0 .621-.504 1.125-1.125 1.125H4.125A1.125 1.125 0 013 18.375V5.625Z" />
|
|
221
221
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 4.5v15" />
|
|
222
222
|
</svg>
|
|
223
|
-
`.trim(),
|
|
223
|
+
`.trim(),st=`
|
|
224
224
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
225
225
|
<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" />
|
|
226
226
|
</svg>
|
|
227
|
-
`.trim(),
|
|
227
|
+
`.trim(),nt=`
|
|
228
228
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
229
229
|
<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
|
|
230
230
|
</svg>
|
|
231
|
-
`.trim(),
|
|
231
|
+
`.trim(),ot=`
|
|
232
232
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
233
233
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" />
|
|
234
234
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0Z" />
|
|
235
235
|
</svg>
|
|
236
|
-
`.trim(),
|
|
236
|
+
`.trim(),rt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-hidden="true"><path fill="currentColor" d="M512 704a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m0-704a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 768a32 32 0 0 1 32 32v64a32 32 0 1 1-64 0v-64a32 32 0 0 1 32-32m384-384a32 32 0 0 1-32 32h-64a32 32 0 0 1 0-64h64a32 32 0 0 1 32 32M96 512a32 32 0 0 1 32-32H192a32 32 0 1 1 0 64H128a32 32 0 0 1-32-32m741.056-266.944a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 45.248-45.248zm-589.056 589.056a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 45.248-45.248zm589.056 0-45.248 45.248a32 32 0 0 1-45.248-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248M247.936 201.984a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 45.248-45.248z"/></svg>',at='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-hidden="true"><path fill="currentColor" d="M240.448 240.448a384 384 0 1 0 543.104 543.104 476.16 476.16 0 0 1-543.104-543.104"/></svg>',lt=`
|
|
237
237
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
238
238
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15a4.5 4.5 0 0 0 4.06 2.25h9.44a3.75 3.75 0 1 0-.3-7.49 5.25 5.25 0 0 0-10.12 1.5A4.5 4.5 0 0 0 2.25 15Z" />
|
|
239
239
|
<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 3.75 16.82 4.61 17.68 4.93 16.82 5.25 16.5 6.11 16.18 5.25 15.32 4.93 16.18 4.61 16.5 3.75Z" />
|
|
240
240
|
<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 7.5 20.5 8.16 21.16 8.41 20.5 8.66 20.25 9.32 20 8.66 19.34 8.41 20 8.16 20.25 7.5Z" />
|
|
241
241
|
</svg>
|
|
242
|
-
`.trim(),
|
|
242
|
+
`.trim(),dt=`
|
|
243
243
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
244
244
|
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m.75 12l3 3m0 0l3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
|
|
245
245
|
</svg>
|
|
246
|
-
`.trim();function
|
|
246
|
+
`.trim();function ct(){const a=document.createElement("span");return a.className="ml-diff-icon",a.innerHTML=Qe,a}function ft(){const a=document.createElement("span");return a.className="ml-diff-empty-icon",a.innerHTML=dt,a}const Ce="ml-diff-viewer-styles-v2",mt=`
|
|
247
247
|
.ml-diff-root {
|
|
248
248
|
--ml-diff-bg: var(--ml-ui-bg, #1d1e1f);
|
|
249
249
|
--ml-diff-panel: var(--ml-ui-bg, #1d1e1f);
|
|
@@ -966,4 +966,4 @@
|
|
|
966
966
|
.ml-diff-change-new {
|
|
967
967
|
color: var(--ml-diff-added);
|
|
968
968
|
}
|
|
969
|
-
`.trim();function xe(){if(document.getElementById(Ce))return;const a=document.createElement("style");a.id=Ce,a.textContent=ct,document.head.appendChild(a)}const we={minimumChunkSize:1e3,mode:b.AcEdOpenMode.Write,progressiveRendering:!1,sysVars:{lwdisplay:!1}},ft=/\.(dwg|dxf)$/i,Pe="cad-diff-viewer:changeset",mt=200,pt=[{command:"markupcloud",labelKey:"markupCloud",icon:D.ICON_MARKUP_CLOUD},{command:"markuprect",labelKey:"markupRect",icon:D.ICON_MARKUP_RECT},{command:"markupcircle",labelKey:"markupCircle",icon:D.ICON_MARKUP_CIRCLE},{command:"markupcallout",labelKey:"markupCallout",icon:D.ICON_MARKUP_CALLOUT},{command:"markuparrow",labelKey:"markupArrow",icon:D.ICON_MARKUP_ARROW},{command:"markupline",labelKey:"markupLine",icon:D.ICON_MARKUP_LINE},{command:"markuptext",labelKey:"markupText",icon:D.ICON_MARKUP_TEXT},{command:"markupstamp",labelKey:"markupStamp",icon:D.ICON_MARKUP_STAMP}],Se=[{locale:"en",label:"English"},{locale:"zh",label:"简体中文"},{locale:"tr",label:"Türkçe"},{locale:"cs",label:"Čeština"},{locale:"ar",label:"العربية"}],ht='<svg class="ml-diff-lang-select__caret" viewBox="0 0 12 12" aria-hidden="true"><path fill="currentColor" d="M2.4 4.2 6 8.1l3.6-3.9"/></svg>';function ut(a){var e;return((e=Se.find(t=>t.locale===a))==null?void 0:e.label)??"English"}const gt={objectId:"fieldObjectId",layer:"fieldLayer",color:"fieldColor",lineType:"fieldLineType",lineWeight:"fieldLineWeight",lineTypeScale:"fieldLineTypeScale",transparency:"fieldTransparency",thickness:"fieldThickness",visibility:"fieldVisibility",startPoint:"fieldStartPoint",endPoint:"fieldEndPoint",center:"fieldCenter",radius:"fieldRadius",startAngle:"fieldStartAngle",endAngle:"fieldEndAngle",position:"fieldPosition",location:"fieldLocation",rotation:"fieldRotation",height:"fieldHeight",blockName:"fieldBlockName",scale:"fieldScale",text:"fieldText",mtext:"fieldMtext",extents:"fieldExtents",geometry:"fieldGeometry"};function yt(a){const e=gt[a];return e?m(e):a}function Te(a,e){return e===""?"—":a==="visibility"?m(e==="true"?"diffVisible":"diffHidden"):e}function S(){try{return b.AcApDocManager.instance}catch{throw new Error("AcApDiffViewer is not initialized")}}function bt(a){return ft.test(a)}function vt(a){return{...b.ACAP_DEFAULT_COMPARE_COLORS,...a}}class kt{constructor(e){this.markupButtons=[],this.leftDragDepth=0,this.rightDragDepth=0,this.bannerTimers=new Map,this.resultGroupMode="kind",this.collapsedResultGroups=new Set,this.activeTab="results",this.navIndex=-1,this.disposed=!1,this.localeMenuOpen=!1,this.diffPopoverPinned=!1,this.diffPopoverHideTimer=0,this.activateSeq=0,this.activateTail=Promise.resolve(),this.compareSeq=0,this.overlayRegisterSeq=0,this.sysVarPreviewTimer=0,this.lastPointerSide="left",this.viewsSynced=!1,this.viewSyncLock=!1,this.viewSyncLeader="left",this.viewSyncFollowOpen=!1,this.viewSyncFromUser=!1,this.handleLocaleChanged=()=>{this.disposed||(this.setLocaleMenuOpen(!1),this.syncChrome(),this.syncViewModeUi(),this.syncPanelUi(),this.renderResultsList(),this.refreshMarkupsList())},this.handleDocumentPointerDown=n=>{var r;n.target instanceof Node&&(this.localeMenuOpen&&!this.localeSelectHost.contains(n.target)&&this.setLocaleMenuOpen(!1),this.diffPopoverPinned&&(this.diffPopover.contains(n.target)||(r=this.diffPopoverAnchor)!=null&&r.contains(n.target)||this.hideDiffPopover(!0)))},this.handleDiffPopoverDismiss=()=>{this.hideDiffPopover(!0)},this.cancelDiffPopoverHide=()=>{this.diffPopoverHideTimer&&(window.clearTimeout(this.diffPopoverHideTimer),this.diffPopoverHideTimer=0)},this.scheduleDiffPopoverHide=()=>{this.diffPopoverPinned||(this.cancelDiffPopoverHide(),this.diffPopoverHideTimer=window.setTimeout(()=>{this.diffPopoverHideTimer=0,this.hideDiffPopover(!1)},180))},this.markViewSyncUserInput=()=>{this.viewSyncFromUser=!0},this.handleLeftViewChanged=()=>{this.onPaneViewChanged("left")},this.handleRightViewChanged=()=>{this.onPaneViewChanged("right")},this.options=e,this.colors=vt(e.compareColors),this.sessionSysVars=Y(),this.uiTheme=e.theme??"dark",this.viewMode=e.viewMode??"side-by-side",this.sidePanelOpen=e.sidePanelOpen!==!1,ke(),xe();let t=!1;try{b.AcApDocManager.instance,t=!0}catch{t=!1}if(t)throw new Error("AcApDiffViewer needs its own AcApDocManager. Create it on a page that does not already host a CAD viewer.");this.root=document.createElement("div"),this.root.className="ml-diff-root",b.acedApplyUiTheme(this.uiTheme,this.root),this.toolbar=document.createElement("div"),this.toolbar.className="ml-diff-toolbar",this.body=document.createElement("div"),this.body.className="ml-diff-body",this.panesHost=document.createElement("div"),this.panesHost.className="ml-diff-panes",this.leftUi=this.createPane("left"),this.rightUi=this.createPane("right"),this.panesHost.append(this.leftUi.pane,this.rightUi.pane);const i=this.createChrome();this.btnSideBySide=i.btnSideBySide,this.btnOverlay=i.btnOverlay,this.btnSyncViews=i.btnSyncViews,this.btnTogglePanel=i.btnTogglePanel,this.btnPrev=i.btnPrev,this.btnNext=i.btnNext,this.btnSettings=i.btnSettings,this.btnMarkupVis=i.btnMarkupVis,this.btnClearMarkups=i.btnClearMarkups,this.btnTheme=i.btnTheme,this.sidePanel=i.sidePanel,this.resultsBody=i.resultsBody,this.markupsBody=i.markupsBody,this.tabResults=i.tabResults,this.tabMarkups=i.tabMarkups,this.groupByKindBtn=i.groupByKindBtn,this.groupByTypeBtn=i.groupByTypeBtn,this.panelTitle=i.panelTitle,this.localeTrigger=i.localeTrigger,this.localeMenu=i.localeMenu,this.localeSelectHost=i.localeSelectHost,this.diffPopover=document.createElement("div"),this.diffPopover.className="ml-diff-change-popover",this.diffPopover.hidden=!0,this.diffPopover.setAttribute("role","tooltip"),this.diffPopover.addEventListener("mouseenter",this.cancelDiffPopoverHide),this.diffPopover.addEventListener("mouseleave",this.scheduleDiffPopoverHide),this.toolbar.append(...i.toolbarChildren),this.body.append(this.panesHost,this.sidePanel),this.root.append(this.toolbar,this.body,this.diffPopover),e.container.appendChild(this.root);const s=e.openDocumentDefaults??we;b.AcApDocManager.createInstance({container:this.leftUi.canvas,busyIndicatorHost:this.leftUi.canvas,autoResize:!0,baseUrl:e.baseUrl,builtinOpenFileDialog:!1,openDocumentDefaults:s,webworkerFileUrls:e.webworkerFileUrls});const o=b.AcApDocManager.instance;this.disableEntitySelection(o.mainView),this.disableEntitySelection(o.ensureSplitView(this.rightUi.canvas)),this.bindViewSyncListeners(),b.AcApI18n.events.localeChanged.addEventListener(this.handleLocaleChanged),document.addEventListener("pointerdown",this.handleDocumentPointerDown),this.resultsBody.addEventListener("scroll",this.handleDiffPopoverDismiss),window.addEventListener("resize",this.handleDiffPopoverDismiss),this.syncChrome(),this.syncViewModeUi(),this.syncPanelUi(),this.syncCompareColorVars()}get leftDocument(){return this.liveDoc(this.leftDoc)}get rightDocument(){return this.liveDoc(this.rightDoc)}get activeSide(){return S().curDocument===this.rightDocument?"right":"left"}get compareResultSnapshot(){return this.compareResult}async openDocument(e,t,i,s){var f,p,u,h;this.assertAlive();const o=S(),n=this.viewMode==="overlay";n&&await this.exitOverlayMode();const r=e==="left"?this.leftDoc:this.rightDoc,d=e==="left"?this.rightDoc:this.leftDoc;if(r&&o.sessionFor(r)&&!r.isReusableUntitled&&r!==d&&await o.closeDocument(r),this.uiFor(e).empty.classList.add("is-hidden"),this.clearPaneError(e),!await o.openDocument(t,i,s??this.options.openDocumentDefaults??we,this.viewFor(e)))return(p=(f=this.options.events)==null?void 0:f.failed)==null||p.call(f,e,t),this.syncChrome(),n&&(await this.enterOverlayMode(),this.syncViewModeUi()),!1;const l=o.curDocument;return e==="left"?this.leftDoc=l:this.rightDoc=l,this.adoptCompareSysVarsAfterOpen(l,!!this.liveDoc(d)),this.syncChrome(),(h=(u=this.options.events)==null?void 0:u.opened)==null||h.call(u,e,l),this.syncFollowerAfterOpen(e),this.applyMarkupVisibility(b.isMarkupVisible()),await this.runCompareAndApply(),!0}async activateSide(e){this.assertAlive();const t=e==="left"?this.leftDocument:this.rightDocument;if(!t)return!1;if(S().curDocument===t)return this.applyFocusClass(e),!0;const s=++this.activateSeq,o=async()=>{var l,f;if(this.disposed||s!==this.activateSeq)return!1;const r=e==="left"?this.leftDocument:this.rightDocument;if(!r)return!1;const d=S();if(d.curDocument===r)return this.applyFocusClass(e),!0;const c=await d.activateDocument(r);return this.disposed||s!==this.activateSeq?(this.disposed||this.syncFocusRings(),!1):(this.applyFocusClass(e),this.refreshMarkupsList(),c&&((f=(l=this.options.events)==null?void 0:l.focus)==null||f.call(l,e)),c)},n=this.activateTail.then(o,o);return this.activateTail=n.then(()=>{},()=>{}),n}async setViewMode(e){this.assertAlive(),e!==this.viewMode&&(e==="overlay"?await this.enterOverlayMode():await this.exitOverlayMode(),this.viewMode=e,this.syncViewModeUi(),e==="side-by-side"&&this.applyViewSyncFromLeader(),await this.applyCompareDisplay(),window.dispatchEvent(new Event("resize")))}setSidePanelOpen(e){this.sidePanelOpen=e,this.syncPanelUi(),window.dispatchEvent(new Event("resize"))}async goToDifference(e){var o;const t=((o=this.compareResult)==null?void 0:o.navigation)??[];if(t.length===0)return;let i;if(this.navIndex<0)if(e>0)i=0;else if(e<0)i=t.length-1;else return;else if(i=this.navIndex+e,i<0||i>=t.length)return;this.navIndex=i;const s=t[this.navIndex];this.collapsedResultGroups.delete(this.resultGroupStorageKeyForHit(s)),await this.focusHit(s),this.renderResultsList()}async destroy(){if(!this.disposed){this.disposed=!0,this.compareSeq++,this.overlayRegisterSeq++,this.clearSysVarPreviewTimer(),W.dismiss(),b.AcApI18n.events.localeChanged.removeEventListener(this.handleLocaleChanged),document.removeEventListener("pointerdown",this.handleDocumentPointerDown),this.resultsBody.removeEventListener("scroll",this.handleDiffPopoverDismiss),window.removeEventListener("resize",this.handleDiffPopoverDismiss),this.hideDiffPopover(!0),this.unbindViewSyncListeners();for(const e of this.bannerTimers.values())window.clearTimeout(e);this.bannerTimers.clear();try{this.overlayId&&S().removeOverlay(this.overlayId),await b.AcApDocManager.instance.destroy()}catch{}this.root.remove()}}createChrome(){const e=document.createElement("div");e.className="ml-diff-toolbar-group";const t=document.createElement("button");t.type="button",t.className="ml-diff-tool-btn is-icon",t.innerHTML=Je;const i=document.createElement("button");i.type="button",i.className="ml-diff-tool-btn is-icon",i.innerHTML=Qe;const s=document.createElement("button");s.type="button",s.className="ml-diff-tool-btn is-icon ml-diff-sync-btn",s.innerHTML=tt,e.append(t,i,s);const o=document.createElement("div");o.className="ml-diff-toolbar-group";const n=document.createElement("button");n.type="button",n.className="ml-diff-tool-btn is-icon",n.innerHTML=et;const r=document.createElement("button");r.type="button",r.className="ml-diff-tool-btn",r.textContent="◀",r.disabled=!0;const d=document.createElement("button");d.type="button",d.className="ml-diff-tool-btn",d.textContent="▶",d.disabled=!0,o.append(n,r,d);const c=document.createElement("div");c.className="ml-diff-toolbar-group";const l=document.createElement("button");l.type="button",l.className="ml-diff-tool-btn is-icon",l.dataset.labelKey="markupGenerateClouds",l.disabled=!0,l.innerHTML=rt,l.addEventListener("click",()=>{this.generateCompareCloudMarkups()}),this.markupButtons.push(l),c.appendChild(l);for(const A of pt){const B=document.createElement("button");B.type="button",B.className="ml-diff-tool-btn is-icon",B.dataset.command=A.command,B.dataset.labelKey=A.labelKey,B.innerHTML=A.icon,B.addEventListener("click",()=>{this.runMarkupCommand(A.command)}),this.markupButtons.push(B),c.appendChild(B)}const f=document.createElement("button");f.type="button",f.className="ml-diff-tool-btn is-icon",f.addEventListener("click",()=>{this.toggleMarkupVisibility()}),c.appendChild(f);const p=document.createElement("button");p.type="button",p.className="ml-diff-tool-btn is-icon",p.dataset.labelKey="markupClear",p.innerHTML=D.ICON_CLEAR_MARKUPS,p.addEventListener("click",()=>{this.clearAllMarkups()}),this.markupButtons.push(p),c.appendChild(p);const u=this.createLanguageSelect(),h=document.createElement("button");h.type="button",h.className="ml-diff-tool-btn is-icon",h.innerHTML=st;const g=document.createElement("button");g.type="button",g.className="ml-diff-tool-btn is-icon",u.group.prepend(h,g),t.addEventListener("click",()=>{this.setViewMode("side-by-side")}),i.addEventListener("click",()=>{this.setViewMode("overlay")}),s.addEventListener("click",()=>{this.setViewsSynced(!this.viewsSynced)}),n.addEventListener("click",()=>{this.setSidePanelOpen(!this.sidePanelOpen)}),r.addEventListener("click",()=>{this.goToDifference(-1)}),d.addEventListener("click",()=>{this.goToDifference(1)}),h.addEventListener("click",()=>{this.openSettings()}),g.addEventListener("click",()=>{this.setUiTheme(this.uiTheme==="dark"?"light":"dark")});const k=document.createElement("aside");k.className="ml-diff-sidepanel";const x=document.createElement("div");x.className="ml-diff-sidepanel-header";const O=document.createElement("div");O.className="ml-diff-sidepanel-title";const M=document.createElement("button");M.type="button",M.className="ml-diff-tool-btn",M.textContent="×",M.addEventListener("click",()=>this.setSidePanelOpen(!1)),x.append(O,M);const K=document.createElement("div");K.className="ml-diff-sidepanel-tabs";const H=document.createElement("button");H.type="button",H.className="ml-diff-sidepanel-tab is-active";const I=document.createElement("button");I.type="button",I.className="ml-diff-sidepanel-tab",K.append(H,I),H.addEventListener("click",()=>{this.activeTab="results",this.syncPanelUi()}),I.addEventListener("click",()=>{this.activeTab="markups",this.syncPanelUi(),this.refreshMarkupsList()});const G=document.createElement("div");G.className="ml-diff-sidepanel-toolbar";const z=document.createElement("button");z.type="button",z.className="ml-diff-tool-btn is-active";const y=document.createElement("button");y.type="button",y.className="ml-diff-tool-btn",G.append(z,y),z.addEventListener("click",()=>{this.resultGroupMode="kind",this.renderResultsList(),this.syncPanelUi()}),y.addEventListener("click",()=>{this.resultGroupMode="type",this.renderResultsList(),this.syncPanelUi()});const w=document.createElement("div");w.className="ml-diff-sidepanel-body";const L=document.createElement("div");return L.className="ml-diff-sidepanel-body",L.hidden=!0,k.append(x,K,G,w,L),{toolbarChildren:[e,o,c,u.group],btnSideBySide:t,btnOverlay:i,btnSyncViews:s,btnTogglePanel:n,btnPrev:r,btnNext:d,btnSettings:h,btnGenerateClouds:l,btnMarkupVis:f,btnClearMarkups:p,btnTheme:g,sidePanel:k,resultsBody:w,markupsBody:L,tabResults:H,tabMarkups:I,groupByKindBtn:z,groupByTypeBtn:y,panelTitle:O,closeBtn:M,localeTrigger:u.trigger,localeMenu:u.menu,localeSelectHost:u.host}}createLanguageSelect(){const e=document.createElement("div");e.className="ml-diff-toolbar-group ml-diff-toolbar-locale";const t=document.createElement("div");t.className="ml-diff-lang-select";const i=document.createElement("button");i.type="button",i.className="ml-diff-lang-select__trigger",i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");const s=document.createElement("span");s.className="ml-diff-lang-select__label",i.append(s),i.insertAdjacentHTML("beforeend",ht),i.addEventListener("click",n=>{n.stopPropagation(),this.setLocaleMenuOpen(!this.localeMenuOpen)});const o=document.createElement("div");o.className="ml-diff-lang-select__menu",o.setAttribute("role","listbox"),o.hidden=!0;for(const n of Se){const r=document.createElement("button");r.type="button",r.className="ml-diff-lang-select__option",r.setAttribute("role","option"),r.dataset.locale=n.locale,r.textContent=n.label,r.addEventListener("click",d=>{d.stopPropagation(),this.setLocaleMenuOpen(!1),n.locale!==b.AcApI18n.currentLocale&&(b.AcApI18n.setCurrentLocale(n.locale),document.documentElement.lang=n.locale)}),o.appendChild(r)}return t.append(i,o),e.appendChild(t),{group:e,host:t,trigger:i,menu:o}}setLocaleMenuOpen(e){this.localeMenuOpen=e,this.localeMenu.hidden=!e,this.localeTrigger.setAttribute("aria-expanded",String(e)),this.localeSelectHost.classList.toggle("is-open",e)}syncLocaleSelect(){const e=b.AcApI18n.currentLocale,t=this.localeTrigger.querySelector(".ml-diff-lang-select__label");t&&(t.textContent=ut(e)),this.localeTrigger.title=m("toolbarLanguage"),this.localeTrigger.setAttribute("aria-label",m("toolbarLanguage")),this.localeMenu.querySelectorAll(".ml-diff-lang-select__option").forEach(i=>{const s=i.dataset.locale===e;i.classList.toggle("is-selected",s),i.setAttribute("aria-selected",String(s))})}createPane(e){const t=document.createElement("section");t.className="ml-diff-pane",t.dataset.side=e,e==="left"&&t.classList.add("is-focused");const i=document.createElement("header");i.className="ml-diff-header";const s=document.createElement("span");s.className="ml-diff-title is-empty";const o=document.createElement("button");o.type="button",o.className="ml-diff-open",o.appendChild(lt());const n=document.createElement("input");n.type="file",n.className="ml-diff-file-input",n.accept=".dwg,.dxf,application/acad,application/dxf",n.tabIndex=-1,i.append(s,o,n);const r=document.createElement("div");r.className="ml-diff-canvas-slot";const d=document.createElement("div");d.className="ml-diff-canvas";const c=document.createElement("div");c.className="ml-diff-empty";const l=document.createElement("div");l.className="ml-diff-empty-card";const f=document.createElement("div");f.className="ml-diff-empty-title";const p=document.createElement("div");p.className="ml-diff-empty-hint";const u=document.createElement("div");u.className="ml-diff-empty-error is-hidden",l.append(dt(),f,p,u),c.appendChild(l);const h=document.createElement("div");return h.className="ml-diff-banner is-hidden",r.append(d,c,h),t.append(i,r),t.addEventListener("pointerenter",()=>{this.activateSideOnHover(e)}),t.addEventListener("pointerdown",()=>{this.lastPointerSide=e,this.applyFocusClass(e),this.activateSideAndResumeMarkup(e)}),t.addEventListener("click",g=>{if(this.documentFor(e))return;const k=g.target;k!=null&&k.closest(".ml-diff-open")||this.pickFile(e)}),o.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),this.pickFile(e)}),n.addEventListener("change",()=>{var k;const g=(k=n.files)==null?void 0:k[0];n.value="",g&&this.openLocalFile(e,g)}),t.addEventListener("dragenter",g=>{g.preventDefault(),this.changeDragDepth(e,1)}),t.addEventListener("dragover",g=>{g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect="copy")}),t.addEventListener("dragleave",g=>{g.preventDefault(),this.changeDragDepth(e,-1)}),t.addEventListener("drop",g=>{var x,O;g.preventDefault(),this.resetDragDepth(e);const k=(O=(x=g.dataTransfer)==null?void 0:x.files)==null?void 0:O[0];k&&this.openLocalFile(e,k)}),{pane:t,canvas:d,title:s,empty:c,emptyTitle:f,emptyHint:p,emptyError:u,banner:h,openButton:o,fileInput:n}}activateSideOnHover(e){this.disposed||this.viewMode==="side-by-side"&&(this.lastPointerSide=e,this.applyFocusClass(e),this.activateSideAndResumeMarkup(e))}async activateSideAndResumeMarkup(e){if(this.disposed||!this.documentFor(e))return;let t;try{const s=S();s.commandManager.activeCommand&&this.lastMarkupCommand&&s.curDocument!==this.documentFor(e)&&(t=this.lastMarkupCommand)}catch{return}!await this.activateSide(e)||this.disposed||this.lastPointerSide===e&&(this.applyFocusClass(e),t&&S().sendStringToExecute(t))}pickFile(e){this.uiFor(e).fileInput.click()}async openLocalFile(e,t){if(!bt(t.name)){this.showPaneError(e,m("invalidFile"));return}await this.openDocument(e,t.name,await t.arrayBuffer())}async runMarkupCommand(e){const t=S(),i=this.viewMode==="side-by-side"?this.lastPointerSide:"left";!this.documentFor(i)||(this.lastMarkupCommand=e,!await this.activateSide(i))||(this.applyFocusClass(i),t.sendStringToExecute(e))}async generateCompareCloudMarkups(){var i;if(this.disposed)return;const e=(i=this.compareResult)==null?void 0:i.changeSets;if(!(e!=null&&e.length))return;this.viewMode==="overlay"?await this.commitChangeSetClouds("left",e):(await this.commitChangeSetClouds("left",e.filter(s=>s.hasLeft)),await this.commitChangeSetClouds("right",e.filter(s=>s.hasRight))),this.disposed||this.refreshMarkupsList()}toggleMarkupVisibility(){this.disposed||!this.leftDocument&&!this.rightDocument||(this.applyMarkupVisibility(!b.isMarkupVisible()),this.syncMarkupVisibilityButton())}applyMarkupVisibility(e){this.leftDocument&&b.setMarkupVisible(this.viewFor("left"),e),this.rightDocument&&b.setMarkupVisible(this.viewFor("right"),e)}async clearAllMarkups(){if(!this.disposed){for(const e of["left","right"]){if(!this.documentFor(e)||!await this.activateSide(e)||this.disposed)continue;const i=this.viewFor(e);b.getMarkupPresenter().clearLayout(i,i.activeLayoutBtrId,{clearStore:!0})}this.disposed||this.refreshMarkupsList()}}async commitChangeSetClouds(e,t){if(!await this.activateSide(e)||this.disposed)return;const s=S(),o=this.viewFor(e),n=s.context;b.runMarkupEdit(o,"Create Markup",()=>{const r=b.getMarkupStore(),d=b.getMarkupPresenter();for(const c of r.list())c.type!=="cloud"||c.comment!==Pe||(d.unpublish(o,c.id,{keepInStore:!0}),r.removeRecord(c.id));for(const c of t){const l=c.extents;if(l.maxX<=l.minX&&l.maxY<=l.minY)continue;const f=b.createMarkupMeta("cloud",o,n,{comment:Pe}),p=_(this.colors[ce(c)]),u={...f,type:"cloud",style:{...f.style,color:p},geometry:{type:"cloud",corner1:{x:l.minX,y:l.minY},corner2:{x:l.maxX,y:l.maxY}}};r.upsert(u),d.publish(o,u)}})}async openSettings(){if(this.disposed)return;const e={...this.colors},t={...this.sessionSysVars},i=await W.open({host:document.body,theme:this.uiTheme,colors:this.colors,sysVars:this.sessionSysVars,onChange:s=>{if(this.disposed)return;this.applyCompareColors(s.colors),JSON.stringify(s.sysVars)!==JSON.stringify(this.sessionSysVars)&&this.scheduleCompareSysVars(s.sysVars)}});if(!this.disposed){if(!i.confirmed){this.applyCompareColors(e),this.flushCompareSysVars(t);return}this.flushCompareSysVars(i.sysVars)}}adoptCompareSysVarsAfterOpen(e,t){t||(this.sessionSysVars=he(e.database)),ae(this.sessionSysVars,[e.database])}clearSysVarPreviewTimer(){this.sysVarPreviewTimer&&(window.clearTimeout(this.sysVarPreviewTimer),this.sysVarPreviewTimer=0)}scheduleCompareSysVars(e){this.clearSysVarPreviewTimer();const t={...e};this.sysVarPreviewTimer=window.setTimeout(()=>{this.sysVarPreviewTimer=0,!this.disposed&&this.applyCompareSysVars(t)},mt)}flushCompareSysVars(e){this.clearSysVarPreviewTimer(),this.applyCompareSysVars(e)}applyCompareSysVars(e){var s,o;const t=JSON.stringify(e)===JSON.stringify(this.sessionSysVars);this.sessionSysVars={...e};const i=[(s=this.leftDocument)==null?void 0:s.database,(o=this.rightDocument)==null?void 0:o.database].filter(n=>n!=null);ae(this.sessionSysVars,i),t||this.runCompareAndApply()}applyCompareColors(e){this.colors={...e},this.syncCompareColorVars(),this.applyCompareDisplay()}syncCompareColorVars(){this.root.style.setProperty("--ml-diff-added",_(this.colors.added)),this.root.style.setProperty("--ml-diff-deleted",_(this.colors.deleted)),this.root.style.setProperty("--ml-diff-modified",_(this.colors.modified))}async runCompareAndApply(){var o,n;const e=++this.compareSeq,t=this.leftDocument,i=this.rightDocument;if(!t||!i){if(this.compareResult=void 0,this.navIndex=-1,await this.clearCompareDisplay(),this.disposed||e!==this.compareSeq)return;this.renderResultsList(),this.syncToolbarButtons();return}const s=ye(t.database,i.database,{compareProps:this.sessionSysVars.compareprops,compareHatch:this.sessionSysVars.comparehatch,compareText:this.sessionSysVars.comparetext,compareTolerance:this.sessionSysVars.comparetolerance,compareRcMargin:this.sessionSysVars.comparercmargin});this.disposed||e!==this.compareSeq||(this.compareResult=s,this.navIndex=-1,(n=(o=this.options.events)==null?void 0:o.compared)==null||n.call(o,this.compareResult),this.viewMode==="overlay"&&await this.enterOverlayMode(),!(this.disposed||e!==this.compareSeq)&&(await this.applyCompareDisplay(),!(this.disposed||e!==this.compareSeq)&&(this.renderResultsList(),this.refreshMarkupsList(),this.syncToolbarButtons())))}async enterOverlayMode(){this.lastPointerSide="left";const e=S(),t=this.rightDocument,i=++this.overlayRegisterSeq;if(!t){this.viewMode="overlay",this.syncViewModeUi(),await this.activateSide("left");return}this.overlayId&&(e.removeOverlay(this.overlayId),this.overlayId=void 0);const s=await e.registerOverlayDatabase(t.database,{targetView:e.mainView});if(this.disposed||i!==this.overlayRegisterSeq){try{e.removeOverlay(s)}catch{}return}this.overlayId=s,this.rightUi.pane.style.display="none",this.root.classList.add("is-overlay"),await this.activateSide("left")}async exitOverlayMode(){this.overlayRegisterSeq++;const e=S();this.overlayId&&(e.removeOverlay(this.overlayId),this.overlayId=void 0),this.rightUi.pane.style.display="",this.root.classList.remove("is-overlay")}async waitForCompareViewsIdle(){const e=S(),t=[e.mainView];e.splitView&&t.push(e.splitView),await Promise.all(t.map(i=>i.waitUntilIdle()))}async clearCompareDisplay(){const e=S();e.setCompareDisplay({enabled:!1},e.mainView),e.splitView&&e.setCompareDisplay({enabled:!1},e.splitView),this.overlayId&&e.setOverlayCompareDisplay(this.overlayId,{enabled:!1},e.mainView)}async applyCompareDisplay(){const e=this.compareResult,t=S();if(!e||!this.leftDocument||!this.rightDocument){await this.clearCompareDisplay();return}if(await this.waitForCompareViewsIdle(),this.disposed||this.compareResult!==e||!this.leftDocument||!this.rightDocument)return;const i={enabled:!0,baseColor:this.colors.unchanged,colors:{deleted:this.colors.deleted,added:this.colors.added,modified:this.colors.modified}},s=e.deleted.filter(d=>d.side==="left").map(d=>d.objectId),o=e.added.filter(d=>d.side==="right").map(d=>d.objectId);if(this.viewMode==="overlay"){const d=[...s.map(l=>({objectId:l,role:"deleted"})),...e.modified.filter(l=>l.side==="left").map(l=>({objectId:l.objectId,role:"deleted"}))],c=[...o.map(l=>({objectId:l,role:"added"})),...e.modified.filter(l=>l.side==="right").map(l=>({objectId:l.objectId,role:"added"}))];t.setCompareDisplay({enabled:!1},t.mainView),t.setCompareDisplay({...i,overrides:d},t.mainView),this.overlayId&&(t.setOverlayCompareDisplay(this.overlayId,{enabled:!1},t.mainView),t.setOverlayCompareDisplay(this.overlayId,{...i,overrides:c},t.mainView));return}const n=[...s.map(d=>({objectId:d,role:"deleted"})),...e.modified.filter(d=>d.side==="left").map(d=>({objectId:d.objectId,role:"modified"}))],r=[...o.map(d=>({objectId:d,role:"added"})),...e.modified.filter(d=>d.side==="right").map(d=>({objectId:d.objectId,role:"modified"}))];t.setCompareDisplay({enabled:!1},t.mainView),t.setCompareDisplay({...i,overrides:n},t.mainView),t.splitView&&(t.setCompareDisplay({enabled:!1},t.splitView),t.setCompareDisplay({...i,overrides:r},t.splitView))}async focusHit(e){const t=this.viewMode==="overlay"?"left":e.side;this.viewMode!=="overlay"&&await this.activateSide(e.side);const i=this.viewFor(t);if(e.extents){const s=new v.AcGeBox2d;if(s.expandByPoint({x:e.extents.minX,y:e.extents.minY}),s.expandByPoint({x:e.extents.maxX,y:e.extents.maxY}),e.pairedId&&e.kind==="modified"&&this.compareResult){const o=this.compareResult.modified.find(n=>n.objectId===e.pairedId);o!=null&&o.extents&&(s.expandByPoint({x:o.extents.minX,y:o.extents.minY}),s.expandByPoint({x:o.extents.maxX,y:o.extents.maxY}))}i.zoomTo(s,1.5)}this.isViewSyncActive()&&(this.viewSyncLeader=t,this.viewSyncFollowOpen=!1,this.copyVisibleView(t,t==="left"?"right":"left"))}renderResultsList(){this.hideDiffPopover(!0);const e=this.resultsBody;e.replaceChildren();const t=this.compareResult;if(!t||t.navigation.length===0){const n=document.createElement("div");n.className="ml-diff-empty-list",n.textContent=m("noResults"),e.appendChild(n),this.syncToolbarButtons();return}const i=new Map,s=(n,r)=>{const d=i.get(n);d?d.push(r):i.set(n,[r])};if(this.resultGroupMode==="kind"){for(const n of t.deleted)s("deleted",n);for(const n of t.modified.filter(r=>r.side==="left"))s("modified",n);for(const n of t.added)s("added",n)}else for(const n of t.navigation)s(n.dxfType||"UNKNOWN",n);const o=n=>n==="added"?m("kindAdded"):n==="deleted"?m("kindDeleted"):n==="modified"?m("kindModified"):n;for(const[n,r]of i){const d=this.resultGroupStorageKey(n),c=document.createElement("details");c.className="ml-diff-group",c.open=!this.collapsedResultGroups.has(d);const l=document.createElement("summary");l.className="ml-diff-group-title",l.textContent=this.resultGroupMode==="kind"?`${o(n)} (${r.length})`:`${n} (${r.length})`,c.appendChild(l),c.addEventListener("toggle",()=>{c.open?this.collapsedResultGroups.delete(d):this.collapsedResultGroups.add(d),this.hideDiffPopover(!0)}),r.forEach(f=>{const p=document.createElement("div");p.className="ml-diff-result-row",p.dataset.kind=f.kind;const u=t.navigation.indexOf(f);u===this.navIndex&&p.classList.add("is-active");const h=document.createElement("button");h.type="button",h.className="ml-diff-result-item",h.dataset.kind=f.kind;const g=document.createElement("span");g.className="ml-diff-result-label",g.textContent=`${f.dxfType} · ${f.objectId}`;const k=document.createElement("span");if(k.className="ml-diff-result-meta",k.textContent=`${f.layer} · ${o(f.kind)}`,h.append(g,k),h.addEventListener("click",()=>{this.navIndex=u>=0?u:this.navIndex,this.focusHit(f),this.renderResultsList()}),p.appendChild(h),f.kind==="modified"){const x=document.createElement("button");x.type="button",x.className="ml-diff-result-info",x.innerHTML=it;const O=m("diffDetails");x.setAttribute("aria-label",O),x.setAttribute("aria-expanded","false"),x.addEventListener("click",M=>{M.preventDefault(),M.stopPropagation(),this.toggleDiffPopover(x,f)}),x.addEventListener("mouseenter",()=>{this.showDiffPopover(x,f,!1)}),x.addEventListener("mouseleave",this.scheduleDiffPopoverHide),p.appendChild(x)}c.appendChild(p)}),e.appendChild(c)}this.syncToolbarButtons()}toggleDiffPopover(e,t){if(this.diffPopoverAnchor===e&&this.diffPopoverPinned){this.hideDiffPopover(!0);return}this.showDiffPopover(e,t,!0)}showDiffPopover(e,t,i){var s;!i&&this.diffPopoverPinned&&this.diffPopoverAnchor!==e||(this.cancelDiffPopoverHide(),!(!i&&this.diffPopoverPinned&&this.diffPopoverAnchor===e&&!this.diffPopover.hidden)&&((s=this.diffPopoverAnchor)==null||s.classList.remove("is-open"),this.diffPopoverAnchor=e,this.diffPopoverPinned=i,e.classList.toggle("is-open",i),e.setAttribute("aria-expanded",String(i)),this.renderDiffPopoverContent(t),this.positionDiffPopover(e),this.diffPopover.hidden=!1))}hideDiffPopover(e=!1){var t,i;this.diffPopoverPinned&&!e||(this.cancelDiffPopoverHide(),this.diffPopover.hidden=!0,this.diffPopoverPinned=!1,(t=this.diffPopoverAnchor)==null||t.classList.remove("is-open"),(i=this.diffPopoverAnchor)==null||i.setAttribute("aria-expanded","false"),this.diffPopoverAnchor=void 0)}renderDiffPopoverContent(e){const t=this.diffPopover;t.replaceChildren();const i=e.changes??[],s=i.filter(l=>l.field!=="geometry"||l.oldValue||l.newValue);if(s.length===0&&i.some(l=>l.field==="geometry")||s.length===0){const l=document.createElement("div");l.className="ml-diff-change-note",l.textContent=m("diffGeometryChanged"),t.appendChild(l);return}const n=document.createElement("table");n.className="ml-diff-change-table";const r=document.createElement("thead"),d=document.createElement("tr");for(const l of["diffColProperty","diffColOld","diffColNew"]){const f=document.createElement("th");f.textContent=m(l),d.appendChild(f)}r.appendChild(d);const c=document.createElement("tbody");for(const l of s){const f=document.createElement("tr"),p=document.createElement("th");p.scope="row",p.textContent=yt(l.field);const u=document.createElement("td");u.className="ml-diff-change-old",u.textContent=Te(l.field,l.oldValue);const h=document.createElement("td");h.className="ml-diff-change-new",h.textContent=Te(l.field,l.newValue),f.append(p,u,h),c.appendChild(f)}n.append(r,c),t.appendChild(n)}positionDiffPopover(e){const t=this.diffPopover;t.style.left="0px",t.style.top="0px",t.hidden=!1;const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=8;let n=i.left-s.width-o,r=i.top;n<o&&(n=Math.max(o,i.right-s.width),r=i.bottom+o),n+s.width>window.innerWidth-o&&(n=Math.max(o,window.innerWidth-s.width-o)),r+s.height>window.innerHeight-o&&(r=Math.max(o,window.innerHeight-s.height-o)),t.style.left=`${n}px`,t.style.top=`${r}px`}resultGroupStorageKey(e){return`${this.resultGroupMode}:${e}`}resultGroupStorageKeyForHit(e){const t=this.resultGroupMode==="kind"?e.kind:e.dxfType||"UNKNOWN";return this.resultGroupStorageKey(t)}refreshMarkupsList(){const e=this.markupsBody;e.replaceChildren();const t=this.leftDocument,i=this.rightDocument,s=S(),o=[];if(t){const n=s.sessionFor(t);if(n)for(const r of b.listMarkupsForSession(n.id))o.push({side:"left",record:r})}if(i){const n=s.sessionFor(i);if(n)for(const r of b.listMarkupsForSession(n.id))o.push({side:"right",record:r})}if(o.length===0){const n=document.createElement("div");n.className="ml-diff-empty-list",n.textContent=m("noMarkups"),e.appendChild(n);return}for(const n of o){const r=document.createElement("button");r.type="button",r.className="ml-diff-markup-item",r.textContent=n.record.type;const d=document.createElement("span");d.className="ml-diff-markup-meta",d.textContent=n.side==="left"?m("markupFromLeft"):m("markupFromRight"),r.appendChild(d),r.addEventListener("click",()=>{this.activateSide(n.side)}),e.appendChild(r)}}showPaneError(e,t){const i=this.uiFor(e);if(this.documentFor(e)){i.banner.textContent=t,i.banner.classList.remove("is-hidden");const s=this.bannerTimers.get(e);s&&window.clearTimeout(s);const o=window.setTimeout(()=>{i.banner.classList.add("is-hidden"),this.bannerTimers.delete(e)},3e3);this.bannerTimers.set(e,o);return}i.emptyError.textContent=t,i.emptyError.classList.remove("is-hidden")}clearPaneError(e){const t=this.uiFor(e);t.emptyError.textContent="",t.emptyError.classList.add("is-hidden"),t.banner.textContent="",t.banner.classList.add("is-hidden");const i=this.bannerTimers.get(e);i&&(window.clearTimeout(i),this.bannerTimers.delete(e))}changeDragDepth(e,t){e==="left"?this.leftDragDepth=Math.max(0,this.leftDragDepth+t):this.rightDragDepth=Math.max(0,this.rightDragDepth+t),this.uiFor(e).pane.classList.toggle("is-dragover",(e==="left"?this.leftDragDepth:this.rightDragDepth)>0)}resetDragDepth(e){e==="left"?this.leftDragDepth=0:this.rightDragDepth=0,this.uiFor(e).pane.classList.remove("is-dragover")}uiFor(e){return e==="left"?this.leftUi:this.rightUi}documentFor(e){return e==="left"?this.leftDocument:this.rightDocument}viewFor(e){const t=S(),i=e==="left"?t.mainView:t.ensureSplitView(this.rightUi.canvas);return this.disableEntitySelection(i),i}disableEntitySelection(e){e.entitySelectionEnabled=!1}isViewSyncActive(){return this.viewsSynced&&this.viewMode==="side-by-side"&&!!this.leftDocument&&!!this.rightDocument}setViewsSynced(e){if(this.viewsSynced=e,this.viewSyncFollowOpen=!1,e){const t=this.documentFor(this.lastPointerSide)?this.lastPointerSide:"left";this.viewSyncLeader=t,this.applyViewSyncFromLeader()}this.syncViewModeUi()}applyViewSyncFromLeader(){if(!this.isViewSyncActive())return;const e=this.documentFor(this.viewSyncLeader)?this.viewSyncLeader:this.leftDocument?"left":"right";this.viewSyncLeader=e,this.copyVisibleView(e,e==="left"?"right":"left")}syncFollowerAfterOpen(e){const t=e==="left"?"right":"left";!this.isViewSyncActive()||!this.documentFor(t)||(this.viewSyncLeader=t,this.viewSyncFollowOpen=!0,this.copyVisibleView(t,e))}bindViewSyncListeners(){try{const e=this.viewFor("left"),t=this.viewFor("right");e.events.viewChanged.addEventListener(this.handleLeftViewChanged),t.events.viewChanged.addEventListener(this.handleRightViewChanged)}catch{return}for(const e of[this.leftUi.canvas,this.rightUi.canvas])e.addEventListener("pointerdown",this.markViewSyncUserInput,!0),e.addEventListener("wheel",this.markViewSyncUserInput,{capture:!0,passive:!0})}unbindViewSyncListeners(){for(const e of[this.leftUi.canvas,this.rightUi.canvas])e.removeEventListener("pointerdown",this.markViewSyncUserInput,!0),e.removeEventListener("wheel",this.markViewSyncUserInput,!0);try{const e=this.viewFor("left"),t=this.viewFor("right");e.events.viewChanged.removeEventListener(this.handleLeftViewChanged),t.events.viewChanged.removeEventListener(this.handleRightViewChanged)}catch{}}onPaneViewChanged(e){if(this.disposed||this.viewSyncLock||!this.isViewSyncActive())return;const t=e==="left"?"right":"left";if(this.viewSyncFollowOpen&&e!==this.viewSyncLeader&&!this.viewSyncFromUser){this.copyVisibleView(this.viewSyncLeader,e);return}this.viewSyncFollowOpen=!1,this.viewSyncFromUser=!1,this.viewSyncLeader=e,this.copyVisibleView(e,t)}copyVisibleView(e,t){if(e===t||this.viewSyncLock||!this.documentFor(e)||!this.documentFor(t))return;let i,s;try{i=this.viewFor(e),s=this.viewFor(t)}catch{return}const o=i.width,n=i.height;if(o<2||n<2)return;let r;try{const d=i.screenToWorld({x:0,y:0}),c=i.screenToWorld({x:o,y:n});r=new v.AcGeBox2d,r.expandByPoint(d),r.expandByPoint(c)}catch{return}this.viewSyncLock=!0;try{s.zoomTo(r,1)}catch{}finally{requestAnimationFrame(()=>{this.viewSyncLock=!1})}}liveDoc(e){if(e)try{return S().sessionFor(e)?e:void 0}catch{return}}paneTitle(e){return e?e.docTitle||e.fileName||b.AcApI18n.t("main.document.untitled"):m("noDrawing")}syncChrome(){const e=this.leftDocument,t=this.rightDocument;this.leftDoc=e,this.rightDoc=t,this.syncPaneChrome(this.leftUi,e),this.syncPaneChrome(this.rightUi,t),this.syncFocusRings(),this.syncToolbarButtons(),window.dispatchEvent(new Event("resize"))}applyFocusClass(e){this.leftUi.pane.classList.toggle("is-focused",e==="left"),this.rightUi.pane.classList.toggle("is-focused",e==="right")}syncFocusRings(){const e=this.rightDocument;let t;try{t=S().curDocument}catch{t=void 0}t===e&&e?this.applyFocusClass("right"):this.applyFocusClass("left")}syncPaneChrome(e,t){e.pane.classList.toggle("is-empty",!t),e.empty.classList.toggle("is-hidden",!!t),e.title.textContent=this.paneTitle(t),e.title.classList.toggle("is-empty",!t),e.openButton.setAttribute("aria-label",m("openFile")),e.openButton.title=m("openFile"),e.emptyTitle.textContent=m("emptyTitle"),e.emptyHint.textContent=m("emptyHint"),e.emptyError.classList.contains("is-hidden")||(e.emptyError.textContent=m("invalidFile")),e.banner.classList.contains("is-hidden")||(e.banner.textContent=m("invalidFile"))}syncViewModeUi(){this.root.classList.toggle("is-overlay",this.viewMode==="overlay"),this.btnSideBySide.classList.toggle("is-active",this.viewMode==="side-by-side"),this.btnOverlay.classList.toggle("is-active",this.viewMode==="overlay");const e=m("toolbarSideBySide"),t=m("toolbarOverlay"),i=m("toolbarTogglePanel");this.btnSideBySide.title=e,this.btnSideBySide.setAttribute("aria-label",e),this.btnOverlay.title=t,this.btnOverlay.setAttribute("aria-label",t);const s=m("toolbarSyncViews");this.btnSyncViews.title=s,this.btnSyncViews.setAttribute("aria-label",s),this.btnSyncViews.setAttribute("aria-pressed",String(this.viewsSynced)),this.btnSyncViews.classList.toggle("is-active",this.viewsSynced),this.btnSyncViews.hidden=this.viewMode!=="side-by-side",this.btnTogglePanel.title=i,this.btnTogglePanel.setAttribute("aria-label",i),this.btnPrev.title=m("toolbarPrev"),this.btnNext.title=m("toolbarNext");const o=m("toolbarSettings");this.btnSettings.title=o,this.btnSettings.setAttribute("aria-label",o),this.syncToolbarButtons(),this.syncMarkupVisibilityButton(),this.syncThemeButton(),this.syncLocaleSelect();for(const n of this.markupButtons){const r=n.dataset.labelKey,d=m(r);n.title=d,n.setAttribute("aria-label",d)}}syncPanelUi(){this.sidePanel.classList.toggle("is-collapsed",!this.sidePanelOpen),this.btnTogglePanel.classList.toggle("is-active",this.sidePanelOpen),this.panelTitle.textContent=m("panelTitle"),this.tabResults.textContent=m("tabResults"),this.tabMarkups.textContent=m("tabMarkups"),this.groupByKindBtn.textContent=m("groupByKind"),this.groupByTypeBtn.textContent=m("groupByType"),this.tabResults.classList.toggle("is-active",this.activeTab==="results"),this.tabMarkups.classList.toggle("is-active",this.activeTab==="markups"),this.resultsBody.hidden=this.activeTab!=="results",this.markupsBody.hidden=this.activeTab!=="markups",this.groupByKindBtn.classList.toggle("is-active",this.resultGroupMode==="kind"),this.groupByTypeBtn.classList.toggle("is-active",this.resultGroupMode==="type");const e=this.groupByKindBtn.parentElement;e&&(e.hidden=this.activeTab!=="results"),(!this.sidePanelOpen||this.activeTab!=="results")&&this.hideDiffPopover(!0)}syncToolbarButtons(){var o,n;const e=!!(this.leftDocument||this.rightDocument),t=!!this.compareResult,i=((o=this.compareResult)==null?void 0:o.navigation)??[],s=t&&i.length>0;this.btnMarkupVis.disabled=!e,this.btnClearMarkups.disabled=!e;for(const r of this.markupButtons)r.dataset.command||r.dataset.labelKey==="markupClear"?r.disabled=!e:r.dataset.labelKey==="markupGenerateClouds"&&(r.disabled=!t||(((n=this.compareResult)==null?void 0:n.changeSets.length)??0)===0);this.btnPrev.disabled=!s||this.navIndex<=0,this.btnNext.disabled=!s||this.navIndex>=i.length-1}setUiTheme(e){this.uiTheme=e,b.acedApplyUiTheme(e,this.root),this.syncThemeButton()}syncMarkupVisibilityButton(){const e=b.isMarkupVisible();this.btnMarkupVis.innerHTML=e?D.ICON_ANNOTATION_HIDE:D.ICON_ANNOTATION_SHOW;const t=m(e?"markupHide":"markupShow");this.btnMarkupVis.title=t,this.btnMarkupVis.setAttribute("aria-label",t),this.btnMarkupVis.setAttribute("aria-pressed",String(e)),this.btnMarkupVis.classList.toggle("is-active",e)}syncThemeButton(){const e=this.uiTheme==="dark";this.btnTheme.innerHTML=e?nt:ot;const t=m(e?"toolbarThemeDark":"toolbarThemeLight");this.btnTheme.title=t,this.btnTheme.setAttribute("aria-label",t)}assertAlive(){if(this.disposed)throw new Error("AcApDiffViewer has been destroyed")}}P.AcApDiffViewer=kt,P.acapBuildCompareChangeSets=fe,P.acapChangeSetCloudRole=ce,P.acapCompareDrawings=ye,P.acapDefaultCompareSysVars=Y,P.acapDiffViewerT=m,P.acapInjectDiffViewerStyles=xe,P.acapReadCompareSysVars=he,P.acapRegisterDiffViewerI18n=ke,P.acapToleranceFromCompareTolerance=ue,P.acapWriteCompareSysVars=ae,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
969
|
+
`.trim();function xe(){if(document.getElementById(Ce))return;const a=document.createElement("style");a.id=Ce,a.textContent=mt,document.head.appendChild(a)}const we={minimumChunkSize:1e3,mode:b.AcEdOpenMode.Write,progressiveRendering:!1,sysVars:{lwdisplay:!1}},pt=/\.(dwg|dxf)$/i,Pe="cad-diff-viewer:changeset",ht=200,ut=[{command:"markupcloud",labelKey:"markupCloud",icon:D.ICON_MARKUP_CLOUD},{command:"markuprect",labelKey:"markupRect",icon:D.ICON_MARKUP_RECT},{command:"markupcircle",labelKey:"markupCircle",icon:D.ICON_MARKUP_CIRCLE},{command:"markupcallout",labelKey:"markupCallout",icon:D.ICON_MARKUP_CALLOUT},{command:"markuparrow",labelKey:"markupArrow",icon:D.ICON_MARKUP_ARROW},{command:"markupline",labelKey:"markupLine",icon:D.ICON_MARKUP_LINE},{command:"markuptext",labelKey:"markupText",icon:D.ICON_MARKUP_TEXT},{command:"markupstamp",labelKey:"markupStamp",icon:D.ICON_MARKUP_STAMP}],Se=[{locale:"en",label:"English"},{locale:"zh",label:"简体中文"},{locale:"tr",label:"Türkçe"},{locale:"cs",label:"Čeština"},{locale:"ar",label:"العربية"}],gt='<svg class="ml-diff-lang-select__caret" viewBox="0 0 12 12" aria-hidden="true"><path fill="currentColor" d="M2.4 4.2 6 8.1l3.6-3.9"/></svg>';function yt(a){var e;return((e=Se.find(t=>t.locale===a))==null?void 0:e.label)??"English"}const bt={objectId:"fieldObjectId",layer:"fieldLayer",color:"fieldColor",lineType:"fieldLineType",lineWeight:"fieldLineWeight",lineTypeScale:"fieldLineTypeScale",transparency:"fieldTransparency",thickness:"fieldThickness",visibility:"fieldVisibility",startPoint:"fieldStartPoint",endPoint:"fieldEndPoint",center:"fieldCenter",radius:"fieldRadius",startAngle:"fieldStartAngle",endAngle:"fieldEndAngle",position:"fieldPosition",location:"fieldLocation",rotation:"fieldRotation",height:"fieldHeight",blockName:"fieldBlockName",scale:"fieldScale",text:"fieldText",mtext:"fieldMtext",extents:"fieldExtents",geometry:"fieldGeometry"};function vt(a){const e=bt[a];return e?m(e):a}function Te(a,e){return e===""?"—":a==="visibility"?m(e==="true"?"diffVisible":"diffHidden"):e}function S(){try{return b.AcApDocManager.instance}catch{throw new Error("AcApDiffViewer is not initialized")}}function kt(a){return pt.test(a)}function Ct(a){return{...b.ACAP_DEFAULT_COMPARE_COLORS,...a}}class xt{constructor(e){this.markupButtons=[],this.leftDragDepth=0,this.rightDragDepth=0,this.bannerTimers=new Map,this.resultGroupMode="kind",this.collapsedResultGroups=new Set,this.activeTab="results",this.navIndex=-1,this.disposed=!1,this.localeMenuOpen=!1,this.diffPopoverPinned=!1,this.diffPopoverHideTimer=0,this.activateSeq=0,this.activateTail=Promise.resolve(),this.compareSeq=0,this.overlayRegisterSeq=0,this.sysVarPreviewTimer=0,this.lastPointerSide="left",this.viewsSynced=!1,this.viewSyncLock=!1,this.viewSyncLeader="left",this.viewSyncFollowOpen=!1,this.viewSyncFromUser=!1,this.handleLocaleChanged=()=>{this.disposed||(this.setLocaleMenuOpen(!1),this.syncChrome(),this.syncViewModeUi(),this.syncPanelUi(),this.renderResultsList(),this.refreshMarkupsList())},this.handleDocumentPointerDown=n=>{var r;n.target instanceof Node&&(this.localeMenuOpen&&!this.localeSelectHost.contains(n.target)&&this.setLocaleMenuOpen(!1),this.diffPopoverPinned&&(this.diffPopover.contains(n.target)||(r=this.diffPopoverAnchor)!=null&&r.contains(n.target)||this.hideDiffPopover(!0)))},this.handleDiffPopoverDismiss=()=>{this.hideDiffPopover(!0)},this.cancelDiffPopoverHide=()=>{this.diffPopoverHideTimer&&(window.clearTimeout(this.diffPopoverHideTimer),this.diffPopoverHideTimer=0)},this.scheduleDiffPopoverHide=()=>{this.diffPopoverPinned||(this.cancelDiffPopoverHide(),this.diffPopoverHideTimer=window.setTimeout(()=>{this.diffPopoverHideTimer=0,this.hideDiffPopover(!1)},180))},this.markViewSyncUserInput=()=>{this.viewSyncFromUser=!0},this.handleLeftViewChanged=()=>{this.onPaneViewChanged("left")},this.handleRightViewChanged=()=>{this.onPaneViewChanged("right")},this.options=e,this.colors=Ct(e.compareColors),this.sessionSysVars=Y(),this.uiTheme=e.theme??"dark",this.viewMode=e.viewMode??"side-by-side",this.sidePanelOpen=e.sidePanelOpen!==!1,ke(),xe();let t=!1;try{b.AcApDocManager.instance,t=!0}catch{t=!1}if(t)throw new Error("AcApDiffViewer needs its own AcApDocManager. Create it on a page that does not already host a CAD viewer.");this.root=document.createElement("div"),this.root.className="ml-diff-root",b.acedApplyUiTheme(this.uiTheme,this.root),this.toolbar=document.createElement("div"),this.toolbar.className="ml-diff-toolbar",this.body=document.createElement("div"),this.body.className="ml-diff-body",this.panesHost=document.createElement("div"),this.panesHost.className="ml-diff-panes",this.leftUi=this.createPane("left"),this.rightUi=this.createPane("right"),this.panesHost.append(this.leftUi.pane,this.rightUi.pane);const i=this.createChrome();this.btnSideBySide=i.btnSideBySide,this.btnOverlay=i.btnOverlay,this.btnSyncViews=i.btnSyncViews,this.btnTogglePanel=i.btnTogglePanel,this.btnPrev=i.btnPrev,this.btnNext=i.btnNext,this.btnSettings=i.btnSettings,this.btnMarkupVis=i.btnMarkupVis,this.btnClearMarkups=i.btnClearMarkups,this.btnTheme=i.btnTheme,this.sidePanel=i.sidePanel,this.resultsBody=i.resultsBody,this.markupsBody=i.markupsBody,this.tabResults=i.tabResults,this.tabMarkups=i.tabMarkups,this.groupByKindBtn=i.groupByKindBtn,this.groupByTypeBtn=i.groupByTypeBtn,this.panelTitle=i.panelTitle,this.localeTrigger=i.localeTrigger,this.localeMenu=i.localeMenu,this.localeSelectHost=i.localeSelectHost,this.diffPopover=document.createElement("div"),this.diffPopover.className="ml-diff-change-popover",this.diffPopover.hidden=!0,this.diffPopover.setAttribute("role","tooltip"),this.diffPopover.addEventListener("mouseenter",this.cancelDiffPopoverHide),this.diffPopover.addEventListener("mouseleave",this.scheduleDiffPopoverHide),this.toolbar.append(...i.toolbarChildren),this.body.append(this.panesHost,this.sidePanel),this.root.append(this.toolbar,this.body,this.diffPopover),e.container.appendChild(this.root);const s=e.openDocumentDefaults??we;b.AcApDocManager.createInstance({container:this.leftUi.canvas,busyIndicatorHost:this.leftUi.canvas,autoResize:!0,baseUrl:e.baseUrl,builtinOpenFileDialog:!1,simpleUi:!1,openDocumentDefaults:s,webworkerFileUrls:e.webworkerFileUrls});const o=b.AcApDocManager.instance;this.disableEntitySelection(o.mainView),this.disableEntitySelection(o.ensureSplitView(this.rightUi.canvas)),this.bindViewSyncListeners(),b.AcApI18n.events.localeChanged.addEventListener(this.handleLocaleChanged),document.addEventListener("pointerdown",this.handleDocumentPointerDown),this.resultsBody.addEventListener("scroll",this.handleDiffPopoverDismiss),window.addEventListener("resize",this.handleDiffPopoverDismiss),this.syncChrome(),this.syncViewModeUi(),this.syncPanelUi(),this.syncCompareColorVars()}get leftDocument(){return this.liveDoc(this.leftDoc)}get rightDocument(){return this.liveDoc(this.rightDoc)}get activeSide(){return S().curDocument===this.rightDocument?"right":"left"}get compareResultSnapshot(){return this.compareResult}async openDocument(e,t,i,s){var f,p,u,h;this.assertAlive();const o=S(),n=this.viewMode==="overlay";n&&await this.exitOverlayMode();const r=e==="left"?this.leftDoc:this.rightDoc,d=e==="left"?this.rightDoc:this.leftDoc;if(r&&o.sessionFor(r)&&!r.isReusableUntitled&&r!==d&&await o.closeDocument(r),this.uiFor(e).empty.classList.add("is-hidden"),this.clearPaneError(e),!await o.openDocument(t,i,s??this.options.openDocumentDefaults??we,this.viewFor(e)))return(p=(f=this.options.events)==null?void 0:f.failed)==null||p.call(f,e,t),this.syncChrome(),n&&(await this.enterOverlayMode(),this.syncViewModeUi()),!1;const l=o.curDocument;return e==="left"?this.leftDoc=l:this.rightDoc=l,this.adoptCompareSysVarsAfterOpen(l,!!this.liveDoc(d)),this.syncChrome(),(h=(u=this.options.events)==null?void 0:u.opened)==null||h.call(u,e,l),this.syncFollowerAfterOpen(e),this.applyMarkupVisibility(b.isMarkupVisible()),await this.runCompareAndApply(),!0}async activateSide(e){this.assertAlive();const t=e==="left"?this.leftDocument:this.rightDocument;if(!t)return!1;if(S().curDocument===t)return this.applyFocusClass(e),!0;const s=++this.activateSeq,o=async()=>{var l,f;if(this.disposed||s!==this.activateSeq)return!1;const r=e==="left"?this.leftDocument:this.rightDocument;if(!r)return!1;const d=S();if(d.curDocument===r)return this.applyFocusClass(e),!0;const c=await d.activateDocument(r);return this.disposed||s!==this.activateSeq?(this.disposed||this.syncFocusRings(),!1):(this.applyFocusClass(e),this.refreshMarkupsList(),c&&((f=(l=this.options.events)==null?void 0:l.focus)==null||f.call(l,e)),c)},n=this.activateTail.then(o,o);return this.activateTail=n.then(()=>{},()=>{}),n}async setViewMode(e){this.assertAlive(),e!==this.viewMode&&(e==="overlay"?await this.enterOverlayMode():await this.exitOverlayMode(),this.viewMode=e,this.syncViewModeUi(),e==="side-by-side"&&this.applyViewSyncFromLeader(),await this.applyCompareDisplay(),window.dispatchEvent(new Event("resize")))}setSidePanelOpen(e){this.sidePanelOpen=e,this.syncPanelUi(),window.dispatchEvent(new Event("resize"))}async goToDifference(e){var o;const t=((o=this.compareResult)==null?void 0:o.navigation)??[];if(t.length===0)return;let i;if(this.navIndex<0)if(e>0)i=0;else if(e<0)i=t.length-1;else return;else if(i=this.navIndex+e,i<0||i>=t.length)return;this.navIndex=i;const s=t[this.navIndex];this.collapsedResultGroups.delete(this.resultGroupStorageKeyForHit(s)),await this.focusHit(s),this.renderResultsList()}async destroy(){if(!this.disposed){this.disposed=!0,this.compareSeq++,this.overlayRegisterSeq++,this.clearSysVarPreviewTimer(),q.dismiss(),b.AcApI18n.events.localeChanged.removeEventListener(this.handleLocaleChanged),document.removeEventListener("pointerdown",this.handleDocumentPointerDown),this.resultsBody.removeEventListener("scroll",this.handleDiffPopoverDismiss),window.removeEventListener("resize",this.handleDiffPopoverDismiss),this.hideDiffPopover(!0),this.unbindViewSyncListeners();for(const e of this.bannerTimers.values())window.clearTimeout(e);this.bannerTimers.clear();try{this.overlayId&&S().removeOverlay(this.overlayId),await b.AcApDocManager.instance.destroy()}catch{}this.root.remove()}}createChrome(){const e=document.createElement("div");e.className="ml-diff-toolbar-group";const t=document.createElement("button");t.type="button",t.className="ml-diff-tool-btn is-icon",t.innerHTML=et;const i=document.createElement("button");i.type="button",i.className="ml-diff-tool-btn is-icon",i.innerHTML=tt;const s=document.createElement("button");s.type="button",s.className="ml-diff-tool-btn is-icon ml-diff-sync-btn",s.innerHTML=st,e.append(t,i,s);const o=document.createElement("div");o.className="ml-diff-toolbar-group";const n=document.createElement("button");n.type="button",n.className="ml-diff-tool-btn is-icon",n.innerHTML=it;const r=document.createElement("button");r.type="button",r.className="ml-diff-tool-btn",r.textContent="◀",r.disabled=!0;const d=document.createElement("button");d.type="button",d.className="ml-diff-tool-btn",d.textContent="▶",d.disabled=!0,o.append(n,r,d);const c=document.createElement("div");c.className="ml-diff-toolbar-group";const l=document.createElement("button");l.type="button",l.className="ml-diff-tool-btn is-icon",l.dataset.labelKey="markupGenerateClouds",l.disabled=!0,l.innerHTML=lt,l.addEventListener("click",()=>{this.generateCompareCloudMarkups()}),this.markupButtons.push(l),c.appendChild(l);for(const A of ut){const B=document.createElement("button");B.type="button",B.className="ml-diff-tool-btn is-icon",B.dataset.command=A.command,B.dataset.labelKey=A.labelKey,B.innerHTML=A.icon,B.addEventListener("click",()=>{this.runMarkupCommand(A.command)}),this.markupButtons.push(B),c.appendChild(B)}const f=document.createElement("button");f.type="button",f.className="ml-diff-tool-btn is-icon",f.addEventListener("click",()=>{this.toggleMarkupVisibility()}),c.appendChild(f);const p=document.createElement("button");p.type="button",p.className="ml-diff-tool-btn is-icon",p.dataset.labelKey="markupClear",p.innerHTML=D.ICON_CLEAR_MARKUPS,p.addEventListener("click",()=>{this.clearAllMarkups()}),this.markupButtons.push(p),c.appendChild(p);const u=this.createLanguageSelect(),h=document.createElement("button");h.type="button",h.className="ml-diff-tool-btn is-icon",h.innerHTML=ot;const g=document.createElement("button");g.type="button",g.className="ml-diff-tool-btn is-icon",u.group.prepend(h,g),t.addEventListener("click",()=>{this.setViewMode("side-by-side")}),i.addEventListener("click",()=>{this.setViewMode("overlay")}),s.addEventListener("click",()=>{this.setViewsSynced(!this.viewsSynced)}),n.addEventListener("click",()=>{this.setSidePanelOpen(!this.sidePanelOpen)}),r.addEventListener("click",()=>{this.goToDifference(-1)}),d.addEventListener("click",()=>{this.goToDifference(1)}),h.addEventListener("click",()=>{this.openSettings()}),g.addEventListener("click",()=>{this.setUiTheme(this.uiTheme==="dark"?"light":"dark")});const k=document.createElement("aside");k.className="ml-diff-sidepanel";const x=document.createElement("div");x.className="ml-diff-sidepanel-header";const O=document.createElement("div");O.className="ml-diff-sidepanel-title";const M=document.createElement("button");M.type="button",M.className="ml-diff-tool-btn",M.textContent="×",M.addEventListener("click",()=>this.setSidePanelOpen(!1)),x.append(O,M);const K=document.createElement("div");K.className="ml-diff-sidepanel-tabs";const j=document.createElement("button");j.type="button",j.className="ml-diff-sidepanel-tab is-active";const I=document.createElement("button");I.type="button",I.className="ml-diff-sidepanel-tab",K.append(j,I),j.addEventListener("click",()=>{this.activeTab="results",this.syncPanelUi()}),I.addEventListener("click",()=>{this.activeTab="markups",this.syncPanelUi(),this.refreshMarkupsList()});const G=document.createElement("div");G.className="ml-diff-sidepanel-toolbar";const U=document.createElement("button");U.type="button",U.className="ml-diff-tool-btn is-active";const y=document.createElement("button");y.type="button",y.className="ml-diff-tool-btn",G.append(U,y),U.addEventListener("click",()=>{this.resultGroupMode="kind",this.renderResultsList(),this.syncPanelUi()}),y.addEventListener("click",()=>{this.resultGroupMode="type",this.renderResultsList(),this.syncPanelUi()});const w=document.createElement("div");w.className="ml-diff-sidepanel-body";const L=document.createElement("div");return L.className="ml-diff-sidepanel-body",L.hidden=!0,k.append(x,K,G,w,L),{toolbarChildren:[e,o,c,u.group],btnSideBySide:t,btnOverlay:i,btnSyncViews:s,btnTogglePanel:n,btnPrev:r,btnNext:d,btnSettings:h,btnGenerateClouds:l,btnMarkupVis:f,btnClearMarkups:p,btnTheme:g,sidePanel:k,resultsBody:w,markupsBody:L,tabResults:j,tabMarkups:I,groupByKindBtn:U,groupByTypeBtn:y,panelTitle:O,closeBtn:M,localeTrigger:u.trigger,localeMenu:u.menu,localeSelectHost:u.host}}createLanguageSelect(){const e=document.createElement("div");e.className="ml-diff-toolbar-group ml-diff-toolbar-locale";const t=document.createElement("div");t.className="ml-diff-lang-select";const i=document.createElement("button");i.type="button",i.className="ml-diff-lang-select__trigger",i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");const s=document.createElement("span");s.className="ml-diff-lang-select__label",i.append(s),i.insertAdjacentHTML("beforeend",gt),i.addEventListener("click",n=>{n.stopPropagation(),this.setLocaleMenuOpen(!this.localeMenuOpen)});const o=document.createElement("div");o.className="ml-diff-lang-select__menu",o.setAttribute("role","listbox"),o.hidden=!0;for(const n of Se){const r=document.createElement("button");r.type="button",r.className="ml-diff-lang-select__option",r.setAttribute("role","option"),r.dataset.locale=n.locale,r.textContent=n.label,r.addEventListener("click",d=>{d.stopPropagation(),this.setLocaleMenuOpen(!1),n.locale!==b.AcApI18n.currentLocale&&(b.AcApI18n.setCurrentLocale(n.locale),document.documentElement.lang=n.locale)}),o.appendChild(r)}return t.append(i,o),e.appendChild(t),{group:e,host:t,trigger:i,menu:o}}setLocaleMenuOpen(e){this.localeMenuOpen=e,this.localeMenu.hidden=!e,this.localeTrigger.setAttribute("aria-expanded",String(e)),this.localeSelectHost.classList.toggle("is-open",e)}syncLocaleSelect(){const e=b.AcApI18n.currentLocale,t=this.localeTrigger.querySelector(".ml-diff-lang-select__label");t&&(t.textContent=yt(e)),this.localeTrigger.title=m("toolbarLanguage"),this.localeTrigger.setAttribute("aria-label",m("toolbarLanguage")),this.localeMenu.querySelectorAll(".ml-diff-lang-select__option").forEach(i=>{const s=i.dataset.locale===e;i.classList.toggle("is-selected",s),i.setAttribute("aria-selected",String(s))})}createPane(e){const t=document.createElement("section");t.className="ml-diff-pane",t.dataset.side=e,e==="left"&&t.classList.add("is-focused");const i=document.createElement("header");i.className="ml-diff-header";const s=document.createElement("span");s.className="ml-diff-title is-empty";const o=document.createElement("button");o.type="button",o.className="ml-diff-open",o.appendChild(ct());const n=document.createElement("input");n.type="file",n.className="ml-diff-file-input",n.accept=".dwg,.dxf,application/acad,application/dxf",n.tabIndex=-1,i.append(s,o,n);const r=document.createElement("div");r.className="ml-diff-canvas-slot";const d=document.createElement("div");d.className="ml-diff-canvas";const c=document.createElement("div");c.className="ml-diff-empty";const l=document.createElement("div");l.className="ml-diff-empty-card";const f=document.createElement("div");f.className="ml-diff-empty-title";const p=document.createElement("div");p.className="ml-diff-empty-hint";const u=document.createElement("div");u.className="ml-diff-empty-error is-hidden",l.append(ft(),f,p,u),c.appendChild(l);const h=document.createElement("div");return h.className="ml-diff-banner is-hidden",r.append(d,c,h),t.append(i,r),t.addEventListener("pointerenter",()=>{this.activateSideOnHover(e)}),t.addEventListener("pointerdown",()=>{this.lastPointerSide=e,this.applyFocusClass(e),this.activateSideAndResumeMarkup(e)}),t.addEventListener("click",g=>{if(this.documentFor(e))return;const k=g.target;k!=null&&k.closest(".ml-diff-open")||this.pickFile(e)}),o.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),this.pickFile(e)}),n.addEventListener("change",()=>{var k;const g=(k=n.files)==null?void 0:k[0];n.value="",g&&this.openLocalFile(e,g)}),t.addEventListener("dragenter",g=>{g.preventDefault(),this.changeDragDepth(e,1)}),t.addEventListener("dragover",g=>{g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect="copy")}),t.addEventListener("dragleave",g=>{g.preventDefault(),this.changeDragDepth(e,-1)}),t.addEventListener("drop",g=>{var x,O;g.preventDefault(),this.resetDragDepth(e);const k=(O=(x=g.dataTransfer)==null?void 0:x.files)==null?void 0:O[0];k&&this.openLocalFile(e,k)}),{pane:t,canvas:d,title:s,empty:c,emptyTitle:f,emptyHint:p,emptyError:u,banner:h,openButton:o,fileInput:n}}activateSideOnHover(e){this.disposed||this.viewMode==="side-by-side"&&(this.lastPointerSide=e,this.applyFocusClass(e),this.activateSideAndResumeMarkup(e))}async activateSideAndResumeMarkup(e){if(this.disposed||!this.documentFor(e))return;let t;try{const s=S();s.commandManager.activeCommand&&this.lastMarkupCommand&&s.curDocument!==this.documentFor(e)&&(t=this.lastMarkupCommand)}catch{return}!await this.activateSide(e)||this.disposed||this.lastPointerSide===e&&(this.applyFocusClass(e),t&&S().sendStringToExecute(t))}pickFile(e){this.uiFor(e).fileInput.click()}async openLocalFile(e,t){if(!kt(t.name)){this.showPaneError(e,m("invalidFile"));return}await this.openDocument(e,t.name,await t.arrayBuffer())}async runMarkupCommand(e){const t=S(),i=this.viewMode==="side-by-side"?this.lastPointerSide:"left";!this.documentFor(i)||(this.lastMarkupCommand=e,!await this.activateSide(i))||(this.applyFocusClass(i),t.sendStringToExecute(e))}async generateCompareCloudMarkups(){var i;if(this.disposed)return;const e=(i=this.compareResult)==null?void 0:i.changeSets;if(!(e!=null&&e.length))return;this.viewMode==="overlay"?await this.commitChangeSetClouds("left",e):(await this.commitChangeSetClouds("left",e.filter(s=>s.hasLeft)),await this.commitChangeSetClouds("right",e.filter(s=>s.hasRight))),this.disposed||this.refreshMarkupsList()}toggleMarkupVisibility(){this.disposed||!this.leftDocument&&!this.rightDocument||(this.applyMarkupVisibility(!b.isMarkupVisible()),this.syncMarkupVisibilityButton())}applyMarkupVisibility(e){this.leftDocument&&b.setMarkupVisible(this.viewFor("left"),e),this.rightDocument&&b.setMarkupVisible(this.viewFor("right"),e)}async clearAllMarkups(){if(!this.disposed){for(const e of["left","right"]){if(!this.documentFor(e)||!await this.activateSide(e)||this.disposed)continue;const i=this.viewFor(e);b.getMarkupPresenter().clearLayout(i,i.activeLayoutBtrId,{clearStore:!0})}this.disposed||this.refreshMarkupsList()}}async commitChangeSetClouds(e,t){if(!await this.activateSide(e)||this.disposed)return;const s=S(),o=this.viewFor(e),n=s.context;b.runMarkupEdit(o,"Create Markup",()=>{const r=b.getMarkupStore(),d=b.getMarkupPresenter();for(const c of r.list())c.type!=="cloud"||c.comment!==Pe||(d.unpublish(o,c.id,{keepInStore:!0}),r.removeRecord(c.id));for(const c of t){const l=c.extents;if(l.maxX<=l.minX&&l.maxY<=l.minY)continue;const f=b.createMarkupMeta("cloud",o,n,{comment:Pe}),p=H(this.colors[fe(c)]),u={...f,type:"cloud",style:{...f.style,color:p},geometry:{type:"cloud",corner1:{x:l.minX,y:l.minY},corner2:{x:l.maxX,y:l.maxY}}};r.upsert(u),d.publish(o,u)}})}async openSettings(){if(this.disposed)return;const e={...this.colors},t={...this.sessionSysVars},i=await q.open({host:document.body,theme:this.uiTheme,colors:this.colors,sysVars:this.sessionSysVars,onChange:s=>{if(this.disposed)return;this.applyCompareColors(s.colors),JSON.stringify(s.sysVars)!==JSON.stringify(this.sessionSysVars)&&this.scheduleCompareSysVars(s.sysVars)}});if(!this.disposed){if(!i.confirmed){this.applyCompareColors(e),this.flushCompareSysVars(t);return}this.flushCompareSysVars(i.sysVars)}}adoptCompareSysVarsAfterOpen(e,t){t||(this.sessionSysVars=ue(e.database)),le(this.sessionSysVars,[e.database])}clearSysVarPreviewTimer(){this.sysVarPreviewTimer&&(window.clearTimeout(this.sysVarPreviewTimer),this.sysVarPreviewTimer=0)}scheduleCompareSysVars(e){this.clearSysVarPreviewTimer();const t={...e};this.sysVarPreviewTimer=window.setTimeout(()=>{this.sysVarPreviewTimer=0,!this.disposed&&this.applyCompareSysVars(t)},ht)}flushCompareSysVars(e){this.clearSysVarPreviewTimer(),this.applyCompareSysVars(e)}applyCompareSysVars(e){var s,o;const t=JSON.stringify(e)===JSON.stringify(this.sessionSysVars);this.sessionSysVars={...e};const i=[(s=this.leftDocument)==null?void 0:s.database,(o=this.rightDocument)==null?void 0:o.database].filter(n=>n!=null);le(this.sessionSysVars,i),t||this.runCompareAndApply()}applyCompareColors(e){this.colors={...e},this.syncCompareColorVars(),this.applyCompareDisplay()}syncCompareColorVars(){this.root.style.setProperty("--ml-diff-added",H(this.colors.added)),this.root.style.setProperty("--ml-diff-deleted",H(this.colors.deleted)),this.root.style.setProperty("--ml-diff-modified",H(this.colors.modified))}async runCompareAndApply(){var o,n;const e=++this.compareSeq,t=this.leftDocument,i=this.rightDocument;if(!t||!i){if(this.compareResult=void 0,this.navIndex=-1,await this.clearCompareDisplay(),this.disposed||e!==this.compareSeq)return;this.renderResultsList(),this.syncToolbarButtons();return}const s=be(t.database,i.database,{compareProps:this.sessionSysVars.compareprops,compareHatch:this.sessionSysVars.comparehatch,compareText:this.sessionSysVars.comparetext,compareTolerance:this.sessionSysVars.comparetolerance,compareRcMargin:this.sessionSysVars.comparercmargin});this.disposed||e!==this.compareSeq||(this.compareResult=s,this.navIndex=-1,(n=(o=this.options.events)==null?void 0:o.compared)==null||n.call(o,this.compareResult),this.viewMode==="overlay"&&await this.enterOverlayMode(),!(this.disposed||e!==this.compareSeq)&&(await this.applyCompareDisplay(),!(this.disposed||e!==this.compareSeq)&&(this.renderResultsList(),this.refreshMarkupsList(),this.syncToolbarButtons())))}async enterOverlayMode(){this.lastPointerSide="left";const e=S(),t=this.rightDocument,i=++this.overlayRegisterSeq;if(!t){this.viewMode="overlay",this.syncViewModeUi(),await this.activateSide("left");return}this.overlayId&&(e.removeOverlay(this.overlayId),this.overlayId=void 0);const s=await e.registerOverlayDatabase(t.database,{targetView:e.mainView});if(this.disposed||i!==this.overlayRegisterSeq){try{e.removeOverlay(s)}catch{}return}this.overlayId=s,this.rightUi.pane.style.display="none",this.root.classList.add("is-overlay"),await this.activateSide("left")}async exitOverlayMode(){this.overlayRegisterSeq++;const e=S();this.overlayId&&(e.removeOverlay(this.overlayId),this.overlayId=void 0),this.rightUi.pane.style.display="",this.root.classList.remove("is-overlay")}async waitForCompareViewsIdle(){const e=S(),t=[e.mainView];e.splitView&&t.push(e.splitView),await Promise.all(t.map(i=>i.waitUntilIdle()))}async clearCompareDisplay(){const e=S();e.setCompareDisplay({enabled:!1},e.mainView),e.splitView&&e.setCompareDisplay({enabled:!1},e.splitView),this.overlayId&&e.setOverlayCompareDisplay(this.overlayId,{enabled:!1},e.mainView)}async applyCompareDisplay(){const e=this.compareResult,t=S();if(!e||!this.leftDocument||!this.rightDocument){await this.clearCompareDisplay();return}if(await this.waitForCompareViewsIdle(),this.disposed||this.compareResult!==e||!this.leftDocument||!this.rightDocument)return;const i={enabled:!0,baseColor:this.colors.unchanged,colors:{deleted:this.colors.deleted,added:this.colors.added,modified:this.colors.modified}},s=e.deleted.filter(d=>d.side==="left").map(d=>d.objectId),o=e.added.filter(d=>d.side==="right").map(d=>d.objectId);if(this.viewMode==="overlay"){const d=[...s.map(l=>({objectId:l,role:"deleted"})),...e.modified.filter(l=>l.side==="left").map(l=>({objectId:l.objectId,role:"deleted"}))],c=[...o.map(l=>({objectId:l,role:"added"})),...e.modified.filter(l=>l.side==="right").map(l=>({objectId:l.objectId,role:"added"}))];t.setCompareDisplay({enabled:!1},t.mainView),t.setCompareDisplay({...i,overrides:d},t.mainView),this.overlayId&&(t.setOverlayCompareDisplay(this.overlayId,{enabled:!1},t.mainView),t.setOverlayCompareDisplay(this.overlayId,{...i,overrides:c},t.mainView));return}const n=[...s.map(d=>({objectId:d,role:"deleted"})),...e.modified.filter(d=>d.side==="left").map(d=>({objectId:d.objectId,role:"modified"}))],r=[...o.map(d=>({objectId:d,role:"added"})),...e.modified.filter(d=>d.side==="right").map(d=>({objectId:d.objectId,role:"modified"}))];t.setCompareDisplay({enabled:!1},t.mainView),t.setCompareDisplay({...i,overrides:n},t.mainView),t.splitView&&(t.setCompareDisplay({enabled:!1},t.splitView),t.setCompareDisplay({...i,overrides:r},t.splitView))}async focusHit(e){const t=this.viewMode==="overlay"?"left":e.side;this.viewMode!=="overlay"&&await this.activateSide(e.side);const i=this.viewFor(t);if(e.extents){const s=new v.AcGeBox2d;if(s.expandByPoint({x:e.extents.minX,y:e.extents.minY}),s.expandByPoint({x:e.extents.maxX,y:e.extents.maxY}),e.pairedId&&e.kind==="modified"&&this.compareResult){const o=this.compareResult.modified.find(n=>n.objectId===e.pairedId);o!=null&&o.extents&&(s.expandByPoint({x:o.extents.minX,y:o.extents.minY}),s.expandByPoint({x:o.extents.maxX,y:o.extents.maxY}))}i.zoomTo(s,1.5)}this.isViewSyncActive()&&(this.viewSyncLeader=t,this.viewSyncFollowOpen=!1,this.copyVisibleView(t,t==="left"?"right":"left"))}renderResultsList(){this.hideDiffPopover(!0);const e=this.resultsBody;e.replaceChildren();const t=this.compareResult;if(!t||t.navigation.length===0){const n=document.createElement("div");n.className="ml-diff-empty-list",n.textContent=m("noResults"),e.appendChild(n),this.syncToolbarButtons();return}const i=new Map,s=(n,r)=>{const d=i.get(n);d?d.push(r):i.set(n,[r])};if(this.resultGroupMode==="kind"){for(const n of t.deleted)s("deleted",n);for(const n of t.modified.filter(r=>r.side==="left"))s("modified",n);for(const n of t.added)s("added",n)}else for(const n of t.navigation)s(n.dxfType||"UNKNOWN",n);const o=n=>n==="added"?m("kindAdded"):n==="deleted"?m("kindDeleted"):n==="modified"?m("kindModified"):n;for(const[n,r]of i){const d=this.resultGroupStorageKey(n),c=document.createElement("details");c.className="ml-diff-group",c.open=!this.collapsedResultGroups.has(d);const l=document.createElement("summary");l.className="ml-diff-group-title",l.textContent=this.resultGroupMode==="kind"?`${o(n)} (${r.length})`:`${n} (${r.length})`,c.appendChild(l),c.addEventListener("toggle",()=>{c.open?this.collapsedResultGroups.delete(d):this.collapsedResultGroups.add(d),this.hideDiffPopover(!0)}),r.forEach(f=>{const p=document.createElement("div");p.className="ml-diff-result-row",p.dataset.kind=f.kind;const u=t.navigation.indexOf(f);u===this.navIndex&&p.classList.add("is-active");const h=document.createElement("button");h.type="button",h.className="ml-diff-result-item",h.dataset.kind=f.kind;const g=document.createElement("span");g.className="ml-diff-result-label",g.textContent=`${f.dxfType} · ${f.objectId}`;const k=document.createElement("span");if(k.className="ml-diff-result-meta",k.textContent=`${f.layer} · ${o(f.kind)}`,h.append(g,k),h.addEventListener("click",()=>{this.navIndex=u>=0?u:this.navIndex,this.focusHit(f),this.renderResultsList()}),p.appendChild(h),f.kind==="modified"){const x=document.createElement("button");x.type="button",x.className="ml-diff-result-info",x.innerHTML=nt;const O=m("diffDetails");x.setAttribute("aria-label",O),x.setAttribute("aria-expanded","false"),x.addEventListener("click",M=>{M.preventDefault(),M.stopPropagation(),this.toggleDiffPopover(x,f)}),x.addEventListener("mouseenter",()=>{this.showDiffPopover(x,f,!1)}),x.addEventListener("mouseleave",this.scheduleDiffPopoverHide),p.appendChild(x)}c.appendChild(p)}),e.appendChild(c)}this.syncToolbarButtons()}toggleDiffPopover(e,t){if(this.diffPopoverAnchor===e&&this.diffPopoverPinned){this.hideDiffPopover(!0);return}this.showDiffPopover(e,t,!0)}showDiffPopover(e,t,i){var s;!i&&this.diffPopoverPinned&&this.diffPopoverAnchor!==e||(this.cancelDiffPopoverHide(),!(!i&&this.diffPopoverPinned&&this.diffPopoverAnchor===e&&!this.diffPopover.hidden)&&((s=this.diffPopoverAnchor)==null||s.classList.remove("is-open"),this.diffPopoverAnchor=e,this.diffPopoverPinned=i,e.classList.toggle("is-open",i),e.setAttribute("aria-expanded",String(i)),this.renderDiffPopoverContent(t),this.positionDiffPopover(e),this.diffPopover.hidden=!1))}hideDiffPopover(e=!1){var t,i;this.diffPopoverPinned&&!e||(this.cancelDiffPopoverHide(),this.diffPopover.hidden=!0,this.diffPopoverPinned=!1,(t=this.diffPopoverAnchor)==null||t.classList.remove("is-open"),(i=this.diffPopoverAnchor)==null||i.setAttribute("aria-expanded","false"),this.diffPopoverAnchor=void 0)}renderDiffPopoverContent(e){const t=this.diffPopover;t.replaceChildren();const i=e.changes??[],s=i.filter(l=>l.field!=="geometry"||l.oldValue||l.newValue);if(s.length===0&&i.some(l=>l.field==="geometry")||s.length===0){const l=document.createElement("div");l.className="ml-diff-change-note",l.textContent=m("diffGeometryChanged"),t.appendChild(l);return}const n=document.createElement("table");n.className="ml-diff-change-table";const r=document.createElement("thead"),d=document.createElement("tr");for(const l of["diffColProperty","diffColOld","diffColNew"]){const f=document.createElement("th");f.textContent=m(l),d.appendChild(f)}r.appendChild(d);const c=document.createElement("tbody");for(const l of s){const f=document.createElement("tr"),p=document.createElement("th");p.scope="row",p.textContent=vt(l.field);const u=document.createElement("td");u.className="ml-diff-change-old",u.textContent=Te(l.field,l.oldValue);const h=document.createElement("td");h.className="ml-diff-change-new",h.textContent=Te(l.field,l.newValue),f.append(p,u,h),c.appendChild(f)}n.append(r,c),t.appendChild(n)}positionDiffPopover(e){const t=this.diffPopover;t.style.left="0px",t.style.top="0px",t.hidden=!1;const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=8;let n=i.left-s.width-o,r=i.top;n<o&&(n=Math.max(o,i.right-s.width),r=i.bottom+o),n+s.width>window.innerWidth-o&&(n=Math.max(o,window.innerWidth-s.width-o)),r+s.height>window.innerHeight-o&&(r=Math.max(o,window.innerHeight-s.height-o)),t.style.left=`${n}px`,t.style.top=`${r}px`}resultGroupStorageKey(e){return`${this.resultGroupMode}:${e}`}resultGroupStorageKeyForHit(e){const t=this.resultGroupMode==="kind"?e.kind:e.dxfType||"UNKNOWN";return this.resultGroupStorageKey(t)}refreshMarkupsList(){const e=this.markupsBody;e.replaceChildren();const t=this.leftDocument,i=this.rightDocument,s=S(),o=[];if(t){const n=s.sessionFor(t);if(n)for(const r of b.listMarkupsForSession(n.id))o.push({side:"left",record:r})}if(i){const n=s.sessionFor(i);if(n)for(const r of b.listMarkupsForSession(n.id))o.push({side:"right",record:r})}if(o.length===0){const n=document.createElement("div");n.className="ml-diff-empty-list",n.textContent=m("noMarkups"),e.appendChild(n);return}for(const n of o){const r=document.createElement("button");r.type="button",r.className="ml-diff-markup-item",r.textContent=n.record.type;const d=document.createElement("span");d.className="ml-diff-markup-meta",d.textContent=n.side==="left"?m("markupFromLeft"):m("markupFromRight"),r.appendChild(d),r.addEventListener("click",()=>{this.activateSide(n.side)}),e.appendChild(r)}}showPaneError(e,t){const i=this.uiFor(e);if(this.documentFor(e)){i.banner.textContent=t,i.banner.classList.remove("is-hidden");const s=this.bannerTimers.get(e);s&&window.clearTimeout(s);const o=window.setTimeout(()=>{i.banner.classList.add("is-hidden"),this.bannerTimers.delete(e)},3e3);this.bannerTimers.set(e,o);return}i.emptyError.textContent=t,i.emptyError.classList.remove("is-hidden")}clearPaneError(e){const t=this.uiFor(e);t.emptyError.textContent="",t.emptyError.classList.add("is-hidden"),t.banner.textContent="",t.banner.classList.add("is-hidden");const i=this.bannerTimers.get(e);i&&(window.clearTimeout(i),this.bannerTimers.delete(e))}changeDragDepth(e,t){e==="left"?this.leftDragDepth=Math.max(0,this.leftDragDepth+t):this.rightDragDepth=Math.max(0,this.rightDragDepth+t),this.uiFor(e).pane.classList.toggle("is-dragover",(e==="left"?this.leftDragDepth:this.rightDragDepth)>0)}resetDragDepth(e){e==="left"?this.leftDragDepth=0:this.rightDragDepth=0,this.uiFor(e).pane.classList.remove("is-dragover")}uiFor(e){return e==="left"?this.leftUi:this.rightUi}documentFor(e){return e==="left"?this.leftDocument:this.rightDocument}viewFor(e){const t=S(),i=e==="left"?t.mainView:t.ensureSplitView(this.rightUi.canvas);return this.disableEntitySelection(i),i}disableEntitySelection(e){e.entitySelectionEnabled=!1}isViewSyncActive(){return this.viewsSynced&&this.viewMode==="side-by-side"&&!!this.leftDocument&&!!this.rightDocument}setViewsSynced(e){if(this.viewsSynced=e,this.viewSyncFollowOpen=!1,e){const t=this.documentFor(this.lastPointerSide)?this.lastPointerSide:"left";this.viewSyncLeader=t,this.applyViewSyncFromLeader()}this.syncViewModeUi()}applyViewSyncFromLeader(){if(!this.isViewSyncActive())return;const e=this.documentFor(this.viewSyncLeader)?this.viewSyncLeader:this.leftDocument?"left":"right";this.viewSyncLeader=e,this.copyVisibleView(e,e==="left"?"right":"left")}syncFollowerAfterOpen(e){const t=e==="left"?"right":"left";!this.isViewSyncActive()||!this.documentFor(t)||(this.viewSyncLeader=t,this.viewSyncFollowOpen=!0,this.copyVisibleView(t,e))}bindViewSyncListeners(){try{const e=this.viewFor("left"),t=this.viewFor("right");e.events.viewChanged.addEventListener(this.handleLeftViewChanged),t.events.viewChanged.addEventListener(this.handleRightViewChanged)}catch{return}for(const e of[this.leftUi.canvas,this.rightUi.canvas])e.addEventListener("pointerdown",this.markViewSyncUserInput,!0),e.addEventListener("wheel",this.markViewSyncUserInput,{capture:!0,passive:!0})}unbindViewSyncListeners(){for(const e of[this.leftUi.canvas,this.rightUi.canvas])e.removeEventListener("pointerdown",this.markViewSyncUserInput,!0),e.removeEventListener("wheel",this.markViewSyncUserInput,!0);try{const e=this.viewFor("left"),t=this.viewFor("right");e.events.viewChanged.removeEventListener(this.handleLeftViewChanged),t.events.viewChanged.removeEventListener(this.handleRightViewChanged)}catch{}}onPaneViewChanged(e){if(this.disposed||this.viewSyncLock||!this.isViewSyncActive())return;const t=e==="left"?"right":"left";if(this.viewSyncFollowOpen&&e!==this.viewSyncLeader&&!this.viewSyncFromUser){this.copyVisibleView(this.viewSyncLeader,e);return}this.viewSyncFollowOpen=!1,this.viewSyncFromUser=!1,this.viewSyncLeader=e,this.copyVisibleView(e,t)}copyVisibleView(e,t){if(e===t||this.viewSyncLock||!this.documentFor(e)||!this.documentFor(t))return;let i,s;try{i=this.viewFor(e),s=this.viewFor(t)}catch{return}const o=i.width,n=i.height;if(o<2||n<2)return;let r;try{const d=i.screenToWorld({x:0,y:0}),c=i.screenToWorld({x:o,y:n});r=new v.AcGeBox2d,r.expandByPoint(d),r.expandByPoint(c)}catch{return}this.viewSyncLock=!0;try{s.zoomTo(r,1)}catch{}finally{requestAnimationFrame(()=>{this.viewSyncLock=!1})}}liveDoc(e){if(e)try{return S().sessionFor(e)?e:void 0}catch{return}}paneTitle(e){return e?e.docTitle||e.fileName||b.AcApI18n.t("main.document.untitled"):m("noDrawing")}syncChrome(){const e=this.leftDocument,t=this.rightDocument;this.leftDoc=e,this.rightDoc=t,this.syncPaneChrome(this.leftUi,e),this.syncPaneChrome(this.rightUi,t),this.syncFocusRings(),this.syncToolbarButtons(),window.dispatchEvent(new Event("resize"))}applyFocusClass(e){this.leftUi.pane.classList.toggle("is-focused",e==="left"),this.rightUi.pane.classList.toggle("is-focused",e==="right")}syncFocusRings(){const e=this.rightDocument;let t;try{t=S().curDocument}catch{t=void 0}t===e&&e?this.applyFocusClass("right"):this.applyFocusClass("left")}syncPaneChrome(e,t){e.pane.classList.toggle("is-empty",!t),e.empty.classList.toggle("is-hidden",!!t),e.title.textContent=this.paneTitle(t),e.title.classList.toggle("is-empty",!t),e.openButton.setAttribute("aria-label",m("openFile")),e.openButton.title=m("openFile"),e.emptyTitle.textContent=m("emptyTitle"),e.emptyHint.textContent=m("emptyHint"),e.emptyError.classList.contains("is-hidden")||(e.emptyError.textContent=m("invalidFile")),e.banner.classList.contains("is-hidden")||(e.banner.textContent=m("invalidFile"))}syncViewModeUi(){this.root.classList.toggle("is-overlay",this.viewMode==="overlay"),this.btnSideBySide.classList.toggle("is-active",this.viewMode==="side-by-side"),this.btnOverlay.classList.toggle("is-active",this.viewMode==="overlay");const e=m("toolbarSideBySide"),t=m("toolbarOverlay"),i=m("toolbarTogglePanel");this.btnSideBySide.title=e,this.btnSideBySide.setAttribute("aria-label",e),this.btnOverlay.title=t,this.btnOverlay.setAttribute("aria-label",t);const s=m("toolbarSyncViews");this.btnSyncViews.title=s,this.btnSyncViews.setAttribute("aria-label",s),this.btnSyncViews.setAttribute("aria-pressed",String(this.viewsSynced)),this.btnSyncViews.classList.toggle("is-active",this.viewsSynced),this.btnSyncViews.hidden=this.viewMode!=="side-by-side",this.btnTogglePanel.title=i,this.btnTogglePanel.setAttribute("aria-label",i),this.btnPrev.title=m("toolbarPrev"),this.btnNext.title=m("toolbarNext");const o=m("toolbarSettings");this.btnSettings.title=o,this.btnSettings.setAttribute("aria-label",o),this.syncToolbarButtons(),this.syncMarkupVisibilityButton(),this.syncThemeButton(),this.syncLocaleSelect();for(const n of this.markupButtons){const r=n.dataset.labelKey,d=m(r);n.title=d,n.setAttribute("aria-label",d)}}syncPanelUi(){this.sidePanel.classList.toggle("is-collapsed",!this.sidePanelOpen),this.btnTogglePanel.classList.toggle("is-active",this.sidePanelOpen),this.panelTitle.textContent=m("panelTitle"),this.tabResults.textContent=m("tabResults"),this.tabMarkups.textContent=m("tabMarkups"),this.groupByKindBtn.textContent=m("groupByKind"),this.groupByTypeBtn.textContent=m("groupByType"),this.tabResults.classList.toggle("is-active",this.activeTab==="results"),this.tabMarkups.classList.toggle("is-active",this.activeTab==="markups"),this.resultsBody.hidden=this.activeTab!=="results",this.markupsBody.hidden=this.activeTab!=="markups",this.groupByKindBtn.classList.toggle("is-active",this.resultGroupMode==="kind"),this.groupByTypeBtn.classList.toggle("is-active",this.resultGroupMode==="type");const e=this.groupByKindBtn.parentElement;e&&(e.hidden=this.activeTab!=="results"),(!this.sidePanelOpen||this.activeTab!=="results")&&this.hideDiffPopover(!0)}syncToolbarButtons(){var o,n;const e=!!(this.leftDocument||this.rightDocument),t=!!this.compareResult,i=((o=this.compareResult)==null?void 0:o.navigation)??[],s=t&&i.length>0;this.btnMarkupVis.disabled=!e,this.btnClearMarkups.disabled=!e;for(const r of this.markupButtons)r.dataset.command||r.dataset.labelKey==="markupClear"?r.disabled=!e:r.dataset.labelKey==="markupGenerateClouds"&&(r.disabled=!t||(((n=this.compareResult)==null?void 0:n.changeSets.length)??0)===0);this.btnPrev.disabled=!s||this.navIndex<=0,this.btnNext.disabled=!s||this.navIndex>=i.length-1}setUiTheme(e){this.uiTheme=e,b.acedApplyUiTheme(e,this.root),this.syncThemeButton()}syncMarkupVisibilityButton(){const e=b.isMarkupVisible();this.btnMarkupVis.innerHTML=e?D.ICON_ANNOTATION_HIDE:D.ICON_ANNOTATION_SHOW;const t=m(e?"markupHide":"markupShow");this.btnMarkupVis.title=t,this.btnMarkupVis.setAttribute("aria-label",t),this.btnMarkupVis.setAttribute("aria-pressed",String(e)),this.btnMarkupVis.classList.toggle("is-active",e)}syncThemeButton(){const e=this.uiTheme==="dark";this.btnTheme.innerHTML=e?rt:at;const t=m(e?"toolbarThemeDark":"toolbarThemeLight");this.btnTheme.title=t,this.btnTheme.setAttribute("aria-label",t)}assertAlive(){if(this.disposed)throw new Error("AcApDiffViewer has been destroyed")}}P.AcApDiffViewer=xt,P.acapBuildCompareChangeSets=me,P.acapChangeSetCloudRole=fe,P.acapCompareDrawings=be,P.acapDefaultCompareSysVars=Y,P.acapDiffViewerT=m,P.acapInjectDiffViewerStyles=xe,P.acapReadCompareSysVars=ue,P.acapRegisterDiffViewerI18n=ke,P.acapToleranceFromCompareTolerance=ge,P.acapWriteCompareSysVars=le,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AcApCompareDisplayColors, type AcEdUiTheme, AcUiDialog } from '@mlightcad/cad-simple-viewer';
|
|
2
|
-
import { type AcApDiffCompareSysVars } from './compare';
|
|
2
|
+
import { type AcApDiffCompareSysVars } from './compare/index.js';
|
|
3
3
|
/** Draft values edited by {@link AcApDiffSettingsDialog}. */
|
|
4
4
|
export interface AcApDiffSettingsDraft {
|
|
5
5
|
/** Compare-display role colors. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApDiffSettingsDialog.d.ts","sourceRoot":"","sources":["../src/AcApDiffSettingsDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,UAAU,EACX,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAkBL,KAAK,sBAAsB,EAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"AcApDiffSettingsDialog.d.ts","sourceRoot":"","sources":["../src/AcApDiffSettingsDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,UAAU,EACX,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAkBL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAA;AAkC3B,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAA;IAC1C,wCAAwC;IACxC,OAAO,EAAE,sBAAsB,CAAA;CAChC;AAED,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,qDAAqD;IACrD,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAA;IAC1C,sDAAsD;IACtD,OAAO,EAAE,sBAAsB,CAAA;IAC/B,sDAAsD;IACtD,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAA;CAClD;AAED,qDAAqD;AACrD,MAAM,WAAW,4BAA4B;IAC3C,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAA;IAClB,4EAA4E;IAC5E,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAA;IAC1C,6EAA6E;IAC7E,OAAO,EAAE,sBAAsB,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED;;;;;;GAMG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IACpD,6CAA6C;IAC7C,gBAAuB,eAAe,uCAAsC;IAE5E,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAQ;IAC7C,OAAO,CAAC,MAAM,CAAC,YAAY,CAAsC;IAEjE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAwC;IAClE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiD;IACzE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4C;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsC;IACjE,OAAO,CAAC,UAAU,CAAC,CAAkB;IACrC,OAAO,CAAC,SAAS,CAAC,CAAkB;IACpC,OAAO,CAAC,WAAW,CAAC,CAAkB;IACtC,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,cAAc,CAAC,CAAkB;IACzC,OAAO,CAAC,cAAc,CAAC,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,UAAU,CAAQ;IAE1B,OAAO;IAwBP;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CACT,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,4BAA4B,CAAC;IAexC,2DAA2D;IAC3D,MAAM,CAAC,OAAO,IAAI,IAAI;IAIb,KAAK,IAAI,IAAI;IAOtB,OAAO,CAAC,YAAY;IAsFpB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,iBAAiB;IAiDzB,OAAO,CAAC,kBAAkB;IA2C1B,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,eAAe;IA2CvB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,MAAM,CAAC,oBAAoB;CA0NpC"}
|
|
@@ -52,8 +52,8 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
import { ACAP_DEFAULT_COMPARE_COLORS, AcUiDialog } from '@mlightcad/cad-simple-viewer';
|
|
55
|
-
import { ACAP_COMPAREHATCH_DEFAULT, ACAP_COMPAREPROPS_COLOR, ACAP_COMPAREPROPS_DEFAULT, ACAP_COMPAREPROPS_LAYER, ACAP_COMPAREPROPS_LINETYPE, ACAP_COMPAREPROPS_LINETYPESCALE, ACAP_COMPAREPROPS_LINEWEIGHT, ACAP_COMPAREPROPS_THICKNESS, ACAP_COMPAREPROPS_TRANSPARENCY, ACAP_COMPARERCMARGIN_DEFAULT, ACAP_COMPARERCMARGIN_MAX, ACAP_COMPARERCMARGIN_MIN, ACAP_COMPARETEXT_DEFAULT, ACAP_COMPARETOLERANCE_DEFAULT, ACAP_COMPARETOLERANCE_MAX, ACAP_COMPARETOLERANCE_MIN, acapDefaultCompareSysVars } from './compare';
|
|
56
|
-
import { acapDiffViewerT } from './i18n';
|
|
55
|
+
import { ACAP_COMPAREHATCH_DEFAULT, ACAP_COMPAREPROPS_COLOR, ACAP_COMPAREPROPS_DEFAULT, ACAP_COMPAREPROPS_LAYER, ACAP_COMPAREPROPS_LINETYPE, ACAP_COMPAREPROPS_LINETYPESCALE, ACAP_COMPAREPROPS_LINEWEIGHT, ACAP_COMPAREPROPS_THICKNESS, ACAP_COMPAREPROPS_TRANSPARENCY, ACAP_COMPARERCMARGIN_DEFAULT, ACAP_COMPARERCMARGIN_MAX, ACAP_COMPARERCMARGIN_MIN, ACAP_COMPARETEXT_DEFAULT, ACAP_COMPARETOLERANCE_DEFAULT, ACAP_COMPARETOLERANCE_MAX, ACAP_COMPARETOLERANCE_MIN, acapDefaultCompareSysVars } from './compare/index.js';
|
|
56
|
+
import { acapDiffViewerT } from './i18n/index.js';
|
|
57
57
|
/** Rows shown in the settings dialog, in display order. */
|
|
58
58
|
var COLOR_ROWS = [
|
|
59
59
|
{ role: 'unchanged', labelKey: 'settingsUnchanged' },
|