@mlightcad/cad-diff-viewer 1.6.3
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/LICENSE +21 -0
- package/README.md +203 -0
- package/dist/cad-diff-viewer.js +3543 -0
- package/dist/cad-diff-viewer.umd.cjs +969 -0
- package/lib/AcApDiffSettingsDialog.d.ts +99 -0
- package/lib/AcApDiffSettingsDialog.d.ts.map +1 -0
- package/lib/AcApDiffSettingsDialog.js +534 -0
- package/lib/AcApDiffSettingsDialog.js.map +1 -0
- package/lib/AcApDiffViewer.d.ts +532 -0
- package/lib/AcApDiffViewer.d.ts.map +1 -0
- package/lib/AcApDiffViewer.js +2757 -0
- package/lib/AcApDiffViewer.js.map +1 -0
- package/lib/compare/acapCompareChangeSets.d.ts +54 -0
- package/lib/compare/acapCompareChangeSets.d.ts.map +1 -0
- package/lib/compare/acapCompareChangeSets.js +191 -0
- package/lib/compare/acapCompareChangeSets.js.map +1 -0
- package/lib/compare/acapCompareDrawings.d.ts +116 -0
- package/lib/compare/acapCompareDrawings.d.ts.map +1 -0
- package/lib/compare/acapCompareDrawings.js +645 -0
- package/lib/compare/acapCompareDrawings.js.map +1 -0
- package/lib/compare/acapCompareSysVars.d.ts +97 -0
- package/lib/compare/acapCompareSysVars.d.ts.map +1 -0
- package/lib/compare/acapCompareSysVars.js +156 -0
- package/lib/compare/acapCompareSysVars.js.map +1 -0
- package/lib/compare/index.d.ts +4 -0
- package/lib/compare/index.d.ts.map +1 -0
- package/lib/compare/index.js +4 -0
- package/lib/compare/index.js.map +1 -0
- package/lib/i18n/index.d.ts +15 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +30 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/messages.d.ts +527 -0
- package/lib/i18n/messages.d.ts.map +1 -0
- package/lib/i18n/messages.js +527 -0
- package/lib/i18n/messages.js.map +1 -0
- package/lib/icons.d.ts +29 -0
- package/lib/icons.d.ts.map +1 -0
- package/lib/icons.js +43 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/injectDiffViewerStyles.d.ts +3 -0
- package/lib/injectDiffViewerStyles.d.ts.map +1 -0
- package/lib/injectDiffViewerStyles.js +15 -0
- package/lib/injectDiffViewerStyles.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,969 @@
|
|
|
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=`
|
|
2
|
+
.ml-ui-dialog.ml-diff-settings-dialog {
|
|
3
|
+
width: min(460px, calc(100vw - 32px));
|
|
4
|
+
max-height: min(560px, calc(100vh - 32px));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ml-ui-dialog.ml-diff-settings-dialog .ml-ui-dialog-body {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
max-height: min(400px, calc(100vh - 180px));
|
|
12
|
+
padding-top: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ml-diff-settings-tabs {
|
|
16
|
+
flex: 0 0 auto;
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: 2px;
|
|
19
|
+
margin: 0 -4px 8px;
|
|
20
|
+
border-bottom: 1px solid var(--ml-ui-border, #4c4d4f);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ml-diff-settings-tab {
|
|
24
|
+
flex: 1 1 0;
|
|
25
|
+
padding: 8px 6px 7px;
|
|
26
|
+
border: none;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
background: transparent;
|
|
29
|
+
color: var(--ml-ui-text-muted, #cfd3dc);
|
|
30
|
+
font: inherit;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ml-diff-settings-tab.is-active {
|
|
36
|
+
color: var(--ml-ui-text, #e5eaf3);
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
box-shadow: inset 0 -2px 0 var(--ml-ui-accent, #409eff);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ml-diff-settings-panels {
|
|
42
|
+
flex: 1 1 auto;
|
|
43
|
+
min-height: 0;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ml-diff-settings-panel[hidden] {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ml-diff-settings-section + .ml-diff-settings-section {
|
|
52
|
+
margin-top: 14px;
|
|
53
|
+
padding-top: 12px;
|
|
54
|
+
border-top: 1px solid var(--ml-ui-border, #4c4d4f);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ml-diff-settings-list + .ml-diff-settings-section {
|
|
58
|
+
margin-top: 14px;
|
|
59
|
+
padding-top: 12px;
|
|
60
|
+
border-top: 1px solid var(--ml-ui-border, #4c4d4f);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ml-diff-settings-heading {
|
|
64
|
+
margin: 0 0 8px;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
letter-spacing: 0.02em;
|
|
68
|
+
text-transform: uppercase;
|
|
69
|
+
color: var(--ml-ui-text-muted, #cfd3dc);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ml-diff-settings-hint {
|
|
73
|
+
margin: 0 0 8px;
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
line-height: 1.4;
|
|
76
|
+
color: var(--ml-ui-text-muted, #cfd3dc);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ml-diff-settings-list {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ml-diff-settings-check-grid {
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
87
|
+
column-gap: 12px;
|
|
88
|
+
row-gap: 2px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ml-diff-settings-check-item {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
padding: 5px 0;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ml-diff-settings-check-item .ml-diff-settings-label {
|
|
101
|
+
line-height: 1.3;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ml-diff-settings-row {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
gap: 12px;
|
|
109
|
+
padding: 8px 0;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ml-diff-settings-row + .ml-diff-settings-row {
|
|
114
|
+
border-top: 1px solid var(--ml-ui-border, #4c4d4f);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ml-diff-settings-label {
|
|
118
|
+
font-size: 13px;
|
|
119
|
+
color: var(--ml-ui-text, #e5eaf3);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ml-diff-settings-control {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: 10px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ml-diff-settings-hex {
|
|
129
|
+
font-size: 12px;
|
|
130
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
131
|
+
color: var(--ml-ui-text-muted, #cfd3dc);
|
|
132
|
+
min-width: 4.6em;
|
|
133
|
+
text-align: right;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ml-diff-settings-color {
|
|
137
|
+
width: 40px;
|
|
138
|
+
height: 28px;
|
|
139
|
+
padding: 0;
|
|
140
|
+
border: 1px solid var(--ml-ui-border, #4c4d4f);
|
|
141
|
+
border-radius: 4px;
|
|
142
|
+
background: transparent;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ml-diff-settings-color::-webkit-color-swatch-wrapper {
|
|
147
|
+
padding: 2px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ml-diff-settings-color::-webkit-color-swatch {
|
|
151
|
+
border: none;
|
|
152
|
+
border-radius: 3px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ml-diff-settings-color::-moz-color-swatch {
|
|
156
|
+
border: none;
|
|
157
|
+
border-radius: 3px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ml-diff-settings-check {
|
|
161
|
+
flex: 0 0 auto;
|
|
162
|
+
width: 16px;
|
|
163
|
+
height: 16px;
|
|
164
|
+
accent-color: var(--ml-ui-accent, #409eff);
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ml-diff-settings-slider-row {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 8px;
|
|
172
|
+
padding: 4px 0 8px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ml-diff-settings-slider-head {
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: space-between;
|
|
179
|
+
gap: 12px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ml-diff-settings-slider-value {
|
|
183
|
+
font-size: 12px;
|
|
184
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
185
|
+
color: var(--ml-ui-text-muted, #cfd3dc);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ml-diff-settings-slider {
|
|
189
|
+
width: 100%;
|
|
190
|
+
accent-color: var(--ml-ui-accent, #409eff);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ml-diff-settings-footer {
|
|
194
|
+
align-items: center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ml-diff-settings-reset {
|
|
198
|
+
margin-right: auto;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ml-ui-dialog-btn.ml-diff-settings-btn-secondary {
|
|
202
|
+
background: transparent;
|
|
203
|
+
color: var(--ml-ui-text, #e5eaf3);
|
|
204
|
+
border-color: var(--ml-ui-border, #4c4d4f);
|
|
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 W=E;const Ze=`
|
|
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
|
+
<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
|
+
</svg>
|
|
210
|
+
`.trim(),Je=`
|
|
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
|
+
<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
|
+
</svg>
|
|
214
|
+
`.trim(),Qe=`
|
|
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
|
+
<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
|
+
</svg>
|
|
218
|
+
`.trim(),et=`
|
|
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
|
+
<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
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 4.5v15" />
|
|
222
|
+
</svg>
|
|
223
|
+
`.trim(),tt=`
|
|
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
|
+
<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
|
+
</svg>
|
|
227
|
+
`.trim(),it=`
|
|
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
|
+
<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
|
+
</svg>
|
|
231
|
+
`.trim(),st=`
|
|
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
|
+
<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
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0Z" />
|
|
235
|
+
</svg>
|
|
236
|
+
`.trim(),nt='<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>',ot='<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>',rt=`
|
|
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
|
+
<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
|
+
<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
|
+
<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
|
+
</svg>
|
|
242
|
+
`.trim(),at=`
|
|
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
|
+
<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
|
+
</svg>
|
|
246
|
+
`.trim();function lt(){const a=document.createElement("span");return a.className="ml-diff-icon",a.innerHTML=Ze,a}function dt(){const a=document.createElement("span");return a.className="ml-diff-empty-icon",a.innerHTML=at,a}const Ce="ml-diff-viewer-styles-v2",ct=`
|
|
247
|
+
.ml-diff-root {
|
|
248
|
+
--ml-diff-bg: var(--ml-ui-bg, #1d1e1f);
|
|
249
|
+
--ml-diff-panel: var(--ml-ui-bg, #1d1e1f);
|
|
250
|
+
--ml-diff-border: var(--ml-ui-border, #4c4d4f);
|
|
251
|
+
--ml-diff-text: var(--ml-ui-text, #e5eaf3);
|
|
252
|
+
--ml-diff-muted: var(--ml-ui-text-muted, #cfd3dc);
|
|
253
|
+
--ml-diff-focus: var(--ml-ui-accent, #409eff);
|
|
254
|
+
--ml-diff-hover: color-mix(in srgb, var(--ml-diff-text) 10%, transparent);
|
|
255
|
+
--ml-diff-added: #22c55e;
|
|
256
|
+
--ml-diff-deleted: #e11d48;
|
|
257
|
+
--ml-diff-modified: #f59e0b;
|
|
258
|
+
box-sizing: border-box;
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
width: 100%;
|
|
262
|
+
height: 100%;
|
|
263
|
+
min-height: 0;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
color: var(--ml-diff-text);
|
|
267
|
+
background: var(--ml-diff-bg);
|
|
268
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.ml-diff-root *,
|
|
272
|
+
.ml-diff-root *::before,
|
|
273
|
+
.ml-diff-root *::after {
|
|
274
|
+
box-sizing: border-box;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.ml-diff-toolbar {
|
|
278
|
+
position: relative;
|
|
279
|
+
z-index: 5;
|
|
280
|
+
flex: 0 0 auto;
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-wrap: wrap;
|
|
283
|
+
align-items: center;
|
|
284
|
+
gap: 0.35rem;
|
|
285
|
+
padding: 0.4rem 0.55rem;
|
|
286
|
+
background: var(--ml-diff-panel);
|
|
287
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.ml-diff-toolbar-group {
|
|
291
|
+
display: inline-flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
gap: 0.2rem;
|
|
294
|
+
padding-right: 0.45rem;
|
|
295
|
+
margin-right: 0.25rem;
|
|
296
|
+
border-right: 1px solid var(--ml-diff-border);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.ml-diff-toolbar-group:last-child {
|
|
300
|
+
border-right: none;
|
|
301
|
+
margin-right: 0;
|
|
302
|
+
padding-right: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ml-diff-toolbar-locale {
|
|
306
|
+
margin-left: auto;
|
|
307
|
+
gap: 0.35rem;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.ml-diff-tool-btn {
|
|
311
|
+
display: inline-flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
gap: 0.3rem;
|
|
315
|
+
min-height: 1.85rem;
|
|
316
|
+
padding: 0.2rem 0.5rem;
|
|
317
|
+
border: 1px solid transparent;
|
|
318
|
+
border-radius: 6px;
|
|
319
|
+
background: transparent;
|
|
320
|
+
color: var(--ml-diff-muted);
|
|
321
|
+
font-size: 0.75rem;
|
|
322
|
+
cursor: pointer;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.ml-diff-tool-btn.is-icon {
|
|
326
|
+
width: 1.85rem;
|
|
327
|
+
padding: 0.2rem;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.ml-diff-root.is-overlay .ml-diff-sync-btn {
|
|
331
|
+
display: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ml-diff-tool-btn:hover,
|
|
335
|
+
.ml-diff-tool-btn:focus-visible {
|
|
336
|
+
color: var(--ml-diff-text);
|
|
337
|
+
background: var(--ml-diff-hover);
|
|
338
|
+
outline: none;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.ml-diff-tool-btn.is-active {
|
|
342
|
+
color: var(--ml-diff-text);
|
|
343
|
+
border-color: var(--ml-diff-focus);
|
|
344
|
+
background: color-mix(in srgb, var(--ml-diff-focus) 18%, transparent);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.ml-diff-tool-btn:disabled {
|
|
348
|
+
opacity: 0.4;
|
|
349
|
+
cursor: default;
|
|
350
|
+
pointer-events: none;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.ml-diff-tool-btn svg {
|
|
354
|
+
width: 1rem;
|
|
355
|
+
height: 1rem;
|
|
356
|
+
display: block;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.ml-diff-lang-select {
|
|
360
|
+
position: relative;
|
|
361
|
+
width: 110px;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.ml-diff-lang-select__trigger {
|
|
365
|
+
position: relative;
|
|
366
|
+
display: inline-flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
width: 100%;
|
|
369
|
+
height: 24px;
|
|
370
|
+
padding: 0 22px 0 8px;
|
|
371
|
+
border: 1px solid var(--ml-diff-border);
|
|
372
|
+
border-radius: 4px;
|
|
373
|
+
background: var(--ml-diff-bg);
|
|
374
|
+
color: var(--ml-diff-text);
|
|
375
|
+
font-size: 12px;
|
|
376
|
+
font-family: inherit;
|
|
377
|
+
line-height: 22px;
|
|
378
|
+
text-align: left;
|
|
379
|
+
cursor: pointer;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.ml-diff-lang-select__trigger:hover,
|
|
383
|
+
.ml-diff-lang-select.is-open .ml-diff-lang-select__trigger {
|
|
384
|
+
border-color: var(--ml-diff-focus);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.ml-diff-lang-select__trigger:focus-visible {
|
|
388
|
+
outline: none;
|
|
389
|
+
border-color: var(--ml-diff-focus);
|
|
390
|
+
box-shadow: 0 0 0 1px var(--ml-diff-focus);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.ml-diff-lang-select__label {
|
|
394
|
+
flex: 1 1 auto;
|
|
395
|
+
overflow: hidden;
|
|
396
|
+
text-overflow: ellipsis;
|
|
397
|
+
white-space: nowrap;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.ml-diff-lang-select__caret {
|
|
401
|
+
position: absolute;
|
|
402
|
+
right: 6px;
|
|
403
|
+
top: 50%;
|
|
404
|
+
width: 10px;
|
|
405
|
+
height: 10px;
|
|
406
|
+
margin-top: -5px;
|
|
407
|
+
color: var(--ml-diff-muted);
|
|
408
|
+
pointer-events: none;
|
|
409
|
+
transition: transform 0.15s ease;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.ml-diff-lang-select.is-open .ml-diff-lang-select__caret {
|
|
413
|
+
transform: rotate(180deg);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.ml-diff-lang-select__menu {
|
|
417
|
+
position: absolute;
|
|
418
|
+
right: 0;
|
|
419
|
+
top: calc(100% + 4px);
|
|
420
|
+
z-index: 40;
|
|
421
|
+
min-width: 100%;
|
|
422
|
+
padding: 4px 0;
|
|
423
|
+
border: 1px solid var(--ml-diff-border);
|
|
424
|
+
border-radius: 4px;
|
|
425
|
+
background: var(--ml-diff-panel);
|
|
426
|
+
box-shadow: var(--ml-ui-shadow, 0 6px 16px rgba(0, 0, 0, 0.45));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.ml-diff-lang-select__option {
|
|
430
|
+
display: block;
|
|
431
|
+
width: 100%;
|
|
432
|
+
margin: 0;
|
|
433
|
+
padding: 5px 12px;
|
|
434
|
+
border: none;
|
|
435
|
+
background: transparent;
|
|
436
|
+
color: var(--ml-diff-text);
|
|
437
|
+
font-size: 12px;
|
|
438
|
+
font-family: inherit;
|
|
439
|
+
text-align: left;
|
|
440
|
+
cursor: pointer;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.ml-diff-lang-select__option:hover {
|
|
444
|
+
background: var(--ml-diff-hover);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.ml-diff-lang-select__option.is-selected {
|
|
448
|
+
color: var(--ml-diff-text);
|
|
449
|
+
background: color-mix(in srgb, var(--ml-diff-focus) 22%, transparent);
|
|
450
|
+
font-weight: 600;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.ml-diff-body {
|
|
454
|
+
flex: 1 1 auto;
|
|
455
|
+
display: flex;
|
|
456
|
+
min-height: 0;
|
|
457
|
+
min-width: 0;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.ml-diff-panes {
|
|
461
|
+
flex: 1 1 auto;
|
|
462
|
+
display: flex;
|
|
463
|
+
min-width: 0;
|
|
464
|
+
min-height: 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.ml-diff-pane {
|
|
468
|
+
flex: 1 1 50%;
|
|
469
|
+
min-width: 0;
|
|
470
|
+
min-height: 0;
|
|
471
|
+
display: flex;
|
|
472
|
+
flex-direction: column;
|
|
473
|
+
border: 2px solid transparent;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.ml-diff-pane.is-empty {
|
|
477
|
+
cursor: pointer;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.ml-diff-root.is-overlay .ml-diff-pane[data-side='right'] {
|
|
481
|
+
display: none;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.ml-diff-root.is-overlay .ml-diff-pane[data-side='left'] {
|
|
485
|
+
flex: 1 1 100%;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ml-diff-pane.is-focused {
|
|
489
|
+
position: relative;
|
|
490
|
+
z-index: 1;
|
|
491
|
+
border-color: var(--ml-diff-focus);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.ml-diff-pane + .ml-diff-pane {
|
|
495
|
+
border-left: 1px solid var(--ml-diff-border);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* Adjacent-sibling divider must not replace the focused pane's left edge. */
|
|
499
|
+
.ml-diff-pane + .ml-diff-pane.is-focused {
|
|
500
|
+
border-left: 2px solid var(--ml-diff-focus);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.ml-diff-header {
|
|
504
|
+
flex: 0 0 auto;
|
|
505
|
+
display: flex;
|
|
506
|
+
align-items: center;
|
|
507
|
+
gap: 0.5rem;
|
|
508
|
+
padding: 0.35rem 0.45rem 0.35rem 0.7rem;
|
|
509
|
+
background: var(--ml-diff-panel);
|
|
510
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ml-diff-title {
|
|
514
|
+
flex: 1 1 auto;
|
|
515
|
+
min-width: 0;
|
|
516
|
+
overflow: hidden;
|
|
517
|
+
text-overflow: ellipsis;
|
|
518
|
+
white-space: nowrap;
|
|
519
|
+
font-size: 0.85rem;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.ml-diff-title.is-empty {
|
|
523
|
+
color: var(--ml-diff-muted);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.ml-diff-open {
|
|
527
|
+
flex: 0 0 auto;
|
|
528
|
+
display: inline-flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
justify-content: center;
|
|
531
|
+
width: 1.85rem;
|
|
532
|
+
height: 1.85rem;
|
|
533
|
+
padding: 0;
|
|
534
|
+
border: none;
|
|
535
|
+
border-radius: 6px;
|
|
536
|
+
background: transparent;
|
|
537
|
+
color: var(--ml-diff-muted);
|
|
538
|
+
cursor: pointer;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.ml-diff-open:hover,
|
|
542
|
+
.ml-diff-open:focus-visible {
|
|
543
|
+
color: var(--ml-diff-text);
|
|
544
|
+
background: var(--ml-diff-hover);
|
|
545
|
+
outline: none;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.ml-diff-open svg,
|
|
549
|
+
.ml-diff-icon svg {
|
|
550
|
+
display: block;
|
|
551
|
+
width: 1.15rem;
|
|
552
|
+
height: 1.15rem;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.ml-diff-file-input {
|
|
556
|
+
position: absolute;
|
|
557
|
+
width: 1px;
|
|
558
|
+
height: 1px;
|
|
559
|
+
padding: 0;
|
|
560
|
+
margin: -1px;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
clip: rect(0, 0, 0, 0);
|
|
563
|
+
white-space: nowrap;
|
|
564
|
+
border: 0;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.ml-diff-canvas-slot {
|
|
568
|
+
position: relative;
|
|
569
|
+
flex: 1 1 auto;
|
|
570
|
+
min-height: 0;
|
|
571
|
+
background: #000;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.ml-diff-canvas {
|
|
575
|
+
position: absolute;
|
|
576
|
+
inset: 0;
|
|
577
|
+
overflow: hidden;
|
|
578
|
+
z-index: 1;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.ml-diff-empty {
|
|
582
|
+
position: absolute;
|
|
583
|
+
inset: 0;
|
|
584
|
+
z-index: 2;
|
|
585
|
+
display: flex;
|
|
586
|
+
align-items: center;
|
|
587
|
+
justify-content: center;
|
|
588
|
+
padding: 1.25rem;
|
|
589
|
+
color: var(--ml-diff-muted);
|
|
590
|
+
cursor: pointer;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.ml-diff-empty.is-hidden {
|
|
594
|
+
display: none;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.ml-diff-empty-card {
|
|
598
|
+
display: flex;
|
|
599
|
+
flex-direction: column;
|
|
600
|
+
align-items: center;
|
|
601
|
+
gap: 0.55rem;
|
|
602
|
+
max-width: 18rem;
|
|
603
|
+
padding: 1.75rem 1.5rem;
|
|
604
|
+
border: 1px dashed var(--ml-diff-border);
|
|
605
|
+
border-radius: 10px;
|
|
606
|
+
text-align: center;
|
|
607
|
+
background: color-mix(in srgb, var(--ml-diff-panel) 70%, transparent);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.ml-diff-empty-icon {
|
|
611
|
+
color: var(--ml-diff-muted);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.ml-diff-empty-icon svg {
|
|
615
|
+
display: block;
|
|
616
|
+
width: 2.25rem;
|
|
617
|
+
height: 2.25rem;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.ml-diff-empty-title {
|
|
621
|
+
font-size: 0.95rem;
|
|
622
|
+
font-weight: 600;
|
|
623
|
+
color: var(--ml-diff-text);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.ml-diff-empty-hint {
|
|
627
|
+
font-size: 0.8rem;
|
|
628
|
+
line-height: 1.4;
|
|
629
|
+
color: var(--ml-diff-muted);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.ml-diff-empty-error {
|
|
633
|
+
font-size: 0.8rem;
|
|
634
|
+
color: #fca5a5;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.ml-diff-empty-error.is-hidden,
|
|
638
|
+
.ml-diff-banner.is-hidden {
|
|
639
|
+
display: none;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.ml-diff-banner {
|
|
643
|
+
position: absolute;
|
|
644
|
+
left: 50%;
|
|
645
|
+
top: 0.7rem;
|
|
646
|
+
z-index: 4;
|
|
647
|
+
transform: translateX(-50%);
|
|
648
|
+
max-width: calc(100% - 1.5rem);
|
|
649
|
+
padding: 0.35rem 0.7rem;
|
|
650
|
+
border-radius: 6px;
|
|
651
|
+
background: #7f1d1d;
|
|
652
|
+
color: #fecaca;
|
|
653
|
+
font-size: 0.8rem;
|
|
654
|
+
pointer-events: none;
|
|
655
|
+
white-space: nowrap;
|
|
656
|
+
overflow: hidden;
|
|
657
|
+
text-overflow: ellipsis;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.ml-diff-pane.is-dragover .ml-diff-canvas-slot::after {
|
|
661
|
+
content: '';
|
|
662
|
+
position: absolute;
|
|
663
|
+
inset: 0.55rem;
|
|
664
|
+
z-index: 3;
|
|
665
|
+
pointer-events: none;
|
|
666
|
+
border: 2px dashed var(--ml-diff-focus);
|
|
667
|
+
border-radius: 8px;
|
|
668
|
+
background: color-mix(in srgb, var(--ml-diff-focus) 12%, transparent);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.ml-diff-pane.is-dragover .ml-diff-empty-card {
|
|
672
|
+
border-color: var(--ml-diff-focus);
|
|
673
|
+
background: color-mix(in srgb, var(--ml-diff-focus) 12%, transparent);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.ml-diff-pane:not(.is-focused) canvas {
|
|
677
|
+
pointer-events: none;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.ml-diff-root.is-overlay .ml-diff-pane canvas {
|
|
681
|
+
pointer-events: auto;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.ml-diff-sidepanel {
|
|
685
|
+
flex: 0 0 280px;
|
|
686
|
+
max-width: 40%;
|
|
687
|
+
min-width: 220px;
|
|
688
|
+
display: flex;
|
|
689
|
+
flex-direction: column;
|
|
690
|
+
border-left: 1px solid var(--ml-diff-border);
|
|
691
|
+
background: var(--ml-diff-panel);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.ml-diff-sidepanel.is-collapsed {
|
|
695
|
+
display: none;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.ml-diff-sidepanel-header {
|
|
699
|
+
flex: 0 0 auto;
|
|
700
|
+
display: flex;
|
|
701
|
+
align-items: center;
|
|
702
|
+
gap: 0.5rem;
|
|
703
|
+
padding: 0.45rem 0.6rem;
|
|
704
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.ml-diff-sidepanel-title {
|
|
708
|
+
flex: 1 1 auto;
|
|
709
|
+
font-size: 0.85rem;
|
|
710
|
+
font-weight: 600;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.ml-diff-sidepanel-tabs {
|
|
714
|
+
flex: 0 0 auto;
|
|
715
|
+
display: flex;
|
|
716
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.ml-diff-sidepanel-tab {
|
|
720
|
+
flex: 1 1 50%;
|
|
721
|
+
padding: 0.45rem;
|
|
722
|
+
border: none;
|
|
723
|
+
background: transparent;
|
|
724
|
+
color: var(--ml-diff-muted);
|
|
725
|
+
font-size: 0.8rem;
|
|
726
|
+
cursor: pointer;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.ml-diff-sidepanel-tab.is-active {
|
|
730
|
+
color: var(--ml-diff-text);
|
|
731
|
+
box-shadow: inset 0 -2px 0 var(--ml-diff-focus);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.ml-diff-sidepanel-toolbar {
|
|
735
|
+
flex: 0 0 auto;
|
|
736
|
+
display: flex;
|
|
737
|
+
gap: 0.35rem;
|
|
738
|
+
padding: 0.4rem 0.55rem;
|
|
739
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.ml-diff-sidepanel-body {
|
|
743
|
+
flex: 1 1 auto;
|
|
744
|
+
min-height: 0;
|
|
745
|
+
overflow: auto;
|
|
746
|
+
padding: 0.4rem 0;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.ml-diff-group {
|
|
750
|
+
margin-bottom: 0.35rem;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.ml-diff-group-title {
|
|
754
|
+
display: flex;
|
|
755
|
+
align-items: center;
|
|
756
|
+
gap: 0.45rem;
|
|
757
|
+
width: 100%;
|
|
758
|
+
padding: 0.3rem 0.7rem;
|
|
759
|
+
font-size: 0.72rem;
|
|
760
|
+
font-weight: 700;
|
|
761
|
+
letter-spacing: 0.03em;
|
|
762
|
+
text-transform: uppercase;
|
|
763
|
+
color: var(--ml-diff-muted);
|
|
764
|
+
cursor: pointer;
|
|
765
|
+
list-style: none;
|
|
766
|
+
user-select: none;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.ml-diff-group-title::-webkit-details-marker,
|
|
770
|
+
.ml-diff-group-title::marker {
|
|
771
|
+
display: none;
|
|
772
|
+
content: none;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.ml-diff-group-title::before {
|
|
776
|
+
content: '';
|
|
777
|
+
flex: 0 0 auto;
|
|
778
|
+
width: 0.35rem;
|
|
779
|
+
height: 0.35rem;
|
|
780
|
+
border-right: 1.5px solid currentColor;
|
|
781
|
+
border-bottom: 1.5px solid currentColor;
|
|
782
|
+
transform: rotate(-45deg);
|
|
783
|
+
transition: transform 0.15s ease;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.ml-diff-group[open] .ml-diff-group-title::before {
|
|
787
|
+
transform: rotate(45deg);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.ml-diff-group-title:hover,
|
|
791
|
+
.ml-diff-group-title:focus-visible {
|
|
792
|
+
color: var(--ml-diff-text);
|
|
793
|
+
background: var(--ml-diff-hover);
|
|
794
|
+
outline: none;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.ml-diff-result-row {
|
|
798
|
+
display: flex;
|
|
799
|
+
align-items: stretch;
|
|
800
|
+
width: 100%;
|
|
801
|
+
border-left: 3px solid transparent;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.ml-diff-result-row[data-kind='added'] {
|
|
805
|
+
border-left-color: var(--ml-diff-added);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.ml-diff-result-row[data-kind='deleted'] {
|
|
809
|
+
border-left-color: var(--ml-diff-deleted);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.ml-diff-result-row[data-kind='modified'] {
|
|
813
|
+
border-left-color: var(--ml-diff-modified);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.ml-diff-result-item,
|
|
817
|
+
.ml-diff-markup-item {
|
|
818
|
+
display: block;
|
|
819
|
+
width: 100%;
|
|
820
|
+
padding: 0.4rem 0.7rem;
|
|
821
|
+
border: none;
|
|
822
|
+
border-left: 3px solid transparent;
|
|
823
|
+
background: transparent;
|
|
824
|
+
color: var(--ml-diff-text);
|
|
825
|
+
text-align: left;
|
|
826
|
+
font-size: 0.8rem;
|
|
827
|
+
cursor: pointer;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.ml-diff-result-row .ml-diff-result-item {
|
|
831
|
+
flex: 1 1 auto;
|
|
832
|
+
min-width: 0;
|
|
833
|
+
border-left: none;
|
|
834
|
+
padding-right: 0.35rem;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
.ml-diff-result-label {
|
|
838
|
+
display: block;
|
|
839
|
+
overflow: hidden;
|
|
840
|
+
text-overflow: ellipsis;
|
|
841
|
+
white-space: nowrap;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.ml-diff-result-info {
|
|
845
|
+
flex: 0 0 auto;
|
|
846
|
+
display: inline-flex;
|
|
847
|
+
align-items: center;
|
|
848
|
+
justify-content: center;
|
|
849
|
+
width: 1.7rem;
|
|
850
|
+
margin: 0.2rem 0.35rem 0.2rem 0;
|
|
851
|
+
padding: 0;
|
|
852
|
+
border: none;
|
|
853
|
+
border-radius: 4px;
|
|
854
|
+
background: transparent;
|
|
855
|
+
color: var(--ml-diff-muted);
|
|
856
|
+
cursor: pointer;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.ml-diff-result-info svg {
|
|
860
|
+
width: 0.95rem;
|
|
861
|
+
height: 0.95rem;
|
|
862
|
+
display: block;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.ml-diff-result-info:hover,
|
|
866
|
+
.ml-diff-result-info:focus-visible,
|
|
867
|
+
.ml-diff-result-info.is-open {
|
|
868
|
+
color: var(--ml-diff-text);
|
|
869
|
+
background: var(--ml-diff-hover);
|
|
870
|
+
outline: none;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.ml-diff-result-item:hover,
|
|
874
|
+
.ml-diff-markup-item:hover,
|
|
875
|
+
.ml-diff-result-item.is-active,
|
|
876
|
+
.ml-diff-result-row:hover,
|
|
877
|
+
.ml-diff-result-row.is-active {
|
|
878
|
+
background: var(--ml-diff-hover);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.ml-diff-result-row:hover .ml-diff-result-item,
|
|
882
|
+
.ml-diff-result-row.is-active .ml-diff-result-item {
|
|
883
|
+
background: transparent;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.ml-diff-result-item[data-kind='added'] {
|
|
887
|
+
border-left-color: var(--ml-diff-added);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.ml-diff-result-item[data-kind='deleted'] {
|
|
891
|
+
border-left-color: var(--ml-diff-deleted);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.ml-diff-result-item[data-kind='modified'] {
|
|
895
|
+
border-left-color: var(--ml-diff-modified);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.ml-diff-result-meta,
|
|
899
|
+
.ml-diff-markup-meta {
|
|
900
|
+
display: block;
|
|
901
|
+
margin-top: 0.15rem;
|
|
902
|
+
font-size: 0.7rem;
|
|
903
|
+
color: var(--ml-diff-muted);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.ml-diff-empty-list {
|
|
907
|
+
padding: 1rem 0.8rem;
|
|
908
|
+
color: var(--ml-diff-muted);
|
|
909
|
+
font-size: 0.8rem;
|
|
910
|
+
text-align: center;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.ml-diff-change-popover {
|
|
914
|
+
position: fixed;
|
|
915
|
+
z-index: 40;
|
|
916
|
+
min-width: 220px;
|
|
917
|
+
max-width: min(360px, calc(100vw - 16px));
|
|
918
|
+
max-height: min(320px, 70vh);
|
|
919
|
+
overflow: auto;
|
|
920
|
+
padding: 0.45rem 0.5rem;
|
|
921
|
+
border: 1px solid var(--ml-diff-border);
|
|
922
|
+
border-radius: 6px;
|
|
923
|
+
background: var(--ml-diff-panel);
|
|
924
|
+
box-shadow: 0 8px 24px color-mix(in srgb, #000 35%, transparent);
|
|
925
|
+
color: var(--ml-diff-text);
|
|
926
|
+
font-size: 0.72rem;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.ml-diff-change-note {
|
|
930
|
+
padding: 0.2rem 0.15rem;
|
|
931
|
+
color: var(--ml-diff-muted);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.ml-diff-change-table {
|
|
935
|
+
width: 100%;
|
|
936
|
+
border-collapse: collapse;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.ml-diff-change-table th,
|
|
940
|
+
.ml-diff-change-table td {
|
|
941
|
+
padding: 0.22rem 0.35rem;
|
|
942
|
+
text-align: left;
|
|
943
|
+
vertical-align: top;
|
|
944
|
+
word-break: break-word;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.ml-diff-change-table thead th {
|
|
948
|
+
color: var(--ml-diff-muted);
|
|
949
|
+
font-weight: 600;
|
|
950
|
+
font-size: 0.68rem;
|
|
951
|
+
letter-spacing: 0.02em;
|
|
952
|
+
text-transform: uppercase;
|
|
953
|
+
border-bottom: 1px solid var(--ml-diff-border);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.ml-diff-change-table tbody th {
|
|
957
|
+
width: 28%;
|
|
958
|
+
font-weight: 600;
|
|
959
|
+
color: var(--ml-diff-text);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.ml-diff-change-old {
|
|
963
|
+
color: var(--ml-diff-deleted);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.ml-diff-change-new {
|
|
967
|
+
color: var(--ml-diff-added);
|
|
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"})}));
|