@embedder/embedder 2.0.7 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import e from"stream";import{r as t,e as n}from"./cli-BN-cw-1f.js";import r from"tty";import s from"util";function o(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var i,a,c,p={},d={exports:{}},l={exports:{}};function u(){if(a)return i;return a=1,i=function(e){function n(e){let t,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(t||s);r.diff=o,r.prev=t,r.curr=s,t=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";i++;const o=n.formatters[s];if("function"==typeof o){const n=e[i];t=o.call(r,n),e.splice(i,1),i--}return t}),n.formatArgs.call(r,e);(r.log||n.log).apply(r,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=r,a.destroy=n.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==n.namespaces&&(s=n.namespaces,o=n.enabled(e)),o),set:e=>{i=e}}),"function"==typeof n.init&&n.init(a),a}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,o=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names,...n.skips.map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const r of t)"-"===r[0]?n.skips.push(r.slice(1)):n.names.push(r)},n.enabled=function(e){for(const t of n.skips)if(s(e,t))return!1;for(const t of n.names)if(s(e,t))return!0;return!1},n.humanize=t(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}}var h,f,g,C={exports:{}};function b(){return h||(h=1,function(e,t){const o=r,i=s;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(i.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),o=` ${s};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(s+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):o.isatty(process.stderr.fd)},t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(c){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=u()(t);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(C,C.exports)),C.exports}function m(){return f||(f=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?d.exports=(c||(c=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=u()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(l,l.exports)),l.exports):d.exports=b()),d.exports}const F=o({__proto__:null},[function(){if(g)return p;g=1;var t=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.SerialPortStream=p.DisconnectedError=void 0;const n=e,r=(0,t(m()).default)("serialport/stream");class s extends Error{disconnected;constructor(e){super(e),this.disconnected=!0}}p.DisconnectedError=s;const o={brk:!1,cts:!1,dtr:!0,rts:!0};function i(e){const t=Buffer.allocUnsafe(e);return t.used=0,t}class a extends n.Duplex{port;_pool;_kMinPoolSpace;opening;closing;settings;constructor(e,t){const n={autoOpen:!0,endOnClose:!1,highWaterMark:65536,...e};if(super({highWaterMark:n.highWaterMark}),!n.binding)throw new TypeError('"Bindings" is invalid pass it as `options.binding`');if(!n.path)throw new TypeError(`"path" is not defined: ${n.path}`);if("number"!=typeof n.baudRate)throw new TypeError(`"baudRate" must be a number: ${n.baudRate}`);this.settings=n,this.opening=!1,this.closing=!1,this._pool=i(this.settings.highWaterMark),this._kMinPoolSpace=128,this.settings.autoOpen&&this.open(t)}get path(){return this.settings.path}get baudRate(){return this.settings.baudRate}get isOpen(){return(this.port?.isOpen??!1)&&!this.closing}_error(e,t){t?t.call(this,e):this.emit("error",e)}_asyncError(e,t){process.nextTick(()=>this._error(e,t))}open(e){if(this.isOpen)return this._asyncError(new Error("Port is already open"),e);if(this.opening)return this._asyncError(new Error("Port is opening"),e);const{highWaterMark:t,binding:n,autoOpen:s,endOnClose:o,...i}=this.settings;this.opening=!0,r("opening",`path: ${this.path}`),this.settings.binding.open(i).then(t=>{r("opened",`path: ${this.path}`),this.port=t,this.opening=!1,this.emit("open"),e&&e.call(this,null)},t=>{this.opening=!1,r("Binding #open had an error",t),this._error(t,e)})}update(e,t){if(!this.isOpen||!this.port)return r("update attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);r("update",`baudRate: ${e.baudRate}`),this.port.update(e).then(()=>{r("binding.update","finished"),this.settings.baudRate=e.baudRate,t&&t.call(this,null)},e=>(r("binding.update","error",e),this._error(e,t)))}write(e,t,n){return Array.isArray(e)&&(e=Buffer.from(e)),"function"==typeof t?super.write(e,t):super.write(e,t,n)}_write(e,t,n){this.isOpen&&this.port?(r("_write",`${e.length} bytes of data`),this.port.write(e).then(()=>{r("binding.write","write finished"),n(null)},e=>{r("binding.write","error",e),e.canceled||this._disconnected(e),n(e)})):this.once("open",()=>{this._write(e,t,n)})}_writev(e,t){r("_writev",`${e.length} chunks of data`);const n=e.map(e=>e.chunk);this._write(Buffer.concat(n),"binary",t)}_read(e){if(!this.isOpen||!this.port)return r("_read","queueing _read for after open"),void this.once("open",()=>{this._read(e)});(!this._pool||this._pool.length-this._pool.used<this._kMinPoolSpace)&&(r("_read","discarding the read buffer pool because it is below kMinPoolSpace"),this._pool=i(this.settings.highWaterMark));const t=this._pool,n=Math.min(t.length-t.used,e),s=t.used;r("_read","reading",{start:s,toRead:n}),this.port.read(t,s,n).then(({bytesRead:e})=>{if(r("binding.read","finished",{bytesRead:e}),0===e)return r("binding.read","Zero bytes read closing readable stream"),void this.push(null);t.used+=e,this.push(t.slice(s,s+e))},t=>{r("binding.read","error",t),t.canceled||this._disconnected(t),this._read(e)})}_disconnected(e){this.isOpen?(r("disconnected",e),this.close(void 0,new s(e.message))):r("disconnected aborted because already closed",e)}close(e,t=null){if(!this.isOpen||!this.port)return r("close attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);this.closing=!0,r("#close"),this.port.close().then(()=>{this.closing=!1,r("binding.close","finished"),this.emit("close",t),this.settings.endOnClose&&this.emit("end"),e&&e.call(this,t)},t=>(this.closing=!1,r("binding.close","had an error",t),this._error(t,e)))}set(e,t){if(!this.isOpen||!this.port)return r("set attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);const n={...o,...e};r("#set",n),this.port.set(n).then(()=>{r("binding.set","finished"),t&&t.call(this,null)},e=>(r("binding.set","had an error",e),this._error(e,t)))}get(e){if(!this.isOpen||!this.port)return r("get attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#get"),this.port.get().then(t=>{r("binding.get","finished"),e.call(this,null,t)},t=>(r("binding.get","had an error",t),this._error(t,e)))}flush(e){if(!this.isOpen||!this.port)return r("flush attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#flush"),this.port.flush().then(()=>{r("binding.flush","finished"),e&&e.call(this,null)},t=>(r("binding.flush","had an error",t),this._error(t,e)))}drain(e){if(r("drain"),!this.isOpen||!this.port)return r("drain queuing on port open"),void this.once("open",()=>{this.drain(e)});this.port.drain().then(()=>{r("binding.drain","finished"),e&&e.call(this,null)},t=>(r("binding.drain","had an error",t),this._error(t,e)))}}return p.SerialPortStream=a,p}()]);export{F as i};
1
+ import e from"stream";import{r as t,e as n}from"./cli-a9hYDLWp.js";import r from"tty";import s from"util";function o(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var i,a,c,p={},d={exports:{}},l={exports:{}};function u(){if(a)return i;return a=1,i=function(e){function n(e){let t,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(t||s);r.diff=o,r.prev=t,r.curr=s,t=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";i++;const o=n.formatters[s];if("function"==typeof o){const n=e[i];t=o.call(r,n),e.splice(i,1),i--}return t}),n.formatArgs.call(r,e);(r.log||n.log).apply(r,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=r,a.destroy=n.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==n.namespaces&&(s=n.namespaces,o=n.enabled(e)),o),set:e=>{i=e}}),"function"==typeof n.init&&n.init(a),a}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,o=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names,...n.skips.map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const r of t)"-"===r[0]?n.skips.push(r.slice(1)):n.names.push(r)},n.enabled=function(e){for(const t of n.skips)if(s(e,t))return!1;for(const t of n.names)if(s(e,t))return!0;return!1},n.humanize=t(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}}var h,f,g,C={exports:{}};function b(){return h||(h=1,function(e,t){const o=r,i=s;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(i.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),o=` ${s};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(s+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):o.isatty(process.stderr.fd)},t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(c){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=u()(t);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(C,C.exports)),C.exports}function m(){return f||(f=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?d.exports=(c||(c=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=u()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(l,l.exports)),l.exports):d.exports=b()),d.exports}const F=o({__proto__:null},[function(){if(g)return p;g=1;var t=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.SerialPortStream=p.DisconnectedError=void 0;const n=e,r=(0,t(m()).default)("serialport/stream");class s extends Error{disconnected;constructor(e){super(e),this.disconnected=!0}}p.DisconnectedError=s;const o={brk:!1,cts:!1,dtr:!0,rts:!0};function i(e){const t=Buffer.allocUnsafe(e);return t.used=0,t}class a extends n.Duplex{port;_pool;_kMinPoolSpace;opening;closing;settings;constructor(e,t){const n={autoOpen:!0,endOnClose:!1,highWaterMark:65536,...e};if(super({highWaterMark:n.highWaterMark}),!n.binding)throw new TypeError('"Bindings" is invalid pass it as `options.binding`');if(!n.path)throw new TypeError(`"path" is not defined: ${n.path}`);if("number"!=typeof n.baudRate)throw new TypeError(`"baudRate" must be a number: ${n.baudRate}`);this.settings=n,this.opening=!1,this.closing=!1,this._pool=i(this.settings.highWaterMark),this._kMinPoolSpace=128,this.settings.autoOpen&&this.open(t)}get path(){return this.settings.path}get baudRate(){return this.settings.baudRate}get isOpen(){return(this.port?.isOpen??!1)&&!this.closing}_error(e,t){t?t.call(this,e):this.emit("error",e)}_asyncError(e,t){process.nextTick(()=>this._error(e,t))}open(e){if(this.isOpen)return this._asyncError(new Error("Port is already open"),e);if(this.opening)return this._asyncError(new Error("Port is opening"),e);const{highWaterMark:t,binding:n,autoOpen:s,endOnClose:o,...i}=this.settings;this.opening=!0,r("opening",`path: ${this.path}`),this.settings.binding.open(i).then(t=>{r("opened",`path: ${this.path}`),this.port=t,this.opening=!1,this.emit("open"),e&&e.call(this,null)},t=>{this.opening=!1,r("Binding #open had an error",t),this._error(t,e)})}update(e,t){if(!this.isOpen||!this.port)return r("update attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);r("update",`baudRate: ${e.baudRate}`),this.port.update(e).then(()=>{r("binding.update","finished"),this.settings.baudRate=e.baudRate,t&&t.call(this,null)},e=>(r("binding.update","error",e),this._error(e,t)))}write(e,t,n){return Array.isArray(e)&&(e=Buffer.from(e)),"function"==typeof t?super.write(e,t):super.write(e,t,n)}_write(e,t,n){this.isOpen&&this.port?(r("_write",`${e.length} bytes of data`),this.port.write(e).then(()=>{r("binding.write","write finished"),n(null)},e=>{r("binding.write","error",e),e.canceled||this._disconnected(e),n(e)})):this.once("open",()=>{this._write(e,t,n)})}_writev(e,t){r("_writev",`${e.length} chunks of data`);const n=e.map(e=>e.chunk);this._write(Buffer.concat(n),"binary",t)}_read(e){if(!this.isOpen||!this.port)return r("_read","queueing _read for after open"),void this.once("open",()=>{this._read(e)});(!this._pool||this._pool.length-this._pool.used<this._kMinPoolSpace)&&(r("_read","discarding the read buffer pool because it is below kMinPoolSpace"),this._pool=i(this.settings.highWaterMark));const t=this._pool,n=Math.min(t.length-t.used,e),s=t.used;r("_read","reading",{start:s,toRead:n}),this.port.read(t,s,n).then(({bytesRead:e})=>{if(r("binding.read","finished",{bytesRead:e}),0===e)return r("binding.read","Zero bytes read closing readable stream"),void this.push(null);t.used+=e,this.push(t.slice(s,s+e))},t=>{r("binding.read","error",t),t.canceled||this._disconnected(t),this._read(e)})}_disconnected(e){this.isOpen?(r("disconnected",e),this.close(void 0,new s(e.message))):r("disconnected aborted because already closed",e)}close(e,t=null){if(!this.isOpen||!this.port)return r("close attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);this.closing=!0,r("#close"),this.port.close().then(()=>{this.closing=!1,r("binding.close","finished"),this.emit("close",t),this.settings.endOnClose&&this.emit("end"),e&&e.call(this,t)},t=>(this.closing=!1,r("binding.close","had an error",t),this._error(t,e)))}set(e,t){if(!this.isOpen||!this.port)return r("set attempted, but port is not open"),this._asyncError(new Error("Port is not open"),t);const n={...o,...e};r("#set",n),this.port.set(n).then(()=>{r("binding.set","finished"),t&&t.call(this,null)},e=>(r("binding.set","had an error",e),this._error(e,t)))}get(e){if(!this.isOpen||!this.port)return r("get attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#get"),this.port.get().then(t=>{r("binding.get","finished"),e.call(this,null,t)},t=>(r("binding.get","had an error",t),this._error(t,e)))}flush(e){if(!this.isOpen||!this.port)return r("flush attempted, but port is not open"),this._asyncError(new Error("Port is not open"),e);r("#flush"),this.port.flush().then(()=>{r("binding.flush","finished"),e&&e.call(this,null)},t=>(r("binding.flush","had an error",t),this._error(t,e)))}drain(e){if(r("drain"),!this.isOpen||!this.port)return r("drain queuing on port open"),void this.once("open",()=>{this.drain(e)});this.port.drain().then(()=>{r("binding.drain","finished"),e&&e.call(this,null)},t=>(r("binding.drain","had an error",t),this._error(t,e)))}}return p.SerialPortStream=a,p}()]);export{F as i};
@@ -1 +1 @@
1
- import{D as e,t}from"./cli-BN-cw-1f.js";import{b as n,c as r,d as s,a as i,f as o,l,s as u}from"./cli-BN-cw-1f.js";import"./_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"fs";import"crypto";import"os";import"path";import"http";import"node:path";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"util";import"stream";import"buffer";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"perf_hooks";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";const a=new class extends e{};function c(e,t,n){return a.diff(e,t,n)}function f(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function h(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function p(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function d(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function g(e,t){return p(e,t,"")}function m(e,t){return d(e,t,"")}function v(e,t){return t.slice(0,function(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);const s=Array(r);let i=0;s[0]=0;for(let o=1;o<r;o++){for(t[o]==t[i]?s[o]=s[i]:s[o]=i;i>0&&t[o]!=t[i];)i=s[i];t[o]==t[i]&&i++}i=0;for(let o=n;o<e.length;o++){for(;i>0&&e[o]!=t[i];)i=s[i];e[o]==t[i]&&i++}return i}(e,t))}function w(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function y(e){const t=e.match(/^\s*/);return t?t[0]:""}const k="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",b=new RegExp(`[${k}]+|\\s+|[^${k}]`,"ug");const L=new class extends e{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){const r=t.intlSegmenter;if("word"!=r.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(r.segment(e),e=>e.segment)}else n=e.match(b)||[];const r=[];let s=null;return n.forEach(e=>{/\s/.test(e)?null==s?r.push(e):r.push(r.pop()+e):null!=s&&/\s/.test(s)?r[r.length-1]==s?r.push(r.pop()+e):r.push(s+e):r.push(e),s=e}),r}join(e){return e.map((e,t)=>0==t?e:e.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,s=null;return e.forEach(e=>{e.added?r=e:e.removed?s=e:((r||s)&&S(n,s,r,e),n=e,r=null,s=null)}),(r||s)&&S(n,s,r,null),e}};function j(e,t,n){return null==(null==n?void 0:n.ignoreWhitespace)||n.ignoreWhitespace?L.diff(e,t,n):E(e,t,n)}function S(e,t,n,r){if(t&&n){const s=y(t.value),i=w(t.value),o=y(n.value),l=w(n.value);if(e){const r=f(s,o);e.value=d(e.value,o,r),t.value=g(t.value,r),n.value=g(n.value,r)}if(r){const e=h(i,l);r.value=p(r.value,l,e),t.value=m(t.value,e),n.value=m(n.value,e)}}else if(n){if(e){const e=y(n.value);n.value=n.value.substring(e.length)}if(r){const e=y(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){const n=y(r.value),s=y(t.value),i=w(t.value),o=f(n,s);t.value=g(t.value,o);const l=h(g(n,o),i);t.value=m(t.value,l),r.value=p(r.value,n,l),e.value=d(e.value,n,n.slice(0,n.length-l.length))}else if(r){const e=y(r.value),n=v(w(t.value),e);t.value=m(t.value,n)}else if(e){const n=v(w(e.value),y(t.value));t.value=g(t.value,n)}}const O=new class extends e{tokenize(e){const t=new RegExp(`(\\r?\\n)|[${k}]+|[^\\S\\n\\r]+|[^${k}]`,"ug");return e.match(t)||[]}};function E(e,t,n){return O.diff(e,t,n)}function A(e){return"."==e||"!"==e||"?"==e}const F=new class extends e{tokenize(e){var t;const n=[];let r=0;for(let s=0;s<e.length;s++){if(s==e.length-1){n.push(e.slice(r));break}if(A(e[s])&&e[s+1].match(/\s/)){for(n.push(e.slice(r,s+1)),s=r=s+1;null===(t=e[s+1])||void 0===t?void 0:t.match(/\s/);)s++;n.push(e.slice(r,s+1)),r=s+1}}return n}};function x(e,t,n){return F.diff(e,t,n)}const $=new class extends e{tokenize(e){return e.split(/([{}:;,]|\s+)/)}};function W(e,t,n){return $.diff(e,t,n)}const N=new class extends e{constructor(){super(...arguments),this.tokenize=t}get useLongestToken(){return!0}castInput(e,t){const{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>void 0===t?n:t}=t;return"string"==typeof e?e:JSON.stringify(_(e,null,null,r),null," ")}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)}};function z(e,t,n){return N.diff(e,t,n)}function _(e,t,n,r,s){let i,o;for(t=t||[],n=n||[],r&&(e=r(void 0===s?"":s,e)),i=0;i<t.length;i+=1)if(t[i]===e)return n[i];if("[object Array]"===Object.prototype.toString.call(e)){for(t.push(e),o=new Array(e.length),n.push(o),i=0;i<e.length;i+=1)o[i]=_(e[i],t,n,r,String(i));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"==typeof e&&null!==e){t.push(e),o={},n.push(o);const s=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&s.push(l);for(s.sort(),i=0;i<s.length;i+=1)l=s[i],o[l]=_(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}const C=new class extends e{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function H(e,t,n){return C.diff(e,t,n)}function J(e){return Array.isArray(e)?e.map(e=>J(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function P(e){return Array.isArray(e)?e.map(e=>P(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function I(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else{if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,l=0;for(;r<t.length&&(l<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?l++:" "===e&&(o++,l++)}if(o||1!==i.newLines||(i.newLines=0),l||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(l!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function D(e,t,n){let r=!0,s=!1,i=!1,o=1;return function l(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,l())}}function R(e,t,n={}){let r;if(r="string"==typeof t?I(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&((r=e).includes("\r\n")&&!r.startsWith("\n")&&!r.match(/[^\r]\n/)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=J(t):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=P(t)));var r;const s=e.split("\n"),i=t.hunks,o=n.compareLine||((e,t,n,r)=>t===r),l=n.fuzzFactor||0;let u=0;if(l<0||!Number.isInteger(l))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return e;let a="",c=!1,f=!1;for(let g=0;g<i[i.length-1].lines.length;g++){const e=i[i.length-1].lines[g];"\\"==e[0]&&("+"==a[0]?c=!0:"-"==a[0]&&(f=!0)),a=e}if(c){if(f){if(!l&&""==s[s.length-1])return!1}else if(""==s[s.length-1])s.pop();else if(!l)return!1}else if(f)if(""!=s[s.length-1])s.push("");else if(!l)return!1;function h(e,t,n,r=0,i=!0,l=[],u=0){let a=0,c=!1;for(;r<e.length;r++){const f=e[r],p=f.length>0?f[0]:" ",d=f.length>0?f.substr(1):f;if("-"===p){if(!o(t+1,s[t],p,d))return n&&null!=s[t]?(l[u]=s[t],h(e,t+1,n-1,r,!1,l,u+1)):null;t++,a=0}if("+"===p){if(!i)return null;l[u]=d,u++,a=0,c=!0}if(" "===p){if(a++,l[u]=s[t],!o(t+1,s[t],p,d))return c||!n?null:s[t]&&(h(e,t+1,n-1,r+1,!1,l,u+1)||h(e,t+1,n-1,r,!1,l,u+1))||h(e,t,n-1,r+1,!1,l,u);u++,i=!0,c=!1,t++}}return u-=a,t-=a,l.length=u,{patchedLines:l,oldLineLastI:t-1}}const p=[];let d=0;for(let g=0;g<i.length;g++){const e=i[g];let t;const n=s.length-e.oldLines+l;let r;for(let s=0;s<=l;s++){r=e.oldStart+d-1;const i=D(r,u,n);for(;void 0!==r&&(t=h(e.lines,r,s),!t);r=i());if(t)break}if(!t)return!1;for(let i=u;i<r;i++)p.push(s[i]);for(let s=0;s<t.patchedLines.length;s++){const e=t.patchedLines[s];p.push(e)}u=t.oldLineLastI+1,d=r+1-e.oldStart}for(let g=u;g<s.length;g++)p.push(s[g]);return p.join("\n")}(e,r[0],n)}function T(e,t){const n="string"==typeof e?I(e):e;let r=0;!function e(){const s=n[r++];if(!s)return t.complete();t.loadFile(s,function(n,r){if(n)return t.complete(n);const i=R(r,s,t);t.patched(s,i,function(n){if(n)return t.complete(n);e()})})}()}function q(e){return Array.isArray(e)?e.map(e=>q(e)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(e=>e.startsWith("-")?`+${e.slice(1)}`:e.startsWith("+")?`-${e.slice(1)}`:e)}))})}function U(e){const t=[];let n,r;for(let s=0;s<e.length;s++)n=e[s],r=n.added?1:n.removed?-1:0,t.push([r,n.value]);return t}function Z(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(B(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function B(e){let t=e;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t=t.replace(/"/g,"&quot;"),t}export{e as Diff,R as applyPatch,T as applyPatches,C as arrayDiff,_ as canonicalize,a as characterDiff,U as convertChangesToDMP,Z as convertChangesToXML,n as createPatch,r as createTwoFilesPatch,$ as cssDiff,H as diffArrays,c as diffChars,W as diffCss,z as diffJson,s as diffLines,x as diffSentences,i as diffTrimmedLines,j as diffWords,E as diffWordsWithSpace,o as formatPatch,N as jsonDiff,l as lineDiff,I as parsePatch,q as reversePatch,F as sentenceDiff,u as structuredPatch,L as wordDiff,O as wordsWithSpaceDiff};
1
+ import{D as e,t}from"./cli-a9hYDLWp.js";import{b as n,c as r,d as s,a as i,f as o,l,s as u}from"./cli-a9hYDLWp.js";import"./_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"fs";import"crypto";import"os";import"path";import"http";import"node:path";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"util";import"stream";import"buffer";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"perf_hooks";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";const a=new class extends e{};function c(e,t,n){return a.diff(e,t,n)}function f(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function h(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function p(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function d(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function g(e,t){return p(e,t,"")}function m(e,t){return d(e,t,"")}function v(e,t){return t.slice(0,function(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);const s=Array(r);let i=0;s[0]=0;for(let o=1;o<r;o++){for(t[o]==t[i]?s[o]=s[i]:s[o]=i;i>0&&t[o]!=t[i];)i=s[i];t[o]==t[i]&&i++}i=0;for(let o=n;o<e.length;o++){for(;i>0&&e[o]!=t[i];)i=s[i];e[o]==t[i]&&i++}return i}(e,t))}function w(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function y(e){const t=e.match(/^\s*/);return t?t[0]:""}const k="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",b=new RegExp(`[${k}]+|\\s+|[^${k}]`,"ug");const L=new class extends e{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){const r=t.intlSegmenter;if("word"!=r.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(r.segment(e),e=>e.segment)}else n=e.match(b)||[];const r=[];let s=null;return n.forEach(e=>{/\s/.test(e)?null==s?r.push(e):r.push(r.pop()+e):null!=s&&/\s/.test(s)?r[r.length-1]==s?r.push(r.pop()+e):r.push(s+e):r.push(e),s=e}),r}join(e){return e.map((e,t)=>0==t?e:e.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,s=null;return e.forEach(e=>{e.added?r=e:e.removed?s=e:((r||s)&&S(n,s,r,e),n=e,r=null,s=null)}),(r||s)&&S(n,s,r,null),e}};function j(e,t,n){return null==(null==n?void 0:n.ignoreWhitespace)||n.ignoreWhitespace?L.diff(e,t,n):E(e,t,n)}function S(e,t,n,r){if(t&&n){const s=y(t.value),i=w(t.value),o=y(n.value),l=w(n.value);if(e){const r=f(s,o);e.value=d(e.value,o,r),t.value=g(t.value,r),n.value=g(n.value,r)}if(r){const e=h(i,l);r.value=p(r.value,l,e),t.value=m(t.value,e),n.value=m(n.value,e)}}else if(n){if(e){const e=y(n.value);n.value=n.value.substring(e.length)}if(r){const e=y(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){const n=y(r.value),s=y(t.value),i=w(t.value),o=f(n,s);t.value=g(t.value,o);const l=h(g(n,o),i);t.value=m(t.value,l),r.value=p(r.value,n,l),e.value=d(e.value,n,n.slice(0,n.length-l.length))}else if(r){const e=y(r.value),n=v(w(t.value),e);t.value=m(t.value,n)}else if(e){const n=v(w(e.value),y(t.value));t.value=g(t.value,n)}}const O=new class extends e{tokenize(e){const t=new RegExp(`(\\r?\\n)|[${k}]+|[^\\S\\n\\r]+|[^${k}]`,"ug");return e.match(t)||[]}};function E(e,t,n){return O.diff(e,t,n)}function A(e){return"."==e||"!"==e||"?"==e}const F=new class extends e{tokenize(e){var t;const n=[];let r=0;for(let s=0;s<e.length;s++){if(s==e.length-1){n.push(e.slice(r));break}if(A(e[s])&&e[s+1].match(/\s/)){for(n.push(e.slice(r,s+1)),s=r=s+1;null===(t=e[s+1])||void 0===t?void 0:t.match(/\s/);)s++;n.push(e.slice(r,s+1)),r=s+1}}return n}};function x(e,t,n){return F.diff(e,t,n)}const $=new class extends e{tokenize(e){return e.split(/([{}:;,]|\s+)/)}};function W(e,t,n){return $.diff(e,t,n)}const N=new class extends e{constructor(){super(...arguments),this.tokenize=t}get useLongestToken(){return!0}castInput(e,t){const{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>void 0===t?n:t}=t;return"string"==typeof e?e:JSON.stringify(_(e,null,null,r),null," ")}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)}};function z(e,t,n){return N.diff(e,t,n)}function _(e,t,n,r,s){let i,o;for(t=t||[],n=n||[],r&&(e=r(void 0===s?"":s,e)),i=0;i<t.length;i+=1)if(t[i]===e)return n[i];if("[object Array]"===Object.prototype.toString.call(e)){for(t.push(e),o=new Array(e.length),n.push(o),i=0;i<e.length;i+=1)o[i]=_(e[i],t,n,r,String(i));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"==typeof e&&null!==e){t.push(e),o={},n.push(o);const s=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&s.push(l);for(s.sort(),i=0;i<s.length;i+=1)l=s[i],o[l]=_(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}const C=new class extends e{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function H(e,t,n){return C.diff(e,t,n)}function J(e){return Array.isArray(e)?e.map(e=>J(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))?t:t+"\r"})}))})}function P(e){return Array.isArray(e)?e.map(e=>P(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function I(e){const t=e.split(/\n/),n=[];let r=0;function s(){const e={};for(n.push(e);r<t.length;){const n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;const s=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(n);s&&(e.index=s[1]),r++}for(i(e),i(e),e.hunks=[];r<t.length;){const n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else{if(n)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(n));r++}}}function i(e){const n=/^(---|\+\+\+)\s+(.*)\r?$/.exec(t[r]);if(n){const t=n[2].split("\t",2),s=(t[1]||"").trim();let i=t[0].replace(/\\\\/g,"\\");/^".*"$/.test(i)&&(i=i.substr(1,i.length-2)),"---"===n[1]?(e.oldFileName=i,e.oldHeader=s):(e.newFileName=i,e.newHeader=s),r++}}function o(){var e;const n=r,s=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+s[1],oldLines:void 0===s[2]?1:+s[2],newStart:+s[3],newLines:void 0===s[4]?1:+s[4],lines:[]};0===i.oldLines&&(i.oldStart+=1),0===i.newLines&&(i.newStart+=1);let o=0,l=0;for(;r<t.length&&(l<i.oldLines||o<i.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){const e=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${n+1} contained invalid line ${t[r]}`);i.lines.push(t[r]),"+"===e?o++:"-"===e?l++:" "===e&&(o++,l++)}if(o||1!==i.newLines||(i.newLines=0),l||1!==i.oldLines||(i.oldLines=0),o!==i.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(l!==i.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return i}for(;r<t.length;)s();return n}function D(e,t,n){let r=!0,s=!1,i=!1,o=1;return function l(){if(r&&!i){if(s?o++:r=!1,e+o<=n)return e+o;i=!0}if(!s)return i||(r=!0),t<=e-o?e-o++:(s=!0,l())}}function R(e,t,n={}){let r;if(r="string"==typeof t?I(t):Array.isArray(t)?t:[t],r.length>1)throw new Error("applyPatch only works with a single input.");return function(e,t,n={}){(n.autoConvertLineEndings||null==n.autoConvertLineEndings)&&((r=e).includes("\r\n")&&!r.startsWith("\n")&&!r.match(/[^\r]\n/)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(t)?t=J(t):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>{var r;return t.startsWith("\\")||t.endsWith("\r")||(null===(r=e.lines[n+1])||void 0===r?void 0:r.startsWith("\\"))})))}(t)&&(t=P(t)));var r;const s=e.split("\n"),i=t.hunks,o=n.compareLine||((e,t,n,r)=>t===r),l=n.fuzzFactor||0;let u=0;if(l<0||!Number.isInteger(l))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return e;let a="",c=!1,f=!1;for(let g=0;g<i[i.length-1].lines.length;g++){const e=i[i.length-1].lines[g];"\\"==e[0]&&("+"==a[0]?c=!0:"-"==a[0]&&(f=!0)),a=e}if(c){if(f){if(!l&&""==s[s.length-1])return!1}else if(""==s[s.length-1])s.pop();else if(!l)return!1}else if(f)if(""!=s[s.length-1])s.push("");else if(!l)return!1;function h(e,t,n,r=0,i=!0,l=[],u=0){let a=0,c=!1;for(;r<e.length;r++){const f=e[r],p=f.length>0?f[0]:" ",d=f.length>0?f.substr(1):f;if("-"===p){if(!o(t+1,s[t],p,d))return n&&null!=s[t]?(l[u]=s[t],h(e,t+1,n-1,r,!1,l,u+1)):null;t++,a=0}if("+"===p){if(!i)return null;l[u]=d,u++,a=0,c=!0}if(" "===p){if(a++,l[u]=s[t],!o(t+1,s[t],p,d))return c||!n?null:s[t]&&(h(e,t+1,n-1,r+1,!1,l,u+1)||h(e,t+1,n-1,r,!1,l,u+1))||h(e,t,n-1,r+1,!1,l,u);u++,i=!0,c=!1,t++}}return u-=a,t-=a,l.length=u,{patchedLines:l,oldLineLastI:t-1}}const p=[];let d=0;for(let g=0;g<i.length;g++){const e=i[g];let t;const n=s.length-e.oldLines+l;let r;for(let s=0;s<=l;s++){r=e.oldStart+d-1;const i=D(r,u,n);for(;void 0!==r&&(t=h(e.lines,r,s),!t);r=i());if(t)break}if(!t)return!1;for(let i=u;i<r;i++)p.push(s[i]);for(let s=0;s<t.patchedLines.length;s++){const e=t.patchedLines[s];p.push(e)}u=t.oldLineLastI+1,d=r+1-e.oldStart}for(let g=u;g<s.length;g++)p.push(s[g]);return p.join("\n")}(e,r[0],n)}function T(e,t){const n="string"==typeof e?I(e):e;let r=0;!function e(){const s=n[r++];if(!s)return t.complete();t.loadFile(s,function(n,r){if(n)return t.complete(n);const i=R(r,s,t);t.patched(s,i,function(n){if(n)return t.complete(n);e()})})}()}function q(e){return Array.isArray(e)?e.map(e=>q(e)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(e=>e.startsWith("-")?`+${e.slice(1)}`:e.startsWith("+")?`-${e.slice(1)}`:e)}))})}function U(e){const t=[];let n,r;for(let s=0;s<e.length;s++)n=e[s],r=n.added?1:n.removed?-1:0,t.push([r,n.value]);return t}function Z(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(B(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function B(e){let t=e;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t=t.replace(/"/g,"&quot;"),t}export{e as Diff,R as applyPatch,T as applyPatches,C as arrayDiff,_ as canonicalize,a as characterDiff,U as convertChangesToDMP,Z as convertChangesToXML,n as createPatch,r as createTwoFilesPatch,$ as cssDiff,H as diffArrays,c as diffChars,W as diffCss,z as diffJson,s as diffLines,x as diffSentences,i as diffTrimmedLines,j as diffWords,E as diffWordsWithSpace,o as formatPatch,N as jsonDiff,l as lineDiff,I as parsePatch,q as reversePatch,F as sentenceDiff,u as structuredPatch,L as wordDiff,O as wordsWithSpaceDiff};
package/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./assets/cli-BN-cw-1f.js";import"./assets/_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"fs";import"crypto";import"os";import"path";import"http";import"node:path";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"util";import"stream";import"buffer";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"perf_hooks";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";
2
+ import"./assets/cli-a9hYDLWp.js";import"./assets/_commonjsHelpers-C1uRMj_j.js";import"assert";import"events";import"node:process";import"node:events";import"node:fs";import"module";import"node:os";import"node:tty";import"node:buffer";import"node:util";import"fs";import"crypto";import"os";import"path";import"http";import"node:path";import"node:url";import"node:child_process";import"node:fs/promises";import"url";import"util";import"stream";import"buffer";import"zlib";import"tty";import"string_decoder";import"https";import"node:crypto";import"node:stream";import"node:string_decoder";import"fs/promises";import"child_process";import"perf_hooks";import"worker_threads";import"node:diagnostics_channel";import"diagnostics_channel";import"node:net";import"async_hooks";import"node:readline";import"node:worker_threads";import"node:http";import"node:https";import"node:zlib";import"node:tls";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedder/embedder",
3
- "version": "2.0.7",
3
+ "version": "2.0.10",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "engines": {
@@ -10,6 +10,9 @@
10
10
  "@serialport/bindings-cpp": "^13.0.1"
11
11
  },
12
12
  "devDependencies": {},
13
+ "pnpmPatchedDependencies": {
14
+ "fullscreen-ink@0.1.0": "patches/fullscreen-ink.patch"
15
+ },
13
16
  "bin": {
14
17
  "embedder": "cli.js"
15
18
  }