virtual-react-json-diff 1.0.1
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 +94 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/src/components/DiffViewer/Diff.stories.d.ts +46 -0
- package/dist/cjs/types/src/components/DiffViewer/components/DiffMinimap.d.ts +3 -0
- package/dist/cjs/types/src/components/DiffViewer/components/VirtualizedDiffViewer.d.ts +5 -0
- package/dist/cjs/types/src/components/DiffViewer/index.d.ts +1 -0
- package/dist/cjs/types/src/components/DiffViewer/types/index.d.ts +50 -0
- package/dist/cjs/types/src/components/DiffViewer/utils/diffSearchUtils.d.ts +3 -0
- package/dist/cjs/types/src/components/DiffViewer/utils/preprocessDiff.d.ts +5 -0
- package/dist/cjs/types/src/components/SearchIcon.d.ts +1 -0
- package/dist/cjs/types/src/index.d.ts +1 -0
- package/dist/index.d.ts +19 -0
- package/package.json +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Muhammad Usman Khilji
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# π virtual-react-json-diff
|
|
2
|
+
|
|
3
|
+
A high-performance React component for visually comparing large JSON objects. Built on top of [json-diff-kit](https://www.npmjs.com/package/json-diff-kit), this viewer supports:
|
|
4
|
+
|
|
5
|
+
- π§ Virtual scrolling for better performance (especially for large diffs)
|
|
6
|
+
- π Search functionality
|
|
7
|
+
- πΊοΈ Mini Map
|
|
8
|
+
- π¨ Custom theming
|
|
9
|
+
- βοΈ Optimized for React (uses `react-window`)
|
|
10
|
+
|
|
11
|
+
This component is developed for dealing with thousands of lines of Json Files, and seamlessly compare then render them on UI
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## π Features
|
|
15
|
+
|
|
16
|
+
- **Compare Large JSON Objects** β Handles big files without freezing the UI
|
|
17
|
+
- **Virtualized Rendering** β Efficient DOM updates using `react-window`
|
|
18
|
+
- **Search Highlighting** β Find matches and scroll directly to them
|
|
19
|
+
- **Mini Map** β A minimap of Json Diff, scaled to better see comparison result
|
|
20
|
+
- **Customizable Styles** β Add your own class names and styles easily (checkout JsonDiffCustomTheme.css)
|
|
21
|
+
|
|
22
|
+
## Demo
|
|
23
|
+
|
|
24
|
+
To see how it works, demo available here: https://virtual-react-json-diff.netlify.app
|
|
25
|
+
|
|
26
|
+
## π¦ Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install virtual-react-json-diff
|
|
30
|
+
# or
|
|
31
|
+
yarn add virtual-react-json-diff
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Example Screenshot
|
|
35
|
+
|
|
36
|
+
The theme is fully customizable, all colors can be changed. (And soon new themes will be available)
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
To change Diff methods please see DifferOptions. By default virtual-react-json-diff uses following configuration
|
|
43
|
+
```
|
|
44
|
+
new Differ({
|
|
45
|
+
detectCircular: true,
|
|
46
|
+
maxDepth: 20,
|
|
47
|
+
showModifications: true,
|
|
48
|
+
arrayDiffMethod: "lcs",
|
|
49
|
+
preserveKeyOrder: "before",
|
|
50
|
+
...differOptions,
|
|
51
|
+
}),
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Simply pass your json objects into Viewer Component. It will find differences and show.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
import React from "react";
|
|
58
|
+
import { VirtualDiffViewer } from "virtual-react-json-diff";
|
|
59
|
+
|
|
60
|
+
const oldData = { name: "Alice", age: 25 };
|
|
61
|
+
const newData = { name: "Alice", age: 26, city: "NYC" };
|
|
62
|
+
|
|
63
|
+
export default function App() {
|
|
64
|
+
return (
|
|
65
|
+
<VirtualDiffViewer
|
|
66
|
+
oldValue={oldData}
|
|
67
|
+
newValue={newData}
|
|
68
|
+
height={600}
|
|
69
|
+
className="my-custom-diff"
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The component exposes a root container with the class:
|
|
76
|
+
```
|
|
77
|
+
<div class="diff-viewer-container">...</div>
|
|
78
|
+
```
|
|
79
|
+
You can pass your own class name via the className prop to apply custom themes.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## π Acknowledgements
|
|
83
|
+
|
|
84
|
+
Built on top of the awesome json-diff-kit.
|
|
85
|
+
|
|
86
|
+
## π License
|
|
87
|
+
|
|
88
|
+
MIT Β© Utku AkyΓΌz
|
|
89
|
+
π οΈ Contributing
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
Pull requests, suggestions, and issues are welcome!
|
|
94
|
+
Check out the issues or open a PR.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{createElement as r,PureComponent as o,useRef as i,useMemo as l,useCallback as s,useEffect as a,useState as c}from"react";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var d=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function p(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||d(r)&&d(o)))return!1;var r,o;return!0}function v(e,t){var n;void 0===t&&(t=p);var r,o=[],i=!1;return function(){for(var l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];return i&&n===this&&t(l,o)||(r=e.apply(this,l),i=!0,n=this,o=l),r}}var g="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function y(e){cancelAnimationFrame(e.id)}var m=-1;function b(e){if(void 0===e&&(e=!1),-1===m||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),m=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return m}var x=null;function w(e){if(void 0===e&&(e=!1),null===x||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?x="positive-descending":(t.scrollLeft=1,x=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),x}return x}process.env.NODE_ENV;var j=function(e,t){return e},_=null,S=null;function E(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,l=e.getItemSize,s=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,c=e.getStopIndexForStartIndex,d=e.initInstanceProps,p=e.shouldResetStyleCacheOnItemSizeChange,m=e.validateProps;return t=function(e){var t,o;function x(t){var r;return(r=e.call(this,t)||this)._instanceProps=d(r.props,f(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:f(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=v((function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})})),r._callOnScroll=void 0,r._callOnScroll=v((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,i=o.direction,s=o.itemSize,a=o.layout,c=r._getItemStyleCache(p&&s,p&&a,p&&i);if(c.hasOwnProperty(e))t=c[e];else{var u=n(r.props,e,r._instanceProps),f=l(r.props,e,r._instanceProps),h="horizontal"===i||"horizontal"===a,d="rtl"===i,v=h?u:0;c[e]=t={position:"absolute",left:d?void 0:v,right:d?v:void 0,top:h?0:u,height:h?"100%":f,width:h?f:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=v((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,l=o;if("rtl"===t)switch(w()){case"negative":l=-o;break;case"positive-descending":l=i-n-o}return l=Math.max(0,Math.min(l,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&y(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=g(),o={id:requestAnimationFrame((function r(){g()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}o=e,(t=x).prototype=Object.create(o.prototype),t.prototype.constructor=t,h(t,o),x.getDerivedStateFromProps=function(e,t){return k(e,t),m(e),null};var _=x.prototype;return _.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},_.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var l=0;if(this._outerRef){var a=this._outerRef;l="vertical"===o?a.scrollWidth>a.clientWidth?b():0:a.scrollHeight>a.clientHeight?b():0}this.scrollTo(s(this.props,e,t,i,this._instanceProps,l))},_.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},_.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(w()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var l=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-l-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},_.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&y(this._resetIsScrollingTimeoutId)},_.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,l=e.height,s=e.innerRef,a=e.innerElementType,c=e.innerTagName,f=e.itemCount,h=e.itemData,d=e.itemKey,p=void 0===d?j:d,v=e.layout,g=e.outerElementType,y=e.outerTagName,m=e.style,b=e.useIsScrolling,x=e.width,w=this.state.isScrolling,_="horizontal"===o||"horizontal"===v,S=_?this._onScrollHorizontal:this._onScrollVertical,E=this._getRangeToRender(),k=E[0],M=E[1],q=[];if(f>0)for(var O=k;O<=M;O++)q.push(r(t,{data:h,key:p(O,h),index:O,isScrolling:b?w:void 0,style:this._getItemStyle(O)}));var A=i(this.props,this._instanceProps);return r(g||y||"div",{className:n,onScroll:S,ref:this._outerRefSetter,style:u({position:"relative",height:l,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},m)},r(a||c||"div",{children:q,ref:s,style:{height:_?"100%":A,pointerEvents:w?"none":void 0,width:_?A:"100%"}}))},_._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,l=i.scrollDirection,s=i.scrollOffset,a=i.scrollUpdateWasRequested;this._callOnScroll(l,s,a)}},_._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var s=a(this.props,l,this._instanceProps),u=c(this.props,s,l,this._instanceProps),f=o&&"backward"!==i?1:Math.max(1,n),h=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,s-f),Math.max(0,Math.min(t-1,u+h)),s,u]},x}(o),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(_=new WeakSet,S=new WeakSet);var k=function(e,t){var n=e.children,r=e.direction,o=e.height,i=e.layout,l=e.innerTagName,s=e.outerTagName,a=e.width,c=t.instance;if("production"!==process.env.NODE_ENV){null==l&&null==s||S&&!S.has(c)&&(S.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u="horizontal"===r||"horizontal"===i;switch(r){case"horizontal":case"vertical":_&&!_.has(c)&&(_.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+r+'" was specified.')}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+i+'" was specified.')}if(null==n)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===n?"null":typeof n)+'" was specified.');if(u&&"number"!=typeof a)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===a?"null":typeof a)+'" was specified.');if(!u&&"number"!=typeof o)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')}},M=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var l=0;if(i>=0){var s=o[i];l=s.offset+s.size}for(var a=i+1;a<=t;a++){var c=r(a);o[a]={offset:l,size:c},l+=c}n.lastMeasuredIndex=t}return o[t]},q=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),l=M(e,i,t).offset;if(l===o)return i;l<o?r=i+1:l>o&&(n=i-1)}return r>0?r-1:0},O=function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&M(e,n,t).offset<r;)n+=i,i*=2;return q(e,t,Math.min(n,o-1),Math.floor(n/2),r)},A=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,l=0;if(i>=n&&(i=n-1),i>=0){var s=r[i];l=s.offset+s.size}return l+(n-i-1)*o},N=E({getItemOffset:function(e,t,n){return M(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:A,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var l=e.direction,s=e.height,a=e.layout,c=e.width,u="horizontal"===l||"horizontal"===a?c:s,f=M(e,t,o),h=A(e,o),d=Math.max(0,Math.min(h-u,f.offset)),p=Math.max(0,f.offset-u+f.size+i);switch("smart"===n&&(n=r>=p-u&&r<=d+u?"auto":"center"),n){case"start":return d;case"end":return p;case"center":return Math.round(p+(d-p)/2);default:return r>=p&&r<=d?r:r<p?p:d}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?q(e,t,o,0,n):O(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,l=e.itemCount,s=e.layout,a=e.width,c="horizontal"===o||"horizontal"===s?a:i,u=M(e,t,r),f=n+c,h=u.offset+u.size,d=t;d<l-1&&h<f;)d++,h+=M(e,d,r).size;return d},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.itemSize;if("production"!==process.env.NODE_ENV&&"function"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.')}});const I=e=>{if(null==e||"bigint"==typeof e||Number.isNaN(e)||e===1/0||e===-1/0)return;if(["string","number","boolean"].includes(typeof e))return e;if(Array.isArray(e))return e.map(I).filter((e=>void 0!==e));const t={};for(const[n,r]of Object.entries(e)){const e=I(r);void 0!==e&&(t[n]=e)}return t},C=(e,t,n=!1)=>{if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Both arguments should be arrays.");const r=e.length,o=t.length,i=new Array(r+o);if(n){for(let e=0;e<o;e++)i[e]=t[o-e-1];for(let t=0;t<r;t++)i[t+o]=e[t];return i}for(let t=0;t<r;t++)i[t]=e[t];for(let e=0;e<o;e++)i[e+r]=t[e];return i},$=(e,t=new Map)=>{if("object"!=typeof e||null===e)return!1;if(t.has(e))return!0;if(t.set(e,!0),Array.isArray(e)){for(let n=0;n<e.length;n++)if($(e[n],t))return!0;return!1}for(const n in e)if($(e[n],t))return!0;return!1},D=(e,t,n,r=1/0,o)=>{if(!e||"object"!=typeof e){let r;if(Number.isNaN(e)||e===1/0||e===-1/0||"bigint"==typeof e||(r=JSON.stringify(e,t,n)),void 0===r)switch(o){case Xr.throw:throw new Error(`Value is not valid in JSON, got ${String(e)}`);case Xr.stringify:return z(e);default:throw new Error("Should not reach here, please report this bug.")}return r}const i=r<1?'"..."':Array.isArray(e)?`[${e.map((e=>D(e,t,n,r-1,o))).join(",")}]`:`{${Object.keys(e).map((i=>`"${i}": ${D(e[i],t,n,r-1,o)}`)).join(", ")}}`;return JSON.stringify(JSON.parse(i),t,n)},z=e=>void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":Number.isNaN(e)?"NaN":"bigint"==typeof e?`${e}n`:String(e),L=(e,t=1/0,n=!1,r=Xr.stringify)=>null===e?"null":Array.isArray(e)||"object"==typeof e?D(e,void 0,n?1:void 0,t,r):D(e,void 0,void 0,void 0,r),B=e=>"boolean"==typeof e?0:"number"==typeof e?1:"string"==typeof e?2:null===e?3:Array.isArray(e)?4:"object"==typeof e?5:"symbol"==typeof e?6:"function"==typeof e?7:"bigint"==typeof e?8:-1,R=(e,t,n)=>{const r=n.keyOrdersMap?.get(e),o=n.keyOrdersMap?.get(t);if(void 0!==r&&void 0!==o)return r-o;const i=B(e),l=B(t);if(i!==l)return i-l;if(null===e&&null===t||Array.isArray(e)&&Array.isArray(t)||5===i&&5===l)return 0;switch(typeof e){case"number":return Number.isNaN(e)&&Number.isNaN(t)||e===1/0&&t===1/0||e===-1/0&&t===-1/0?0:e-t;case"string":return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e<t?-1:e>t?1:0;case"boolean":return+e-+t;case"symbol":case"function":return String(e).localeCompare(String(t))}if("bigint"==typeof e&&"bigint"==typeof t){const n=BigInt(e)-BigInt(t);return n<0?-1:n>0?1:0}return String(e).localeCompare(String(t))},T=e=>Array.isArray(e)?"array":null===e?"null":typeof e,P=(e,t,n,r,o,i,l,s)=>{const a={ignoreCase:s.ignoreCase},c=L(o,s.maxDepth,!0,s.undefinedBehavior).split("\n"),u=L(i,s.maxDepth,!0,s.undefinedBehavior).split("\n");if(0!==R(o,i,a))if(s.showModifications){const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:l,type:"modify",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:l+(c[t].match(/^\s+/)?.[0]?.length||0),type:"modify",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=c.length;t<o;t++)e.push({level:l,type:"equal",text:""});t.push({level:l,type:"modify",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:l+(u[e].match(/^\s+/)?.[0]?.length||0),type:"modify",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")});for(let e=u.length;e<o;e++)t.push({level:l,type:"equal",text:""})}else{e.push({level:l,type:"remove",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:l+(c[t].match(/^\s+/)?.[0]?.length||0),type:"remove",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=0;t<u.length;t++)e.push({level:l,type:"equal",text:""});for(let e=0;e<c.length;e++)t.push({level:l,type:"equal",text:""});t.push({level:l,type:"add",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:l+(u[e].match(/^\s+/)?.[0]?.length||0),type:"add",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}else{const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:l,type:"equal",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:l+(c[t].match(/^\s+/)?.[0]?.length||0),type:"equal",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});t.push({level:l,type:"equal",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:l+(u[e].match(/^\s+/)?.[0]?.length||0),type:"equal",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}},F=(e,t)=>e.sort(((e,n)=>R(e,n,{ignoreCase:t.ignoreCaseForKey}))),W=(e,t,n=1,r,o)=>{if(n>(r.maxDepth||1/0))return[[{level:n,type:"equal",text:"..."}],[{level:n,type:"equal",text:"..."}]];let i=[],l=[];if(null===e&&null===t||void 0===e&&void 0===t)return[i,l];if(null==e){const e=D(t,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)i.push({level:n,type:"equal",text:""}),l.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});return[i,l]}if(null==t){const t=D(e,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),l.push({level:n,type:"equal",text:""});return[i,l]}const s=Object.keys(e),a=Object.keys(t),c=new Map;if(r.preserveKeyOrder){if("before"===r.preserveKeyOrder){for(let e=0;e<s.length;e++)c.set(s[e],e);for(let e=0;e<a.length;e++)c.has(a[e])||c.set(a[e],s.length+e);a.sort(((e,t)=>c.get(e)-c.get(t)))}else if("after"===r.preserveKeyOrder){for(let e=0;e<a.length;e++)c.set(a[e],e);for(let e=0;e<s.length;e++)c.has(s[e])||c.set(s[e],a.length+e);s.sort(((e,t)=>c.get(e)-c.get(t)))}}else F(s,r),F(a,r);const u={ignoreCase:r.ignoreCaseForKey,keyOrdersMap:c};for(;s.length||a.length;){const c=s[0],f=a[0],h=R(c,f,u);if(0===h)if(T(e[c])!==T(t[f]))P(i,l,c,f,e[c],t[f],n,r);else if(Array.isArray(e[c])){const s=[...e[c]],a=[...t[f]],[u,h]=o(s,a,c,f,n,r,[],[]);i=C(i,u),l=C(l,h)}else if(null===e[c])i.push({level:n,type:"equal",text:`"${c}": null`}),l.push({level:n,type:"equal",text:`"${f}": null`});else if("object"==typeof e[c]){const s=W(e[c],t[f],n+1,r,o);i.push({level:n,type:"equal",text:`"${c}": {`}),i=C(i,s[0]),i.push({level:n,type:"equal",text:"}"}),l.push({level:n,type:"equal",text:`"${f}": {`}),l=C(l,s[1]),l.push({level:n,type:"equal",text:"}"})}else P(i,l,c,f,e[c],t[f],n,r);else if(s.length&&a.length)if(h<0){const t=D(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),l.push({level:n,type:"equal",text:""})}}else{const e=D(t[f],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),l.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${f}": ${r}`})}}else if(s.length){const t=D(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),l.push({level:n,type:"equal",text:""})}}else if(a.length){const e=D(t[f],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),l.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${f}": ${r}`})}}c?f?0===h?(s.shift(),a.shift()):h<0?s.shift():a.shift():s.shift():a.shift()}if(i.length!==l.length)throw new Error("Diff error: length not match for left & right, please report a bug with your data.");return[i,l]};var U=function(){this.__data__=[],this.size=0};var V=function(e,t){return e===t||e!=e&&t!=t},H=V;var K=function(e,t){for(var n=e.length;n--;)if(H(e[n][0],t))return n;return-1},J=K,Z=Array.prototype.splice;var Y=K;var G=K;var Q=K;var X=U,ee=function(e){var t=this.__data__,n=J(t,e);return!(n<0)&&(n==t.length-1?t.pop():Z.call(t,n,1),--this.size,!0)},te=function(e){var t=this.__data__,n=Y(t,e);return n<0?void 0:t[n][1]},ne=function(e){return G(this.__data__,e)>-1},re=function(e,t){var n=this.__data__,r=Q(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}oe.prototype.clear=X,oe.prototype.delete=ee,oe.prototype.get=te,oe.prototype.has=ne,oe.prototype.set=re;var ie=oe,le=ie;var se=function(){this.__data__=new le,this.size=0};var ae=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var ce=function(e){return this.__data__.get(e)};var ue=function(e){return this.__data__.has(e)},fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},he="object"==typeof fe&&fe&&fe.Object===Object&&fe,de=he,pe="object"==typeof self&&self&&self.Object===Object&&self,ve=de||pe||Function("return this")(),ge=ve.Symbol,ye=ge,me=Object.prototype,be=me.hasOwnProperty,xe=me.toString,we=ye?ye.toStringTag:void 0;var je=function(e){var t=be.call(e,we),n=e[we];try{e[we]=void 0;var r=!0}catch(e){}var o=xe.call(e);return r&&(t?e[we]=n:delete e[we]),o},_e=Object.prototype.toString;var Se=je,Ee=function(e){return _e.call(e)},ke=ge?ge.toStringTag:void 0;var Me=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ke&&ke in Object(e)?Se(e):Ee(e)};var qe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Oe=Me,Ae=qe;var Ne,Ie=function(e){if(!Ae(e))return!1;var t=Oe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ce=ve["__core-js_shared__"],$e=(Ne=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||""))?"Symbol(src)_1."+Ne:"";var De=function(e){return!!$e&&$e in e},ze=Function.prototype.toString;var Le=function(e){if(null!=e){try{return ze.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Be=Ie,Re=De,Te=qe,Pe=Le,Fe=/^\[object .+?Constructor\]$/,We=Function.prototype,Ue=Object.prototype,Ve=We.toString,He=Ue.hasOwnProperty,Ke=RegExp("^"+Ve.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Je=function(e){return!(!Te(e)||Re(e))&&(Be(e)?Ke:Fe).test(Pe(e))},Ze=function(e,t){return null==e?void 0:e[t]};var Ye=function(e,t){var n=Ze(e,t);return Je(n)?n:void 0},Ge=Ye(ve,"Map"),Qe=Ye(Object,"create"),Xe=Qe;var et=function(){this.__data__=Xe?Xe(null):{},this.size=0};var tt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nt=Qe,rt=Object.prototype.hasOwnProperty;var ot=function(e){var t=this.__data__;if(nt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rt.call(t,e)?t[e]:void 0},it=Qe,lt=Object.prototype.hasOwnProperty;var st=Qe;var at=et,ct=tt,ut=ot,ft=function(e){var t=this.__data__;return it?void 0!==t[e]:lt.call(t,e)},ht=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=st&&void 0===t?"__lodash_hash_undefined__":t,this};function dt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dt.prototype.clear=at,dt.prototype.delete=ct,dt.prototype.get=ut,dt.prototype.has=ft,dt.prototype.set=ht;var pt=dt,vt=ie,gt=Ge;var yt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var mt=function(e,t){var n=e.__data__;return yt(t)?n["string"==typeof t?"string":"hash"]:n.map},bt=mt;var xt=mt;var wt=mt;var jt=mt;var _t=function(e,t){var n=jt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},St=function(){this.size=0,this.__data__={hash:new pt,map:new(gt||vt),string:new pt}},Et=function(e){var t=bt(this,e).delete(e);return this.size-=t?1:0,t},kt=function(e){return xt(this,e).get(e)},Mt=function(e){return wt(this,e).has(e)},qt=_t;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ot.prototype.clear=St,Ot.prototype.delete=Et,Ot.prototype.get=kt,Ot.prototype.has=Mt,Ot.prototype.set=qt;var At=Ot,Nt=ie,It=Ge,Ct=At;var $t=ie,Dt=se,zt=ae,Lt=ce,Bt=ue,Rt=function(e,t){var n=this.__data__;if(n instanceof Nt){var r=n.__data__;if(!It||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ct(r)}return n.set(e,t),this.size=n.size,this};function Tt(e){var t=this.__data__=new $t(e);this.size=t.size}Tt.prototype.clear=Dt,Tt.prototype.delete=zt,Tt.prototype.get=Lt,Tt.prototype.has=Bt,Tt.prototype.set=Rt;var Pt=Tt;var Ft=At,Wt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ut=function(e){return this.__data__.has(e)};function Vt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ft;++t<n;)this.add(e[t])}Vt.prototype.add=Vt.prototype.push=Wt,Vt.prototype.has=Ut;var Ht=Vt,Kt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},Jt=function(e,t){return e.has(t)};var Zt=function(e,t,n,r,o,i){var l=1&n,s=e.length,a=t.length;if(s!=a&&!(l&&a>s))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,h=!0,d=2&n?new Ht:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var p=e[f],v=t[f];if(r)var g=l?r(v,p,f,t,e,i):r(p,v,f,e,t,i);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!Kt(t,(function(e,t){if(!Jt(d,t)&&(p===e||o(p,e,n,r,i)))return d.push(t)}))){h=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h};var Yt=ve.Uint8Array,Gt=V,Qt=Zt,Xt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},en=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},tn=ge?ge.prototype:void 0,nn=tn?tn.valueOf:void 0;var rn=function(e,t,n,r,o,i,l){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Yt(e),new Yt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Gt(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Xt;case"[object Set]":var a=1&r;if(s||(s=en),e.size!=t.size&&!a)return!1;var c=l.get(e);if(c)return c==t;r|=2,l.set(e,t);var u=Qt(s(e),s(t),r,o,i,l);return l.delete(e),u;case"[object Symbol]":if(nn)return nn.call(e)==nn.call(t)}return!1};var on=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},ln=Array.isArray,sn=on,an=ln;var cn=function(e,t,n){var r=t(e);return an(e)?r:sn(r,n(e))};var un=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var l=e[n];t(l,n,e)&&(i[o++]=l)}return i},fn=function(){return[]},hn=Object.prototype.propertyIsEnumerable,dn=Object.getOwnPropertySymbols,pn=dn?function(e){return null==e?[]:(e=Object(e),un(dn(e),(function(t){return hn.call(e,t)})))}:fn;var vn=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var gn=function(e){return null!=e&&"object"==typeof e},yn=Me,mn=gn;var bn=function(e){return mn(e)&&"[object Arguments]"==yn(e)},xn=gn,wn=Object.prototype,jn=wn.hasOwnProperty,_n=wn.propertyIsEnumerable,Sn=bn(function(){return arguments}())?bn:function(e){return xn(e)&&jn.call(e,"callee")&&!_n.call(e,"callee")},En={exports:{}};var kn=function(){return!1};!function(e,t){var n=ve,r=kn,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,l=i&&i.exports===o?n.Buffer:void 0,s=(l?l.isBuffer:void 0)||r;e.exports=s}(En,En.exports);var Mn=/^(?:0|[1-9]\d*)$/;var qn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Mn.test(e))&&e>-1&&e%1==0&&e<t};var On=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},An=Me,Nn=On,In=gn,Cn={};Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=!0,Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object DataView]"]=Cn["[object Date]"]=Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object WeakMap]"]=!1;var $n=function(e){return In(e)&&Nn(e.length)&&!!Cn[An(e)]};var Dn=function(e){return function(t){return e(t)}},zn={exports:{}};!function(e,t){var n=he,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}(zn,zn.exports);var Ln=$n,Bn=Dn,Rn=zn.exports,Tn=Rn&&Rn.isTypedArray,Pn=Tn?Bn(Tn):Ln,Fn=vn,Wn=Sn,Un=ln,Vn=En.exports,Hn=qn,Kn=Pn,Jn=Object.prototype.hasOwnProperty;var Zn=function(e,t){var n=Un(e),r=!n&&Wn(e),o=!n&&!r&&Vn(e),i=!n&&!r&&!o&&Kn(e),l=n||r||o||i,s=l?Fn(e.length,String):[],a=s.length;for(var c in e)!t&&!Jn.call(e,c)||l&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Hn(c,a))||s.push(c);return s},Yn=Object.prototype;var Gn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Yn)};var Qn=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Xn=Gn,er=Qn,tr=Object.prototype.hasOwnProperty;var nr=Ie,rr=On;var or=Zn,ir=function(e){if(!Xn(e))return er(e);var t=[];for(var n in Object(e))tr.call(e,n)&&"constructor"!=n&&t.push(n);return t},lr=function(e){return null!=e&&rr(e.length)&&!nr(e)};var sr=cn,ar=pn,cr=function(e){return lr(e)?or(e):ir(e)};var ur=function(e){return sr(e,cr,ar)},fr=Object.prototype.hasOwnProperty;var hr=function(e,t,n,r,o,i){var l=1&n,s=ur(e),a=s.length;if(a!=ur(t).length&&!l)return!1;for(var c=a;c--;){var u=s[c];if(!(l?u in t:fr.call(t,u)))return!1}var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=l;++c<a;){var v=e[u=s[c]],g=t[u];if(r)var y=l?r(g,v,u,t,e,i):r(v,g,u,e,t,i);if(!(void 0===y?v===g||o(v,g,n,r,i):y)){d=!1;break}p||(p="constructor"==u)}if(d&&!p){var m=e.constructor,b=t.constructor;m==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(e),i.delete(t),d},dr=Ye(ve,"DataView"),pr=Ge,vr=Ye(ve,"Promise"),gr=Ye(ve,"Set"),yr=Ye(ve,"WeakMap"),mr=Me,br=Le,xr="[object Map]",wr="[object Promise]",jr="[object Set]",_r="[object WeakMap]",Sr="[object DataView]",Er=br(dr),kr=br(pr),Mr=br(vr),qr=br(gr),Or=br(yr),Ar=mr;(dr&&Ar(new dr(new ArrayBuffer(1)))!=Sr||pr&&Ar(new pr)!=xr||vr&&Ar(vr.resolve())!=wr||gr&&Ar(new gr)!=jr||yr&&Ar(new yr)!=_r)&&(Ar=function(e){var t=mr(e),n="[object Object]"==t?e.constructor:void 0,r=n?br(n):"";if(r)switch(r){case Er:return Sr;case kr:return xr;case Mr:return wr;case qr:return jr;case Or:return _r}return t});var Nr=Pt,Ir=Zt,Cr=rn,$r=hr,Dr=Ar,zr=ln,Lr=En.exports,Br=Pn,Rr="[object Arguments]",Tr="[object Array]",Pr="[object Object]",Fr=Object.prototype.hasOwnProperty;var Wr=function(e,t,n,r,o,i){var l=zr(e),s=zr(t),a=l?Tr:Dr(e),c=s?Tr:Dr(t),u=(a=a==Rr?Pr:a)==Pr,f=(c=c==Rr?Pr:c)==Pr,h=a==c;if(h&&Lr(e)){if(!Lr(t))return!1;l=!0,u=!1}if(h&&!u)return i||(i=new Nr),l||Br(e)?Ir(e,t,n,r,o,i):Cr(e,t,a,n,r,o,i);if(!(1&n)){var d=u&&Fr.call(e,"__wrapped__"),p=f&&Fr.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,g=p?t.value():t;return i||(i=new Nr),o(v,g,n,r,i)}}return!!h&&(i||(i=new Nr),$r(e,t,n,r,o,i))},Ur=gn;var Vr=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Ur(t)&&!Ur(n)?t!=t&&n!=n:Wr(t,n,r,o,e,i))},Hr=Vr;var Kr=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Hr(e,t,void 0,n):!!r};const Jr=(e,t,n)=>n.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase():"symbol"==typeof e&&"symbol"==typeof t?e.toString()===t.toString():n.recursiveEqual?Kr(e,t,((e,t)=>n.ignoreCase&&"string"==typeof e&&"string"==typeof t?e.toLowerCase()===t.toLowerCase():void 0)):e===t,Zr=(e,t)=>{if(e===t)return 1;if(null===e||null===t)return 0;if("object"!=typeof e||"object"!=typeof t)return 0;let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&Object.prototype.hasOwnProperty.call(t,r)&&e[r]===t[r]&&n++;return Math.max(n/Object.keys(e).length,n/Object.keys(t).length)},Yr=(e,t,n,r,o,i,l=[],s=[])=>{if(n&&r?(l.push({level:o,type:"equal",text:`"${n}": [`}),s.push({level:o,type:"equal",text:`"${r}": [`})):(l.push({level:o,type:"equal",text:"["}),s.push({level:o,type:"equal",text:"["})),o>=(i.maxDepth||1/0))l.push({level:o+1,type:"equal",text:"..."}),s.push({level:o+1,type:"equal",text:"..."});else{const[a,c]=((e,t,n,r,o,i)=>{const l=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0))),s=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0)));for(let t=1;t<=e.length;t++)s[t][0]="up";for(let e=1;e<=t.length;e++)s[0][e]="left";for(let n=1;n<=e.length;n++)for(let r=1;r<=t.length;r++){const o=T(e[n-1]);o!==T(t[r-1])||"array"!==o&&"object"!==o?Jr(e[n-1],t[r-1],i)?(l[n][r]=l[n-1][r-1]+1,s[n][r]="diag"):l[n-1][r]>=l[n][r-1]?(l[n][r]=l[n-1][r],s[n][r]="up"):(l[n][r]=l[n][r-1],s[n][r]="left"):i.recursiveEqual?Jr(e[n-1],t[r-1],i)||Zr(e[n-1],t[r-1])>.5?(l[n][r]=l[n-1][r-1]+1,s[n][r]="diag"):l[n-1][r]>=l[n][r-1]?(l[n][r]=l[n-1][r],s[n][r]="up"):(l[n][r]=l[n][r-1],s[n][r]="left"):(l[n][r]=l[n-1][r-1]+1,s[n][r]="diag")}let a=e.length,c=t.length,u=[],f=[];for(;a>0||c>0;)if("diag"===s[a][c]){const l=T(e[a-1]);if(i.recursiveEqual&&("array"===l||"object"===l)&&Jr(e[a-1],t[c-1],i)){const n=[],r=[];P(n,r,"","",e[a-1],t[c-1],o+1,i),u=C(u,n.reverse(),!0),f=C(f,r.reverse(),!0)}else if("array"===l){const[l,s]=Yr(e[a-1],t[c-1],n,r,o+1,i);u=C(u,l.reverse(),!0),f=C(f,s.reverse(),!0)}else if("object"===l){const[n,r]=W(e[a-1],t[c-1],o+2,i,Yr);u.unshift({level:o+1,type:"equal",text:"}"}),f.unshift({level:o+1,type:"equal",text:"}"}),u=C(u,n.reverse(),!0),f=C(f,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),f.unshift({level:o+1,type:"equal",text:"{"})}else{const n=[],r=[];P(n,r,"","",e[a-1],t[c-1],o+1,i),u=C(u,n.reverse(),!0),f=C(f,r.reverse(),!0)}a--,c--}else if("up"===s[a][c])if(i.showModifications&&a>1&&"left"===s[a-1][c]){const l=T(e[a-1]);if(l===T(t[c-1]))if("array"===l){const[l,s]=Yr(e[a-1],t[c-1],n,r,o+1,i);u=C(u,l.reverse(),!0),f=C(f,s.reverse(),!0)}else if("object"===l){const[n,r]=W(e[a-1],t[c-1],o+2,i,Yr);u.unshift({level:o+1,type:"equal",text:"}"}),f.unshift({level:o+1,type:"equal",text:"}"}),u=C(u,n.reverse(),!0),f=C(f,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),f.unshift({level:o+1,type:"equal",text:"{"})}else u.unshift({level:o+1,type:"modify",text:L(e[a-1],void 0,void 0,i.undefinedBehavior)}),f.unshift({level:o+1,type:"modify",text:L(t[c-1],void 0,void 0,i.undefinedBehavior)});else{const n=[],r=[];P(n,r,"","",e[a-1],t[c-1],o+1,i),u=C(u,n.reverse(),!0),f=C(f,r.reverse(),!0)}a--,c--}else{const t=D(e[a-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let e=t.length-1;e>=0;e--)u.unshift({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),f.unshift({level:o+1,type:"equal",text:""});a--}else{const e=D(t[c-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let t=e.length-1;t>=0;t--)u.unshift({level:o+1,type:"equal",text:""}),f.unshift({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});c--}return[u,f]})(e,t,n,r,o,i);l=C(l,a),s=C(s,c)}return l.push({level:o,type:"equal",text:"]"}),s.push({level:o,type:"equal",text:"]"}),[l,s]},Gr=(e,t,n,r,o,i,l=[],s=[])=>{if(e=[...e],t=[...t],n&&r?(l.push({level:o,type:"equal",text:`"${n}": [`}),s.push({level:o,type:"equal",text:`"${r}": [`})):(l.push({level:o,type:"equal",text:"["}),s.push({level:o,type:"equal",text:"["})),o>=(i.maxDepth||1/0))l.push({level:o+1,type:"equal",text:"..."}),s.push({level:o+1,type:"equal",text:"..."});else for(;e.length||t.length;){const n=e[0],r=t[0],a=T(n),c=T(r);if(e.length&&t.length){if(a!==c)P(l,s,"","",n,r,o+1,i);else if(i.recursiveEqual&&["object","array"].includes(a)&&Jr(n,r,i))P(l,s,"","",n,r,o+1,i);else if("object"===a){l.push({level:o+1,type:"equal",text:"{"}),s.push({level:o+1,type:"equal",text:"{"});const[e,t]=W(n,r,o+2,i,Gr);l=C(l,e),s=C(s,t),l.push({level:o+1,type:"equal",text:"}"}),s.push({level:o+1,type:"equal",text:"}"})}else if("array"===a){const[e,t]=Gr(n,r,"","",o+1,i,[],[]);l=C(l,e),s=C(s,t)}else 0===R(n,r,{ignoreCase:i.ignoreCase})?(l.push({level:o+1,type:"equal",text:L(n,void 0,void 0,i.undefinedBehavior)}),s.push({level:o+1,type:"equal",text:L(r,void 0,void 0,i.undefinedBehavior)})):i.showModifications?(l.push({level:o+1,type:"modify",text:L(n,void 0,void 0,i.undefinedBehavior)}),s.push({level:o+1,type:"modify",text:L(r,void 0,void 0,i.undefinedBehavior)})):(l.push({level:o+1,type:"remove",text:L(n,void 0,void 0,i.undefinedBehavior)}),l.push({level:o+1,type:"equal",text:""}),s.push({level:o+1,type:"equal",text:""}),s.push({level:o+1,type:"add",text:L(r,void 0,void 0,i.undefinedBehavior)}));e.shift(),t.shift()}else if(e.length){const t=L(n,void 0,!0,i.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)l.push({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),s.push({level:o+1,type:"equal",text:""});e.shift()}else if(t.length){const e=L(r,void 0,!0,i.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)l.push({level:o+1,type:"equal",text:""}),s.push({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});t.shift()}}return l.push({level:o,type:"equal",text:"]"}),s.push({level:o,type:"equal",text:"]"}),[l,s]},Qr=(e,t)=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){const n=[...e];return n.sort(((e,n)=>R(e,n,{ignoreCase:t?.ignoreCase}))),n.map((e=>Qr(e,t)))}const n={...e};for(const e in n)n[e]=Qr(n[e],t);return n};var Xr=function(e){return e.stringify="stringify",e.ignore="ignore",e.throw="throw",e}({});const eo={level:0,type:"equal",text:""},to={level:0,type:"equal",text:"{"},no={level:0,type:"equal",text:"}"};let ro=class{detectCircular(e){if(this.options.detectCircular&&$(e))throw new Error(`Circular reference detected in object (with keys ${Object.keys(e).map((e=>`"${e}"`)).join(", ")})`)}sortResultLines(e,t){for(let n=0;n<e.length;n++){let n=!1;for(let r=1;r<e.length;r++)if("remove"===e[r].type&&"equal"===e[r-1].type&&"equal"===t[r].type&&"add"===t[r-1].type){const o=e[r-1];e[r-1]=e[r],e[r]=o;const i=t[r-1];t[r-1]=t[r],t[r]=i,n=!0}if(!n)break}}calculateLineNumbers(e){let t=0;for(const n of e)n.text&&(n.lineNumber=++t)}calculateCommas(e){const t=Array(e.length).fill(0);for(let n=e.length-1;n>0;n--)e[n].text?t[n-1]=n:t[n-1]=t[n];for(let n=0;n<e.length;n++)!e[n].text.endsWith("{")&&!e[n].text.endsWith("[")&&e[n].text&&t[n]&&e[n].level<=e[t[n]].level&&(e[n].comma=!0)}diff(e,t){this.detectCircular(e),this.detectCircular(t),"unorder-normal"!==this.options.arrayDiffMethod&&"unorder-lcs"!==this.options.arrayDiffMethod||(e=Qr(e,this.options),t=Qr(t,this.options)),"ignore"===this.options.undefinedBehavior&&(e=I(e)??null,t=I(t)??null);let n=[],r=[];const o=T(e);if(o!==T(t)){n=D(e,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"remove",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));r=D(t,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"add",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));const o=n.length,i=r.length;n=C(n,Array(i).fill(0).map((()=>({...eo})))),r=C(r,Array(o).fill(0).map((()=>({...eo}))),!0)}else"object"===o?([n,r]=W(e,t,1,this.options,this.arrayDiffFunc),n.unshift({...to}),n.push({...no}),r.unshift({...to}),r.push({...no})):"array"===o?[n,r]=this.arrayDiffFunc(e,t,"","",0,this.options):e!==t?this.options.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()&&(n=[{level:0,type:"equal",text:e}],r=[{level:0,type:"equal",text:t}]):this.options.showModifications?(n=[{level:0,type:"modify",text:D(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"modify",text:D(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"remove",text:D(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...eo}],r=[{...eo},{level:0,type:"add",text:D(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"equal",text:D(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"equal",text:D(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(n,r),this.calculateLineNumbers(n),this.calculateLineNumbers(r),this.calculateCommas(n),this.calculateCommas(r),[n,r]}constructor({detectCircular:e=!0,maxDepth:t=1/0,showModifications:n=!0,arrayDiffMethod:r="normal",ignoreCase:o=!1,ignoreCaseForKey:i=!1,recursiveEqual:l=!1,preserveKeyOrder:s,undefinedBehavior:a="stringify"}={}){this.options={detectCircular:e,maxDepth:t,showModifications:n,arrayDiffMethod:r,ignoreCase:o,ignoreCaseForKey:i,recursiveEqual:l,preserveKeyOrder:s,undefinedBehavior:a},this.arrayDiffFunc="lcs"===r||"unorder-lcs"===r?Yr:Gr}};const oo=e=>"hasLinesBefore"in e||"hasLinesAfter"in e,io=(e,t,n)=>oo(e)?n:t*(e.end-e.start+1),lo=(e,t)=>{const n=[];let r,o;if(e.length&&t.length)for(e=[...e],t=[...t],r={...e.shift()},o={...t.shift()};;){if(r.start===o.start){const e=Math.min(r.end,o.end);n.push({...r,...o,end:e}),r.start=o.start=e}else if(r.start<o.start){const e=Math.min(r.end,o.start);n.push({...o,...r,end:e}),r.start=e}else{const e=Math.min(r.start,o.end);n.push({...r,...o,end:e}),o.start=e}if(!e.length||!t.length)break;r.start===r.end&&(r={...e.shift()}),o.start===o.end&&(o={...t.shift()})}return e.length||n.push(...t.map((e=>({...e,token:r.token||"plain"})))),t.length||n.push(...e),n};var so={};Object.defineProperty(so,"__esModule",{value:!0}),so.applyPatch=so.calcPatch=ho=so.lcs=so.diff=so.diff_core=void 0;let ao=class{[Symbol.iterator](){return this}next(){const{state:e,result:t}=this;if(this.c>1)return t.done=!0,t.value=void 0,t;const n=function(e,t){const{b:n,eq:r,stack_base:o}=e;let{i:i,N:l,j:s,M:a,Z:c,stack_top:u}=e;for(;;)switch(t){case 0:e:for(;l>0&&a>0;){n.fill(0,0,2*c);const e=l-a,t=l+a,f=1&t,h=i+l-1,d=s+a-1,p=(t+f)/2;let v;t:for(let t=0;t<=p;t++){const p=2*Math.max(0,t-a)-t,g=t-2*Math.max(0,t-l);for(let h=p;h<=g;h+=2){const d=n[h-1-c*Math.floor((h-1)/c)],p=n[h+1-c*Math.floor((h+1)/c)],g=h===-t||h!==t&&d<p?p:d+1,y=g-h;let m=g,b=y;for(;m<l&&b<a&&r(i+m,s+b);)m++,b++;if(n[h-c*Math.floor(h/c)]=m,1===f&&(v=e-h)>=1-t&&v<t&&m+n[c+v-c*Math.floor(v/c)]>=l){if(t>1||m!==g){o[u++]=i+m,o[u++]=l-m,o[u++]=s+b,o[u++]=a-b,l=g,a=y,c=2*(Math.min(l,a)+1);continue e}break t}}for(let y=p;y<=g;y+=2){const p=n[c+y-1-c*Math.floor((y-1)/c)],g=n[c+y+1-c*Math.floor((y+1)/c)],m=y===-t||y!==t&&p<g?g:p+1,b=m-y;let x=m,w=b;for(;x<l&&w<a&&r(h-x,d-w);)x++,w++;if(n[c+y-c*Math.floor(y/c)]=x,0===f&&(v=e-y)>=-t&&v<=t&&x+n[v-c*Math.floor(v/c)]>=l){if(t>0||x!==m){o[u++]=i+l-m,o[u++]=m,o[u++]=s+a-b,o[u++]=b,l-=x,a-=w,c=2*(Math.min(l,a)+1);continue e}break t}}}if(l!==a){a>l?(i+=l,s+=l,a-=l,l=0):(i+=a,s+=a,l-=a,a=0);break}}if(l+a!==0)if(e.pxe===i||e.pye===s)e.pxe=i+l,e.pye=s+a;else{const t=e.pxs;if(e.oxs=e.pxs,e.oxe=e.pxe,e.oys=e.pys,e.oye=e.pye,e.pxs=i,e.pxe=i+l,e.pys=s,e.pye=s+a,t>=0)return e.i=i,e.N=l,e.j=s,e.M=a,e.Z=c,e.stack_top=u,1}case 1:if(0===u)return 2;a=o[--u],s=o[--u],l=o[--u],i=o[--u],c=2*(Math.min(l,a)+1),t=0}}(e,this.c);return this.c=n,1===n?(t.value=[e.oxs,e.oxe,e.oys,e.oye],t):e.pxs>=0?(t.value=[e.pxs,e.pxe,e.pys,e.pye],t):(t.done=!0,t.value=void 0,t)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function co(e,t,n,r,o){const i=2*(Math.min(t,r)+1),l=t+r,s=new(l<256?Uint8Array:l<65536?Uint16Array:Uint32Array)(2*i);return new ao({i:e,N:t,j:n,M:r,Z:i,b:s,eq:o,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}function uo(e,t){let[n,r,o]=[0,e.length,t.length];for(;n<r&&n<o&&e[n]===t[n];)n++;if(n===r&&n===o)return[][Symbol.iterator]();for(;e[--r]===t[--o]&&r>n&&o>n;);return co(n,r+1-n,n,o+1-n,((n,r)=>e[n]===t[r]))}so.diff_core=co,so.diff=uo;let fo=class{[Symbol.iterator](){return this}next(){const e=this.diff.next();if(e.done){const{i:t,j:n,N:r}=this;return t<r&&(e.done=!1,e.value=[t,n,r-t],this.i=r),e}const t=e.value,n=t[0],r=t[1],o=t[3],{i:i,j:l}=this;return i!==n&&(t.length--,t[0]=i,t[1]=l,t[2]=n-i),this.i=r,this.j=o,e}constructor(e,t){this.diff=e,this.N=t,this.i=0,this.j=0}};var ho=so.lcs=function(e,t){return new fo(uo(e,t),e.length)};so.calcPatch=function*(e,t){const n=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const r of uo(e,t))r[2]=n.call(t,r[2],r[3]),yield r},so.applyPatch=function*(e,t){let n=0;const r=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const[o,i,l]of t)n<o&&(yield r.call(e,n,o)),l.length>0&&(yield l),n=i;n<e.length&&(yield r.call(e,n))};const po=(e,t)=>{const n=[];let r=0;for(const o of e)n.push(r),r+=o.length+t;return n.push(r-t),n},vo=e=>e.filter((e=>e.end>e.start)),go=(e,t,n)=>{if(!e)return[{token:"plain",start:n,end:t.length+n}];if("undefined"===t||"Infinity"===t||"-Infinity"===t||"NaN"===t||/^\d+n$/i.test(t)||t.startsWith("Symbol(")||t.startsWith("function")||t.startsWith("("))return[{token:"invalid",start:n,end:t.length+n}];if(!Number.isNaN(Number(t)))return[{token:"number",start:n,end:t.length+n}];if("true"===t||"false"===t)return[{token:"boolean",start:n,end:t.length+n}];if("null"===t)return[{token:"null",start:n,end:t.length+n}];if(t.startsWith('"')){if(t.endsWith(": [")||t.endsWith(": {"))return[{token:"key",start:n,end:t.length-3+n},{token:"punctuation",start:t.length-3,end:t.length-2+n},{token:"plain",start:t.length-2,end:t.length-1+n},{token:"punctuation",start:t.length-1,end:t.length+n}];let r=1;for(;r<t.length&&'"'!==t[r];)"\\"===t[r]&&++r,++r;return r===t.length-1?[{token:"string",start:n,end:t.length+n}]:[{token:"key",start:n,end:r+1+n},{token:"punctuation",start:r+1,end:r+2+n},{token:"plain",start:r+2,end:r+3+n},...go(e,t.substring(r+3),n+r+3)]}return"{"===t||"}"===t||"["===t||"]"===t?[{token:"punctuation",start:n,end:t.length+n}]:[{token:"plain",start:n,end:t.length+n}]},yo={threshold:8,margin:3},mo=(e,t,n,r)=>{if(!n||r)return[{start:0,end:e.length,isEqual:!1}];const o=[];for(let n=0;n<e.length;n++)"equal"===e[n].type&&"equal"===t[n].type?o.length&&o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!0}):o.length&&!o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!1});const i=!0===n?yo:{...yo,...n},{threshold:l,margin:s}=i;l<2*s+1&&console.warn(`Threshold (${l}) is no more than 2 margins + 1 "expand" line (${s} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${2*s+1} lines.`);const a=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isEqual||n.end-n.start<l||n.end-n.start<=2*s+1?a.push(n):t?t===o.length-1?(a.push({start:n.start,end:n.start+s,isEqual:!0}),a.push({hasLinesBefore:!1,hasLinesAfter:!0,start:n.start+s,end:e.length,isEqual:!0})):(a.push({start:n.start,end:n.start+s,isEqual:!0}),a.push({hasLinesBefore:!0,hasLinesAfter:!0,start:n.start+s,end:n.end-s,isEqual:!0}),a.push({start:n.end-s,end:n.end,isEqual:!0})):(a.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:n.end-s,isEqual:!0}),a.push({start:n.end-s,end:n.end,isEqual:!0}))}return a},bo={noChangeDetected:"No change detected",showLinesBefore:"β‘ Show %d lines before",showLinesAfter:"β£ Show %d lines after",showAll:"β₯ Show all unchanged lines"},xo=e=>{const[t,r]=e.diff,o=n.useMemo((()=>t.length===r.length&&t.every((e=>"equal"===e.type))&&r.every((e=>"equal"===e.type))),[t,r]),i={...bo,...e.texts},l=e.lineNumbers?`calc(${String(t.length).length}ch + 16px)`:0,s=e.indent??2,a="tab"===s?"\t":" ",c="tab"===s?1:s,u={mode:e.inlineDiffOptions?.mode||"char",wordSeparator:e.inlineDiffOptions?.wordSeparator||""},f=e.hideUnchangedLines??!1,{scrollContainer:h="body",itemHeight:d=18,expandLineHeight:p=26}=e.virtual&&!0!==e.virtual?e.virtual:{},v="body"===h?document.body:document.querySelector(h),g=n.useRef(t),y=n.useRef(r),m=n.useRef(mo(t,r,f,o)),b=n.useRef([]),x=n.useRef(0),w=n.useRef(null),[,j]=n.useState({}),_=()=>{if(b.current=[],e.virtual){let e=0;for(const t of m.current)oo(t)?(b.current.push(e),e+=p):(b.current.push(e),e+=d*(t.end-t.start));x.current=m.current.reduce(((e,t)=>oo(t)?e+p:e+(t.end-t.start)*d),0)}j({})};n.useEffect((()=>{g.current=t,y.current=r,m.current=mo(t,r,f,o),_()}),[f,t,r]),n.useEffect((()=>{if(!e.virtual||!v)return;const t=()=>j({});return v.addEventListener("scroll",t),()=>{v.removeEventListener("scroll",t)}}),[e.virtual,v]);const S=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,end:Math.max(r.end-t,r.start)},e+1<m.current.length-1&&(n[e+1]={...n[e+1],start:Math.max(r.end-t,r.start)}),m.current=n,_()},E=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,start:Math.min(r.start+t,r.end)},e>1&&(n[e-1]={...n[e-1],end:Math.min(r.start+t,r.end)}),m.current=n,_()},k=e=>()=>{const t=[...m.current],n=t[e];t[e]={...n,start:n.start,end:n.start},e+1<m.current.length-1?t[e+1]={...t[e+1],start:n.start}:t[e-1]={...t[e-1],end:n.end},m.current=t,_()},M=(e,t=[],r=!1,o=!1)=>n.createElement(n.Fragment,null,t.map(((t,r)=>{const o=e.slice(t.start,t.end);if(!t.type&&!t.token)return o;const i=[t.type?`inline-diff-${t.type}`:"",t.token?`token ${t.token}`:""].filter(Boolean).join(" ");return n.createElement("span",{key:`${r}-${t.type}-${o}`,className:i},o)})),r&&(o?n.createElement("span",{className:"token punctuation"},","):",")),q=(t,r)=>{const o=g.current[t],i=y.current[t],[l,s]=e.highlightInlineDiff&&"modify"===o.type&&"modify"===i.type?((e,t,n)=>{let r=[],o=[],i=0,l=0;if("word"===n.mode){const s=n.wordSeparator||" ",a=e.split(s),c=t.split(s),u=[...ho(a,c)],f=s.length,h=po(a,f),d=po(c,f);for(const[e,t,n]of u)e>i&&r.push({type:"remove",start:h[i],end:h[e]}),t>l&&o.push({type:"add",start:d[l],end:d[t]}),i=e+n,l=t+n,r.push({start:h[e],end:h[i]}),o.push({start:d[t],end:d[l]});return e.length>i&&r.push({type:"remove",start:h[i],end:e.length}),t.length>l&&o.push({type:"add",start:d[l],end:t.length}),r=vo(r),o=vo(o),[r,o]}const s=ho(e,t);for(const[e,t,n]of s)e>i&&r.push({type:"remove",start:i,end:e}),t>l&&o.push({type:"add",start:l,end:t}),i=e+n,l=t+n,r.push({start:e,end:i}),o.push({start:t,end:l});return e.length>i&&r.push({type:"remove",start:i,end:e.length}),t.length>l&&o.push({type:"add",start:l,end:t.length}),r=vo(r),o=vo(o),[r,o]})(o.text,i.text,u):[[],[]],f=go(r,o.text,0),h=go(r,i.text,0),d=lo(f,l),p=lo(h,s),v="equal"!==o.type?e.bgColour?.[o.type]??"":"",m="equal"!==i.type?e.bgColour?.[i.type]??"":"";return n.createElement("tr",{key:t},e.lineNumbers&&n.createElement("td",{className:`line-${o.type} line-number`,style:{backgroundColor:v}},o.lineNumber),n.createElement("td",{className:`line-${o.type}`,style:{backgroundColor:v}},n.createElement("pre",null,o.text&&a.repeat(o.level*c),M(o.text,d,o.comma,r))),e.lineNumbers&&n.createElement("td",{className:`line-${i.type} line-number`,style:{backgroundColor:m}},i.lineNumber),n.createElement("td",{className:`line-${i.type}`,style:{backgroundColor:m}},n.createElement("pre",null,i.text&&a.repeat(i.level*c),M(i.text,p,i.comma,r))))},O=(e,t,r,o)=>n.createElement(n.Fragment,null,e&&n.createElement("button",{onClick:()=>S(o)(r)},i.showLinesBefore.replaceAll("%d",String(r))),n.createElement("button",{onClick:()=>k(o)()},i.showAll),t&&n.createElement("button",{onClick:()=>E(o)(r)},i.showLinesAfter.replaceAll("%d",String(r)))),A=(e,t,r,o,i)=>{let{start:l,end:s}=e;if(l=Math.max(l,r),s=Math.min(s,o),l===s)return null;if(!oo(e))return Array(s-l).fill(0).map(((e,t)=>q(l+t,i)));const{hasLinesBefore:a,hasLinesAfter:c}=e,u="boolean"==typeof f?20:f.expandMoreLinesLimit||20;return[n.createElement("tr",{key:`expand-line-${t}`,className:"expand-line"},n.createElement("td",{colSpan:4,className:`${a?"has-lines-before":""} ${c?"has-lines-after":""}`},"boolean"!=typeof f&&f.expandLineRenderer?f.expandLineRenderer({hasLinesBefore:a,hasLinesAfter:c,onExpandBefore:S(t),onExpandAfter:E(t),onExpandAll:k(t)}):O(a,c,u,t)))]},N=["json-diff-viewer",e.virtual&&"json-diff-viewer-virtual",e.syntaxHighlight&&`json-diff-viewer-theme-${e.syntaxHighlight.theme||"monokai"}`,e.className].filter(Boolean).join(" "),I=!!e.syntaxHighlight;return n.createElement("table",{className:N,style:e.style},n.createElement("colgroup",{className:"measure-line"},e.lineNumbers&&n.createElement("col",{style:{width:l}}),n.createElement("col",null),e.lineNumbers&&n.createElement("col",{style:{width:l}}),n.createElement("col",null)),n.createElement("tbody",{ref:w},(t=>{if(o&&f)return n.createElement("tr",{key:"message-line",className:"message-line"},n.createElement("td",{colSpan:4},i.noChangeDetected));if(!e.virtual)return m.current.map(((e,n)=>A(e,n,0,g.current.length,t)));const r=v?.clientHeight??0,l=v?.scrollTop??0,s=l+r;let a=w.current,c=a?.offsetTop??0;for(;a?.offsetParent&&a?.offsetParent!==v;)a=a.offsetParent,c+=a.offsetTop;if(c>s||c+x.current<l)return n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}));const u=l-c,h=s-c,[y,j,_,S]=((e,t,n,r,o,i)=>{if(!t.length)return[0,0,0,0];let l=0,s=0,a=0,c=0,u=0,f=e.length-1;for(;;){const r=Math.floor((u+f)/2);if(t[r]+io(e[r],o,i)<=n?u=r+1:f=r,u===f){l=u;break}}const h=e[l];for(a=oo(h)?h.start:h.start+Math.floor((n-t[l])/o),u=0,f=e.length-1;;){const e=Math.floor((u+f+1)/2);if(t[e]>=r?f=e-1:u=e,u===f){s=u;break}}const d=e[s];return c=oo(d)?d.end:d.start+Math.ceil((r-t[s])/o),[l,a,s,c]})(m.current,b.current,u,h,d,p),[E,k]=((e,t,n,r,o,i,l,s,a)=>{if(!t.length)return[0,0];let c=0,u=0;const f=e[n];c=oo(f)?t[n]:t[n]+(r-f.start)*l;const h=e[o];return u=oo(h)?a-t[o]-s:a-t[o]-(i-h.start)*l,[c,u]})(m.current,b.current,y,j,_,S,d,p,x.current),M=m.current.slice(y,_+1);return M.length?n.createElement(n.Fragment,null,n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:E,padding:0}})),M.map(((e,n)=>A(e,n,j,S,t))),n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:k,padding:0}}))):n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}))})(I)))};xo.displayName="Viewer";const wo=100,jo=20,_o="#363743",So=({leftDiff:t,rightDiff:n,height:r,onScroll:o,currentScrollTop:c,searchResults:u=[],currentMatchIndex:f=-1})=>{const h=i(null),d=i(null),p=i(!1),{totalLines:v,viewportHeight:g}=l((()=>{const e=r/jo,o=Math.max(t.length,n.length)||e;return{totalLines:o,viewportHeight:r*(1/(o/e))}}),[r,t.length,n.length,t]),y=s(((e,t,n,r,o)=>{if("collapsed"===t.type)e.fillStyle=_o;else switch(t.type){case"equal":e.fillStyle=_o;break;case"add":e.fillStyle="#4CAF50";break;case"remove":e.fillStyle="#F44336";break;case"modify":e.fillStyle="#FFC107"}e.fillRect(r,n,o,jo)}),[]),m=s((()=>{const e=h.current;if(!e)return;const o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height);const i=Math.max(t.length,n.length),l=r/i;if(t.forEach(((e,t)=>{y(o,e,t*l,0,50)})),n.forEach(((e,t)=>{y(o,e,t*l,50,50)})),u.forEach((e=>{const t=e*l,n=Math.max(1,l);o.fillStyle="#ffd700",o.fillRect(0,t,wo,n)})),f>=0&&void 0!==u[f]){const e=u[f]*l,t=Math.max(1,l);o.fillStyle="#ff4500",o.fillRect(0,e,wo,t)}const s=c/(i*jo)*r;o.strokeStyle="#2196F3",o.lineWidth=2,o.strokeRect(0,s,wo,g)}),[t,n,r,c,u,f,y,g]);a((()=>{m()}),[m]);const b=s((e=>{if(p.current=!0,!d.current)return;const t=d.current.getBoundingClientRect(),n=e.clientY-t.top;if(r<=0||v<=0)return;const i=(n-g/2)/r*v*jo;!isNaN(i)&&isFinite(i)&&o(Math.max(0,i))}),[r,v,g,o]),x=s((e=>{if(!p.current||!d.current)return;const t=d.current.getBoundingClientRect(),n=e.clientY-t.top;if(r<=0||v<=0)return;const i=(n-g/2)/r*v*jo;if(isNaN(i)||!isFinite(i))return;if(e.clientY+g/2>t.bottom){const e=(t.bottom-g/2-t.top)/r*v*jo;!isNaN(e)&&isFinite(e)&&o(Math.max(0,e-250))}else o(Math.max(0,i))}),[r,v,g,o]),w=s((()=>{p.current=!1}),[]);return a((()=>(window.addEventListener("mouseup",w),()=>window.removeEventListener("mouseup",w))),[w]),e("div",{ref:d,style:{width:wo,height:r,position:"relative",cursor:"pointer"},onMouseDown:b,onMouseMove:x,children:e("canvas",{ref:h,width:wo,height:r,style:{width:"100%",height:"100%"}})})},Eo=(e,t="json-diff-viewer-theme-custom")=>{if(!e){return void document.querySelectorAll(`.${t} span.token.search-match`).forEach((e=>e.classList.remove("search-match")))}const n=e.replaceAll("(","").replaceAll(")",""),r=new RegExp(n,"gi");document.querySelectorAll(`.${t} span.token`).forEach((e=>{const t=e.textContent||"";r.test(t)?e.classList.add("search-match"):e.classList.remove("search-match")}))},ko=e=>"equal"===e.type&&""!==e.text;function Mo(e,t,n=3){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Both segments and diff must be arrays");const r=[];return e.forEach(((o,i)=>{if(o.isEqual){if(o.end-o.start<=2*n||o.isExpanded)for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e});else{if(((e,t,n)=>0===e||t[e-1].end<n.start&&t[e-1].isEqual)(i,e,o))for(let e=o.start;e<Math.min(o.start+n,o.end);e++)r.push({...t[e],originalIndex:e});o.end-(o.start+n)>n&&r.push({type:"collapsed",segmentIndex:i,originalIndex:r.length,level:0,text:""});for(let e=Math.max(o.end-n,o.start+n);e<o.end;e++)r.push({...t[e],originalIndex:e})}}else for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e})})),r}const qo=()=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.diff-viewer-container {\n background-color: #282a36;\n font-size: 12px;\n text-align: left;\n padding-bottom: 12px;\n}\n\n\n.diff-viewer-container {\n button {\n border-radius: 4px;\n border: 1px solid transparent;\n font-size: 1em;\n font-weight: 500;\n font-family: inherit;\n color: white;\n background-color: #1a1a1a;\n cursor: pointer;\n transition: border-color 0.25s;\n }\n button:hover {\n border-color: #649dffab;\n }\n button:focus,\n button:focus-visible {\n outline: 4px auto -webkit-focus-ring-color;\n }\n \n}\n\n\n.json-diff-header {\n background: #2f323e;\n padding: 10px;\n border-bottom: 1px solid #353846;\n color: #ffffffe5;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\n "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",\n "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-header .search-container {\n margin-bottom: 8px;\n width: 100%;\n}\n\n.json-diff-header .json-diff-title-container {\n width: 100%;\n display: flex;\n flex-direction: row;\n}\n\n.json-diff-header .json-diff-title-container div {\n flex: 0.47\n}\n\n.json-diff-header .search-input-container {\n display: flex;\n align-items: center;\n gap: 10px\n}\n\n.json-diff-header .search-input-container svg {\n width: 1em;\n height: 1em;\n}\n\n.json-diff-header .search-input-container input {\n border: 1px solid #434343;\n border-radius: 4px;\n padding: 6px;\n width: 100%;\n background: #2f323e;\n color: white;\n}\n\n.json-diff-header .search-results {\n margin-top: 3px;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.json-diff-header .search-results button {\n height: 20px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n color: white;\n}\n\n.json-diff-viewer-virtual pre {\n overflow-x: auto;\n white-space: pre;\n}\n\n\n.json-diff-viewer-virtual pre::-webkit-scrollbar {\n display: none;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom {\n background: #282a36;\n color: #f8f8f2;\n width: 100%;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\n "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",\n "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom.has-search\n tr\n td\n pre\n span.token.search-match {\n background-color: #ffeb3b;\n color: #000;\n padding: 0 2px;\n border-radius: 2px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .line-number {\n color: #999;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td {\n max-width: 260px;\n width: 300px !important;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td pre {\n margin-top: 0;\n margin-bottom: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\n "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",\n "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr:hover {\n background: #53535f54;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-add {\n border-left: 1px solid #a5ff99;\n background: rgba(100, 182, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-remove {\n border-left: 1px solid #ffaa99;\n background: rgba(160, 128, 100, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-modify {\n border-left: 1px solid #ecff99;\n background: rgba(182, 180, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-number {\n background: unset;\n padding: 0 4px;\n border-left: 0;\n border-bottom: none;\n max-width: 30px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line td {\n text-align: center;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line button {\n color: #1e616d;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .string {\n color: #e6db74;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .number,\n.json-diff-viewer.json-diff-viewer-theme-custom .boolean,\n.json-diff-viewer.json-diff-viewer-theme-custom .null {\n color: #ae81ff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .key {\n color: #66d9ef;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .invalid {\n background: #960050;\n color: #fff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .search-highlight {\n background-color: #ffeb3b;\n padding: 0 2px;\n border-radius: 2px;\n color: #000;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .token .search-highlight {\n background-color: #ffeb3b !important;\n color: #000 !important;\n}\n\n.collapsed-button {\n display: flex;\n background-color: #262626;\n justify-content: center;\n align-items: center;\n}\n\n.collapsed-button button {\n height: 20px;\n color: rgba(255, 255, 255, 0.7);\n padding: 0px 8px;\n line-height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n\n.hide-all-button {\n text-align: right;\n margin-top: 10px;\n}\n\n.hide-all-button button {\n height: 28px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n color: white;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n');const Oo="json-diff-viewer-theme-custom",Ao=e=>e&&"object"==typeof e&&"type"in e&&"collapsed"===e.type,No=({index:t,style:n,data:r})=>{const{onExpand:o,searchTerm:i}=r,l=r.leftDiff[t],s=r.rightDiff[t];if(Ao(l))return e("div",{className:"collapsed-button",style:n,children:e("button",{onClick:()=>o(l.segmentIndex),className:"text-blue-500 underline",children:"Show Hidden Lines"})});const a={...l},c={...s};return e("div",{style:n,children:e(xo,{indent:1,className:`${Oo} ${i?"has-search":""}`,lineNumbers:!0,diff:[[a],[c]],highlightInlineDiff:!0,inlineDiffOptions:{mode:"word"},syntaxHighlight:{theme:"monokai"}})})},Io=({oldValue:n,newValue:r,height:o,searchTerm:u,leftTitle:f,rightTitle:h,hideSearch:d,onSearchMatch:p,differOptions:v,className:g})=>{const y=i(null),m=i(),[b,x]=c(0),[w,j]=c([]),[_,S]=c({term:"",results:[],currentIndex:0}),E=l((()=>new ro({detectCircular:!0,maxDepth:20,showModifications:!0,arrayDiffMethod:"lcs",preserveKeyOrder:"before",...v})),[]),k=l((()=>n&&r?E.diff(n,r):[[],[]]),[n,r,E]),[M,q]=k,[O,A]=c([]),[I,C]=c([]);a((()=>{const e=function(e,t=3){if(!Array.isArray(e))throw new Error("Diff input must be an array");const n=[];let r=0;if(r<e.length&&ko(e[r])){let o=Math.min(r+t,e.length);for(;o<e.length&&ko(e[o]);)o++;n.push({start:r,end:o,isEqual:!0}),r=o}for(;r<e.length;)if(ko(e[r])){let t=r;for(;t<e.length&&ko(e[t]);)t++;n.push({start:r,end:t,isEqual:!0}),r=t}else{const o=Math.max(0,r-t),i=Math.min(e.length,r+1+t);o<r&&(0===n.length||n[n.length-1].end<=o)&&n.push({start:o,end:r,isEqual:!0}),n.push({start:r,end:r+1,isEqual:!1}),r+1<i&&n.push({start:r+1,end:i,isEqual:!0}),r=i}return n}(M);j(e)}),[M]),a((()=>{const e=Mo(w,M),t=Mo(w,q);A(e),C(t)}),[w,M,q]),a((()=>{y.current?.resetAfterIndex(0)}),[O]);const $=s((e=>{S((t=>({...t,term:e}))),m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{const t=((e,t)=>{if(!e)return[];const n=[],r=new RegExp(e,"gi");return t.forEach(((e,t)=>{"object"==typeof e&&"text"in e&&r.test(e.text)&&n.push(t)})),n})(e,O);S((e=>({...e,results:t,currentIndex:0})))}),300)}),[O]),D=s((e=>{if(0===_.results.length)return;const t="next"===e?(_.currentIndex+1)%_.results.length:(_.currentIndex-1+_.results.length)%_.results.length;S((e=>({...e,currentIndex:t})));const n=_.results[t];y.current?.scrollToItem(n,"center"),p&&p(n)}),[_.results,_.currentIndex,p]);a((()=>{void 0!==u&&$(u)}),[u,$]),a((()=>{Eo(_.term,Oo);const e=new MutationObserver((()=>Eo(_.term,Oo))),t={childList:!0,subtree:!0},n=document.querySelector(`.${Oo}`);n&&e.observe(n,t);const r=document.querySelector(".virtual-json-diff-list-container");if(r){const t=()=>{setTimeout((()=>Eo(_.term,Oo)),100)};return r.addEventListener("scroll",t),()=>{e.disconnect(),r.removeEventListener("scroll",t)}}return()=>{e.disconnect()}}),[_.term]);const z=s((e=>{j((t=>{const n=[...t],r=n[e];if(!r||!r.isEqual)return t;const o={...r,isExpanded:!0,originalStart:r.start,originalEnd:r.end,start:r.start,end:r.end};return n[e]=o,n}))}),[]),L=s((()=>{j((e=>e.map((e=>e.isEqual&&e.isExpanded?{...e,isExpanded:!1,start:e.originalStart??e.start,end:e.originalEnd??e.end}:e))))}),[]),B=s((e=>{const t=O[e];return Ao(t),20}),[O]),R=l((()=>w.some((e=>e.isEqual&&e.isExpanded))),[w]),T=l((()=>({leftDiff:O,rightDiff:I,onExpand:z,searchTerm:_.term})),[O,I,z,_.term]);return t("div",{className:"diff-viewer-container"+(g?` ${g}`:""),children:[t("div",{className:"json-diff-header",children:[!d&&t("div",{className:"search-container",children:[t("div",{className:"search-input-container",children:[e("span",{role:"img","aria-label":"search",children:e(qo,{})}),e("input",{type:"text",placeholder:"Search in JSON...",value:_.term,onChange:e=>$(e.target.value)})]}),_.results.length>0&&t("div",{className:"search-results",children:[t("span",{children:[_.currentIndex+1," of ",_.results.length," matches"]}),e("button",{onClick:()=>D("prev"),children:"Previous"}),e("button",{onClick:()=>D("next"),children:"Next"})]})]}),t("div",{className:"json-diff-title-container",children:[e("div",{children:e("span",{children:f})}),e("div",{children:e("span",{children:h})})]})]}),t("div",{style:{display:"flex",gap:"8px"},children:[e(N,{ref:y,className:"virtual-json-diff-list-container",height:o,itemCount:Math.max(O.length,I.length),itemSize:B,overscanCount:28,width:"100%",itemData:T,onScroll:({scrollOffset:e})=>{x(e)},children:No}),e("div",{children:e(So,{leftDiff:O,rightDiff:I,height:o,onScroll:e=>{y.current?.scrollTo(e)},currentScrollTop:b,searchResults:_.results,currentMatchIndex:_.currentIndex})})]}),R&&e("div",{className:"hide-all-button",children:e("button",{onClick:L,children:"Hide All Expanded Lines"})})]})};export{Io as VirtualDiffViewer};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|