Current section

Files

Jump to
live_json priv static live_json.min.js
Raw

priv/static/live_json.min.js

var LiveJson=(()=>{var ht=Object.create;var me=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var wr=l=>me(l,"__esModule",{value:!0});var br=(l,p)=>()=>(p||l((p={exports:{}}).exports,p),p.exports),Fe=(l,p)=>{wr(l);for(var g in p)me(l,g,{get:p[g],enumerable:!0})},gt=(l,p,g)=>{if(p&&typeof p=="object"||typeof p=="function")for(let m of pt(p))!ct.call(l,m)&&m!=="default"&&me(l,m,{get:()=>p[m],enumerable:!(g=vt(p,m))||g.enumerable});return l},mt=l=>gt(wr(me(l!=null?ht(dt(l)):{},"default",l&&l.__esModule&&"default"in l?{get:()=>l.default,enumerable:!0}:{value:l,enumerable:!0})),l);var Er=br(()=>{});var Pr=br((Ee,Rr)=>{(function(l,p){typeof Ee=="object"&&typeof Rr!="undefined"?p(Ee,Er()):typeof define=="function"&&define.amd?define(["exports","./empty"],p):p(l.jsondiffpatch={},l.chalk)})(Ee,function(l,p){"use strict";p=p&&p.hasOwnProperty("default")?p.default:p;var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},m=function(v,e){if(!(v instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function v(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,n,t){return n&&v(e.prototype,n),t&&v(e,t),e}}(),E=function v(e,n,t){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,n);if(a===void 0){var r=Object.getPrototypeOf(e);return r===null?void 0:v(r,n,t)}else{if("value"in a)return a.value;var i=a.get;return i===void 0?void 0:i.call(t)}},A=function(v,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);v.prototype=Object.create(e&&e.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(v,e):v.__proto__=e)},T=function(v,e){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:v},J=function(){function v(e,n){var t=[],a=!0,r=!1,i=void 0;try{for(var f=e[Symbol.iterator](),s;!(a=(s=f.next()).done)&&(t.push(s.value),!(n&&t.length===n));a=!0);}catch(u){r=!0,i=u}finally{try{!a&&f.return&&f.return()}finally{if(r)throw i}}return t}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return v(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=function(v){if(Array.isArray(v)){for(var e=0,n=Array(v.length);e<v.length;e++)n[e]=v[e];return n}else return Array.from(v)},M=function(){function v(e){m(this,v),this.selfOptions=e||{},this.pipes={}}return w(v,[{key:"options",value:function(n){return n&&(this.selfOptions=n),this.selfOptions}},{key:"pipe",value:function(n,t){var a=t;if(typeof n=="string"){if(typeof a=="undefined")return this.pipes[n];this.pipes[n]=a}if(n&&n.name){if(a=n,a.processor===this)return a;this.pipes[a.name]=a}return a.processor=this,a}},{key:"process",value:function(n,t){var a=n;a.options=this.options();for(var r=t||n.pipe||"default",i=void 0,f=void 0;r;)typeof a.nextAfterChildren!="undefined"&&(a.next=a.nextAfterChildren,a.nextAfterChildren=null),typeof r=="string"&&(r=this.pipe(r)),r.process(a),f=a,i=r,r=null,a&&a.next&&(a=a.next,r=f.nextPipe||a.pipe||i);return a.hasResult?a.result:void 0}}]),v}(),H=function(){function v(e){m(this,v),this.name=e,this.filters=[]}return w(v,[{key:"process",value:function(n){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var t=this.debug,a=this.filters.length,r=n,i=0;i<a;i++){var f=this.filters[i];if(t&&this.log("filter: "+f.filterName),f(r),(typeof r=="undefined"?"undefined":g(r))==="object"&&r.exiting){r.exiting=!1;break}}!r.next&&this.resultCheck&&this.resultCheck(r)}},{key:"log",value:function(n){console.log("[jsondiffpatch] "+this.name+" pipe, "+n)}},{key:"append",value:function(){var n;return(n=this.filters).push.apply(n,arguments),this}},{key:"prepend",value:function(){var n;return(n=this.filters).unshift.apply(n,arguments),this}},{key:"indexOf",value:function(n){if(!n)throw new Error("a filter name is required");for(var t=0;t<this.filters.length;t++){var a=this.filters[t];if(a.filterName===n)return t}throw new Error("filter not found: "+n)}},{key:"list",value:function(){return this.filters.map(function(n){return n.filterName})}},{key:"after",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t+1,0),Array.prototype.splice.apply(this.filters,a),this}},{key:"before",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t,0),Array.prototype.splice.apply(this.filters,a),this}},{key:"replace",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t,1),Array.prototype.splice.apply(this.filters,a),this}},{key:"remove",value:function(n){var t=this.indexOf(n);return this.filters.splice(t,1),this}},{key:"clear",value:function(){return this.filters.length=0,this}},{key:"shouldHaveResult",value:function(n){if(n===!1){this.resultCheck=null;return}if(!this.resultCheck){var t=this;return this.resultCheck=function(a){if(!a.hasResult){console.log(a);var r=new Error(t.name+" failed");throw r.noResult=!0,r}},this}}}]),v}(),z=function(){function v(){m(this,v)}return w(v,[{key:"setResult",value:function(n){return this.result=n,this.hasResult=!0,this}},{key:"exit",value:function(){return this.exiting=!0,this}},{key:"switchTo",value:function(n,t){return typeof n=="string"||n instanceof H?this.nextPipe=n:(this.next=n,t&&(this.nextPipe=t)),this}},{key:"push",value:function(n,t){return n.parent=this,typeof t!="undefined"&&(n.childName=t),n.root=this.root||this,n.options=n.options||this.options,this.children?(this.children[this.children.length-1].next=n,this.children.push(n)):(this.children=[n],this.nextAfterChildren=this.next||null,this.next=n),n.next=this,this}}]),v}(),B=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array};function ie(v){var e=/^\/(.*)\/([gimyu]*)$/.exec(v.toString());return new RegExp(e[1],e[2])}function he(v){if((typeof v=="undefined"?"undefined":g(v))!=="object")return v;if(v===null)return null;if(B(v))return v.map(he);if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return ie(v);var e={};for(var n in v)Object.prototype.hasOwnProperty.call(v,n)&&(e[n]=he(v[n]));return e}var X=function(v){A(e,v);function e(n,t){m(this,e);var a=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.left=n,a.right=t,a.pipe="diff",a}return w(e,[{key:"setResult",value:function(t){if(this.options.cloneDiffValues&&(typeof t=="undefined"?"undefined":g(t))==="object"){var a=typeof this.options.cloneDiffValues=="function"?this.options.cloneDiffValues:he;g(t[0])==="object"&&(t[0]=a(t[0])),g(t[1])==="object"&&(t[1]=a(t[1]))}return z.prototype.setResult.apply(this,arguments)}}]),e}(z),Re=function(v){A(e,v);function e(n,t){m(this,e);var a=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.left=n,a.delta=t,a.pipe="patch",a}return e}(z),Pe=function(v){A(e,v);function e(n){m(this,e);var t=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.delta=n,t.pipe="reverse",t}return e}(z),ve=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},$e=function(e){if(e.left===e.right){e.setResult(void 0).exit();return}if(typeof e.left=="undefined"){if(typeof e.right=="function")throw new Error("functions are not supported");e.setResult([e.right]).exit();return}if(typeof e.right=="undefined"){e.setResult([e.left,0,0]).exit();return}if(typeof e.left=="function"||typeof e.right=="function")throw new Error("functions are not supported");if(e.leftType=e.left===null?"null":g(e.left),e.rightType=e.right===null?"null":g(e.right),e.leftType!==e.rightType){e.setResult([e.left,e.right]).exit();return}if(e.leftType==="boolean"||e.leftType==="number"){e.setResult([e.left,e.right]).exit();return}if(e.leftType==="object"&&(e.leftIsArray=ve(e.left)),e.rightType==="object"&&(e.rightIsArray=ve(e.right)),e.leftIsArray!==e.rightIsArray){e.setResult([e.left,e.right]).exit();return}e.left instanceof RegExp&&(e.right instanceof RegExp?e.setResult([e.left.toString(),e.right.toString()]).exit():e.setResult([e.left,e.right]).exit())};$e.filterName="trivial";var He=function(e){if(typeof e.delta=="undefined"){e.setResult(e.left).exit();return}if(e.nested=!ve(e.delta),!e.nested){if(e.delta.length===1){e.setResult(e.delta[0]).exit();return}if(e.delta.length===2){if(e.left instanceof RegExp){var n=/^\/(.*)\/([gimyu]+)$/.exec(e.delta[1]);if(n){e.setResult(new RegExp(n[1],n[2])).exit();return}}e.setResult(e.delta[1]).exit();return}e.delta.length===3&&e.delta[2]===0&&e.setResult(void 0).exit()}};He.filterName="trivial";var Je=function(e){if(typeof e.delta=="undefined"){e.setResult(e.delta).exit();return}if(e.nested=!ve(e.delta),!e.nested){if(e.delta.length===1){e.setResult([e.delta[0],0,0]).exit();return}if(e.delta.length===2){e.setResult([e.delta[1],e.delta[0]]).exit();return}e.delta.length===3&&e.delta[2]===0&&e.setResult([e.delta[0]]).exit()}};Je.filterName="trivial";function ze(v){if(!(!v||!v.children)){for(var e=v.children.length,n=void 0,t=v.result,a=0;a<e;a++)n=v.children[a],typeof n.result!="undefined"&&(t=t||{},t[n.childName]=n.result);t&&v.leftIsArray&&(t._t="a"),v.setResult(t).exit()}}ze.filterName="collectChildren";function Ve(v){if(!(v.leftIsArray||v.leftType!=="object")){var e=void 0,n=void 0,t=v.options.propertyFilter;for(e in v.left)!Object.prototype.hasOwnProperty.call(v.left,e)||t&&!t(e,v)||(n=new X(v.left[e],v.right[e]),v.push(n,e));for(e in v.right)!Object.prototype.hasOwnProperty.call(v.right,e)||t&&!t(e,v)||typeof v.left[e]=="undefined"&&(n=new X(void 0,v.right[e]),v.push(n,e));if(!v.children||v.children.length===0){v.setResult(void 0).exit();return}v.exit()}}Ve.filterName="objects";var Qe=function(e){if(!!e.nested&&!e.delta._t){var n=void 0,t=void 0;for(n in e.delta)t=new Re(e.left[n],e.delta[n]),e.push(t,n);e.exit()}};Qe.filterName="objects";var Ye=function(e){if(!(!e||!e.children)&&!e.delta._t){for(var n=e.children.length,t=void 0,a=0;a<n;a++)t=e.children[a],Object.prototype.hasOwnProperty.call(e.left,t.childName)&&t.result===void 0?delete e.left[t.childName]:e.left[t.childName]!==t.result&&(e.left[t.childName]=t.result);e.setResult(e.left).exit()}};Ye.filterName="collectChildren";var qe=function(e){if(!!e.nested&&!e.delta._t){var n=void 0,t=void 0;for(n in e.delta)t=new Pe(e.delta[n]),e.push(t,n);e.exit()}};qe.filterName="objects";function Ge(v){if(!(!v||!v.children)&&!v.delta._t){for(var e=v.children.length,n=void 0,t={},a=0;a<e;a++)n=v.children[a],t[n.childName]!==n.result&&(t[n.childName]=n.result);v.setResult(t).exit()}}Ge.filterName="collectChildren";var Dr=function(e,n,t,a){return e[t]===n[a]},Cr=function(e,n,t,a){var r=e.length,i=n.length,f=void 0,s=void 0,u=[r+1];for(f=0;f<r+1;f++)for(u[f]=[i+1],s=0;s<i+1;s++)u[f][s]=0;for(u.match=t,f=1;f<r+1;f++)for(s=1;s<i+1;s++)t(e,n,f-1,s-1,a)?u[f][s]=u[f-1][s-1]+1:u[f][s]=Math.max(u[f-1][s],u[f][s-1]);return u},jr=function(e,n,t,a){for(var r=n.length,i=t.length,f={sequence:[],indices1:[],indices2:[]};r!==0&&i!==0;){var s=e.match(n,t,r-1,i-1,a);if(s)f.sequence.unshift(n[r-1]),f.indices1.unshift(r-1),f.indices2.unshift(i-1),--r,--i;else{var u=e[r][i-1],o=e[r-1][i];u>o?--i:--r}}return f},Mr=function(e,n,t,a){var r=a||{},i=Cr(e,n,t||Dr,r),f=jr(i,e,n,r);return typeof e=="string"&&typeof n=="string"&&(f.sequence=f.sequence.join("")),f},Nr={get:Mr},re=3,Xe=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},We=typeof Array.prototype.indexOf=="function"?function(v,e){return v.indexOf(e)}:function(v,e){for(var n=v.length,t=0;t<n;t++)if(v[t]===e)return t;return-1};function kr(v,e,n,t){for(var a=0;a<n;a++)for(var r=v[a],i=0;i<t;i++){var f=e[i];if(a!==i&&r===f)return!0}}function pe(v,e,n,t,a){var r=v[n],i=e[t];if(r===i)return!0;if((typeof r=="undefined"?"undefined":g(r))!=="object"||(typeof i=="undefined"?"undefined":g(i))!=="object")return!1;var f=a.objectHash;if(!f)return a.matchByPosition&&n===t;var s=void 0,u=void 0;return typeof n=="number"?(a.hashCache1=a.hashCache1||[],s=a.hashCache1[n],typeof s=="undefined"&&(a.hashCache1[n]=s=f(r,n))):s=f(r),typeof s=="undefined"||(typeof t=="number"?(a.hashCache2=a.hashCache2||[],u=a.hashCache2[t],typeof u=="undefined"&&(a.hashCache2[t]=u=f(i,t))):u=f(i),typeof u=="undefined")?!1:s===u}var Ze=function(e){if(!!e.leftIsArray){var n={objectHash:e.options&&e.options.objectHash,matchByPosition:e.options&&e.options.matchByPosition},t=0,a=0,r=void 0,i=void 0,f=void 0,s=e.left,u=e.right,o=s.length,h=u.length,d=void 0;for(o>0&&h>0&&!n.objectHash&&typeof n.matchByPosition!="boolean"&&(n.matchByPosition=!kr(s,u,o,h));t<o&&t<h&&pe(s,u,t,t,n);)r=t,d=new X(e.left[r],e.right[r]),e.push(d,r),t++;for(;a+t<o&&a+t<h&&pe(s,u,o-1-a,h-1-a,n);)i=o-1-a,f=h-1-a,d=new X(e.left[i],e.right[f]),e.push(d,f),a++;var c=void 0;if(t+a===o){if(o===h){e.setResult(void 0).exit();return}for(c=c||{_t:"a"},r=t;r<h-a;r++)c[r]=[u[r]];e.setResult(c).exit();return}if(t+a===h){for(c=c||{_t:"a"},r=t;r<o-a;r++)c["_"+r]=[s[r],0,0];e.setResult(c).exit();return}delete n.hashCache1,delete n.hashCache2;var y=s.slice(t,o-a),_=u.slice(t,h-a),b=Nr.get(y,_,pe,n),O=[];for(c=c||{_t:"a"},r=t;r<o-a;r++)We(b.indices1,r-t)<0&&(c["_"+r]=[s[r],0,0],O.push(r));var R=!0;e.options&&e.options.arrays&&e.options.arrays.detectMove===!1&&(R=!1);var P=!1;e.options&&e.options.arrays&&e.options.arrays.includeValueOnMove&&(P=!0);var C=O.length;for(r=t;r<h-a;r++){var N=We(b.indices2,r-t);if(N<0){var D=!1;if(R&&C>0){for(var j=0;j<C;j++)if(i=O[j],pe(y,_,i-t,r-t,n)){c["_"+i].splice(1,2,r,re),P||(c["_"+i][0]=""),f=r,d=new X(e.left[i],e.right[f]),e.push(d,f),O.splice(j,1),D=!0;break}}D||(c[r]=[u[r]])}else i=b.indices1[N]+t,f=b.indices2[N]+t,d=new X(e.left[i],e.right[f]),e.push(d,f)}e.setResult(c).exit()}};Ze.filterName="arrays";var Ke={numerically:function(e,n){return e-n},numericallyBy:function(e){return function(n,t){return n[e]-t[e]}}},xe=function(e){if(!!e.nested&&e.delta._t==="a"){var n=void 0,t=void 0,a=e.delta,r=e.left,i=[],f=[],s=[];for(n in a)if(n!=="_t")if(n[0]==="_")if(a[n][2]===0||a[n][2]===re)i.push(parseInt(n.slice(1),10));else throw new Error("only removal or move can be applied at original array indices,"+(" invalid diff type: "+a[n][2]));else a[n].length===1?f.push({index:parseInt(n,10),value:a[n][0]}):s.push({index:parseInt(n,10),delta:a[n]});for(i=i.sort(Ke.numerically),n=i.length-1;n>=0;n--){t=i[n];var u=a["_"+t],o=r.splice(t,1)[0];u[2]===re&&f.push({index:u[1],value:o})}f=f.sort(Ke.numericallyBy("index"));var h=f.length;for(n=0;n<h;n++){var d=f[n];r.splice(d.index,0,d.value)}var c=s.length,y=void 0;if(c>0)for(n=0;n<c;n++){var _=s[n];y=new Re(e.left[_.index],_.delta),e.push(y,_.index)}if(!e.children){e.setResult(e.left).exit();return}e.exit()}};xe.filterName="arrays";var er=function(e){if(!(!e||!e.children)&&e.delta._t==="a"){for(var n=e.children.length,t=void 0,a=0;a<n;a++)t=e.children[a],e.left[t.childName]=t.result;e.setResult(e.left).exit()}};er.filterName="arraysCollectChildren";var rr=function(e){if(!e.nested){e.delta[2]===re&&(e.newName="_"+e.delta[1],e.setResult([e.delta[0],parseInt(e.childName.substr(1),10),re]).exit());return}if(e.delta._t==="a"){var n=void 0,t=void 0;for(n in e.delta)n!=="_t"&&(t=new Pe(e.delta[n]),e.push(t,n));e.exit()}};rr.filterName="arrays";var Fr=function(e,n,t){if(typeof n=="string"&&n[0]==="_")return parseInt(n.substr(1),10);if(Xe(t)&&t[2]===0)return"_"+n;var a=+n;for(var r in e){var i=e[r];if(Xe(i))if(i[2]===re){var f=parseInt(r.substr(1),10),s=i[1];if(s===+n)return f;f<=a&&s>a?a++:f>=a&&s<a&&a--}else if(i[2]===0){var u=parseInt(r.substr(1),10);u<=a&&a++}else i.length===1&&r<=a&&a--}return a};function tr(v){if(!(!v||!v.children)&&v.delta._t==="a"){for(var e=v.children.length,n=void 0,t={_t:"a"},a=0;a<e;a++){n=v.children[a];var r=n.newName;typeof r=="undefined"&&(r=Fr(v.delta,n.childName,n.result)),t[r]!==n.result&&(t[r]=n.result)}v.setResult(t).exit()}}tr.filterName="arraysCollectChildren";var nr=function(e){e.left instanceof Date?(e.right instanceof Date?e.left.getTime()!==e.right.getTime()?e.setResult([e.left,e.right]):e.setResult(void 0):e.setResult([e.left,e.right]),e.exit()):e.right instanceof Date&&e.setResult([e.left,e.right]).exit()};nr.filterName="dates";function Ir(v,e){return e={exports:{}},v(e,e.exports),e.exports}var Te=Ir(function(v){function e(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var n=-1,t=1,a=0;e.prototype.diff_main=function(r,i,f,s){typeof s=="undefined"&&(this.Diff_Timeout<=0?s=Number.MAX_VALUE:s=new Date().getTime()+this.Diff_Timeout*1e3);var u=s;if(r==null||i==null)throw new Error("Null input. (diff_main)");if(r==i)return r?[[a,r]]:[];typeof f=="undefined"&&(f=!0);var o=f,h=this.diff_commonPrefix(r,i),d=r.substring(0,h);r=r.substring(h),i=i.substring(h),h=this.diff_commonSuffix(r,i);var c=r.substring(r.length-h);r=r.substring(0,r.length-h),i=i.substring(0,i.length-h);var y=this.diff_compute_(r,i,o,u);return d&&y.unshift([a,d]),c&&y.push([a,c]),this.diff_cleanupMerge(y),y},e.prototype.diff_compute_=function(r,i,f,s){var u;if(!r)return[[t,i]];if(!i)return[[n,r]];var o=r.length>i.length?r:i,h=r.length>i.length?i:r,d=o.indexOf(h);if(d!=-1)return u=[[t,o.substring(0,d)],[a,h],[t,o.substring(d+h.length)]],r.length>i.length&&(u[0][0]=u[2][0]=n),u;if(h.length==1)return[[n,r],[t,i]];var c=this.diff_halfMatch_(r,i);if(c){var y=c[0],_=c[1],b=c[2],O=c[3],R=c[4],P=this.diff_main(y,b,f,s),C=this.diff_main(_,O,f,s);return P.concat([[a,R]],C)}return f&&r.length>100&&i.length>100?this.diff_lineMode_(r,i,s):this.diff_bisect_(r,i,s)},e.prototype.diff_lineMode_=function(r,i,f){var s=this.diff_linesToChars_(r,i);r=s.chars1,i=s.chars2;var u=s.lineArray,o=this.diff_main(r,i,!1,f);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push([a,""]);for(var h=0,d=0,c=0,y="",_="";h<o.length;){switch(o[h][0]){case t:c++,_+=o[h][1];break;case n:d++,y+=o[h][1];break;case a:if(d>=1&&c>=1){o.splice(h-d-c,d+c),h=h-d-c;for(var s=this.diff_main(y,_,!1,f),b=s.length-1;b>=0;b--)o.splice(h,0,s[b]);h=h+s.length}c=0,d=0,y="",_="";break}h++}return o.pop(),o},e.prototype.diff_bisect_=function(r,i,f){for(var s=r.length,u=i.length,o=Math.ceil((s+u)/2),h=o,d=2*o,c=new Array(d),y=new Array(d),_=0;_<d;_++)c[_]=-1,y[_]=-1;c[h+1]=0,y[h+1]=0;for(var b=s-u,O=b%2!=0,R=0,P=0,C=0,N=0,D=0;D<o&&!(new Date().getTime()>f);D++){for(var j=-D+R;j<=D-P;j+=2){var k=h+j,F;j==-D||j!=D&&c[k-1]<c[k+1]?F=c[k+1]:F=c[k-1]+1;for(var Q=F-j;F<s&&Q<u&&r.charAt(F)==i.charAt(Q);)F++,Q++;if(c[k]=F,F>s)P+=2;else if(Q>u)R+=2;else if(O){var $=h+b-j;if($>=0&&$<d&&y[$]!=-1){var L=s-y[$];if(F>=L)return this.diff_bisectSplit_(r,i,F,Q,f)}}}for(var Y=-D+C;Y<=D-N;Y+=2){var $=h+Y,L;Y==-D||Y!=D&&y[$-1]<y[$+1]?L=y[$+1]:L=y[$-1]+1;for(var G=L-Y;L<s&&G<u&&r.charAt(s-L-1)==i.charAt(u-G-1);)L++,G++;if(y[$]=L,L>s)N+=2;else if(G>u)C+=2;else if(!O){var k=h+b-Y;if(k>=0&&k<d&&c[k]!=-1){var F=c[k],Q=h+F-k;if(L=s-L,F>=L)return this.diff_bisectSplit_(r,i,F,Q,f)}}}}return[[n,r],[t,i]]},e.prototype.diff_bisectSplit_=function(r,i,f,s,u){var o=r.substring(0,f),h=i.substring(0,s),d=r.substring(f),c=i.substring(s),y=this.diff_main(o,h,!1,u),_=this.diff_main(d,c,!1,u);return y.concat(_)},e.prototype.diff_linesToChars_=function(r,i){var f=[],s={};f[0]="";function u(d){for(var c="",y=0,_=-1,b=f.length;_<d.length-1;){_=d.indexOf(`
`,y),_==-1&&(_=d.length-1);var O=d.substring(y,_+1);y=_+1,(s.hasOwnProperty?s.hasOwnProperty(O):s[O]!==void 0)?c+=String.fromCharCode(s[O]):(c+=String.fromCharCode(b),s[O]=b,f[b++]=O)}return c}var o=u(r),h=u(i);return{chars1:o,chars2:h,lineArray:f}},e.prototype.diff_charsToLines_=function(r,i){for(var f=0;f<r.length;f++){for(var s=r[f][1],u=[],o=0;o<s.length;o++)u[o]=i[s.charCodeAt(o)];r[f][1]=u.join("")}},e.prototype.diff_commonPrefix=function(r,i){if(!r||!i||r.charAt(0)!=i.charAt(0))return 0;for(var f=0,s=Math.min(r.length,i.length),u=s,o=0;f<u;)r.substring(o,u)==i.substring(o,u)?(f=u,o=f):s=u,u=Math.floor((s-f)/2+f);return u},e.prototype.diff_commonSuffix=function(r,i){if(!r||!i||r.charAt(r.length-1)!=i.charAt(i.length-1))return 0;for(var f=0,s=Math.min(r.length,i.length),u=s,o=0;f<u;)r.substring(r.length-u,r.length-o)==i.substring(i.length-u,i.length-o)?(f=u,o=f):s=u,u=Math.floor((s-f)/2+f);return u},e.prototype.diff_commonOverlap_=function(r,i){var f=r.length,s=i.length;if(f==0||s==0)return 0;f>s?r=r.substring(f-s):f<s&&(i=i.substring(0,f));var u=Math.min(f,s);if(r==i)return u;for(var o=0,h=1;;){var d=r.substring(u-h),c=i.indexOf(d);if(c==-1)return o;h+=c,(c==0||r.substring(u-h)==i.substring(0,h))&&(o=h,h++)}},e.prototype.diff_halfMatch_=function(r,i){if(this.Diff_Timeout<=0)return null;var f=r.length>i.length?r:i,s=r.length>i.length?i:r;if(f.length<4||s.length*2<f.length)return null;var u=this;function o(P,C,N){for(var D=P.substring(N,N+Math.floor(P.length/4)),j=-1,k="",F,Q,$,L;(j=C.indexOf(D,j+1))!=-1;){var Y=u.diff_commonPrefix(P.substring(N),C.substring(j)),G=u.diff_commonSuffix(P.substring(0,N),C.substring(0,j));k.length<G+Y&&(k=C.substring(j-G,j)+C.substring(j,j+Y),F=P.substring(0,N-G),Q=P.substring(N+Y),$=C.substring(0,j-G),L=C.substring(j+Y))}return k.length*2>=P.length?[F,Q,$,L,k]:null}var h=o(f,s,Math.ceil(f.length/4)),d=o(f,s,Math.ceil(f.length/2)),c;if(!h&&!d)return null;d?h?c=h[4].length>d[4].length?h:d:c=d:c=h;var y,_,b,O;r.length>i.length?(y=c[0],_=c[1],b=c[2],O=c[3]):(b=c[0],O=c[1],y=c[2],_=c[3]);var R=c[4];return[y,_,b,O,R]},e.prototype.diff_cleanupSemantic=function(r){for(var i=!1,f=[],s=0,u=null,o=0,h=0,d=0,c=0,y=0;o<r.length;)r[o][0]==a?(f[s++]=o,h=c,d=y,c=0,y=0,u=r[o][1]):(r[o][0]==t?c+=r[o][1].length:y+=r[o][1].length,u&&u.length<=Math.max(h,d)&&u.length<=Math.max(c,y)&&(r.splice(f[s-1],0,[n,u]),r[f[s-1]+1][0]=t,s--,s--,o=s>0?f[s-1]:-1,h=0,d=0,c=0,y=0,u=null,i=!0)),o++;for(i&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),o=1;o<r.length;){if(r[o-1][0]==n&&r[o][0]==t){var _=r[o-1][1],b=r[o][1],O=this.diff_commonOverlap_(_,b),R=this.diff_commonOverlap_(b,_);O>=R?(O>=_.length/2||O>=b.length/2)&&(r.splice(o,0,[a,b.substring(0,O)]),r[o-1][1]=_.substring(0,_.length-O),r[o+1][1]=b.substring(O),o++):(R>=_.length/2||R>=b.length/2)&&(r.splice(o,0,[a,_.substring(0,R)]),r[o-1][0]=t,r[o-1][1]=b.substring(0,b.length-R),r[o+1][0]=n,r[o+1][1]=_.substring(R),o++),o++}o++}},e.prototype.diff_cleanupSemanticLossless=function(r){function i(R,P){if(!R||!P)return 6;var C=R.charAt(R.length-1),N=P.charAt(0),D=C.match(e.nonAlphaNumericRegex_),j=N.match(e.nonAlphaNumericRegex_),k=D&&C.match(e.whitespaceRegex_),F=j&&N.match(e.whitespaceRegex_),Q=k&&C.match(e.linebreakRegex_),$=F&&N.match(e.linebreakRegex_),L=Q&&R.match(e.blanklineEndRegex_),Y=$&&P.match(e.blanklineStartRegex_);return L||Y?5:Q||$?4:D&&!k&&F?3:k||F?2:D||j?1:0}for(var f=1;f<r.length-1;){if(r[f-1][0]==a&&r[f+1][0]==a){var s=r[f-1][1],u=r[f][1],o=r[f+1][1],h=this.diff_commonSuffix(s,u);if(h){var d=u.substring(u.length-h);s=s.substring(0,s.length-h),u=d+u.substring(0,u.length-h),o=d+o}for(var c=s,y=u,_=o,b=i(s,u)+i(u,o);u.charAt(0)===o.charAt(0);){s+=u.charAt(0),u=u.substring(1)+o.charAt(0),o=o.substring(1);var O=i(s,u)+i(u,o);O>=b&&(b=O,c=s,y=u,_=o)}r[f-1][1]!=c&&(c?r[f-1][1]=c:(r.splice(f-1,1),f--),r[f][1]=y,_?r[f+1][1]=_:(r.splice(f+1,1),f--))}f++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(r){for(var i=!1,f=[],s=0,u=null,o=0,h=!1,d=!1,c=!1,y=!1;o<r.length;)r[o][0]==a?(r[o][1].length<this.Diff_EditCost&&(c||y)?(f[s++]=o,h=c,d=y,u=r[o][1]):(s=0,u=null),c=y=!1):(r[o][0]==n?y=!0:c=!0,u&&(h&&d&&c&&y||u.length<this.Diff_EditCost/2&&h+d+c+y==3)&&(r.splice(f[s-1],0,[n,u]),r[f[s-1]+1][0]=t,s--,u=null,h&&d?(c=y=!0,s=0):(s--,o=s>0?f[s-1]:-1,c=y=!1),i=!0)),o++;i&&this.diff_cleanupMerge(r)},e.prototype.diff_cleanupMerge=function(r){r.push([a,""]);for(var i=0,f=0,s=0,u="",o="",h;i<r.length;)switch(r[i][0]){case t:s++,o+=r[i][1],i++;break;case n:f++,u+=r[i][1],i++;break;case a:f+s>1?(f!==0&&s!==0&&(h=this.diff_commonPrefix(o,u),h!==0&&(i-f-s>0&&r[i-f-s-1][0]==a?r[i-f-s-1][1]+=o.substring(0,h):(r.splice(0,0,[a,o.substring(0,h)]),i++),o=o.substring(h),u=u.substring(h)),h=this.diff_commonSuffix(o,u),h!==0&&(r[i][1]=o.substring(o.length-h)+r[i][1],o=o.substring(0,o.length-h),u=u.substring(0,u.length-h))),f===0?r.splice(i-s,f+s,[t,o]):s===0?r.splice(i-f,f+s,[n,u]):r.splice(i-f-s,f+s,[n,u],[t,o]),i=i-f-s+(f?1:0)+(s?1:0)+1):i!==0&&r[i-1][0]==a?(r[i-1][1]+=r[i][1],r.splice(i,1)):i++,s=0,f=0,u="",o="";break}r[r.length-1][1]===""&&r.pop();var d=!1;for(i=1;i<r.length-1;)r[i-1][0]==a&&r[i+1][0]==a&&(r[i][1].substring(r[i][1].length-r[i-1][1].length)==r[i-1][1]?(r[i][1]=r[i-1][1]+r[i][1].substring(0,r[i][1].length-r[i-1][1].length),r[i+1][1]=r[i-1][1]+r[i+1][1],r.splice(i-1,1),d=!0):r[i][1].substring(0,r[i+1][1].length)==r[i+1][1]&&(r[i-1][1]+=r[i+1][1],r[i][1]=r[i][1].substring(r[i+1][1].length)+r[i+1][1],r.splice(i+1,1),d=!0)),i++;d&&this.diff_cleanupMerge(r)},e.prototype.diff_xIndex=function(r,i){var f=0,s=0,u=0,o=0,h;for(h=0;h<r.length&&(r[h][0]!==t&&(f+=r[h][1].length),r[h][0]!==n&&(s+=r[h][1].length),!(f>i));h++)u=f,o=s;return r.length!=h&&r[h][0]===n?o:o+(i-u)},e.prototype.diff_prettyHtml=function(r){for(var i=[],f=/&/g,s=/</g,u=/>/g,o=/\n/g,h=0;h<r.length;h++){var d=r[h][0],c=r[h][1],y=c.replace(f,"&amp;").replace(s,"&lt;").replace(u,"&gt;").replace(o,"&para;<br>");switch(d){case t:i[h]='<ins style="background:#e6ffe6;">'+y+"</ins>";break;case n:i[h]='<del style="background:#ffe6e6;">'+y+"</del>";break;case a:i[h]="<span>"+y+"</span>";break}}return i.join("")},e.prototype.diff_text1=function(r){for(var i=[],f=0;f<r.length;f++)r[f][0]!==t&&(i[f]=r[f][1]);return i.join("")},e.prototype.diff_text2=function(r){for(var i=[],f=0;f<r.length;f++)r[f][0]!==n&&(i[f]=r[f][1]);return i.join("")},e.prototype.diff_levenshtein=function(r){for(var i=0,f=0,s=0,u=0;u<r.length;u++){var o=r[u][0],h=r[u][1];switch(o){case t:f+=h.length;break;case n:s+=h.length;break;case a:i+=Math.max(f,s),f=0,s=0;break}}return i+=Math.max(f,s),i},e.prototype.diff_toDelta=function(r){for(var i=[],f=0;f<r.length;f++)switch(r[f][0]){case t:i[f]="+"+encodeURI(r[f][1]);break;case n:i[f]="-"+r[f][1].length;break;case a:i[f]="="+r[f][1].length;break}return i.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(r,i){for(var f=[],s=0,u=0,o=i.split(/\t/g),h=0;h<o.length;h++){var d=o[h].substring(1);switch(o[h].charAt(0)){case"+":try{f[s++]=[t,decodeURI(d)]}catch(_){throw new Error("Illegal escape in diff_fromDelta: "+d)}break;case"-":case"=":var c=parseInt(d,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+d);var y=r.substring(u,u+=c);o[h].charAt(0)=="="?f[s++]=[a,y]:f[s++]=[n,y];break;default:if(o[h])throw new Error("Invalid diff operation in diff_fromDelta: "+o[h])}}if(u!=r.length)throw new Error("Delta length ("+u+") does not equal source text length ("+r.length+").");return f},e.prototype.match_main=function(r,i,f){if(r==null||i==null||f==null)throw new Error("Null input. (match_main)");return f=Math.max(0,Math.min(f,r.length)),r==i?0:r.length?r.substring(f,f+i.length)==i?f:this.match_bitap_(r,i,f):-1},e.prototype.match_bitap_=function(r,i,f){if(i.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var s=this.match_alphabet_(i),u=this;function o(F,Q){var $=F/i.length,L=Math.abs(f-Q);return u.Match_Distance?$+L/u.Match_Distance:L?1:$}var h=this.Match_Threshold,d=r.indexOf(i,f);d!=-1&&(h=Math.min(o(0,d),h),d=r.lastIndexOf(i,f+i.length),d!=-1&&(h=Math.min(o(0,d),h)));var c=1<<i.length-1;d=-1;for(var y,_,b=i.length+r.length,O,R=0;R<i.length;R++){for(y=0,_=b;y<_;)o(R,f+_)<=h?y=_:b=_,_=Math.floor((b-y)/2+y);b=_;var P=Math.max(1,f-_+1),C=Math.min(f+_,r.length)+i.length,N=Array(C+2);N[C+1]=(1<<R)-1;for(var D=C;D>=P;D--){var j=s[r.charAt(D-1)];if(R===0?N[D]=(N[D+1]<<1|1)&j:N[D]=(N[D+1]<<1|1)&j|((O[D+1]|O[D])<<1|1)|O[D+1],N[D]&c){var k=o(R,D-1);if(k<=h)if(h=k,d=D-1,d>f)P=Math.max(1,2*f-d);else break}}if(o(R+1,f)>h)break;O=N}return d},e.prototype.match_alphabet_=function(r){for(var i={},f=0;f<r.length;f++)i[r.charAt(f)]=0;for(var f=0;f<r.length;f++)i[r.charAt(f)]|=1<<r.length-f-1;return i},e.prototype.patch_addContext_=function(r,i){if(i.length!=0){for(var f=i.substring(r.start2,r.start2+r.length1),s=0;i.indexOf(f)!=i.lastIndexOf(f)&&f.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)s+=this.Patch_Margin,f=i.substring(r.start2-s,r.start2+r.length1+s);s+=this.Patch_Margin;var u=i.substring(r.start2-s,r.start2);u&&r.diffs.unshift([a,u]);var o=i.substring(r.start2+r.length1,r.start2+r.length1+s);o&&r.diffs.push([a,o]),r.start1-=u.length,r.start2-=u.length,r.length1+=u.length+o.length,r.length2+=u.length+o.length}},e.prototype.patch_make=function(r,i,f){var s,u;if(typeof r=="string"&&typeof i=="string"&&typeof f=="undefined")s=r,u=this.diff_main(s,i,!0),u.length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(r&&typeof r=="object"&&typeof i=="undefined"&&typeof f=="undefined")u=r,s=this.diff_text1(u);else if(typeof r=="string"&&i&&typeof i=="object"&&typeof f=="undefined")s=r,u=i;else if(typeof r=="string"&&typeof i=="string"&&f&&typeof f=="object")s=r,u=f;else throw new Error("Unknown call format to patch_make.");if(u.length===0)return[];for(var o=[],h=new e.patch_obj,d=0,c=0,y=0,_=s,b=s,O=0;O<u.length;O++){var R=u[O][0],P=u[O][1];switch(!d&&R!==a&&(h.start1=c,h.start2=y),R){case t:h.diffs[d++]=u[O],h.length2+=P.length,b=b.substring(0,y)+P+b.substring(y);break;case n:h.length1+=P.length,h.diffs[d++]=u[O],b=b.substring(0,y)+b.substring(y+P.length);break;case a:P.length<=2*this.Patch_Margin&&d&&u.length!=O+1?(h.diffs[d++]=u[O],h.length1+=P.length,h.length2+=P.length):P.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(h,_),o.push(h),h=new e.patch_obj,d=0,_=b,c=y);break}R!==t&&(c+=P.length),R!==n&&(y+=P.length)}return d&&(this.patch_addContext_(h,_),o.push(h)),o},e.prototype.patch_deepCopy=function(r){for(var i=[],f=0;f<r.length;f++){var s=r[f],u=new e.patch_obj;u.diffs=[];for(var o=0;o<s.diffs.length;o++)u.diffs[o]=s.diffs[o].slice();u.start1=s.start1,u.start2=s.start2,u.length1=s.length1,u.length2=s.length2,i[f]=u}return i},e.prototype.patch_apply=function(r,i){if(r.length==0)return[i,[]];r=this.patch_deepCopy(r);var f=this.patch_addPadding(r);i=f+i+f,this.patch_splitMax(r);for(var s=0,u=[],o=0;o<r.length;o++){var h=r[o].start2+s,d=this.diff_text1(r[o].diffs),c,y=-1;if(d.length>this.Match_MaxBits?(c=this.match_main(i,d.substring(0,this.Match_MaxBits),h),c!=-1&&(y=this.match_main(i,d.substring(d.length-this.Match_MaxBits),h+d.length-this.Match_MaxBits),(y==-1||c>=y)&&(c=-1))):c=this.match_main(i,d,h),c==-1)u[o]=!1,s-=r[o].length2-r[o].length1;else{u[o]=!0,s=c-h;var _;if(y==-1?_=i.substring(c,c+d.length):_=i.substring(c,y+this.Match_MaxBits),d==_)i=i.substring(0,c)+this.diff_text2(r[o].diffs)+i.substring(c+d.length);else{var b=this.diff_main(d,_,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(b)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(b);for(var O=0,R,P=0;P<r[o].diffs.length;P++){var C=r[o].diffs[P];C[0]!==a&&(R=this.diff_xIndex(b,O)),C[0]===t?i=i.substring(0,c+R)+C[1]+i.substring(c+R):C[0]===n&&(i=i.substring(0,c+R)+i.substring(c+this.diff_xIndex(b,O+C[1].length))),C[0]!==n&&(O+=C[1].length)}}}}}return i=i.substring(f.length,i.length-f.length),[i,u]},e.prototype.patch_addPadding=function(r){for(var i=this.Patch_Margin,f="",s=1;s<=i;s++)f+=String.fromCharCode(s);for(var s=0;s<r.length;s++)r[s].start1+=i,r[s].start2+=i;var u=r[0],o=u.diffs;if(o.length==0||o[0][0]!=a)o.unshift([a,f]),u.start1-=i,u.start2-=i,u.length1+=i,u.length2+=i;else if(i>o[0][1].length){var h=i-o[0][1].length;o[0][1]=f.substring(o[0][1].length)+o[0][1],u.start1-=h,u.start2-=h,u.length1+=h,u.length2+=h}if(u=r[r.length-1],o=u.diffs,o.length==0||o[o.length-1][0]!=a)o.push([a,f]),u.length1+=i,u.length2+=i;else if(i>o[o.length-1][1].length){var h=i-o[o.length-1][1].length;o[o.length-1][1]+=f.substring(0,h),u.length1+=h,u.length2+=h}return f},e.prototype.patch_splitMax=function(r){for(var i=this.Match_MaxBits,f=0;f<r.length;f++)if(!(r[f].length1<=i)){var s=r[f];r.splice(f--,1);for(var u=s.start1,o=s.start2,h="";s.diffs.length!==0;){var d=new e.patch_obj,c=!0;for(d.start1=u-h.length,d.start2=o-h.length,h!==""&&(d.length1=d.length2=h.length,d.diffs.push([a,h]));s.diffs.length!==0&&d.length1<i-this.Patch_Margin;){var y=s.diffs[0][0],_=s.diffs[0][1];y===t?(d.length2+=_.length,o+=_.length,d.diffs.push(s.diffs.shift()),c=!1):y===n&&d.diffs.length==1&&d.diffs[0][0]==a&&_.length>2*i?(d.length1+=_.length,u+=_.length,c=!1,d.diffs.push([y,_]),s.diffs.shift()):(_=_.substring(0,i-d.length1-this.Patch_Margin),d.length1+=_.length,u+=_.length,y===a?(d.length2+=_.length,o+=_.length):c=!1,d.diffs.push([y,_]),_==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(_.length))}h=this.diff_text2(d.diffs),h=h.substring(h.length-this.Patch_Margin);var b=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push([a,b])),c||r.splice(++f,0,d)}}},e.prototype.patch_toText=function(r){for(var i=[],f=0;f<r.length;f++)i[f]=r[f];return i.join("")},e.prototype.patch_fromText=function(r){var i=[];if(!r)return i;for(var f=r.split(`
`),s=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<f.length;){var o=f[s].match(u);if(!o)throw new Error("Invalid patch string: "+f[s]);var h=new e.patch_obj;for(i.push(h),h.start1=parseInt(o[1],10),o[2]===""?(h.start1--,h.length1=1):o[2]=="0"?h.length1=0:(h.start1--,h.length1=parseInt(o[2],10)),h.start2=parseInt(o[3],10),o[4]===""?(h.start2--,h.length2=1):o[4]=="0"?h.length2=0:(h.start2--,h.length2=parseInt(o[4],10)),s++;s<f.length;){var d=f[s].charAt(0);try{var c=decodeURI(f[s].substring(1))}catch(y){throw new Error("Illegal escape in patch_fromText: "+c)}if(d=="-")h.diffs.push([n,c]);else if(d=="+")h.diffs.push([t,c]);else if(d==" ")h.diffs.push([a,c]);else{if(d=="@")break;if(d!=="")throw new Error('Invalid patch mode "'+d+'" in: '+c)}s++}}return i},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var r,i;this.length1===0?r=this.start1+",0":this.length1==1?r=this.start1+1:r=this.start1+1+","+this.length1,this.length2===0?i=this.start2+",0":this.length2==1?i=this.start2+1:i=this.start2+1+","+this.length2;for(var f=["@@ -"+r+" +"+i+` @@
`],s,u=0;u<this.diffs.length;u++){switch(this.diffs[u][0]){case t:s="+";break;case n:s="-";break;case a:s=" ";break}f[u+1]=s+encodeURI(this.diffs[u][1])+`
`}return f.join("").replace(/%20/g," ")},v.exports=e,v.exports.diff_match_patch=e,v.exports.DIFF_DELETE=n,v.exports.DIFF_INSERT=t,v.exports.DIFF_EQUAL=a}),de=2,Sr=60,De=null,ir=function(e){if(!De){var n=void 0;if(typeof diff_match_patch!="undefined")n=typeof diff_match_patch=="function"?new diff_match_patch:new diff_match_patch.diff_match_patch;else if(Te)try{n=Te&&new Te}catch(a){n=null}if(!n){if(!e)return null;var t=new Error("text diff_match_patch library not found");throw t.diff_match_patch_not_found=!0,t}De={diff:function(r,i){return n.patch_toText(n.patch_make(r,i))},patch:function(r,i){for(var f=n.patch_apply(n.patch_fromText(i),r),s=0;s<f[1].length;s++)if(!f[1][s]){var u=new Error("text patch failed");u.textPatchFailed=!0}return f[0]}}}return De},ar=function(e){if(e.leftType==="string"){var n=e.options&&e.options.textDiff&&e.options.textDiff.minLength||Sr;if(e.left.length<n||e.right.length<n){e.setResult([e.left,e.right]).exit();return}var t=ir();if(!t){e.setResult([e.left,e.right]).exit();return}var a=t.diff;e.setResult([a(e.left,e.right),0,de]).exit()}};ar.filterName="texts";var fr=function(e){if(!e.nested&&e.delta[2]===de){var n=ir(!0).patch;e.setResult(n(e.left,e.delta[0])).exit()}};fr.filterName="texts";var Lr=function(e){var n=void 0,t=void 0,a=void 0,r=void 0,i=void 0,f=null,s=/^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,u=void 0;for(a=e.split(`
`),n=0,t=a.length;n<t;n++){r=a[n];var o=r.slice(0,1);o==="@"?(f=s.exec(r),u=n,a[u]="@@ -"+f[3]+","+f[4]+" +"+f[1]+","+f[2]+" @@"):o==="+"?(a[n]="-"+a[n].slice(1),a[n-1].slice(0,1)==="+"&&(i=a[n],a[n]=a[n-1],a[n-1]=i)):o==="-"&&(a[n]="+"+a[n].slice(1))}return a.join(`
`)},sr=function(e){e.nested||e.delta[2]===de&&e.setResult([Lr(e.delta[0]),0,de]).exit()};sr.filterName="texts";var W=function(){function v(e){m(this,v),this.processor=new M(e),this.processor.pipe(new H("diff").append(ze,$e,nr,ar,Ve,Ze).shouldHaveResult()),this.processor.pipe(new H("patch").append(Ye,er,He,fr,Qe,xe).shouldHaveResult()),this.processor.pipe(new H("reverse").append(Ge,tr,Je,sr,qe,rr).shouldHaveResult())}return w(v,[{key:"options",value:function(){var n;return(n=this.processor).options.apply(n,arguments)}},{key:"diff",value:function(n,t){return this.processor.process(new X(n,t))}},{key:"patch",value:function(n,t){return this.processor.process(new Re(n,t))}},{key:"reverse",value:function(n){return this.processor.process(new Pe(n))}},{key:"unpatch",value:function(n,t){return this.patch(n,this.reverse(t))}},{key:"clone",value:function(n){return he(n)}}]),v}(),Ce=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},Br=typeof Object.keys=="function"?function(v){return Object.keys(v)}:function(v){var e=[];for(var n in v)Object.prototype.hasOwnProperty.call(v,n)&&e.push(n);return e},Ur=function(e){return e.substr(0,1)==="_"?e.slice(1):e},or=function(e){return e==="_t"?-1:e.substr(0,1)==="_"?parseInt(e.slice(1),10):parseInt(e,10)+.1},$r=function(e,n){return or(e)-or(n)},ae=function(){function v(){m(this,v)}return w(v,[{key:"format",value:function(n,t){var a={};return this.prepareContext(a),this.recurse(a,n,t),this.finalize(a)}},{key:"prepareContext",value:function(n){n.buffer=[],n.out=function(){var t;(t=this.buffer).push.apply(t,arguments)}}},{key:"typeFormattterNotFound",value:function(n,t){throw new Error("cannot format delta type: "+t)}},{key:"typeFormattterErrorFormatter",value:function(n,t){return t.toString()}},{key:"finalize",value:function(n){var t=n.buffer;if(Ce(t))return t.join("")}},{key:"recurse",value:function(n,t,a,r,i,f,s){var u=t&&f,o=u?f.value:a;if(!(typeof t=="undefined"&&typeof r=="undefined")){var h=this.getDeltaType(t,f),d=h==="node"?t._t==="a"?"array":"object":"";typeof r!="undefined"?this.nodeBegin(n,r,i,h,d,s):this.rootBegin(n,h,d);var c=void 0;try{c=this["format_"+h]||this.typeFormattterNotFound(n,h),c.call(this,n,t,o,r,i,f)}catch(y){this.typeFormattterErrorFormatter(n,y,t,o,r,i,f),typeof console!="undefined"&&console.error&&console.error(y.stack)}typeof r!="undefined"?this.nodeEnd(n,r,i,h,d,s):this.rootEnd(n,h,d)}}},{key:"formatDeltaChildren",value:function(n,t,a){var r=this;this.forEachDeltaKey(t,a,function(i,f,s,u){r.recurse(n,t[i],a?a[f]:void 0,i,f,s,u)})}},{key:"forEachDeltaKey",value:function(n,t,a){var r=Br(n),i=n._t==="a",f={},s=void 0;if(typeof t!="undefined")for(s in t)Object.prototype.hasOwnProperty.call(t,s)&&typeof n[s]=="undefined"&&(!i||typeof n["_"+s]=="undefined")&&r.push(s);for(s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var u=n[s];Ce(u)&&u[2]===3&&(f[u[1].toString()]={key:s,value:t&&t[parseInt(s.substr(1))]},this.includeMoveDestinations!==!1&&typeof t=="undefined"&&typeof n[u[1]]=="undefined"&&r.push(u[1].toString()))}i?r.sort($r):r.sort();for(var o=0,h=r.length;o<h;o++){var d=r[o];if(!(i&&d==="_t")){var c=i?typeof d=="number"?d:parseInt(Ur(d),10):d,y=o===h-1;a(d,c,f[c],y)}}}},{key:"getDeltaType",value:function(n,t){if(typeof n=="undefined")return typeof t!="undefined"?"movedestination":"unchanged";if(Ce(n)){if(n.length===1)return"added";if(n.length===2)return"modified";if(n.length===3&&n[2]===0)return"deleted";if(n.length===3&&n[2]===2)return"textdiff";if(n.length===3&&n[2]===3)return"moved"}else if((typeof n=="undefined"?"undefined":g(n))==="object")return"node";return"unknown"}},{key:"parseTextDiff",value:function(n){for(var t=[],a=n.split(`
@@ `),r=0,i=a.length;r<i;r++){var f=a[r],s={pieces:[]},u=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(f).slice(1);s.location={line:u[0],chr:u[1]};for(var o=f.split(`
`).slice(1),h=0,d=o.length;h<d;h++){var c=o[h];if(!!c.length){var y={type:"context"};c.substr(0,1)==="+"?y.type="added":c.substr(0,1)==="-"&&(y.type="deleted"),y.text=c.slice(1),s.pieces.push(y)}}t.push(s)}return t}}]),v}(),Hr=Object.freeze({default:ae}),lr=function(v){A(e,v);function e(){return m(this,e),T(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return w(e,[{key:"typeFormattterErrorFormatter",value:function(t,a){t.out('<pre class="jsondiffpatch-error">'+a+"</pre>")}},{key:"formatValue",value:function(t,a){t.out("<pre>"+ur(JSON.stringify(a,null,2))+"</pre>")}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,f=r.length;i<f;i++){var s=r[i];t.out('<li><div class="jsondiffpatch-textdiff-location">'+('<span class="jsondiffpatch-textdiff-line-number">'+s.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+s.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'));for(var u=s.pieces,o=0,h=u.length;o<h;o++){var d=u[o];t.out('<span class="jsondiffpatch-textdiff-'+d.type+'">'+ur(decodeURI(d.text))+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,a,r){var i="jsondiffpatch-"+a+(r?" jsondiffpatch-child-node-type-"+r:"");t.out('<div class="jsondiffpatch-delta '+i+'">')}},{key:"rootEnd",value:function(t){t.out("</div>"+(t.hasArrows?'<script type="text/javascript">setTimeout('+(hr.toString()+",10);<\/script>"):""))}},{key:"nodeBegin",value:function(t,a,r,i,f){var s="jsondiffpatch-"+i+(f?" jsondiffpatch-child-node-type-"+f:"");t.out('<li class="'+s+'" data-key="'+r+'">'+('<div class="jsondiffpatch-property-name">'+r+"</div>"))}},{key:"nodeEnd",value:function(t){t.out("</li>")}},{key:"format_unchanged",value:function(t,a,r){typeof r!="undefined"&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,r),t.out("</div>"))}},{key:"format_movedestination",value:function(t,a,r){typeof r!="undefined"&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,r),t.out("</div>"))}},{key:"format_node",value:function(t,a,r){var i=a._t==="a"?"array":"object";t.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-'+i+'">'),this.formatDeltaChildren(t,a,r),t.out("</ul>")}},{key:"format_added",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out("</div>")}},{key:"format_modified",value:function(t,a){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,a[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,a[1]),t.out("</div>")}},{key:"format_deleted",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out("</div>")}},{key:"format_moved",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out('</div><div class="jsondiffpatch-moved-destination">'+a[1]+"</div>"),t.out(`<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">
<svg width="30" height="60" style="position: absolute; display: none;">
<defs>
<marker id="markerArrow" markerWidth="8" markerHeight="8"
refx="2" refy="4"
orient="auto" markerUnits="userSpaceOnUse">
<path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />
</marker>
</defs>
<path d="M30,0 Q-10,25 26,50"
style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"
></path>
</svg>
</div>`),t.hasArrows=!0}},{key:"format_textdiff",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,a[0]),t.out("</div>")}}]),e}(ae);function ur(v){for(var e=v,n=[[/&/g,"&amp;"],[/</g,"&lt;"],[/>/g,"&gt;"],[/'/g,"&apos;"],[/"/g,"&quot;"]],t=0;t<n.length;t++)e=e.replace(n[t][0],n[t][1]);return e}var hr=function(e){var n=e||document,t=function(f){var s=f.textContent,u=f.innerText;return s||u},a=function(f,s,u){for(var o=f.querySelectorAll(s),h=0,d=o.length;h<d;h++)u(o[h])},r=function(f,s){for(var u=f.children,o=0,h=u.length;o<h;o++)s(u[o],o)};a(n,".jsondiffpatch-arrow",function(i){var f=i.parentNode,s=i.children,u=i.style,o=f,h=s[0],d=h.children[1];h.style.display="none";var c=t(o.querySelector(".jsondiffpatch-moved-destination")),y=o.parentNode,_=void 0;if(r(y,function(R){R.getAttribute("data-key")===c&&(_=R)}),!!_)try{var b=_.offsetTop-o.offsetTop;h.setAttribute("height",Math.abs(b)+6),u.top=-8+(b>0?0:b)+"px";var O=b>0?"M30,0 Q-10,"+Math.round(b/2)+" 26,"+(b-4):"M30,"+-b+" Q-10,"+Math.round(-b/2)+" 26,4";d.setAttribute("d",O),h.style.display=""}catch(R){}})},vr=function(e,n,t){var a=n||document.body,r="jsondiffpatch-unchanged-",i={showing:r+"showing",hiding:r+"hiding",visible:r+"visible",hidden:r+"hidden"},f=a.classList;if(!!f){if(!t){f.remove(i.showing),f.remove(i.hiding),f.remove(i.visible),f.remove(i.hidden),e===!1&&f.add(i.hidden);return}e===!1?(f.remove(i.showing),f.add(i.visible),setTimeout(function(){f.add(i.hiding)},10)):(f.remove(i.hiding),f.add(i.showing),f.remove(i.hidden));var s=setInterval(function(){hr(a)},100);setTimeout(function(){f.remove(i.showing),f.remove(i.hiding),e===!1?(f.add(i.hidden),f.remove(i.visible)):(f.add(i.visible),f.remove(i.hidden)),setTimeout(function(){f.remove(i.visible),clearInterval(s)},t+400)},t)}},Jr=function(e,n){return vr(!1,e,n)},je=void 0;function zr(v,e){return je||(je=new lr),je.format(v,e)}var Vr=Object.freeze({showUnchanged:vr,hideUnchanged:Jr,default:lr,format:zr}),Z=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!1,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.indent=function(a){this.indentLevel=(this.indentLevel||0)+(typeof a=="undefined"?1:a),this.indentPad=new Array(this.indentLevel+1).join("&nbsp;&nbsp;")},t.row=function(a,r){t.out('<tr><td style="white-space: nowrap;"><pre class="jsondiffpatch-annotated-indent" style="display: inline-block">'),t.out(t.indentPad),t.out('</pre><pre style="display: inline-block">'),t.out(a),t.out('</pre></td><td class="jsondiffpatch-delta-note"><div>'),t.out(r),t.out("</div></td></tr>")}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.row("",'<pre class="jsondiffpatch-error">'+a+"</pre>")}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,f=r.length;i<f;i++){var s=r[i];t.out('<li><div class="jsondiffpatch-textdiff-location">'+('<span class="jsondiffpatch-textdiff-line-number">'+s.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+s.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'));for(var u=s.pieces,o=0,h=u.length;o<h;o++){var d=u[o];t.out('<span class="jsondiffpatch-textdiff-'+d.type+'">'+d.text+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,a,r){t.out('<table class="jsondiffpatch-annotated-delta">'),a==="node"&&(t.row("{"),t.indent()),r==="array"&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"rootEnd",value:function(t,a){a==="node"&&(t.indent(-1),t.row("}")),t.out("</table>")}},{key:"nodeBegin",value:function(t,a,r,i,f){t.row("&quot;"+a+"&quot;: {"),i==="node"&&t.indent(),f==="array"&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"nodeEnd",value:function(t,a,r,i,f,s){i==="node"&&t.indent(-1),t.row("}"+(s?"":","))}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}}]),e}(ae),ce=function(e){return'<pre style="display:inline-block">&quot;'+e+"&quot;</pre>"},Qr={added:function(e,n,t,a){var r=" <pre>([newValue])</pre>";return typeof a=="undefined"?"new value"+r:typeof a=="number"?"insert at index "+a+r:"add property "+ce(a)+r},modified:function(e,n,t,a){var r=" <pre>([previousValue, newValue])</pre>";return typeof a=="undefined"?"modify value"+r:typeof a=="number"?"modify at index "+a+r:"modify property "+ce(a)+r},deleted:function(e,n,t,a){var r=" <pre>([previousValue, 0, 0])</pre>";return typeof a=="undefined"?"delete value"+r:typeof a=="number"?"remove index "+a+r:"delete property "+ce(a)+r},moved:function(e,n,t,a){return'move from <span title="(position to remove at original state)">'+("index "+a+'</span> to <span title="(position to insert at final')+(' state)">index '+e[1]+"</span>")},textdiff:function(e,n,t,a){var r=typeof a=="undefined"?"":typeof a=="number"?" at index "+a:" at property "+ce(a);return"text diff"+r+', format is <a href="https://code.google.com/p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>'}},fe=function(e,n){var t=this.getDeltaType(n),a=Qr[t],r=a&&a.apply(a,Array.prototype.slice.call(arguments,1)),i=JSON.stringify(n,null,2);t==="textdiff"&&(i=i.split("\\n").join(`\\n"+
"`)),e.indent(),e.row(i,r),e.indent(-1)};Z.prototype.format_added=fe,Z.prototype.format_modified=fe,Z.prototype.format_deleted=fe,Z.prototype.format_moved=fe,Z.prototype.format_textdiff=fe;var Me=void 0;function Yr(v,e){return Me||(Me=new Z),Me.format(v,e)}var qr=Object.freeze({default:Z,format:Yr}),ge={add:"add",remove:"remove",replace:"replace",move:"move"},pr=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!0,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.result=[],t.path=[],t.pushCurrentOp=function(a){var r=a.op,i=a.value,f={op:r,path:this.currentPath()};typeof i!="undefined"&&(f.value=i),this.result.push(f)},t.pushMoveOp=function(a){var r=this.currentPath();this.result.push({op:ge.move,from:r,path:this.toPath(a)})},t.currentPath=function(){return"/"+this.path.join("/")},t.toPath=function(a){var r=this.path.slice();return r[r.length-1]=a,"/"+r.join("/")}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.out("[ERROR] "+a)}},{key:"rootBegin",value:function(){}},{key:"rootEnd",value:function(){}},{key:"nodeBegin",value:function(t,a,r){var i=t.path;i.push(r)}},{key:"nodeEnd",value:function(t){var a=t.path;a.pop()}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}},{key:"format_added",value:function(t,a){t.pushCurrentOp({op:ge.add,value:a[0]})}},{key:"format_modified",value:function(t,a){t.pushCurrentOp({op:ge.replace,value:a[1]})}},{key:"format_deleted",value:function(t){t.pushCurrentOp({op:ge.remove})}},{key:"format_moved",value:function(t,a){var r=a[1];t.pushMoveOp(r)}},{key:"format_textdiff",value:function(){throw new Error("Not implemented")}},{key:"format",value:function(t,a){var r={};return this.prepareContext(r),this.recurse(r,t,a),r.result}}]),e}(ae),dr=function(e){return e[e.length-1]},Gr=function(e,n){return e.sort(n),e},Xr=function(e,n){var t=parseInt(e,10),a=parseInt(n,10);return isNaN(t)||isNaN(a)?0:a-t},Wr=function(e){return Gr(e,function(n,t){var a=n.path.split("/"),r=t.path.split("/");return a.length!==r.length?a.length-r.length:Xr(dr(a),dr(r))})},cr=function(e,n){var t=Array(n.length+1).fill().map(function(){return[]});return e.map(function(a){var r=n.map(function(i){return i(a)}).indexOf(!0);return r<0&&(r=n.length),{item:a,position:r}}).reduce(function(a,r){return a[r.position].push(r.item),a},t)},Zr=function(e){var n=e.op;return n==="move"},Kr=function(e){var n=e.op;return n==="remove"},xr=function(e){var n=cr(e,[Zr,Kr]),t=J(n,3),a=t[0],r=t[1],i=t[2],f=Wr(r);return[].concat(I(f),I(a),I(i))},Ne=void 0,gr=function(e,n){return Ne||(Ne=new pr),xr(Ne.format(e,n))},et=function(e,n){console.log(gr(e,n))},rt=Object.freeze({default:pr,partitionOps:cr,format:gr,log:et});function K(v){return p&&p[v]||function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return n}}var x={added:K("green"),deleted:K("red"),movedestination:K("gray"),moved:K("yellow"),unchanged:K("gray"),error:K("white.bgRed"),textDiffLine:K("gray")},mr=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!1,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.indent=function(a){this.indentLevel=(this.indentLevel||0)+(typeof a=="undefined"?1:a),this.indentPad=new Array(this.indentLevel+1).join(" "),this.outLine()},t.outLine=function(){this.buffer.push(`
`+(this.indentPad||""))},t.out=function(){for(var a=arguments.length,r=Array(a),i=0;i<a;i++)r[i]=arguments[i];for(var f=0,s=r.length;f<s;f++){var u=r[f].split(`
`),o=u.join(`
`+(this.indentPad||""));this.color&&this.color[0]&&(o=this.color[0](o)),this.buffer.push(o)}},t.pushColor=function(a){this.color=this.color||[],this.color.unshift(a)},t.popColor=function(){this.color=this.color||[],this.color.shift()}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.pushColor(x.error),t.out("[ERROR]"+a),t.popColor()}},{key:"formatValue",value:function(t,a){t.out(JSON.stringify(a,null,2))}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.indent();for(var i=0,f=r.length;i<f;i++){var s=r[i];t.pushColor(x.textDiffLine),t.out(s.location.line+","+s.location.chr+" "),t.popColor();for(var u=s.pieces,o=0,h=u.length;o<h;o++){var d=u[o];t.pushColor(x[d.type]),t.out(d.text),t.popColor()}i<f-1&&t.outLine()}t.indent(-1)}},{key:"rootBegin",value:function(t,a,r){t.pushColor(x[a]),a==="node"&&(t.out(r==="array"?"[":"{"),t.indent())}},{key:"rootEnd",value:function(t,a,r){a==="node"&&(t.indent(-1),t.out(r==="array"?"]":"}")),t.popColor()}},{key:"nodeBegin",value:function(t,a,r,i,f){t.pushColor(x[i]),t.out(r+": "),i==="node"&&(t.out(f==="array"?"[":"{"),t.indent())}},{key:"nodeEnd",value:function(t,a,r,i,f,s){i==="node"&&(t.indent(-1),t.out(f==="array"?"]":"}"+(s?"":","))),s||t.outLine(),t.popColor()}},{key:"format_unchanged",value:function(t,a,r){typeof r!="undefined"&&this.formatValue(t,r)}},{key:"format_movedestination",value:function(t,a,r){typeof r!="undefined"&&this.formatValue(t,r)}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}},{key:"format_added",value:function(t,a){this.formatValue(t,a[0])}},{key:"format_modified",value:function(t,a){t.pushColor(x.deleted),this.formatValue(t,a[0]),t.popColor(),t.out(" => "),t.pushColor(x.added),this.formatValue(t,a[1]),t.popColor()}},{key:"format_deleted",value:function(t,a){this.formatValue(t,a[0])}},{key:"format_moved",value:function(t,a){t.out("==> "+a[1])}},{key:"format_textdiff",value:function(t,a){this.formatTextDiffString(t,a[0])}}]),e}(ae),ke=void 0,yr=function(e,n){return ke||(ke=new mr),ke.format(e,n)};function tt(v,e){console.log(yr(v,e))}var _r=Object.freeze({default:mr,format:yr,log:tt}),nt=Object.freeze({base:Hr,html:Vr,annotated:qr,jsonpatch:rt,console:_r});function it(v,e){var n=void 0;return typeof e=="string"&&(n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+-])(\d{2}):(\d{2}))$/.exec(e),n)?new Date(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4],+n[5],+n[6],+(n[7]||0))):e}function at(v){return new W(v)}var U=void 0;function ft(){return U||(U=new W),U.diff.apply(U,arguments)}function st(){return U||(U=new W),U.patch.apply(U,arguments)}function ot(){return U||(U=new W),U.unpatch.apply(U,arguments)}function lt(){return U||(U=new W),U.reverse.apply(U,arguments)}function ut(){return U||(U=new W),U.clone.apply(U,arguments)}l.DiffPatcher=W,l.formatters=nt,l.console=_r,l.create=at,l.dateReviver=it,l.diff=ft,l.patch=st,l.unpatch=ot,l.reverse=lt,l.clone=ut,Object.defineProperty(l,"__esModule",{value:!0})})});var Nt={};Fe(Nt,{createLiveJsonHooks:()=>Mt});var Ie={};Fe(Ie,{JsonPatchError:()=>S,_areEquals:()=>le,applyOperation:()=>ee,applyPatch:()=>ne,applyReducer:()=>At,deepClone:()=>wt,getValueByPointer:()=>Ae,validate:()=>Or,validator:()=>Oe});var yt=function(){var l=function(p,g){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,w){m.__proto__=w}||function(m,w){for(var E in w)w.hasOwnProperty(E)&&(m[E]=w[E])},l(p,g)};return function(p,g){l(p,g);function m(){this.constructor=p}p.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}}(),_t=Object.prototype.hasOwnProperty;function ye(l,p){return _t.call(l,p)}function _e(l){if(Array.isArray(l)){for(var p=new Array(l.length),g=0;g<p.length;g++)p[g]=""+g;return p}if(Object.keys)return Object.keys(l);var m=[];for(var w in l)ye(l,w)&&m.push(w);return m}function V(l){switch(typeof l){case"object":return JSON.parse(JSON.stringify(l));case"undefined":return null;default:return l}}function we(l){for(var p=0,g=l.length,m;p<g;){if(m=l.charCodeAt(p),m>=48&&m<=57){p++;continue}return!1}return!0}function q(l){return l.indexOf("/")===-1&&l.indexOf("~")===-1?l:l.replace(/~/g,"~0").replace(/\//g,"~1")}function se(l){return l.replace(/~1/g,"/").replace(/~0/g,"~")}function be(l){if(l===void 0)return!0;if(l){if(Array.isArray(l)){for(var p=0,g=l.length;p<g;p++)if(be(l[p]))return!0}else if(typeof l=="object"){for(var m=_e(l),w=m.length,E=0;E<w;E++)if(be(l[m[E]]))return!0}}return!1}function Ar(l,p){var g=[l];for(var m in p){var w=typeof p[m]=="object"?JSON.stringify(p[m],null,2):p[m];typeof w!="undefined"&&g.push(m+": "+w)}return g.join(`
`)}var oe=function(l){yt(p,l);function p(g,m,w,E,A){var T=this.constructor,J=l.call(this,Ar(g,{name:m,index:w,operation:E,tree:A}))||this;return J.name=m,J.index=w,J.operation=E,J.tree=A,Object.setPrototypeOf(J,T.prototype),J.message=Ar(g,{name:m,index:w,operation:E,tree:A}),J}return p}(Error);var S=oe,wt=V,te={add:function(l,p,g){return l[p]=this.value,{newDocument:g}},remove:function(l,p,g){var m=l[p];return delete l[p],{newDocument:g,removed:m}},replace:function(l,p,g){var m=l[p];return l[p]=this.value,{newDocument:g,removed:m}},move:function(l,p,g){var m=Ae(g,this.path);m&&(m=V(m));var w=ee(g,{op:"remove",path:this.from}).removed;return ee(g,{op:"add",path:this.path,value:w}),{newDocument:g,removed:m}},copy:function(l,p,g){var m=Ae(g,this.from);return ee(g,{op:"add",path:this.path,value:V(m)}),{newDocument:g}},test:function(l,p,g){return{newDocument:g,test:le(l[p],this.value)}},_get:function(l,p,g){return this.value=l[p],{newDocument:g}}},bt={add:function(l,p,g){return we(p)?l.splice(p,0,this.value):l[p]=this.value,{newDocument:g,index:p}},remove:function(l,p,g){var m=l.splice(p,1);return{newDocument:g,removed:m[0]}},replace:function(l,p,g){var m=l[p];return l[p]=this.value,{newDocument:g,removed:m}},move:te.move,copy:te.copy,test:te.test,_get:te._get};function Ae(l,p){if(p=="")return l;var g={op:"_get",path:p};return ee(l,g),g.value}function ee(l,p,g,m,w,E){if(g===void 0&&(g=!1),m===void 0&&(m=!0),w===void 0&&(w=!0),E===void 0&&(E=0),g&&(typeof g=="function"?g(p,0,l,p.path):Oe(p,0)),p.path===""){var A={newDocument:l};if(p.op==="add")return A.newDocument=p.value,A;if(p.op==="replace")return A.newDocument=p.value,A.removed=l,A;if(p.op==="move"||p.op==="copy")return A.newDocument=Ae(l,p.from),p.op==="move"&&(A.removed=l),A;if(p.op==="test"){if(A.test=le(l,p.value),A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,l);return A.newDocument=l,A}else{if(p.op==="remove")return A.removed=l,A.newDocument=null,A;if(p.op==="_get")return p.value=l,A;if(g)throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",E,p,l);return A}}else{m||(l=V(l));var T=p.path||"",J=T.split("/"),I=l,M=1,H=J.length,z=void 0,B=void 0,ie=void 0;for(typeof g=="function"?ie=g:ie=Oe;;){if(B=J[M],B&&B.indexOf("~")!=-1&&(B=se(B)),w&&(B=="__proto__"||B=="prototype"&&M>0&&J[M-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(g&&z===void 0&&(I[B]===void 0?z=J.slice(0,M).join("/"):M==H-1&&(z=p.path),z!==void 0&&ie(p,0,l,z)),M++,Array.isArray(I)){if(B==="-")B=I.length;else{if(g&&!we(B))throw new S("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",E,p,l);we(B)&&(B=~~B)}if(M>=H){if(g&&p.op==="add"&&B>I.length)throw new S("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",E,p,l);var A=bt[p.op].call(p,I,B,l);if(A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,l);return A}}else if(M>=H){var A=te[p.op].call(p,I,B,l);if(A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,l);return A}if(I=I[B],g&&M<H&&(!I||typeof I!="object"))throw new S("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",E,p,l)}}}function ne(l,p,g,m,w){if(m===void 0&&(m=!0),w===void 0&&(w=!0),g&&!Array.isArray(p))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");m||(l=V(l));for(var E=new Array(p.length),A=0,T=p.length;A<T;A++)E[A]=ee(l,p[A],g,!0,w,A),l=E[A].newDocument;return E.newDocument=l,E}function At(l,p,g){var m=ee(l,p);if(m.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",g,p,l);return m.newDocument}function Oe(l,p,g,m){if(typeof l!="object"||l===null||Array.isArray(l))throw new S("Operation is not an object","OPERATION_NOT_AN_OBJECT",p,l,g);if(te[l.op]){if(typeof l.path!="string")throw new S("Operation `path` property is not a string","OPERATION_PATH_INVALID",p,l,g);if(l.path.indexOf("/")!==0&&l.path.length>0)throw new S('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",p,l,g);if((l.op==="move"||l.op==="copy")&&typeof l.from!="string")throw new S("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",p,l,g);if((l.op==="add"||l.op==="replace"||l.op==="test")&&l.value===void 0)throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",p,l,g);if((l.op==="add"||l.op==="replace"||l.op==="test")&&be(l.value))throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",p,l,g);if(g){if(l.op=="add"){var w=l.path.split("/").length,E=m.split("/").length;if(w!==E+1&&w!==E)throw new S("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",p,l,g)}else if(l.op==="replace"||l.op==="remove"||l.op==="_get"){if(l.path!==m)throw new S("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",p,l,g)}else if(l.op==="move"||l.op==="copy"){var A={op:"_get",path:l.from,value:void 0},T=Or([A],g);if(T&&T.name==="OPERATION_PATH_UNRESOLVABLE")throw new S("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",p,l,g)}}}else throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,l,g)}function Or(l,p,g){try{if(!Array.isArray(l))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(p)ne(V(p),V(l),g||!0);else{g=g||Oe;for(var m=0;m<l.length;m++)g(l[m],m,p,void 0)}}catch(w){if(w instanceof S)return w;throw w}}function le(l,p){if(l===p)return!0;if(l&&p&&typeof l=="object"&&typeof p=="object"){var g=Array.isArray(l),m=Array.isArray(p),w,E,A;if(g&&m){if(E=l.length,E!=p.length)return!1;for(w=E;w--!=0;)if(!le(l[w],p[w]))return!1;return!0}if(g!=m)return!1;var T=Object.keys(l);if(E=T.length,E!==Object.keys(p).length)return!1;for(w=E;w--!=0;)if(!p.hasOwnProperty(T[w]))return!1;for(w=E;w--!=0;)if(A=T[w],!le(l[A],p[A]))return!1;return!0}return l!==l&&p!==p}var Ue={};Fe(Ue,{compare:()=>jt,generate:()=>Le,observe:()=>Ct,unobserve:()=>Dt});var Se=new WeakMap,Ot=function(){function l(p){this.observers=new Map,this.obj=p}return l}(),Et=function(){function l(p,g){this.callback=p,this.observer=g}return l}();function Rt(l){return Se.get(l)}function Pt(l,p){return l.observers.get(p)}function Tt(l,p){l.observers.delete(p.callback)}function Dt(l,p){p.unobserve()}function Ct(l,p){var g=[],m,w=Rt(l);if(!w)w=new Ot(l),Se.set(l,w);else{var E=Pt(w,p);m=E&&E.observer}if(m)return m;if(m={},w.value=V(l),p){m.callback=p,m.next=null;var A=function(){Le(m)},T=function(){clearTimeout(m.next),m.next=setTimeout(A)};typeof window!="undefined"&&(window.addEventListener("mouseup",T),window.addEventListener("keyup",T),window.addEventListener("mousedown",T),window.addEventListener("keydown",T),window.addEventListener("change",T))}return m.patches=g,m.object=l,m.unobserve=function(){Le(m),clearTimeout(m.next),Tt(w,m),typeof window!="undefined"&&(window.removeEventListener("mouseup",T),window.removeEventListener("keyup",T),window.removeEventListener("mousedown",T),window.removeEventListener("keydown",T),window.removeEventListener("change",T))},w.observers.set(p,new Et(p,m)),m}function Le(l,p){p===void 0&&(p=!1);var g=Se.get(l.object);Be(g.value,l.object,l.patches,"",p),l.patches.length&&ne(g.value,l.patches);var m=l.patches;return m.length>0&&(l.patches=[],l.callback&&l.callback(m)),m}function Be(l,p,g,m,w){if(p!==l){typeof p.toJSON=="function"&&(p=p.toJSON());for(var E=_e(p),A=_e(l),T=!1,J=!1,I=A.length-1;I>=0;I--){var M=A[I],H=l[M];if(ye(p,M)&&!(p[M]===void 0&&H!==void 0&&Array.isArray(p)===!1)){var z=p[M];typeof H=="object"&&H!=null&&typeof z=="object"&&z!=null&&Array.isArray(H)===Array.isArray(z)?Be(H,z,g,m+"/"+q(M),w):H!==z&&(T=!0,w&&g.push({op:"test",path:m+"/"+q(M),value:V(H)}),g.push({op:"replace",path:m+"/"+q(M),value:V(z)}))}else Array.isArray(l)===Array.isArray(p)?(w&&g.push({op:"test",path:m+"/"+q(M),value:V(H)}),g.push({op:"remove",path:m+"/"+q(M)}),J=!0):(w&&g.push({op:"test",path:m,value:l}),g.push({op:"replace",path:m,value:p}),T=!0)}if(!(!J&&E.length==A.length))for(var I=0;I<E.length;I++){var M=E[I];!ye(l,M)&&p[M]!==void 0&&g.push({op:"add",path:m+"/"+q(M),value:V(p[M])})}}}function jt(l,p,g){g===void 0&&(g=!1);var m=[];return Be(l,p,m,"",g),m}var Ut=Object.assign({},Ie,Ue,{JsonPatchError:oe,deepClone:V,escapePathComponent:q,unescapePathComponent:se});var Tr=mt(Pr());function ue(l){let p;typeof window.CustomEvent=="function"?p=new window.CustomEvent(l,{}):(p=document.createEvent("Event"),p.initEvent(l,!1,!0)),window.dispatchEvent(p)}function Mt(){return{LiveJSON:{mounted(){this.handleEvent("lj:patch",({doc_name:l,patch:p,method:g})=>{g=="rfc"?window[l]=ne(window[l],p).newDocument:window[l]=Tr.patch(window[l],p),ue(l+"_patched")}),this.handleEvent("lj:init",({doc_name:l,data:p})=>{window[l]=p,ue(l+"_initialized")}),this.handleEvent("lj:assign",({doc_name:l,data:p})=>{window[l]=p,ue(l+"_assigned")}),this.handleEvent("lj:append",({doc_name:l,data:p})=>{l in window||(window[l]=[]),window[l].push(p),ue(l+"_appended")}),this.handleEvent("lj:put",({doc_name:l,key:p,value:g})=>{l in window||(window[l]={}),window[l].set(p,g),ue(l+"_put")})}}}}return Nt;})();
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/