diff --git a/.prettierignore b/.prettierignore index 6cba1e3..a1a895b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ /bundle/js .ts-built *.min.js +pnpm-lock.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index b46c099..3de184f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { "json.schemaDownload.enable": true -} \ No newline at end of file +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dd3216b --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +ZIP_FILE="extension.zip" +HASH_ALG=sha384 +BIN=node_modules/.bin + +.PHONY: + install all dev prod build format lint clean + +install: + npm i -g pnpm + pnpm i + +all: build + +dev: + NODE_OPTIONS="--loader=ts-node/esm" \ + $(BIN)/webpack --progress --watch --mode=development + +prod: + NODE_OPTIONS="--loader=ts-node/esm --no-warnings=ExperimentalWarning" \ + NODE_ENV="production" \ + $(BIN)/webpack --mode=production + +build: + make lint + make prod + make zip + make print_zip_hash + +zip: + rm -rf $(ZIP_FILE) + zip -r $(ZIP_FILE) ./bundle ./manifest.json > /dev/null + +print_zip_hash: + FILE_HASH=$$(openssl dgst -$(HASH_ALG) -binary $(ZIP_FILE) | openssl base64 -A); \ + echo "$(ZIP_FILE) $(HASH_ALG):$$FILE_HASH" + +format: + $(BIN)/prettier . --write + +lint: + $(BIN)/tsc -noEmit + +clean: + rm -rf ./node_modules + rm -rf $(ZIP_FILE) + rm -rf ./bundle/js/ diff --git a/README.md b/README.md index 21cdcf5..eb35107 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Chrome extension to compare objects in memory with console.diff(old, new) devtoo - Button to clear current result. - Indicator of the last update time. - Indicator of a fatal error (out of storage memory). + - Devtools light/dark colour scheme support. - Compare objects between multiple [sub]domains, chrome tabs, or single page reloads. @@ -66,9 +67,7 @@ Chrome extension to compare objects in memory with console.diff(old, new) devtoo [i10]: https://github.com/zendive/jsdiff/issues/10 -- Compared objects, after being serialized, and stored in `chrome.storage.local` wich has 10MB limit. - -- Will not work on `file:///` prorocol and https://chrome.google.com/webstore site. +- Compared objects, after being serialized, stored in `chrome.storage.local` wich has 10MB limit (before chrome v114 was 5MB). ### API @@ -102,7 +101,7 @@ console.diffLeft(Date.now()); console.diffRight(Date.now()); ``` -- **console.diff\_(\*)** - deprecated, left for backward compatibility, uses `nativeClone` based of JSON.parse(JSON.stringify(...)) serialization method +- **console.diff\_(\*)** - uses deprecated `nativeClone` serialization method, based of JSON.parse(JSON.stringify(...)), left for backward compatibility ### Usage basics @@ -126,12 +125,11 @@ Historically, left side represents the old state and right side the new state. ### How to build - requires npm/nodejs -- requires pnpm `npm i -g pnpm` ```sh -pnpm i -pnpm dev # local development -pnpm zip # make extension.zip +make install # to install dependencies +make all # build for prod and make extension.zip +make dev # local development ``` ### Protection diff --git a/bundle/js/jsdiff-console.js b/bundle/js/jsdiff-console.js index 434dc59..515237a 100644 --- a/bundle/js/jsdiff-console.js +++ b/bundle/js/jsdiff-console.js @@ -1 +1 @@ -(()=>{"use strict";const t={EMPTY:"⟪empty⟫",UNDEFINED:"⟪undefined⟫",NULL:"⟪null⟫",NATIVE_FUNCTION:"ƒ⟪native⟫",EXCEPTION_FALLBACK:"⁉️ ⟪exception⟫",EXCEPTION:t=>`⁉️ ⟪${t}⟫`,RECURRING_ARRAY:t=>`0x${t}: [♻️]`,RECURRING_OBJECT:t=>`0x${t}: {♻️}`,RECURRING_SET:t=>`0x${t}: Set[♻️]`,RECURRING_MAP:t=>`0x${t}: Map{♻️}`,UNSERIALIZABLE:t=>`0x${t}: ⟪unserializable⟫`,SYMBOL:(t,n)=>`0x${n}: ${t}`,FUNCTION:(t,n)=>`ƒ${t?` ${t}`:""}⟪${n}⟫`,NUMERIC:t=>"bigint"==typeof t?`BigInt⟪${t}⟫`:`Number⟪${t}⟫`};var n,e,o,i,r=function(t,n,e,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!i:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,e):i?i.value=e:n.set(t,e),e},a=function(t,n,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:n.get(t)};class s{constructor(){n.add(this),e.set(this,void 0),o.set(this,0),r(this,e,new Map,"f")}clear(){a(this,e,"f").clear()}lookup(t,s){var c;let f=a(this,e,"f").get(t);if(!f){r(this,o,(c=a(this,o,"f"),++c),"f");const u=a(this,n,"m",i).call(this,a(this,o,"f"));f={name:A(t)?s(t.toString(),u):s(u),seen:!1},a(this,e,"f").set(t,f)}return f}}async function c(n,e){try{window.postMessage({source:"jsdiff-console-to-proxy-inprogress",on:!0},window.location.origin);for(const o of["push","left","right"])if(Reflect.has(e,o)){const i=e[o];e[o]=void 0===i?t.UNDEFINED:null===i?t.NULL:await n(i)}window.postMessage({source:"jsdiff-console-to-proxy-compare",payload:e},window.location.origin)}catch(t){console.error("console.diff()",t),window.postMessage({source:"jsdiff-console-to-proxy-inprogress",on:!1},window.location.origin)}}async function f(t){let n=new Set;const e=JSON.parse(JSON.stringify(t,R.bind(null,n)));return n.clear(),n=null,e}async function u(t){let n=new s;const e=await l(n,t);return n.clear(),n=null,e}async function l(n,e){let o=e;if(g(e)){const{name:i}=n.lookup(e,t.UNSERIALIZABLE);o=i}else if(m(e))o=await E(e);else if(A(e)){const{name:i}=n.lookup(e,t.SYMBOL);o=i}else d(e)?o=await w(n,e,t.RECURRING_ARRAY):h(e)?o=await w(n,e,t.RECURRING_SET):I(e)?o=await async function(n,e){const o=n.lookup(e,t.RECURRING_MAP);let i;if(o.seen)i=o.name;else{o.seen=!0;const t={};for(const[o,i]of e){const e=await y(n,o),r=await l(n,i);t[e]=r}i=t}return i}(n,e):U(e)?o=await async function(n,e){const o=n.lookup(e,t.RECURRING_OBJECT);let i;if(o.seen)i=o.name;else if(o.seen=!0,function(t){let n;try{n=null!==t&&"object"==typeof t&&"toJSON"in t&&"function"==typeof t.toJSON}catch(t){n=!1}return n}(e)){const t=function(t){let n;try{n=t.toJSON()}catch(t){n=N(t)}return n}(e);i=await l(n,t)}else{const o={},r=Reflect.ownKeys(e);for(const i of r){let r,a;if(A(i)){const{name:e}=n.lookup(i,t.SYMBOL);r=e}else r=i;try{a=await l(n,e[i])}catch(t){a=N(t)}o[r]=a}i=o}return i}(n,e):p(e)?o=t.NUMERIC(e):void 0===e&&(o=t.UNDEFINED);return o}function p(t){return"bigint"==typeof t||Number.isNaN(t)||t===-1/0||t===1/0}async function w(t,n,e){const o=t.lookup(n,e);let i;if(o.seen)i=o.name;else{o.seen=!0;const e=[];for(const o of n)e.push(await l(t,o));i=e}return i}async function y(n,e){let o;if(g(e)){const{name:i}=n.lookup(e,t.UNSERIALIZABLE);o=i}else if(m(e))o=await E(e);else if(A(e)){const{name:i}=n.lookup(e,t.SYMBOL);o=i}else if(d(e)){const{name:i}=n.lookup(e,t.RECURRING_ARRAY);o=i}else if(h(e)){const{name:i}=n.lookup(e,t.RECURRING_SET);o=i}else if(I(e)){const{name:i}=n.lookup(e,t.RECURRING_MAP);o=i}else if(U(e)){const{name:i}=n.lookup(e,t.RECURRING_OBJECT);o=i}else o=p(e)?t.NUMERIC(e):void 0===e?t.UNDEFINED:String(e);return o}async function E(n){const e=n.toString();if(e.endsWith("{ [native code] }"))return t.NATIVE_FUNCTION;{const o=await async function(t){const n=(new TextEncoder).encode(t),e=await window.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(e)).map((t=>t.toString(16).padStart(2,"0").toUpperCase())).join("")}(e);return t.FUNCTION(n.name,o)}}function N(n){return"function"==typeof n?.toString?t.EXCEPTION(n.toString()):t.EXCEPTION_FALLBACK}function R(t,n,e){try{if(g(e))return;if(m(e))return e.toString();if(U(e)){if(t.has(e))return;t.add(e)}return e}catch(t){return N(t)}}function d(t){return t instanceof Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof BigUint64Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof BigInt64Array||t instanceof Float32Array||t instanceof Float64Array}function m(t){return"function"==typeof t&&"toString"in t&&"function"==typeof t.toString}function h(t){return t instanceof Set}function I(t){return t instanceof Map}function g(t){return t instanceof Element||t instanceof Document}function A(t){return"symbol"==typeof t}function U(t){return null!==t&&"object"==typeof t||t instanceof Object}e=new WeakMap,o=new WeakMap,n=new WeakSet,i=function(t){return t.toString(16).padStart(4,"0")},Object.assign(console,{diff:(...t)=>{c(u,1===t.length?{push:t[0],timestamp:Date.now()}:{left:t[0],right:t[1],timestamp:Date.now()})},diffLeft:t=>{c(u,{left:t,timestamp:Date.now()})},diffRight:t=>{c(u,{right:t,timestamp:Date.now()})},diffPush:t=>{c(u,{push:t,timestamp:Date.now()})},diff_:(...t)=>{c(f,1===t.length?{push:t[0],timestamp:Date.now()}:{left:t[0],right:t[1],timestamp:Date.now()})}}),console.debug("✚ console.diff()")})(); \ No newline at end of file +(()=>{"use strict";var h={};const o={EMPTY:"\u27EAempty\u27EB",UNDEFINED:"\u27EAundefined\u27EB",NULL:"\u27EAnull\u27EB",NATIVE_FUNCTION:"\u0192\u27EAnative\u27EB",EXCEPTION_FALLBACK:"\u2049\uFE0F \u27EAexception\u27EB",EXCEPTION:n=>`\u2049\uFE0F \u27EA${n}\u27EB`,RECURRING_ARRAY:n=>`0x${n}: [\u267B\uFE0F]`,RECURRING_OBJECT:n=>`0x${n}: {\u267B\uFE0F}`,RECURRING_SET:n=>`0x${n}: Set[\u267B\uFE0F]`,RECURRING_MAP:n=>`0x${n}: Map{\u267B\uFE0F}`,UNSERIALIZABLE:n=>`0x${n}: \u27EAunserializable\u27EB`,SYMBOL:(n,e)=>`0x${e}: ${n}`,FUNCTION:(n,e)=>`\u0192${n?` ${n}`:""}\u27EA${e}\u27EB`,NUMERIC:n=>typeof n=="bigint"?`BigInt\u27EA${n}\u27EB`:`Number\u27EA${n}\u27EB`},g={NO_CONNECTION:"Could not establish connection. Receiving end does not exist.",PORT_CLOSED:"The message port closed before a response was received.",QUOTA_EXCEEDED:"QUOTA_BYTES quota exceeded"};function x(n){return n!=null}async function O(n){const e=new TextEncoder().encode(n),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(s=>s.toString(16).padStart(2,"0").toUpperCase()).join("")}class B{#n;#e=0;constructor(){this.#n=new Map}clear(){this.#n.clear()}#t(e){return e.toString(16).padStart(4,"0")}lookup(e,t){let i=this.#n.get(e);if(!i){++this.#e;const r=this.#t(this.#e);i={name:p(e)?t(e.toString(),r):t(r),seen:!1},this.#n.set(e,i)}return i}}async function f(n,e){try{window.postMessage({source:"jsdiff-console-to-proxy-inprogress",on:!0},"*");for(const t of["push","left","right"])if(Reflect.has(e,t)){const i=e[t];i===void 0?e[t]=o.UNDEFINED:i===null?e[t]=o.NULL:e[t]=await n(i)}window.postMessage({source:"jsdiff-console-to-proxy-compare",payload:e},"*")}catch(t){console.error("console.diff()",t),window.postMessage({source:"jsdiff-console-to-proxy-inprogress",on:!1},"*")}}async function F(n){let e=new Set;const t=JSON.parse(JSON.stringify(n,L.bind(null,e)));return e.clear(),e=null,t}async function l(n){let e=new B;const t=await u(e,n);return e.clear(),e=null,t}async function u(n,e){let t=e;if(R(e)){const{name:i}=n.lookup(e,o.UNSERIALIZABLE);t=i}else if(N(e))t=await m(e);else if(p(e)){const{name:i}=n.lookup(e,o.SYMBOL);t=i}else C(e)?t=await S(n,e,o.RECURRING_ARRAY):y(e)?t=await S(n,e,o.RECURRING_SET):U(e)?t=await T(n,e):d(e)?t=await b(n,e):w(e)?t=o.NUMERIC(e):e===void 0&&(t=o.UNDEFINED);return t}function w(n){return typeof n=="bigint"||Number.isNaN(n)||n===-1/0||n===1/0}async function S(n,e,t){const i=n.lookup(e,t);let r;if(i.seen)r=i.name;else{i.seen=!0;const s=[];for(const c of e)s.push(await u(n,c));r=s}return r}async function T(n,e){const t=n.lookup(e,o.RECURRING_MAP);let i;if(t.seen)i=t.name;else{t.seen=!0;const r={};for(const[s,c]of e){const E=await _(n,s),a=await u(n,c);r[E]=a}i=r}return i}async function _(n,e){let t;if(R(e)){const{name:i}=n.lookup(e,o.UNSERIALIZABLE);t=i}else if(N(e))t=await m(e);else if(p(e)){const{name:i}=n.lookup(e,o.SYMBOL);t=i}else if(C(e)){const{name:i}=n.lookup(e,o.RECURRING_ARRAY);t=i}else if(y(e)){const{name:i}=n.lookup(e,o.RECURRING_SET);t=i}else if(U(e)){const{name:i}=n.lookup(e,o.RECURRING_MAP);t=i}else if(d(e)){const{name:i}=n.lookup(e,o.RECURRING_OBJECT);t=i}else w(e)?t=o.NUMERIC(e):e===void 0?t=o.UNDEFINED:t=String(e);return t}async function b(n,e){const t=n.lookup(e,o.RECURRING_OBJECT);let i;if(t.seen)i=t.name;else if(t.seen=!0,M(e)){const r=D(e);i=await u(n,r)}else{const r={},s=Reflect.ownKeys(e);for(const c of s){let E,a;if(p(c)){const{name:I}=n.lookup(c,o.SYMBOL);E=I}else E=c;try{a=await u(n,e[c])}catch(I){a=A(I)}r[E]=a}i=r}return i}async function m(n){const e=n.toString();if(e.endsWith("{ [native code] }"))return o.NATIVE_FUNCTION;{const t=await O(e);return o.FUNCTION(n.name,t)}}function D(n){let e;try{e=n.toJSON()}catch(t){e=A(t)}return e}function A(n){return typeof n?.toString=="function"?o.EXCEPTION(n.toString()):o.EXCEPTION_FALLBACK}function L(n,e,t){try{if(R(t))return;if(N(t))return t.toString();if(d(t)){if(n.has(t))return;n.add(t)}return t}catch(i){return A(i)}}function C(n){return n instanceof Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Uint16Array||n instanceof Uint32Array||n instanceof BigUint64Array||n instanceof Int8Array||n instanceof Int16Array||n instanceof Int32Array||n instanceof BigInt64Array||n instanceof Float32Array||n instanceof Float64Array}function N(n){return typeof n=="function"&&"toString"in n&&typeof n.toString=="function"}function y(n){return n instanceof Set}function U(n){return n instanceof Map}function M(n){let e;try{e=n!==null&&typeof n=="object"&&"toJSON"in n&&typeof n.toJSON=="function"}catch{e=!1}return e}function R(n){return n instanceof Element||n instanceof Document}function p(n){return typeof n=="symbol"}function d(n){return n!==null&&typeof n=="object"||n instanceof Object}Object.assign(console,{diff:(...n)=>{f(l,n.length===1?{push:n[0],timestamp:Date.now()}:{left:n[0],right:n[1],timestamp:Date.now()})},diffLeft:n=>{f(l,{left:n,timestamp:Date.now()})},diffRight:n=>{f(l,{right:n,timestamp:Date.now()})},diffPush:n=>{f(l,{push:n,timestamp:Date.now()})},diff_:(...n)=>{f(F,n.length===1?{push:n[0],timestamp:Date.now()}:{left:n[0],right:n[1],timestamp:Date.now()})}}),console.debug("\u271A console.diff()")})(); diff --git a/bundle/js/jsdiff-devtools.js b/bundle/js/jsdiff-devtools.js index 89a6126..95d1f7b 100644 --- a/bundle/js/jsdiff-devtools.js +++ b/bundle/js/jsdiff-devtools.js @@ -1 +1 @@ -(()=>{"use strict";null!==chrome.devtools.inspectedWindow.tabId&&chrome.devtools.panels.create("JSDiff","/bundle/img/panel-icon28.png","/bundle/jsdiff-panel.html",(e=>{e.onSearch.addListener((async(e,s)=>{await chrome.runtime.sendMessage({source:"jsdiff-devtools-to-panel-search",params:{cmd:e,query:s}})}))}))})(); \ No newline at end of file +(()=>{"use strict";var n={};chrome.devtools.inspectedWindow.tabId!==null&&chrome.devtools.panels.create("JSDiff","/bundle/img/panel-icon28.png","/bundle/jsdiff-panel.html",e=>{e.onSearch.addListener(async(s,a)=>{await chrome.runtime.sendMessage({source:"jsdiff-devtools-to-panel-search",params:{cmd:s,query:a}})})})})(); diff --git a/bundle/js/jsdiff-panel.js b/bundle/js/jsdiff-panel.js index 9dbc32d..b11d43c 100644 --- a/bundle/js/jsdiff-panel.js +++ b/bundle/js/jsdiff-panel.js @@ -1 +1,29 @@ -(()=>{var e={825:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(916),i=n.n(r),o=n(282),s=n.n(o)()(i());s.push([e.id,'.jsondiffpatch-delta{font-family:"Bitstream Vera Sans Mono","DejaVu Sans Mono",Monaco,Courier,monospace;font-size:12px;margin:0;padding:0 0 0 12px;display:inline-block}.jsondiffpatch-delta pre{font-family:"Bitstream Vera Sans Mono","DejaVu Sans Mono",Monaco,Courier,monospace;font-size:12px;margin:0;padding:0;display:inline-block}ul.jsondiffpatch-delta{list-style-type:none;padding:0 0 0 20px;margin:0}.jsondiffpatch-delta ul{list-style-type:none;padding:0 0 0 20px;margin:0}.jsondiffpatch-added .jsondiffpatch-property-name,.jsondiffpatch-added .jsondiffpatch-value pre,.jsondiffpatch-modified .jsondiffpatch-right-value pre,.jsondiffpatch-textdiff-added{background:#bfb}.jsondiffpatch-deleted .jsondiffpatch-property-name,.jsondiffpatch-deleted pre,.jsondiffpatch-modified .jsondiffpatch-left-value pre,.jsondiffpatch-textdiff-deleted{background:#fbb;text-decoration:line-through}.jsondiffpatch-unchanged,.jsondiffpatch-movedestination{color:gray}.jsondiffpatch-unchanged,.jsondiffpatch-movedestination>.jsondiffpatch-value{transition:all .5s;-webkit-transition:all .5s;overflow-y:hidden}.jsondiffpatch-unchanged-showing .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-showing .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:100px}.jsondiffpatch-unchanged-hidden .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-hidden .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:0}.jsondiffpatch-unchanged-hiding .jsondiffpatch-movedestination>.jsondiffpatch-value,.jsondiffpatch-unchanged-hidden .jsondiffpatch-movedestination>.jsondiffpatch-value{display:block}.jsondiffpatch-unchanged-visible .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-visible .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:100px}.jsondiffpatch-unchanged-hiding .jsondiffpatch-unchanged,.jsondiffpatch-unchanged-hiding .jsondiffpatch-movedestination>.jsondiffpatch-value{max-height:0}.jsondiffpatch-unchanged-showing .jsondiffpatch-arrow,.jsondiffpatch-unchanged-hiding .jsondiffpatch-arrow{display:none}.jsondiffpatch-value{display:inline-block}.jsondiffpatch-property-name{display:inline-block;padding-right:5px;vertical-align:top}.jsondiffpatch-property-name:after{content:": "}.jsondiffpatch-child-node-type-array>.jsondiffpatch-property-name:after{content:": ["}.jsondiffpatch-child-node-type-array:after{content:"],"}div.jsondiffpatch-child-node-type-array:before{content:"["}div.jsondiffpatch-child-node-type-array:after{content:"]"}.jsondiffpatch-child-node-type-object>.jsondiffpatch-property-name:after{content:": {"}.jsondiffpatch-child-node-type-object:after{content:"},"}div.jsondiffpatch-child-node-type-object:before{content:"{"}div.jsondiffpatch-child-node-type-object:after{content:"}"}.jsondiffpatch-value pre:after{content:","}li:last-child>.jsondiffpatch-value pre:after,.jsondiffpatch-modified>.jsondiffpatch-left-value pre:after{content:""}.jsondiffpatch-modified .jsondiffpatch-value{display:inline-block}.jsondiffpatch-modified .jsondiffpatch-right-value{margin-left:5px}.jsondiffpatch-moved .jsondiffpatch-value{display:none}.jsondiffpatch-moved .jsondiffpatch-moved-destination{display:inline-block;background:#ffb;color:#888}.jsondiffpatch-moved .jsondiffpatch-moved-destination:before{content:" => "}ul.jsondiffpatch-textdiff{padding:0}.jsondiffpatch-textdiff-location{color:#bbb;display:inline-block;min-width:60px}.jsondiffpatch-textdiff-line{display:inline-block}.jsondiffpatch-textdiff-line-number:after{content:","}.jsondiffpatch-error{background:red;color:#fff;font-weight:bold}',""]);const a=s},348:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(916),i=n.n(r),o=n(282),s=n.n(o)()(i());s.push([e.id,":root{--colour-background: #fff;--colour-text: #000;--colour-found: 0, 191, 255;--height-header: 1.625rem}body{margin:0;padding:0}.jsdiff-panel{height:100vh;background-color:var(--colour-background);color:var(--colour-text)}.jsdiff-panel .btn{height:var(--height-header);cursor:pointer;border:none;border-radius:0;outline:none;background-color:rgba(0,0,0,.03)}.jsdiff-panel .btn:hover{background-color:rgba(0,0,0,.3)}.jsdiff-panel .-header{border-bottom:1px solid #bbb;box-shadow:1px 2px 5px #bbb;display:flex;align-items:center;height:var(--height-header);margin-bottom:12px;min-width:512px;user-select:none}.jsdiff-panel .-header .-toolbox{display:flex;justify-content:center;align-items:center;padding-left:10px}.jsdiff-panel .-header .-toolbox .btn{margin:0 2px}.jsdiff-panel .-header .-toolbox .-last-updated{cursor:default;margin-left:10px;color:#bbb}.jsdiff-panel .-header .-toolbox .-last-updated .-value{font-weight:bold}.jsdiff-panel .-header .-last-error{display:flex;justify-content:center;align-items:center;padding-left:10px;color:#b62121}.jsdiff-panel .-header .-badge{position:fixed;top:0;right:0;display:flex;flex-direction:column;align-items:center;padding:4px 4px}.jsdiff-panel .-header .-badge .-version{font-family:monospace}.jsdiff-panel .-header .-badge .-icon img{width:32px}.jsdiff-panel .-center{margin:0 auto;text-align:center}.jsdiff-panel .-match{display:flex;align-items:center;height:100%}.jsdiff-panel .-match .-center{font-size:26px;color:#bbb}.jsdiff-panel .-empty{display:flex;height:calc(100vh - var(--height-header));justify-content:center;align-items:center}.jsdiff-panel .-empty .-links{margin-top:16px;font-size:11px}.jsdiff-panel .-empty .-center{font-size:26px;color:#bbb}.jsdiff-panel .-delta{padding-top:10px}.jsdiff-panel .-delta .jsdiff-found{outline:1px solid rgba(var(--colour-found), 0.6);outline-offset:-1px}.jsdiff-panel .-delta .jsdiff-found.jsdiff-found-this{outline:2px solid rgb(var(--colour-found));outline-offset:-2px;animation:found_this 1s infinite}@keyframes found_this{0%{background-color:rgba(0,0,0,0)}50%{background-color:rgba(var(--colour-found), 0.2)}}",""]);const a=s},697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(916),i=n.n(r),o=n(282),s=n.n(o)()(i());s.push([e.id,".progress-indicator[data-v-28e0d635]{background-color:rgba(0,0,0,0);height:2px;width:100%;overflow:hidden;position:fixed;top:0;display:block}.progress-indicator>.-eye[data-v-28e0d635]{background-image:linear-gradient(to right, rgba(179, 7, 247, 0) 15%, rgb(241, 14, 14) 50%, rgba(179, 7, 247, 0) 85%);color:rgba(0,0,0,0);height:100%;width:20%;animation:wt-scanning-eye-animation-28e0d635 1s linear infinite alternate,wt-scanning-eye-animation-blink-28e0d635 1.25s linear infinite alternate}@keyframes wt-scanning-eye-animation-28e0d635{from{transform:translateX(-100%)}to{transform:translateX(500%)}}@keyframes wt-scanning-eye-animation-blink-28e0d635{0%{filter:hue-rotate(0deg)}80%{filter:hue-rotate(0deg)}100%{filter:hue-rotate(360deg)}}",""]);const a=s},282:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=o),n&&(f[2]?(f[1]="@media ".concat(f[2]," {").concat(f[1],"}"),f[2]=n):f[2]=n),i&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=i):f[4]="".concat(i)),t.push(f))}},t}},916:e=>{"use strict";e.exports=function(e){return e[1]}},931:()=>{},908:function(e,t,n){!function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;ne[i-1][o]?--o:--i;return s},R={get:function(e,t,n,r){var i=r||{},o=M(e,t,n||O,i),s=T(o,e,t,i);return"string"==typeof e&&"string"==typeof t&&(s.sequence=s.sequence.join("")),s}},P=3,N="function"==typeof Array.isArray?Array.isArray:function(e){return e instanceof Array},F="function"==typeof Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){for(var n=e.length,r=0;r0&&f>0&&!t.objectHash&&"boolean"!=typeof t.matchByPosition&&(t.matchByPosition=!I(a,l,c,f));n0)for(var j=0;j<_;j++)if(D(h,p,(o=m[j])-n,i-n,t)){d["_"+o].splice(1,2,i,P),b||(d["_"+o][0]=""),s=i,u=new g(e.left[o],e.right[s]),e.push(u,s),m.splice(j,1),w=!0;break}w||(d[i]=[l[i]])}else o=v.indices1[x]+n,s=v.indices2[x]+n,u=new g(e.left[o],e.right[s]),e.push(u,s)}e.setResult(d).exit()}else{for(d=d||{_t:"a"},i=n;i=0;t--){var l=r["_"+(n=o[t])],c=i.splice(n,1)[0];l[2]===P&&s.push({index:l[1],value:c})}var f=(s=s.sort(V.numericallyBy("index"))).length;for(t=0;t0)for(t=0;tr?r++:s>=r&&at.length?e:t,c=e.length>t.length?t:e,f=l.indexOf(c);if(-1!=f)return a=[[r,l.substring(0,f)],[i,c],[r,l.substring(f+c.length)]],e.length>t.length&&(a[0][0]=a[2][0]=n),a;if(1==c.length)return[[n,e],[r,t]];var u=this.diff_halfMatch_(e,t);if(u){var d=u[0],h=u[1],p=u[2],v=u[3],g=u[4],m=this.diff_main(d,p,o,s),y=this.diff_main(h,v,o,s);return m.concat([[i,g]],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},t.prototype.diff_lineMode_=function(e,t,o){e=(h=this.diff_linesToChars_(e,t)).chars1,t=h.chars2;var s=h.lineArray,a=this.diff_main(e,t,!1,o);this.diff_charsToLines_(a,s),this.diff_cleanupSemantic(a),a.push([i,""]);for(var l=0,c=0,f=0,u="",d="";l=1&&f>=1){a.splice(l-c-f,c+f),l=l-c-f;for(var h,p=(h=this.diff_main(u,d,!1,o)).length-1;p>=0;p--)a.splice(l,0,h[p]);l+=h.length}f=0,c=0,u="",d=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,t,i){for(var o=e.length,s=t.length,a=Math.ceil((o+s)/2),l=a,c=2*a,f=new Array(c),u=new Array(c),d=0;di);b++){for(var _=-b+v;_<=b-g;_+=2){for(var x=l+_,w=(A=_==-b||_!=b&&f[x-1]o)g+=2;else if(w>s)v+=2;else if(p&&(C=l+h-_)>=0&&C=(k=o-u[C]))return this.diff_bisectSplit_(e,t,A,w,i)}for(var j=-b+m;j<=b-y;j+=2){for(var k,C=l+j,E=(k=j==-b||j!=b&&u[C-1]o)y+=2;else if(E>s)m+=2;else if(!p){var A;if((x=l+h-j)>=0&&x=(k=o-k))return this.diff_bisectSplit_(e,t,A,w,i)}}}return[[n,e],[r,t]]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),c=this.diff_main(o,s,!1,i),f=this.diff_main(a,l,!1,i);return c.concat(f)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t="",i=0,o=-1,s=n.length;or?e=e.substring(n-r):nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,o,s,a,f]:null}var s,a,l,c,f,u=o(n,r,Math.ceil(n.length/4)),d=o(n,r,Math.ceil(n.length/2));return u||d?(s=d?u&&u[4].length>d[4].length?u:d:u,e.length>t.length?(a=s[0],l=s[1],c=s[2],f=s[3]):(c=s[0],f=s[1],a=s[2],l=s[3]),[a,l,c,f,s[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,a=null,l=0,c=0,f=0,u=0,d=0;l0?o[s-1]:-1,c=0,f=0,u=0,d=0,a=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l=g?(v>=h.length/2||v>=p.length/2)&&(e.splice(l,0,[i,p.substring(0,v)]),e[l-1][1]=h.substring(0,h.length-v),e[l+1][1]=p.substring(v),l++):(g>=h.length/2||g>=p.length/2)&&(e.splice(l,0,[i,h.substring(0,g)]),e[l-1][0]=r,e[l-1][1]=p.substring(0,p.length-g),e[l+1][0]=n,e[l+1][1]=h.substring(g),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),o=r.match(t.nonAlphaNumericRegex_),s=i.match(t.nonAlphaNumericRegex_),a=o&&r.match(t.whitespaceRegex_),l=s&&i.match(t.whitespaceRegex_),c=a&&r.match(t.linebreakRegex_),f=l&&i.match(t.linebreakRegex_),u=c&&e.match(t.blanklineEndRegex_),d=f&&n.match(t.blanklineStartRegex_);return u||d?5:c||f?4:o&&!a&&l?3:a||l?2:o||s?1:0}for(var r=1;r=h&&(h=p,f=o,u=s,d=a)}e[r-1][1]!=f&&(f?e[r-1][1]=f:(e.splice(r-1,1),r--),e[r][1]=u,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,a=null,l=0,c=!1,f=!1,u=!1,d=!1;l0?o[s-1]:-1,u=d=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push([i,""]);for(var t,o=0,s=0,a=0,l="",c="";o1?(0!==s&&0!==a&&(0!==(t=this.diff_commonPrefix(c,l))&&(o-s-a>0&&e[o-s-a-1][0]==i?e[o-s-a-1][1]+=c.substring(0,t):(e.splice(0,0,[i,c.substring(0,t)]),o++),c=c.substring(t),l=l.substring(t)),0!==(t=this.diff_commonSuffix(c,l))&&(e[o][1]=c.substring(c.length-t)+e[o][1],c=c.substring(0,c.length-t),l=l.substring(0,l.length-t))),0===s?e.splice(o-a,s+a,[r,c]):0===a?e.splice(o-s,s+a,[n,l]):e.splice(o-s-a,s+a,[n,l],[r,c]),o=o-s-a+(s?1:0)+(a?1:0)+1):0!==o&&e[o-1][0]==i?(e[o-1][1]+=e[o][1],e.splice(o,1)):o++,a=0,s=0,l="",c=""}""===e[e.length-1][1]&&e.pop();var f=!1;for(o=1;ot));i++)a=o,l=s;return e.length!=i&&e[i][0]===n?l:l+(t-a)},t.prototype.diff_prettyHtml=function(e){for(var t=[],o=/&/g,s=//g,l=/\n/g,c=0;c");switch(f){case r:t[c]=''+u+"";break;case n:t[c]=''+u+"";break;case i:t[c]=""+u+""}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(e,r){var o=e/t.length,s=Math.abs(n-r);return i.Match_Distance?o+s/i.Match_Distance:s?1:o}var s=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(s=Math.min(o(0,a),s),-1!=(a=e.lastIndexOf(t,n+t.length))&&(s=Math.min(o(0,a),s)));var l,c,f=1<=p;m--){var y=r[e.charAt(m-1)];if(g[m]=0===h?(g[m+1]<<1|1)&y:(g[m+1]<<1|1)&y|(u[m+1]|u[m])<<1|1|u[m+1],g[m]&f){var b=o(h,m-1);if(b<=s){if(s=b,!((a=m-1)>n))break;p=Math.max(1,2*n-a)}}}if(o(h+1,n)>s)break;u=g}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(e&&"object"==typeof e&&void 0===o&&void 0===s)l=e,a=this.diff_text1(l);else if("string"==typeof e&&o&&"object"==typeof o&&void 0===s)a=e,l=o;else{if("string"!=typeof e||"string"!=typeof o||!s||"object"!=typeof s)throw new Error("Unknown call format to patch_make.");a=e,l=s}if(0===l.length)return[];for(var c=[],f=new t.patch_obj,u=0,d=0,h=0,p=a,v=a,g=0;g=2*this.Patch_Margin&&u&&(this.patch_addContext_(f,p),c.push(f),f=new t.patch_obj,u=0,p=v,d=h)}m!==r&&(d+=y.length),m!==n&&(h+=y.length)}return u&&(this.patch_addContext_(f,p),c.push(f)),c},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;rthis.Match_MaxBits?-1!=(c=this.match_main(t,d.substring(0,this.Match_MaxBits),u))&&(-1==(h=this.match_main(t,d.substring(d.length-this.Match_MaxBits),u+d.length-this.Match_MaxBits))||c>=h)&&(c=-1):c=this.match_main(t,d,u),-1==c)a[l]=!1,s-=e[l].length2-e[l].length1;else if(a[l]=!0,s=c-u,d==(f=-1==h?t.substring(c,c+d.length):t.substring(c,h+this.Match_MaxBits)))t=t.substring(0,c)+this.diff_text2(e[l].diffs)+t.substring(c+d.length);else{var p=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(p)/d.length>this.Patch_DeleteThreshold)a[l]=!1;else{this.diff_cleanupSemanticLossless(p);for(var v,g=0,m=0;ms[0][1].length){var a=t-s[0][1].length;s[0][1]=n.substring(s[0][1].length)+s[0][1],o.start1-=a,o.start2-=a,o.length1+=a,o.length2+=a}return 0==(s=(o=e[e.length-1]).diffs).length||s[s.length-1][0]!=i?(s.push([i,n]),o.length1+=t,o.length2+=t):t>s[s.length-1][1].length&&(a=t-s[s.length-1][1].length,s[s.length-1][1]+=n.substring(0,a),o.length1+=a,o.length2+=a),n},t.prototype.patch_splitMax=function(e){for(var o=this.Match_MaxBits,s=0;s2*o?(u.length1+=p.length,l+=p.length,d=!1,u.diffs.push([h,p]),a.diffs.shift()):(p=p.substring(0,o-u.length1-this.Patch_Margin),u.length1+=p.length,l+=p.length,h===i?(u.length2+=p.length,c+=p.length):d=!1,u.diffs.push([h,p]),p==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(p.length))}f=(f=this.diff_text2(u.diffs)).substring(f.length-this.Patch_Margin);var v=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);""!==v&&(u.length1+=v.length,u.length2+=v.length,0!==u.diffs.length&&u.diffs[u.diffs.length-1][0]===i?u.diffs[u.diffs.length-1][1]+=v:u.diffs.push([i,v])),d||e.splice(++s,0,u)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n'+t+"")}},{key:"formatValue",value:function(e,t){e.out("
"+ue(JSON.stringify(t,null,2))+"
")}},{key:"formatTextDiffString",value:function(e,t){var n=this.parseTextDiff(t);e.out('
    ');for(var r=0,i=n.length;r
    '+o.location.line+''+o.location.chr+'
    ');for(var s=o.pieces,a=0,l=s.length;a'+ue(decodeURI(c.text))+"")}e.out("
    ")}e.out("
")}},{key:"rootBegin",value:function(e,t,n){var r="jsondiffpatch-"+t+(n?" jsondiffpatch-child-node-type-"+n:"");e.out('
')}},{key:"rootEnd",value:function(e){e.out("
"+(e.hasArrows?'