From bb40c5c2a9d96f08fe63fb8d203627766d4b827b Mon Sep 17 00:00:00 2001 From: hiteshshetty-dev Date: Mon, 27 Mar 2023 20:49:00 +0530 Subject: [PATCH] fix: copy paste issue on rte --- content-intelligence/dist/plugin.system.js | 8 +++--- .../Provider/getApiSuggestion.d.ts | 2 ++ .../content-intelligence/ciFeatures.d.ts | 10 ++++--- .../components/index.d.ts | 6 +++++ .../types/content-intelligence/index.d.ts | 3 ++- .../types/content-intelligence/types.d.ts | 26 +++++++++++++++++++ content-intelligence/dist/types/plugin.d.ts | 4 +-- .../types/spell-check/SpellCheckTooltip.d.ts | 2 +- .../types/spell-check/SpellComponent.d.ts | 2 +- .../types/spell-check/getSpellSuggestion.d.ts | 12 ++++++++- .../dist/types/spell-check/index.d.ts | 3 ++- .../dist/types/spell-check/utils/index.d.ts | 16 ++++++++++++ .../src/content-intelligence/index.tsx | 16 +++++++++--- .../src/spell-check/SpellCheckTooltip.tsx | 8 +++--- .../src/spell-check/index.tsx | 3 +-- .../src/spell-check/utils/index.ts | 24 ++++++++++++----- 16 files changed, 114 insertions(+), 31 deletions(-) create mode 100644 content-intelligence/dist/types/content-intelligence/components/index.d.ts create mode 100644 content-intelligence/dist/types/content-intelligence/types.d.ts create mode 100644 content-intelligence/dist/types/spell-check/utils/index.d.ts diff --git a/content-intelligence/dist/plugin.system.js b/content-intelligence/dist/plugin.system.js index 6320f555..973a05b6 100644 --- a/content-intelligence/dist/plugin.system.js +++ b/content-intelligence/dist/plugin.system.js @@ -1,10 +1,12 @@ -System.register(["react","@contentstack/venus-components","react-dom"],(function(e){var t,n,r;return{setters:[function(e){t=e},function(e){n=e},function(e){r=e}],execute:function(){e(function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=57)}([function(e,n){e.exports=t},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),o={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},i={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:r?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},a={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=1;s<20;s++)a["f"+s]=111+s;function u(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return c(e,t)})),o=function(e){return r.some((function(t){return l(t,e)}))};return null==n?o:o(n)}function c(e,t){var n=t&&t.byKey,r={},s=(e=e.replace("++","+add")).split("+"),u=s.length;for(var c in o)r[o[c]]=!1;var l=!0,p=!1,h=void 0;try{for(var y,v=s[Symbol.iterator]();!(l=(y=v.next()).done);l=!0){var m=y.value,g=m.endsWith("?")&&m.length>1;g&&(m=m.slice(0,-1));var b=d(m),w=o[b];if(m.length>1&&!w&&!i[m]&&!a[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==u&&w||(n?r.key=b:r.which=f(m)),w&&(r[w]=!g||null)}}catch(e){p=!0,h=e}finally{try{!l&&v.return&&v.return()}finally{if(p)throw h}}return r}function l(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function f(e){return e=d(e),a[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=i[e]||e}t.default=u,t.isHotkey=u,t.isCodeHotkey=function(e,t){return u(e,t)},t.isKeyHotkey=function(e,t){return u(e,{byKey:!0},t)},t.parseHotkey=c,t.compareHotkey=l,t.toKeyCode=f,t.toKeyName=d},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1;g&&(m=m.slice(0,-1));var b=d(m),w=o[b];if(m.length>1&&!w&&!i[m]&&!a[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==u&&w||(n?r.key=b:r.which=f(m)),w&&(r[w]=!g||null)}}catch(e){p=!0,h=e}finally{try{!l&&v.return&&v.return()}finally{if(p)throw h}}return r}function l(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function f(e){return e=d(e),a[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=i[e]||e}t.default=u,t.isHotkey=u,t.isCodeHotkey=function(e,t){return u(e,t)},t.isKeyHotkey=function(e,t){return u(e,{byKey:!0},t)},t.parseHotkey=c,t.compareHotkey=l,t.toKeyCode=f,t.toKeyName=d},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n * @license MIT */ -var r=n(37),o=n(38),i=n(12);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return W(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var f=!0,d=0;do&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(1))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(6).Buffer)},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,o)}));default:for(i=new Array(s-1),a=0;ae._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new r(i.length),s=0;se._pos&&(e.push(new r(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,n(4),n(6).Buffer,n(1))},function(e,t,n){(t=e.exports=n(16)).Stream=t,t.Readable=t,t.Writable=n(20),t.Duplex=n(5),t.Transform=n(22),t.PassThrough=n(45)},function(e,t,n){"use strict";(function(t,r){var o=n(8);e.exports=b;var i,a=n(12);b.ReadableState=g;n(17).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(18),c=n(9).Buffer,l=t.Uint8Array||function(){};var f=Object.create(n(7));f.inherits=n(3);var d=n(39),p=void 0;p=d&&d.debuglog?d.debuglog("stream"):function(){};var h,y=n(40),v=n(19);f.inherits(b,u);var m=["error","close","destroy","pause","resume"];function g(e,t){e=e||{};var r=t instanceof(i=i||n(5));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(21).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(5),!(this instanceof b))return new b(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,O(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):S(e,a)):_(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(x,e):x(e))}function x(e){p("emit readable"),e.emit("readable"),k(e)}function S(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(A,e,t))}function A(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):O(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){p("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",y),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,k(e))}}(n);e.on("drain",f);var d=!1;var h=!1;function y(t){p("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!d&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function v(t){p("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),b()}function g(){p("onfinish"),e.removeListener("close",m),b()}function b(){p("unpipe"),n.unpipe(e)}return n.on("data",y),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",m),e.once("finish",g),e.emit("pipe",n),i.flowing||(p("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=v(u,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(17).EventEmitter},function(e,t,n){"use strict";var r=n(8);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t,r,o){var i=n(8);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=g;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;g.WritableState=m;var c=Object.create(n(7));c.inherits=n(3);var l={deprecate:n(44)},f=n(18),d=n(9).Buffer,p=o.Uint8Array||function(){};var h,y=n(19);function v(){}function m(e,t){s=s||n(5),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(x,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),x(e,t))}(e,n,r,t,o);else{var a=E(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(w,e,n,a,o):w(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(e){if(s=s||n(5),!(h.call(g,this)||this instanceof s))return new g(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),x(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(g,f),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,d.isBuffer(r)||r instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=v),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,x(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(4),n(42).setImmediate,n(1))},function(e,t,n){"use strict";var r=n(9).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(5),o=Object.create(n(7));function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(52);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?M+="x":M+=j[D];if(!M.match(p)){var I=R.slice(0,T),N=R.slice(T+1),q=j.match(h);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+U,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[E])for(T=0,P=l.length;T0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!O.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=O.slice(-1)[0],A=(n.host||e.host||O.length>1)&&("."===S||".."===S)||""===S,T=0,C=O.length;C>=0;C--)"."===(S=O[C])?O.splice(C,1):".."===S?(O.splice(C,1),T++):T&&(O.splice(C,1),T--);if(!_&&!E)for(;T--;T)O.unshift("..");!_||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),A&&"/"!==O.join("/").substr(-1)&&O.push("");var k,R=""===O[0]||O[0]&&"/"===O[0].charAt(0);x&&(n.hostname=n.host=R?"":O.length?O.shift():"",(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift()));return(_=_||n.host&&O.length)&&!R&&O.unshift(""),O.length?n.pathname=O.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(10),o=n(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){var r=n(10),o=n(56);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){var r,o;e.exports=(r={957:function(e){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./src/index.js")}({"./node_modules/cross-domain-utils/src/index.js":function(e,t,n){"use strict";var r=n("./node_modules/cross-domain-utils/src/utils.js");n.d(t,"getActualDomain",(function(){return r.a})),n.d(t,"getAncestor",(function(){return r.b})),n.d(t,"getDomain",(function(){return r.c})),n.d(t,"getUserAgent",(function(){return r.d})),n.d(t,"isActuallySameDomain",(function(){return r.e})),n.d(t,"isAncestor",(function(){return r.f})),n.d(t,"isIframe",(function(){return r.g})),n.d(t,"isPopup",(function(){return r.h})),n.d(t,"isWindow",(function(){return r.i})),n.d(t,"isWindowClosed",(function(){return r.j})),n.d(t,"matchDomain",(function(){return r.k})),n.d(t,"stringifyDomainPattern",(function(){return r.l}));var o=n("./node_modules/cross-domain-utils/src/types.js");n.n(o)},"./node_modules/cross-domain-utils/src/types.js":function(e,t){},"./node_modules/cross-domain-utils/src/utils.js":function(e,t,n){"use strict";function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.a=l,t.c=f,t.e=d,t.j=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(t&&function(e){if(!d(e))return!1;try{if(e===window)return!0;if(a(e)&&c(e))return!0;if(f(window)===f(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var n=function(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function s(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function u(e){if(e&&!s(e))try{return e.opener}catch(e){}}function c(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function l(e){var t=(e=e||window).location;if(!t)throw new Error("Can not read window location");var n=t.protocol;if(!n)throw new Error("Can not read window protocol");if(n===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(n===o.ABOUT_PROTOCOL){var r=s(e);return r&&c(r)?l(r):o.ABOUT_PROTOCOL+"//"}var i=t.host;if(!i)throw new Error("Can not read window host");return n+"//"+i}function f(e){var t=l(e=e||window);return t&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:t}function d(e){try{if(e===window)return!0}catch(e){}try{var t=Object.getOwnPropertyDescriptor(e,"location");if(t&&!1===t.enumerable)return!1}catch(e){}try{if(a(e)&&c(e))return!0}catch(e){}try{if(l(e)===l(window))return!0}catch(e){}return!1}function p(e,t){if(!e||!t)return!1;var n=s(t);return n?n===e:-1!==function(e){var t=[];try{for(;e.parent!==e;)t.push(e.parent),e=e.parent}catch(e){}return t}(t).indexOf(e)}function h(e){var t=[],n=void 0;try{n=e.frames}catch(t){n=e}var r=void 0;try{r=n.length}catch(e){}if(0===r)return t;if(r){for(var o=0;o>>0)+"__"+u,function(){if(!window.WeakMap)return!1;if(!window.Object.freeze)return!1;try{var e=new window.WeakMap,t={};return window.Object.freeze(t),e.set(t,"__testvalue__"),"__testvalue__"===e.get(t)}catch(e){return!1}}())try{this.weakmap=new window.WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,t=this.keys,n=0;n1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!e)return"";if("string"==typeof e)return e;if(e instanceof Error){var n=e&&e.stack,r=e&&e.message;if(n&&r)return-1!==n.indexOf(r)?n:r+"\n"+n;if(n)return n;if(r)return r}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+h(e,t+1)}}var y=function(e){if(!e)return e;var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}};function v(){}function m(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,(function(){return e.charAt(Math.floor(Math.random()*e.length))}))}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>=100)throw new Error("Self-referential object passed, or object contained too many layers");var r=void 0;if("object"!==(void 0===e?"undefined":p(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":p(e)));r=[]}else r={};return function(e,t){Array.isArray(e)?function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=m(),i=Object(o.isPopup)()?l.WINDOW_TYPES.POPUP:Object(o.isIframe)()?l.WINDOW_TYPES.IFRAME:l.WINDOW_TYPES.FULLPAGE,a=Object(o.getDomain)(window);return M({},t,n,{sourceDomain:a,id:t.id||r,windowType:i})}(e,t,{data:function(e,n,r){return g({obj:t.data},(function(t,r){return"function"==typeof t?T(e,n,t,r.toString()):t instanceof Error?(o=t,{__type__:l.SERIALIZATION_TYPES.ERROR,__message__:h(o),__code__:o.code}):window.Promise&&t instanceof window.Promise?function(e,t,n,r){return{__type__:l.SERIALIZATION_TYPES.PROMISE,__then__:T(e,t,(function(e,t){return n.then(e,t)}),r+".then")}}(e,n,t,r.toString()):E.isPromise(t)?function(e,t,n,r){return{__type__:l.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:T(e,t,(function(e,t){return n.then(e,t)}),r+".then")}}(e,n,t,r.toString()):b(t)?(i=t,{__type__:l.SERIALIZATION_TYPES.REGEX,__source__:i.source}):void 0;var o,i})).obj}(e,n),domain:n}),e===window&&!d.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(o.isWindowClosed)(e))throw new Error("Window is closed");var i=[],a=function(e,t,n){var r=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(r=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,null,2);try{r&&(Object.prototype.toJSON=r),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}(((r={})[l.WINDOW_PROPS.POSTROBOT]=t,r));return E.map(Object.keys(P),(function(t){return E.try((function(){if(!d.ALLOWED_POST_MESSAGE_METHODS[t])throw new Error("Strategy disallowed: "+t);return P[t](e,a,n)})).then((function(){return i.push(t+": success"),!0}),(function(e){return i.push(t+": "+h(e)+"\n"),!1}))})).then((function(e){var n=e.some(Boolean),r=t.type+" "+t.name+" "+(n?"success":"error")+":\n - "+i.join("\n - ")+"\n";if(!n)throw new Error(r)}))}))}function L(e){return O.responseListeners[e]}function I(e){delete O.responseListeners[e]}function N(e){return Boolean(O.erroredResponseListeners[e])}function q(e){var t=e.name,n=e.win,r=e.domain;if(n===l.WILDCARD&&(n=null),r===l.WILDCARD&&(r=null),!t)throw new Error("Name required to get request listener");var i=O.requestListeners[t];if(i)for(var a=0,s=[n,O.WINDOW_WILDCARD],u=null==s?0:s.length;a1&&void 0!==arguments[1]?arguments[1]:5e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=O.readyPromises.get(e);return r||(r=new E,O.readyPromises.set(e,r),-1!==t&&setTimeout((function(){return r.reject(new Error(n+" did not load after "+t+"ms"))}),t),r)}(a,e.timeout||d.CHILD_WINDOW_TIMEOUT)})).then((function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(b(r)&&!e)return R(a)})).then((function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(b(r)){if(!Object(o.matchDomain)(r,n))throw new Error("Remote window domain "+n+" does not match regex: "+r.toString());r=n}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var i=r;return new E((function(n,r){var p=void 0;if(e.fireAndForget||function(e,t){O.responseListeners[e]=t}(s,p={name:t,window:a,domain:i,respond:function(e,t){e||(u=!0,c.splice(c.indexOf(f,1))),e?r(e):n(t)}}),D(a,{type:l.POST_MESSAGE_TYPE.REQUEST,hash:s,name:t,data:e.data,fireAndForget:e.fireAndForget},i).catch(r),e.fireAndForget)return n();var h=d.ACK_TIMEOUT,y=e.timeout||d.RES_TIMEOUT,v=100;setTimeout((function n(){if(!u){if(Object(o.isWindowClosed)(a))return p.ack?r(new Error("Window closed for "+t+" before response")):r(new Error("Window closed for "+t+" before ack"));if(h=Math.max(h-v,0),-1!==y&&(y=Math.max(y-v,0)),p.ack){if(-1===y)return;v=Math.min(y,2e3)}else{if(0===h)return r(new Error("No ack for postMessage "+t+" in "+Object(o.getDomain)()+" in "+d.ACK_TIMEOUT+"ms"));if(0===y)return r(new Error("No response for postMessage "+t+" in "+Object(o.getDomain)()+" in "+(e.timeout||d.RES_TIMEOUT)+"ms"))}setTimeout(n,v)}}),v)}))}));return f.catch((function(){!function(e){O.erroredResponseListeners[e]=!0}(s),I(s)})),c.push(f),f}))}function G(e,t,n,r){return(r=r||{}).window=e,r.name=t,r.data=n,z(r)}function Y(e,t,n){var r=Object(o.getAncestor)();return r?G(r,e,t,n):new E((function(e,t){return t(new Error("Window does not have a parent"))}))}function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var t=e.window;return{send:function(n,r){return G(t,n,r,e)}}}O.receivedMessages=O.receivedMessages||[],O.receiveMessage=H,O.requestPromises=O.requestPromises||new c,O.send=G;var K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function $(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var t,n=e.name,r=e.window,i=e.domain,a={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:i||l.WILDCARD,name:n},s=function e(t,n){var r=t.name,o=t.win,i=t.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,u=o,f=null==u?0:u.length;s1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"function"==typeof t&&(n=t,t={}),t=t||{},n=n||t.handler;var r=t.errorHandler,o=new E((function(o,i){(t=t||{}).name=e,t.once=!0,t.handler=function(e){if(o(e),n)return n(e)},t.errorHandler=function(e){if(i(e),r)return r(e)}})),i=$(t);return o.cancel=i.cancel,o}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(t,n){return Q(t,e,n)}}}function X(){delete window[l.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",F)}O.on=Q;var ee=Object(o.getAncestor)();function te(e){var t=O.requestPromises.get(e);if(t)for(var n=0,r=null==t?0:t.length;n{e.exports=n(957),e.exports.default=e.exports},979:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["file","reference","blocks","group","global_field"],r=function(){function e(e,t,n){this.uid=e.data.uid,this.data_type=e.data.schema.data_type,this.schema=e.data.schema,this._emitter=n;var r,o,i,a,s=(r=this,i=o=e.data.value,a=o,"file"===r.data_type&&(o?(i=o,a=!0===r.schema.multiple?o.map((function(e){return e.uid})):o.uid):!0===r.schema.multiple&&(i=[],a=[])),{resolvedData:i,unResolvedData:a});this._data=s.unResolvedData,this._resolvedData=s.resolvedData,this._connection=t,this._self=e.data.self||!1;var u=this;n.on("updateFields",(function(e){var t=u.uid.split("."),n=e.data;t.forEach((function(e){n&&(n=n[e])})),u._data!==n&&(u._data=n)}))}return e.prototype.setData=function(e){var t=this,r=this,o={data:e,uid:r.uid,self:r._self};return r._self||-1===n.indexOf(r.data_type)&&r.data_type?this._connection.sendToParent("setData",o).then((function(){return t._data=e,Promise.resolve(r)})).catch((function(e){return Promise.reject(e)})):Promise.reject(new Error("Cannot call set data for current field type"))},e.prototype.getData=function(e){var t=(void 0===e?{}:e).resolved;return void 0!==t&&t?this._resolvedData:this._data},e.prototype.setFocus=function(){return this._connection.sendToParent("focus")},e.prototype.onChange=function(e){var t=this;if(!e||"function"!=typeof e)throw Error("Callback must be a function");this._emitter.on("extensionFieldChange",(function(n){t._data=n.data,t._resolvedData=n.data,e(n.data)}))},e}();t.default=r},607:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(112)),i=r(n(727)),a=n(147);i.default.CONFIG.LOG_LEVEL="error";var s=function(){function e(){}return e.init=function(){var e=this;return this._extension?Promise.resolve(this._extension):o.default.initialize(a.version).then((function(t){return e._extension=new o.default(t),Promise.resolve(e._extension)})).catch((function(e){return Promise.reject(e)}))},Object.defineProperty(e,"SDK_VERSION",{get:function(){return a.version},enumerable:!1,configurable:!0}),e}();t.default=s,e.exports=s},65:function(e,t){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getReferences=t.includeReference=t.includeSchema=t.includeContentType=t.includeOwner=t.environment=t.language=t.addQuery=t.addParam=t._type=t.mergeDeep=t.merge=t.transform=void 0,t.transform=function(e){return function(){switch(arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0])return t=(t=this._query[e+"[BASE]"]||[]).concat(arguments[0]),this._query[e+"[BASE]"]=t,this;throw Error("Kindly provide valid parameters");case 2:var t;if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1]))return t=(t=this._query[e+"["+arguments[0]+"]"]||[]).concat(arguments[1]),this._query[e+"["+arguments[0]+"]"]=t,this;throw Error("Kindly provide valid parameters");default:throw Error("Kindly provide valid parameters")}}},t.merge=function(e,t){var n=e;return e&&t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n},t.mergeDeep=function(e,t){var n=e,r=this,o=function(e,t){var n=e;Object.keys(t).forEach((function(e){"object"===r._type(t[e])&&r._type(n[e])===r._type(t[e])?o(n[e],t[e]):"array"===r._type(t[e])&&r._type(n[e])===r._type(t[e])?n[e]=n[e].concat(t[e]):n[e]=t[e]}))};return o(n,t),n},t._type=function(e){var t=typeof e;return"object"===t&&Array.isArray(e)&&(t="array"),t},t.addParam=function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;throw Error("Kindly provide valid parameters.")},t.addQuery=function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;throw Error("First argument should be a String.")},t.language=function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;throw Error("Argument should be a String.")},t.environment=function(e){if(e&&"string"==typeof e)return this._query.environment=e,this;throw Error("Argument should be a String.")},t.includeOwner=function(){return this._query.include_owner=!0,this},t.includeContentType=function(){return this._query.include_content_type=!0,this},t.includeSchema=function(){return this._query.include_schema=!0,this},t.includeReference=function(e){if(Array.isArray(e))for(var t=0;t{"use strict";function n(e){return Promise.reject(e)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._connection=e}return e.prototype.get=function(e){if(!e||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"get",key:e}).then((function(e){return Promise.resolve(e.data)})).catch(n)},e.prototype.getAll=function(){return this._connection.sendToParent("store",{action:"getAll"}).then((function(e){var t=e.data,n=void 0===t?{}:t;return Promise.resolve(n)})).catch(n)},e.prototype.set=function(e,t){if(!e||!t||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"set",key:e,value:t}).then((function(){return Promise.resolve(!0)})).catch(n)},e.prototype.remove=function(e){if(!e||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"remove",key:e}).then((function(){return Promise.resolve(!0)})).catch(n)},e.prototype.clear=function(){return this._connection.sendToParent("store",{action:"clear"}).then((function(){return Promise.resolve(!0)})).catch(n)},e}();t.default=r},593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onError=t.onData=void 0,t.onData=function(e){return"string"==typeof e.data?Promise.reject(e.data):Promise.resolve(e.data)},t.onError=function(e){return Promise.reject(e)}},362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r={attributes:!0,childList:!0,subtree:!0},o=function(){function e(e,t,n,r){void 0===r&&(r="half_width"),this._connection=e,this._autoResizingEnabled=!1,this._resizingEnabled=!1,this.type=t,this.state=r,this._emitter=n}return e.prototype.enableResizing=function(){return"DASHBOARD"!==this.type?Promise.resolve():(this._resizingEnabled=!0,this._connection.sendToParent("window",{action:"enableResizing"}))},e.prototype.onDashboardResize=function(e){var t=this;if("DASHBOARD"!==this.type)return!1;if(!e||"function"!=typeof e)throw Error("Callback must be a function");return t._emitter.on("dashboardResize",(function(n){t.state=n.state,e(n.state)})),!0},e.prototype.updateHeight=function(e){if("DASHBOARD"===this.type&&"half_width"===this.state)return Promise.resolve();if(!e||isNaN(e))this._height=Math.ceil(document.documentElement.getBoundingClientRect().height);else{if(this._height===e)return Promise.resolve();this._height=e}return this._connection.sendToParent("resize",this._height)},e.prototype.enableAutoResizing=function(){return this._autoResizingEnabled||"half_width"===this.state&&"DASHBOARD"===this.type||(this._autoResizingEnabled=!0,(n=new MutationObserver(this.updateHeight.bind(this))).observe(window.document.body,r)),this},e.prototype.disableAutoResizing=function(){return this._autoResizingEnabled?(this._autoResizingEnabled=!1,n.disconnect(),this):this},e}();t.default=o},795:function(e,t,n){var r;!function(t){"use strict";function o(){}var i=o.prototype,a=t.EventEmitter;function s(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function u(e){return function(){return this[e].apply(this,arguments)}}i.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t{"use strict";e.exports=JSON.parse('{"name":"@contentstack/app-sdk","version":"1.1.0","types":"dist/src/index.d.ts","description":"This SDK helps connect to the development server of the Contentstack and sync the data.","main":"dist/index.js","repository":"https://github.com/contentstack/app-sdk","scripts":{"prepublish":"npm run build","build":"webpack","test":"jest","test:watch":"jest --watchAll","test:coverage":"jest --coverage --coverageDirectory=\\"coverage\\"","dev":"webpack --watch --mode development","lint":"eslint . --ext .ts"},"keywords":[],"author":{"name":"Contentstack","url":"https://www.contentstack.com/"},"maintainers":[{"name":"Deepak Kharah","email":"deepak.kharah@contentstack.com"}],"license":"MIT","devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1","@testing-library/jest-dom":"^5.14.1","@types/chai":"^4.2.22","@types/jest":"^27.0.2","@types/mocha":"^9.0.0","@types/post-robot":"^10.0.3","@types/react":"^17.0.18","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-loader":"^8.0.5","chai":"^4.3.4","css-loader":"^5.2.2","eslint":"^8.7.0","jest":"^27.3.1","mocha":"^9.2.0","react":"^17.0.2","slate":"^0.72.3","ts-jest":"^27.0.7","ts-loader":"^8.1.0","ts-node":"^10.3.0","typescript":"^4.4.4","webpack":"^5.65.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3"},"dependencies":{"post-robot":"8.0.29","wolfy87-eventemitter":"5.2.4"},"files":["dist"]}')}},o={},function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(607))},function(e,t){e.exports=n},function(e,t,n){var r=n(34);e.exports=class{constructor(e,t="api.openai.com",n="v1"){this.__personalKey=e,this.__apiBase=t,this.__version=n,this.__httpOptions={hostname:t,port:443,method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+e}}}CompletionsCreate(e,t=5,n="davinci",o){var i=this;return new Promise((function(a,s){var u={...{path:"/"+i.__version+"/engines/"+n+"/completions"},...i.__httpOptions};const c={prompt:e,max_tokens:t};var l=JSON.stringify({...o,...c}),f="";const d=r.request(u,e=>{e.setEncoding("utf8"),e.on("data",e=>{f+=e}),e.on("end",()=>{a(JSON.parse(f))})});d.on("error",e=>{s(e)}),d.write(l),d.end()}))}}},function(e,t){e.exports=r},,,function(e,t,n){var r=n(10),o=n(33);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){(t=n(11)(!1)).push([e.i,".table-header-btn {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.toggle-btn {\n width: 34px;\n height: 18px;\n border-radius: 48px;\n display: inline-block;\n position: relative;\n background: #a9b6cb;\n cursor: pointer;\n -webkit-transition: background-color 0.4s ease-in-out;\n -moz-transition: background-color 0.4s ease-in-out;\n -o-transition: background-color 0.4s ease-in-out;\n transition: background-color 0.4s ease-in-out;\n}\n\n.toggle-btn.active {\n background: #6c5ce7;\n}\n\n.round-btn {\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 50%;\n display: inline-block;\n position: absolute;\n left: 3px;\n top: 50%;\n margin-top: -6px;\n -webkit-transition: all 0.3s ease-in-out;\n -moz-transition: all 0.3s ease-in-out;\n -o-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out;\n}\n\n.toggle-btn.active .round-btn {\n left: 18px;\n}\n\n.toggle-btn:hover .round-btn {\n box-shadow: 3px 0px 4px 0px red 100%;\n}\n\n.toggle-btn .round-btn {\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 50%;\n display: inline-block;\n position: absolute;\n left: 3px;\n top: 50%;\n margin-top: -6px;\n -webkit-transition: all 0.3s ease-in-out;\n -moz-transition: all 0.3s ease-in-out;\n -o-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out;\n}\n\n.toggle-btn.active .round-btn {\n left: 18px;\n}\n\n.toggle-btn:hover .round-btn {\n box-shadow: 3px 0px 4px 0px red 100%;\n}\n",""]),e.exports=t},function(e,t,n){var r=n(35),o=n(23),i=e.exports;for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a]);function s(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=s(e),r.request.call(this,e,t)},i.get=function(e,t){return e=s(e),r.get.call(this,e,t)}},function(e,t,n){(function(e){var r=n(36),o=n(14),i=n(47),a=n(48),s=n(23),u=t;u.request=function(t,n){t="string"==typeof t?s.parse(t):i(t);var o=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||o,u=t.hostname||t.host,c=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new r(t);return n&&f.on("response",n),f},u.get=function(e,t){var n=u.request(e,t);return n.end(),n},u.ClientRequest=r,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(1))},function(e,t,n){(function(t,r,o){var i=n(13),a=n(3),s=n(14),u=n(15),c=n(46),l=s.IncomingMessage,f=s.readyStates;var d=e.exports=function(e){var n,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)o=!1,n=!0;else if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}r._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":i.vbArray&&e?"text:vbarray":"text"}(n,o),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};a(d,u.Writable),d.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===p.indexOf(n)&&(this._headers[n]={name:e,value:t})},d.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},d.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},d.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,a=e._headers,s=null;"GET"!==n.method&&"HEAD"!==n.method&&(s=i.arraybuffer?c(t.concat(e._body)):i.blobConstructor?new r.Blob(e._body.map((function(e){return c(e)})),{type:(a["content-type"]||{}).value||""}):t.concat(e._body).toString());var u=[];if(Object.keys(a).forEach((function(e){var t=a[e].name,n=a[e].value;Array.isArray(n)?n.forEach((function(e){u.push([t,e])})):u.push([t,n])})),"fetch"===e._mode){var l=null;if(i.abortController){var d=new AbortController;l=d.signal,e._fetchAbortController=d,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=r.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:u,body:s||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var p=e._xhr=new r.XMLHttpRequest;try{p.open(e._opts.method,e._opts.url,!0)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}"responseType"in p&&(p.responseType=e._mode.split(":")[0]),"withCredentials"in p&&(p.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(p.timeout=n.requestTimeout,p.ontimeout=function(){e.emit("requestTimeout")}),u.forEach((function(e){p.setRequestHeader(e[0],e[1])})),e._response=null,p.onreadystatechange=function(){switch(p.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(p.onprogress=function(){e._onXHRProgress()}),p.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{p.send(s)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}}}},d.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},d.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},d.prototype._write=function(e,t,n){this._body.push(e),n()},d.prototype.abort=d.prototype.destroy=function(){this._destroyed=!0,r.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},d.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),u.Writable.prototype.end.call(this,e,t,n)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(6).Buffer,n(1),n(4))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){ +var r=n(38),o=n(39),i=n(13);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var f=!0,d=0;do&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(1))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(6).Buffer)},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,o)}));default:for(i=new Array(s-1),a=0;a=0?r=setTimeout(u,t-c):(r=null,n||(s=e.apply(i,o),i=o=null))}null==t&&(t=100);var c=function(){i=this,o=arguments,a=Date.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(s=e.apply(i,o),i=o=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},c}n.debounce=n,e.exports=n},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var n;function r(){if(void 0!==n)return n;if(e.XMLHttpRequest){n=new e.XMLHttpRequest;try{n.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function o(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var i=void 0!==e.ArrayBuffer,a=i&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||i&&o("arraybuffer"),t.msstream=!t.fetch&&a&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!r()&&s(r().overrideMimeType),t.vbArray=s(e.VBArray),n=null}).call(this,n(1))},function(e,t,n){(function(e,r,o){var i=n(14),a=n(3),s=n(16),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,n,a,u){var c=this;if(s.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){e.nextTick((function(){c.emit("close")}))})),"fetch"===a){if(c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach((function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)})),i.writableStream){var l=new WritableStream({write:function(e){return new Promise((function(t,n){c._destroyed?n():c.push(new r(e))?t():c._resumeFetch=t}))},close:function(){o.clearTimeout(u),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{return void n.body.pipeTo(l).catch((function(e){o.clearTimeout(u),c._destroyed||c.emit("error",e)}))}catch(e){}}var f=n.body.getReader();!function e(){f.read().then((function(t){if(!c._destroyed){if(t.done)return o.clearTimeout(u),void c.push(null);c.push(new r(t.value)),e()}})).catch((function(e){o.clearTimeout(u),c._destroyed||c.emit("error",e)}))}()}else{if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(t[2])):void 0!==c.headers[n]?c.headers[n]+=", "+t[2]:c.headers[n]=t[2],c.rawHeaders.push(t[1],t[2])}})),c._charset="x-user-defined",!i.overrideMimeType){var d=c.rawHeaders["mime-type"];if(d){var p=d.match(/;\s*charset=([^;])(;|$)/);p&&(c._charset=p[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};a(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{n=new o.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new r(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new r(i.length),s=0;se._pos&&(e.push(new r(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,n(4),n(6).Buffer,n(1))},function(e,t,n){(t=e.exports=n(17)).Stream=t,t.Readable=t,t.Writable=n(21),t.Duplex=n(5),t.Transform=n(23),t.PassThrough=n(46)},function(e,t,n){"use strict";(function(t,r){var o=n(8);e.exports=b;var i,a=n(13);b.ReadableState=g;n(18).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(19),c=n(9).Buffer,l=t.Uint8Array||function(){};var f=Object.create(n(7));f.inherits=n(3);var d=n(40),p=void 0;p=d&&d.debuglog?d.debuglog("stream"):function(){};var h,y=n(41),v=n(20);f.inherits(b,u);var m=["error","close","destroy","pause","resume"];function g(e,t){e=e||{};var r=t instanceof(i=i||n(5));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(22).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(5),!(this instanceof b))return new b(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,x(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):S(e,a)):_(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(O,e):O(e))}function O(e){p("emit readable"),e.emit("readable"),k(e)}function S(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):x(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){p("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",y),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,k(e))}}(n);e.on("drain",f);var d=!1;var h=!1;function y(t){p("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!d&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function v(t){p("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),b()}function g(){p("onfinish"),e.removeListener("close",m),b()}function b(){p("unpipe"),n.unpipe(e)}return n.on("data",y),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",m),e.once("finish",g),e.emit("pipe",n),i.flowing||(p("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=v(u,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(18).EventEmitter},function(e,t,n){"use strict";var r=n(8);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t,r,o){var i=n(8);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=g;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;g.WritableState=m;var c=Object.create(n(7));c.inherits=n(3);var l={deprecate:n(45)},f=n(19),d=n(9).Buffer,p=o.Uint8Array||function(){};var h,y=n(20);function v(){}function m(e,t){s=s||n(5),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(O,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),O(e,t))}(e,n,r,t,o);else{var a=E(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(w,e,n,a,o):w(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(e){if(s=s||n(5),!(h.call(g,this)||this instanceof s))return new g(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),O(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(g,f),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):h=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,d.isBuffer(r)||r instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=v),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,O(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(4),n(43).setImmediate,n(1))},function(e,t,n){"use strict";var r=n(9).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(5),o=Object.create(n(7));function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(53);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?M+="x":M+=j[D];if(!M.match(p)){var I=P.slice(0,A),N=P.slice(A+1),q=j.match(h);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=r.toASCII(this.hostname));var W=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+W,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[E])for(A=0,R=l.length;A0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=x.slice(-1)[0],T=(n.host||e.host||x.length>1)&&("."===S||".."===S)||""===S,A=0,C=x.length;C>=0;C--)"."===(S=x[C])?x.splice(C,1):".."===S?(x.splice(C,1),A++):A&&(x.splice(C,1),A--);if(!_&&!E)for(;A--;A)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),T&&"/"!==x.join("/").substr(-1)&&x.push("");var k,P=""===x[0]||x[0]&&"/"===x[0].charAt(0);O&&(n.hostname=n.host=P?"":x.length?x.shift():"",(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift()));return(_=_||n.host&&x.length)&&!P&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(10),o=n(56);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){var r=n(10),o=n(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){ +/*! For license information please see index.js.LICENSE.txt */ +!function(t,n){e.exports=n()}(0,()=>{return e={957:function(e){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./src/index.js")}({"./src/index.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.d(r,"cleanUpWindow",(function(){return Oe})),n.d(r,"Promise",(function(){return G})),n.d(r,"bridge",(function(){return Se})),n.d(r,"init",(function(){return Te})),n.d(r,"parent",(function(){return xe})),n.d(r,"send",(function(){return he})),n.d(r,"request",(function(){return pe})),n.d(r,"sendToParent",(function(){return ye})),n.d(r,"client",(function(){return ve})),n.d(r,"on",(function(){return be})),n.d(r,"listen",(function(){return ge})),n.d(r,"once",(function(){return we})),n.d(r,"listener",(function(){return _e})),n.d(r,"CONFIG",(function(){return k})),n.d(r,"CONSTANTS",(function(){return A})),n.d(r,"disable",(function(){return Ee}));var i="mock:",a="file:",s="about:",u="Call was rejected by callee.\r\n";function c(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===s}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(e&&!l(e))try{return e.opener}catch(e){}}function d(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.location;if(!t)throw new Error("Can not read window location");var n=t.protocol;if(!n)throw new Error("Can not read window protocol");if(n===a)return a+"//";if(n===s){var r=l(e);return r&&d(r)?p(r):s+"//"}var o=t.host;if(!o)throw new Error("Can not read window host");return n+"//"+o}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=p(e);return t&&e.mockDomain&&0===e.mockDomain.indexOf(i)?e.mockDomain:t}function y(e){try{if(e===window)return!0}catch(e){}try{var t=Object.getOwnPropertyDescriptor(e,"location");if(t&&!1===t.enumerable)return!1}catch(e){}try{if(c(e)&&d(e))return!0}catch(e){}try{if(p(e)===p(window))return!0}catch(e){}return!1}function v(e,t){if(!e||!t)return!1;var n=l(t);return n?n===e:-1!==function(e){var t=[];try{for(;e.parent!==e;)t.push(e.parent),e=e.parent}catch(e){}return t}(t).indexOf(e)}function m(e){var t=[],n=void 0;try{n=e.frames}catch(t){n=e}var r=void 0;try{r=n.length}catch(e){}if(0===r)return t;if(r){for(var o=0;o1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==u}if(t&&function(e){if(!y(e))return!1;try{if(e===window)return!0;if(c(e)&&d(e))return!0;if(h(window)===h(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var n=function(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:window;return f(e=e||window)||l(e)||void 0}function E(e,t){if("string"==typeof e){if("string"==typeof t)return"*"===e||t===e;if(o(t))return!1;if(Array.isArray(t))return!1}return o(e)?o(t)?e.toString()===t.toString():!Array.isArray(t)&&Boolean(t.match(e)):!!Array.isArray(e)&&(Array.isArray(t)?JSON.stringify(e)===JSON.stringify(t):!o(t)&&e.some((function(e){return E(e,t)})))}function x(e){try{if(e===window)return!0}catch(e){if(e&&e.message===u)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===u)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===u)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===u)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===u)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===u)return!0}try{if(e&&"__unlikely_value__"===e.__cross_domain_utils_window_check__)return!1}catch(e){return!0}return!1}function O(e,t){for(var n=0;n>>0)+"__",function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,t={};return Object.freeze(t),e.set(t,"__testvalue__"),"__testvalue__"===e.get(t)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,t=this.keys,n=0;n1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!e)return"";if("string"==typeof e)return e;if(e instanceof Error){var n=e&&e.stack,r=e&&e.message;if(n&&r)return-1!==n.indexOf(r)?n:r+"\n"+n;if(n)return n;if(r)return r}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+R(e,t+1)}}var j=function(e){if(!e)return e;var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}};function M(){}function D(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,(function(){return e.charAt(Math.floor(Math.random()*e.length))}))}function L(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>=100)throw new Error("Self-referential object passed, or object contained too many layers");var r=void 0;if("object"!==(void 0===e?"undefined":P(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":P(e)));r=[]}else r={};return function(e,t){Array.isArray(e)?function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=D(),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return Boolean(f(e))}()?A.WINDOW_TYPES.POPUP:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return Boolean(l(e))}()?A.WINDOW_TYPES.IFRAME:A.WINDOW_TYPES.FULLPAGE,i=h(window);return ne({},t,n,{sourceDomain:i,id:t.id||r,windowType:o})}(e,t,{data:function(e,n,r){return L({obj:t.data},(function(t,r){return"function"==typeof t?Q(e,n,t,r.toString()):t instanceof Error?(o=t,{__type__:A.SERIALIZATION_TYPES.ERROR,__message__:R(o),__code__:o.code}):window.Promise&&t instanceof window.Promise?function(e,t,n,r){return{__type__:A.SERIALIZATION_TYPES.PROMISE,__then__:Q(e,t,(function(e,t){return n.then(e,t)}),r+".then")}}(e,n,t,r.toString()):G.isPromise(t)?function(e,t,n,r){return{__type__:A.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:Q(e,t,(function(e,t){return n.then(e,t)}),r+".then")}}(e,n,t,r.toString()):I(t)?(i=t,{__type__:A.SERIALIZATION_TYPES.REGEX,__source__:i.source}):void 0;var o,i})).obj}(e,n),domain:n}),e===window&&!k.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(w(e))throw new Error("Window is closed");var o=[],i=function(e,t,n){var r=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(r=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,null,2);try{r&&(Object.prototype.toJSON=r),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}(((r={})[A.WINDOW_PROPS.POSTROBOT]=t,r));return G.map(Object.keys(ee),(function(t){return G.try((function(){if(!k.ALLOWED_POST_MESSAGE_METHODS[t])throw new Error("Strategy disallowed: "+t);return ee[t](e,i,n)})).then((function(){return o.push(t+": success"),!0}),(function(e){return o.push(t+": "+R(e)+"\n"),!1}))})).then((function(e){var n=e.some(Boolean),r=t.type+" "+t.name+" "+(n?"success":"error")+":\n - "+o.join("\n - ")+"\n";if(!n)throw new Error(r)}))}))}function oe(e){return Y.responseListeners[e]}function ie(e){delete Y.responseListeners[e]}function ae(e){return Boolean(Y.erroredResponseListeners[e])}function se(e){var t=e.name,n=e.win,r=e.domain;if(n===A.WILDCARD&&(n=null),r===A.WILDCARD&&(r=null),!t)throw new Error("Name required to get request listener");var o=Y.requestListeners[t];if(o)for(var i=0,a=[n,Y.WINDOW_WILDCARD],s=null==a?0:a.length;i0&&void 0!==arguments[0]?arguments[0]:window;try{if(e.top)return e.top}catch(e){}if(l(e)===e)return e;try{if(v(window,e)&&window.top)return window.top}catch(e){}try{if(v(e,window)&&window.top)return window.top}catch(e){}for(var t=0,n=function e(t){for(var n=[],r=0,o=m(t),i=null==o?0:o.length;r1&&void 0!==arguments[1]?arguments[1]:5e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=Y.readyPromises.get(e);return r||(r=new G,Y.readyPromises.set(e,r),-1!==t&&setTimeout((function(){return r.reject(new Error(n+" did not load after "+t+"ms"))}),t),r)}(i,e.timeout||k.CHILD_WINDOW_TIMEOUT)})).then((function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(I(r)&&!e)return J(i)})).then((function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(I(r)){if(!E(r,n))throw new Error("Remote window domain "+n+" does not match regex: "+r.toString());r=n}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return new G((function(n,r){var l=void 0;if(e.fireAndForget||function(e,t){Y.responseListeners[e]=t}(a,l={name:t,window:i,domain:o,respond:function(e,t){e||(s=!0,u.splice(u.indexOf(c,1))),e?r(e):n(t)}}),re(i,{type:A.POST_MESSAGE_TYPE.REQUEST,hash:a,name:t,data:e.data,fireAndForget:e.fireAndForget},o).catch(r),e.fireAndForget)return n();var f=k.ACK_TIMEOUT,d=e.timeout||k.RES_TIMEOUT,p=100;setTimeout((function n(){if(!s){if(w(i))return l.ack?r(new Error("Window closed for "+t+" before response")):r(new Error("Window closed for "+t+" before ack"));if(f=Math.max(f-p,0),-1!==d&&(d=Math.max(d-p,0)),l.ack){if(-1===d)return;p=Math.min(d,2e3)}else{if(0===f)return r(new Error("No ack for postMessage "+t+" in "+h()+" in "+k.ACK_TIMEOUT+"ms"));if(0===d)return r(new Error("No response for postMessage "+t+" in "+h()+" in "+(e.timeout||k.RES_TIMEOUT)+"ms"))}setTimeout(n,p)}}),p)}))}));return c.catch((function(){!function(e){Y.erroredResponseListeners[e]=!0}(a),ie(a)})),u.push(c),c}))}function he(e,t,n,r){return(r=r||{}).window=e,r.name=t,r.data=n,pe(r)}function ye(e,t,n){var r=_();return r?he(r,e,t,n):new G((function(e,t){return t(new Error("Window does not have a parent"))}))}function ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var t=e.window;return{send:function(n,r){return he(t,n,r,e)}}}Y.receivedMessages=Y.receivedMessages||[],Y.receiveMessage=fe,Y.requestPromises=Y.requestPromises||new T,Y.send=he;var me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function ge(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var t,n=e.name,r=e.window,o=e.domain,i={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:o||A.WILDCARD,name:n},a=function e(t,n){var r=t.name,o=t.win,i=t.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,u=o,c=null==u?0:u.length;s1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"function"==typeof t&&(n=t,t={}),t=t||{},n=n||t.handler;var r=t.errorHandler,o=new G((function(o,i){(t=t||{}).name=e,t.once=!0,t.handler=function(e){if(o(e),n)return n(e)},t.errorHandler=function(e){if(i(e),r)return r(e)}})),i=ge(t);return o.cancel=i.cancel,o}function _e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(t,n){return be(t,e,n)}}}function Ee(){delete window[A.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",de)}Y.on=be;var xe=_();function Oe(e){var t=Y.requestPromises.get(e);if(t)for(var n=0,r=null==t?0:t.length;n{e.exports=n(957),e.exports.default=e.exports},979:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["file","reference","blocks","group","global_field"],r=function(){function e(e,t,n){this.uid=e.data.uid,this.data_type=e.data.schema.data_type,this.schema=e.data.schema,this._emitter=n;var r,o,i,a,s=(r=this,i=o=e.data.value,a=o,"file"===r.data_type&&(o?(i=o,a=!0===r.schema.multiple?o.map((function(e){return e.uid})):o.uid):!0===r.schema.multiple&&(i=[],a=[])),{resolvedData:i,unResolvedData:a});this._data=s.unResolvedData,this._resolvedData=s.resolvedData,this._connection=t,this._self=e.data.self||!1;var u=this;n.on("updateFields",(function(e){var t=u.uid.split("."),n=e.data;t.forEach((function(e){n&&(n=n[e])})),u._data!==n&&(u._data=n)}))}return e.prototype.setData=function(e){var t=this,r=this,o={data:e,uid:r.uid,self:r._self};return r._self||-1===n.indexOf(r.data_type)&&r.data_type?this._connection.sendToParent("setData",o).then((function(){return t._data=e,Promise.resolve(r)})).catch((function(e){return Promise.reject(e)})):Promise.reject(new Error("Cannot call set data for current field type"))},e.prototype.getData=function(e){var t=(void 0===e?{}:e).resolved;return void 0!==t&&t?this._resolvedData:this._data},e.prototype.setFocus=function(){return this._connection.sendToParent("focus")},e.prototype.onChange=function(e){var t=this;if(!e||"function"!=typeof e)throw Error("Callback must be a function");this._emitter.on("extensionFieldChange",(function(n){t._data=n.data,t._resolvedData=n.data,e(n.data)}))},e}();t.default=r},607:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(112)),i=r(n(727)),a=n(147);i.default.CONFIG.LOG_LEVEL="error";var s=function(){function e(){}return e.init=function(){var e=this;return this._extension?Promise.resolve(this._extension):o.default.initialize(a.version).then((function(t){return e._extension=new o.default(t),Promise.resolve(e._extension)})).catch((function(e){return Promise.reject(e)}))},Object.defineProperty(e,"SDK_VERSION",{get:function(){return a.version},enumerable:!1,configurable:!0}),e}();t.default=s,e.exports=s},65:function(e,t){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getReferences=t.includeReference=t.includeSchema=t.includeContentType=t.includeOwner=t.environment=t.language=t.addQuery=t.addParam=t._type=t.mergeDeep=t.merge=t.transform=void 0,t.transform=function(e){return function(){switch(arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0])return t=(t=this._query[e+"[BASE]"]||[]).concat(arguments[0]),this._query[e+"[BASE]"]=t,this;throw Error("Kindly provide valid parameters");case 2:var t;if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1]))return t=(t=this._query[e+"["+arguments[0]+"]"]||[]).concat(arguments[1]),this._query[e+"["+arguments[0]+"]"]=t,this;throw Error("Kindly provide valid parameters");default:throw Error("Kindly provide valid parameters")}}},t.merge=function(e,t){var n=e;return e&&t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n},t.mergeDeep=function(e,t){var n=e,r=this,o=function(e,t){var n=e;Object.keys(t).forEach((function(e){"object"===r._type(t[e])&&r._type(n[e])===r._type(t[e])?o(n[e],t[e]):"array"===r._type(t[e])&&r._type(n[e])===r._type(t[e])?n[e]=n[e].concat(t[e]):n[e]=t[e]}))};return o(n,t),n},t._type=function(e){var t=typeof e;return"object"===t&&Array.isArray(e)&&(t="array"),t},t.addParam=function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;throw Error("Kindly provide valid parameters.")},t.addQuery=function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;throw Error("First argument should be a String.")},t.language=function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;throw Error("Argument should be a String.")},t.environment=function(e){if(e&&"string"==typeof e)return this._query.environment=e,this;throw Error("Argument should be a String.")},t.includeOwner=function(){return this._query.include_owner=!0,this},t.includeContentType=function(){return this._query.include_content_type=!0,this},t.includeSchema=function(){return this._query.include_schema=!0,this},t.includeReference=function(e){if(Array.isArray(e))for(var t=0;t{"use strict";function n(e){return Promise.reject(e)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._connection=e}return e.prototype.get=function(e){if(!e||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"get",key:e}).then((function(e){return Promise.resolve(e.data)})).catch(n)},e.prototype.getAll=function(){return this._connection.sendToParent("store",{action:"getAll"}).then((function(e){var t=e.data,n=void 0===t?{}:t;return Promise.resolve(n)})).catch(n)},e.prototype.set=function(e,t){if(!e||!t||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"set",key:e,value:t}).then((function(){return Promise.resolve(!0)})).catch(n)},e.prototype.remove=function(e){if(!e||"string"!=typeof e)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"remove",key:e}).then((function(){return Promise.resolve(!0)})).catch(n)},e.prototype.clear=function(){return this._connection.sendToParent("store",{action:"clear"}).then((function(){return Promise.resolve(!0)})).catch(n)},e}();t.default=r},593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onError=t.onData=void 0,t.onData=function(e){return"string"==typeof e.data?Promise.reject(e.data):Promise.resolve(e.data)},t.onError=function(e){return Promise.reject(e)}},362:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(n(727)),a={attributes:!0,childList:!0,subtree:!0},s=function(){function e(e,t,n,r){void 0===r&&(r="half_width"),this._connection=e||i.default,this._autoResizingEnabled=!1,this._resizingEnabled=!1,this.type=t,this.state=r,this._emitter=n}return e.prototype.enableResizing=function(){return"DASHBOARD"!==this.type?Promise.resolve():(this._resizingEnabled=!0,this._connection.sendToParent("window",{action:"enableResizing"}))},e.prototype.onDashboardResize=function(e){var t=this;if("DASHBOARD"!==this.type)return!1;if(!e||"function"!=typeof e)throw Error("Callback must be a function");return t._emitter.on("dashboardResize",(function(n){t.state=n.state,e(n.state)})),!0},e.prototype.updateHeight=function(e){if("DASHBOARD"===this.type&&"half_width"===this.state)return Promise.resolve();if(!e||isNaN(e))this._height=Math.ceil(document.documentElement.getBoundingClientRect().height);else{if(this._height===e)return Promise.resolve();this._height=e}return this._connection.sendToParent("resize",this._height)},e.prototype.enableAutoResizing=function(){return this._autoResizingEnabled||"half_width"===this.state&&"DASHBOARD"===this.type||(this._autoResizingEnabled=!0,(o=new MutationObserver(this.updateHeight.bind(this))).observe(window.document.body,a)),this},e.prototype.disableAutoResizing=function(){return this._autoResizingEnabled?(this._autoResizingEnabled=!1,o.disconnect(),this):this},e.prototype.enablePaddingTop=function(){return i.default.sendToParent("window",{action:"dashboardEnableTopPadding"})},e.prototype.disablePaddingTop=function(){return i.default.sendToParent("window",{action:"dashboardDisableTopPadding"})},e}();t.default=s},795:function(e,t,n){var r;!function(t){"use strict";function o(){}var i=o.prototype,a=t.EventEmitter;function s(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function u(e){return function(){return this[e].apply(this,arguments)}}i.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t{"use strict";e.exports=JSON.parse('{"name":"@contentstack/app-sdk","version":"1.3.0","types":"dist/src/index.d.ts","description":"This SDK helps connect to the development server of the Contentstack and sync the data.","main":"dist/index.js","repository":"https://github.com/contentstack/app-sdk","scripts":{"prepublish":"npm run build","build":"webpack","test":"jest","test:watch":"jest --watchAll","test:coverage":"jest --coverage --coverageDirectory=\\"coverage\\"","dev":"webpack --watch --mode development","lint":"eslint . --ext .ts","docs":"typedoc --out doc --entryPointStrategy expand ./src","prepare":"husky install"},"keywords":[],"author":{"name":"Contentstack","url":"https://www.contentstack.com/"},"maintainers":[{"name":"Deepak Kharah","email":"deepak.kharah@contentstack.com"}],"license":"MIT","devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1","@testing-library/jest-dom":"^5.14.1","@types/chai":"^4.2.22","@types/jest":"^27.0.2","@types/mocha":"^9.0.0","@types/post-robot":"^10.0.3","@types/react":"^17.0.18","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-loader":"^9.1.0","chai":"^4.3.4","css-loader":"^5.2.2","eslint":"^8.7.0","husky":"^8.0.0","jest":"^27.3.1","mocha":"^9.2.0","react":"^17.0.2","slate":"^0.72.3","ts-jest":"^27.0.7","ts-loader":"^8.1.0","ts-node":"^10.3.0","typedoc":"^0.22.17","typescript":"^4.4.4","webpack":"^5.65.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3"},"dependencies":{"loader-utils":"^3.2.1","post-robot":"^8.0.31","wolfy87-eventemitter":"^5.2.9"},"files":["dist"]}')}},t={},function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607);var e,t})},function(e,t){e.exports=n},function(e,t,n){var r=n(35);e.exports=class{constructor(e,t="api.openai.com",n="v1"){this.__personalKey=e,this.__apiBase=t,this.__version=n,this.__httpOptions={hostname:t,port:443,method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+e}}}CompletionsCreate(e,t=5,n="davinci",o){var i=this;return new Promise((function(a,s){var u={...{path:"/"+i.__version+"/engines/"+n+"/completions"},...i.__httpOptions};const c={prompt:e,max_tokens:t};var l=JSON.stringify({...o,...c}),f="";const d=r.request(u,e=>{e.setEncoding("utf8"),e.on("data",e=>{f+=e}),e.on("end",()=>{a(JSON.parse(f))})});d.on("error",e=>{s(e)}),d.write(l),d.end()}))}}},function(e,t){e.exports=r},,,function(e,t,n){var r=n(10),o=n(34);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){(t=n(11)(!1)).push([e.i,".table-header-btn {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.toggle-btn {\n width: 34px;\n height: 18px;\n border-radius: 48px;\n display: inline-block;\n position: relative;\n background: #a9b6cb;\n cursor: pointer;\n -webkit-transition: background-color 0.4s ease-in-out;\n -moz-transition: background-color 0.4s ease-in-out;\n -o-transition: background-color 0.4s ease-in-out;\n transition: background-color 0.4s ease-in-out;\n}\n\n.toggle-btn.active {\n background: #6c5ce7;\n}\n\n.round-btn {\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 50%;\n display: inline-block;\n position: absolute;\n left: 3px;\n top: 50%;\n margin-top: -6px;\n -webkit-transition: all 0.3s ease-in-out;\n -moz-transition: all 0.3s ease-in-out;\n -o-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out;\n}\n\n.toggle-btn.active .round-btn {\n left: 18px;\n}\n\n.toggle-btn:hover .round-btn {\n box-shadow: 3px 0px 4px 0px red 100%;\n}\n\n.toggle-btn .round-btn {\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 50%;\n display: inline-block;\n position: absolute;\n left: 3px;\n top: 50%;\n margin-top: -6px;\n -webkit-transition: all 0.3s ease-in-out;\n -moz-transition: all 0.3s ease-in-out;\n -o-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out;\n}\n\n.toggle-btn.active .round-btn {\n left: 18px;\n}\n\n.toggle-btn:hover .round-btn {\n box-shadow: 3px 0px 4px 0px red 100%;\n}\n",""]),e.exports=t},function(e,t,n){var r=n(36),o=n(24),i=e.exports;for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a]);function s(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=s(e),r.request.call(this,e,t)},i.get=function(e,t){return e=s(e),r.get.call(this,e,t)}},function(e,t,n){(function(e){var r=n(37),o=n(15),i=n(48),a=n(49),s=n(24),u=t;u.request=function(t,n){t="string"==typeof t?s.parse(t):i(t);var o=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||o,u=t.hostname||t.host,c=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new r(t);return n&&f.on("response",n),f},u.get=function(e,t){var n=u.request(e,t);return n.end(),n},u.ClientRequest=r,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(1))},function(e,t,n){(function(t,r,o){var i=n(14),a=n(3),s=n(15),u=n(16),c=n(47),l=s.IncomingMessage,f=s.readyStates;var d=e.exports=function(e){var n,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)o=!1,n=!0;else if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}r._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":i.vbArray&&e?"text:vbarray":"text"}(n,o),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};a(d,u.Writable),d.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===p.indexOf(n)&&(this._headers[n]={name:e,value:t})},d.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},d.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},d.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,a=e._headers,s=null;"GET"!==n.method&&"HEAD"!==n.method&&(s=i.arraybuffer?c(t.concat(e._body)):i.blobConstructor?new r.Blob(e._body.map((function(e){return c(e)})),{type:(a["content-type"]||{}).value||""}):t.concat(e._body).toString());var u=[];if(Object.keys(a).forEach((function(e){var t=a[e].name,n=a[e].value;Array.isArray(n)?n.forEach((function(e){u.push([t,e])})):u.push([t,n])})),"fetch"===e._mode){var l=null;if(i.abortController){var d=new AbortController;l=d.signal,e._fetchAbortController=d,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=r.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:u,body:s||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var p=e._xhr=new r.XMLHttpRequest;try{p.open(e._opts.method,e._opts.url,!0)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}"responseType"in p&&(p.responseType=e._mode.split(":")[0]),"withCredentials"in p&&(p.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(p.timeout=n.requestTimeout,p.ontimeout=function(){e.emit("requestTimeout")}),u.forEach((function(e){p.setRequestHeader(e[0],e[1])})),e._response=null,p.onreadystatechange=function(){switch(p.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(p.onprogress=function(){e._onXHRProgress()}),p.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{p.send(s)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}}}},d.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},d.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},d.prototype._write=function(e,t,n){this._body.push(e),n()},d.prototype.abort=d.prototype.destroy=function(){this._destroyed=!0,r.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},d.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),u.Writable.prototype.end.call(this,e,t,n)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(6).Buffer,n(1),n(4))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<>1,l=-7,f=n?o-1:0,d=n?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=h,s/=256,o-=8);for(a=a<0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*y}},function(e,t){},function(e,t,n){"use strict";var r=n(9).Buffer,o=n(41);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(43),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,h=String.fromCharCode;function y(e){throw new RangeError(d[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function m(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(f,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=h(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function E(e){var t,n,r,o,i,a,s,c,l,f,d,h=[],v=e.length,m=0,g=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=v&&y("invalid-input"),((c=(d=e.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||c>p((u-m)/a))&&y("overflow"),m+=c*a,!(c<(l=s<=w?1:s>=w+26?26:s-w));s+=36)a>p(u/(f=36-l))&&y("overflow"),a*=f;w=_(m-i,t=h.length+1,0==i),p(m/t)>u-g&&y("overflow"),g+=p(m/t),m%=t,h.splice(m++,0,g)}return b(h)}function O(e){var t,n,r,o,i,a,s,c,l,f,d,v,m,b,E,O=[];for(v=(e=g(e)).length,t=128,n=0,i=72,a=0;a=t&&dp((u-n)/(m=r+1))&&y("overflow"),n+=(s-t)*m,t=s,a=0;au&&y("overflow"),d==t){for(c=n,l=36;!(c<(f=l<=i?1:l>=i+26?26:l-i));l+=36)E=c-f,b=36-f,O.push(h(w(f+E%b,0))),c=p(E/b);O.push(h(w(c,0))),i=_(n,m,r==o),n=0,++r}++n,++t}return O.join("")}s={version:"1.4.1",ucs2:{decode:g,encode:b},decode:E,encode:O,toASCII:function(e){return m(e,(function(e){return l.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return m(e,(function(e){return c.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(50)(e),n(1))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(53),t.encode=t.stringify=n(54)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=y.substr(0,v),d=y.substr(v+1)):(f=y,d=""),p=decodeURIComponent(f),h=decodeURIComponent(d),r(a,p)?o(a[p])?a[p].push(h):a[p]=[a[p],h]:a[p]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?S(I,--D):0,j--,10===L&&(j=1,P--),L}function W(){return L=D2||z(L)>3?"":" "}function $(e,t){for(;--t&&W()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return F(e,H()+(t<6&&32==B()&&32==W()))}function Q(e,t){for(;W()&&e+L!==57&&(e+L!==84||47!==B()););return"/*"+F(t,D-1)+"*"+_(47===e?e:W())}function J(e){for(;!z(B());)W();return F(e,D)}function Z(e){return Y(function e(t,n,r,o,i,a,s,u,c){var l=0,f=0,d=s,p=0,h=0,y=0,v=1,m=1,g=1,b=0,w="",E=i,x=a,S=o,A=w;for(;m;)switch(y=b,b=W()){case 34:case 39:case 91:case 40:A+=V(b);break;case 9:case 10:case 13:case 32:A+=K(y);break;case 92:A+=$(H()-1,7);continue;case 47:switch(B()){case 42:case 47:k(ee(Q(W(),H()),n,r),c);break;default:A+="/"}break;case 123*v:u[l++]=T(A)*g;case 125*v:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+f:h>0&&T(A)-d&&k(h>32?te(A+";",o,r,d-1):te(O(A," ","")+";",o,r,d-2),c);break;case 59:A+=";";default:if(k(S=X(A,n,r,l,f,i,u,w,E=[],x=[],d),a),123===b)if(0===f)e(A,n,S,S,E,a,d,u,x);else switch(p){case 100:case 109:case 115:e(t,S,S,o&&k(X(t,S,S,0,0,i,u,w,i,E=[],d),x),i,x,d,u,o?E:x);break;default:e(A,S,S,S,[""],x,d,u,x)}}l=f=h=0,v=g=1,w=A="",d=s;break;case 58:d=1+T(A),h=y;default:if(v<1)if(123==b)--v;else if(125==b&&0==v++&&125==U())continue;switch(A+=_(b),b*v){case 38:g=f>0?1:(A+="\f",-1);break;case 44:u[l++]=(T(A)-1)*g,g=1;break;case 64:45===B()&&(A+=V(W())),p=B(),f=T(w=A+=J(H())),b++;break;case 45:45===y&&2==T(A)&&(v=0)}}return a}("",null,null,null,[""],e=G(e),0,[0],e))}function X(e,t,n,r,o,i,a,s,u,c,l){for(var f=o-1,d=0===o?i:[""],p=C(d),h=0,y=0,v=0;h0?d[m]+" "+b:O(b,/&\f/g,d[m])))&&(u[v++]=_);return N(e,t,n,0===o?g:s,u,c,l)}function ee(e,t,n){return N(e,t,n,m,_(L),A(e,2,-2),0)}function te(e,t,n,r){return N(e,t,n,b,A(e,0,r),A(e,r+1,-1),r)}function ne(e,t){switch(function(e,t){return(((t<<2^S(e,0))<<2^S(e,1))<<2^S(e,2))<<2^S(e,3)}(e,t)){case 5103:return v+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return v+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return v+e+y+e+h+e+e;case 6828:case 4268:return v+e+h+e+e;case 6165:return v+e+h+"flex-"+e+e;case 5187:return v+e+O(e,/(\w+).+(:[^]+)/,v+"box-$1$2"+h+"flex-$1$2")+e;case 5443:return v+e+h+"flex-item-"+O(e,/flex-|-self/,"")+e;case 4675:return v+e+h+"flex-line-pack"+O(e,/align-content|flex-|-self/,"")+e;case 5548:return v+e+h+O(e,"shrink","negative")+e;case 5292:return v+e+h+O(e,"basis","preferred-size")+e;case 6060:return v+"box-"+O(e,"-grow","")+v+e+h+O(e,"grow","positive")+e;case 4554:return v+O(e,/([^-])(transform)/g,"$1"+v+"$2")+e;case 6187:return O(O(O(e,/(zoom-|grab)/,v+"$1"),/(image-set)/,v+"$1"),e,"")+e;case 5495:case 3959:return O(e,/(image-set\([^]*)/,v+"$1$`$1");case 4968:return O(O(e,/(.+:)(flex-)?(.*)/,v+"box-pack:$3"+h+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+v+e+e;case 4095:case 3583:case 4068:case 2532:return O(e,/(.+)-inline(.+)/,v+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(T(e)-1-t>6)switch(S(e,t+1)){case 109:if(45!==S(e,t+4))break;case 102:return O(e,/(.+:)(.+)-([^]+)/,"$1"+v+"$2-$3$1"+y+(108==S(e,t+3)?"$3":"$2-$3"))+e;case 115:return~x(e,"stretch")?ne(O(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==S(e,t+1))break;case 6444:switch(S(e,T(e)-3-(~x(e,"!important")&&10))){case 107:return O(e,":",":"+v)+e;case 101:return O(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+v+(45===S(e,14)?"inline-":"")+"box$3$1"+v+"$2$3$1"+h+"$2box$3")+e}break;case 5936:switch(S(e,t+11)){case 114:return v+e+h+O(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return v+e+h+O(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return v+e+h+O(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return v+e+h+e+e}return e}function re(e,t){for(var n="",r=C(e),o=0;o=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},he={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ye=/[A-Z]|^ms/g,ve=/_EMO_([^_]+?)_([^]*?)_EMO_/g,me=function(e){return 45===e.charCodeAt(1)},ge=function(e){return null!=e&&"boolean"!=typeof e},be=ae((function(e){return me(e)?e:e.replace(ye,"-$&").toLowerCase()})),we=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ve,(function(e,t,n){return Ee={name:t,styles:n,next:Ee},t}))}return 1===he[e]||me(e)||"number"!=typeof t||0===t?t:t+"px"};function _e(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Ee={name:n.name,styles:n.styles,next:Ee},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Ee={name:r.name,styles:r.styles,next:Ee},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&(o.preventDefault(),r.insertText(a,{at:r.selection.get()}),null==i||(i.childNodes[0].innerHTML="")),32===o.keyCode?function(e,t){Ke(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u;return $e(this,(function(c){switch(c.label){case 0:return e.selection.get()&&"Tab"!==t?(n=e.getNode(e.selection.get())[0].text,r=document.getElementById("shadowDiv"),n&&0!==n.trim().length?r?[3,2]:[4,Ve(n,"data-api")]:[3,5]):[2];case 1:return(o=c.sent())&&Qe(null===(i=window.getSelection())||void 0===i?void 0:i.anchorNode,o,t,!0),[3,5];case 2:return""!==(null===(a=null==r?void 0:r.childNodes[0])||void 0===a?void 0:a.textContent)?[3,4]:[4,Ve(n,"data-api")];case 3:return(o=c.sent())&&Qe(null===(s=window.getSelection())||void 0===s?void 0:s.anchorNode,o,t,!0),[3,5];case 4:Qe(null===(u=window.getSelection())||void 0===u?void 0:u.anchorNode,null==r?void 0:r.childNodes[0].textContent,t,!1),c.label=5;case 5:return[2]}}))}))}(r,Be):(null==a?void 0:a.length)>0&&Qe(null===(n=window.getSelection())||void 0===n?void 0:n.anchorNode,a,Be,!1)}})),t.on("change",(function(e){e.event,e.rte})),t};n(24);function Ze(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xe(e){return e instanceof Ze(e).Element||e instanceof Element}function et(e){return e instanceof Ze(e).HTMLElement||e instanceof HTMLElement}function tt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ze(e).ShadowRoot||e instanceof ShadowRoot)}var nt=Math.round;function rt(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;return et(e)&&t&&(r=n.width/e.offsetWidth||1,o=n.height/e.offsetHeight||1),{width:nt(n.width/r),height:nt(n.height/o),top:nt(n.top/o),right:nt(n.right/r),bottom:nt(n.bottom/o),left:nt(n.left/r),x:nt(n.left/r),y:nt(n.top/o)}}function ot(e){var t=Ze(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function it(e){return e?(e.nodeName||"").toLowerCase():null}function at(e){return((Xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function st(e){return rt(at(e)).left+ot(e).scrollLeft}function ut(e){return Ze(e).getComputedStyle(e)}function ct(e){var t=ut(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function lt(e,t,n){void 0===n&&(n=!1);var r,o,i=et(t),a=et(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return 1!==n||1!==r}(t),s=at(t),u=rt(e,a),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==it(t)||ct(s))&&(c=(r=t)!==Ze(r)&&et(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:ot(r)),et(t)?((l=rt(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=st(s))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function ft(e){var t=rt(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function dt(e){return"html"===it(e)?e:e.assignedSlot||e.parentNode||(tt(e)?e.host:null)||at(e)}function pt(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(it(t))>=0?t.ownerDocument.body:et(t)&&ct(t)?t:e(dt(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Ze(r),a=o?[i].concat(i.visualViewport||[],ct(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(pt(dt(a)))}function ht(e){return["table","td","th"].indexOf(it(e))>=0}function yt(e){return et(e)&&"fixed"!==ut(e).position?e.offsetParent:null}function vt(e){for(var t=Ze(e),n=yt(e);n&&ht(n)&&"static"===ut(n).position;)n=yt(n);return n&&("html"===it(n)||"body"===it(n)&&"static"===ut(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&et(e)&&"fixed"===ut(e).position)return null;for(var n=dt(e);et(n)&&["html","body"].indexOf(it(n))<0;){var r=ut(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var mt="top",gt="bottom",bt="right",wt="left",_t=[mt,gt,bt,wt],Et=_t.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),Ot=[].concat(_t,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),xt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function St(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=t.get(r);o&&e(o)}})),r.push(o)}(e)})),r}var At={placement:"bottom",modifiers:[],strategy:"absolute"};function Tt(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Dt(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Pt(o):null,a=o?jt(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case mt:t={x:s,y:n.y-r.height};break;case gt:t={x:s,y:n.y+n.height};break;case bt:t={x:n.x+n.width,y:u};break;case wt:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var c=i?Mt(i):null;if(null!=c){var l="y"===c?"height":"width";switch(a){case"start":t[c]=t[c]-(n[l]/2-r[l]/2);break;case"end":t[c]=t[c]+(n[l]/2-r[l]/2)}}return t}var Lt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Dt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},It=Math.max,Nt=Math.min,qt=Math.round,Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,s=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,l=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:qt(qt(t*r)/r)||0,y:qt(qt(n*r)/r)||0}}(i):"function"==typeof c?c(i):i,f=l.x,d=void 0===f?0:f,p=l.y,h=void 0===p?0:p,y=i.hasOwnProperty("x"),v=i.hasOwnProperty("y"),m=wt,g=mt,b=window;if(u){var w=vt(n),_="clientHeight",E="clientWidth";w===Ze(n)&&"static"!==ut(w=at(n)).position&&(_="scrollHeight",E="scrollWidth"),w=w,o===mt&&(g=gt,h-=w[_]-r.height,h*=s?1:-1),o===wt&&(m=bt,d-=w[E]-r.width,d*=s?1:-1)}var O,x=Object.assign({position:a},u&&Ut);return s?Object.assign({},x,((O={})[g]=v?"0":"",O[m]=y?"0":"",O.transform=(b.devicePixelRatio||1)<2?"translate("+d+"px, "+h+"px)":"translate3d("+d+"px, "+h+"px, 0)",O)):Object.assign({},x,((t={})[g]=v?h+"px":"",t[m]=y?d+"px":"",t.transform="",t))}var Bt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];et(o)&&it(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});et(r)&&it(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Ht={left:"right",right:"left",bottom:"top",top:"bottom"};function Ft(e){return e.replace(/left|right|bottom|top/g,(function(e){return Ht[e]}))}var zt={start:"end",end:"start"};function Gt(e){return e.replace(/start|end/g,(function(e){return zt[e]}))}function Yt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tt(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Vt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Kt(e,t){return"viewport"===t?Vt(function(e){var t=Ze(e),n=at(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+st(e),y:s}}(e)):et(t)?function(e){var t=rt(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Vt(function(e){var t,n=at(e),r=ot(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=It(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=It(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+st(e),u=-r.scrollTop;return"rtl"===ut(o||n).direction&&(s+=It(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(at(e)))}function $t(e,t,n){var r="clippingParents"===t?function(e){var t=pt(dt(e)),n=["absolute","fixed"].indexOf(ut(e).position)>=0&&et(e)?vt(e):e;return Xe(n)?t.filter((function(e){return Xe(e)&&Yt(e,n)&&"body"!==it(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Kt(e,n);return t.top=It(r.top,t.top),t.right=Nt(r.right,t.right),t.bottom=Nt(r.bottom,t.bottom),t.left=It(r.left,t.left),t}),Kt(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Jt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Zt(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?"viewport":s,c=n.elementContext,l=void 0===c?"popper":c,f=n.altBoundary,d=void 0!==f&&f,p=n.padding,h=void 0===p?0:p,y=Qt("number"!=typeof h?h:Jt(h,_t)),v="popper"===l?"reference":"popper",m=e.elements.reference,g=e.rects.popper,b=e.elements[d?v:l],w=$t(Xe(b)?b:b.contextElement||at(e.elements.popper),a,u),_=rt(m),E=Dt({reference:_,element:g,strategy:"absolute",placement:o}),O=Vt(Object.assign({},g,E)),x="popper"===l?O:_,S={top:w.top-x.top+y.top,bottom:x.bottom-w.bottom+y.bottom,left:w.left-x.left+y.left,right:x.right-w.right+y.right},A=e.modifiersData.offset;if("popper"===l&&A){var T=A[o];Object.keys(S).forEach((function(e){var t=[bt,gt].indexOf(e)>=0?1:-1,n=[mt,gt].indexOf(e)>=0?"y":"x";S[e]+=T[n]*t}))}return S}function Xt(e,t,n){return It(e,Nt(t,n))}function en(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function tn(e){return[mt,bt,gt,wt].some((function(t){return e[t]>=0}))}var nn=Ct({defaultModifiers:[Rt,Lt,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s,c={placement:Pt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Wt(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Wt(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Bt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Ot.reduce((function(e,n){return e[n]=function(e,t,n){var r=Pt(e),o=[wt,mt].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[wt,bt].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,y=n.allowedAutoPlacements,v=t.options.placement,m=Pt(v),g=u||(m===v||!h?[Ft(v)]:function(e){if("auto"===Pt(e))return[];var t=Ft(e);return[Gt(e),t,Gt(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat("auto"===Pt(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?Ot:u,l=jt(r),f=l?s?Et:Et.filter((function(e){return jt(e)===l})):_t,d=f.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=Zt(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Pt(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:y}):n)}),[]),w=t.rects.reference,_=t.rects.popper,E=new Map,O=!0,x=b[0],S=0;S=0,R=k?"width":"height",P=Zt(t,{placement:A,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),j=k?C?bt:wt:C?gt:mt;w[R]>_[R]&&(j=Ft(j));var M=Ft(j),D=[];if(i&&D.push(P[T]<=0),s&&D.push(P[j]<=0,P[M]<=0),D.every((function(e){return e}))){x=A,O=!1;break}E.set(A,D)}if(O)for(var L=function(e){var t=b.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return x=t,"break"},I=h?3:1;I>0;I--){if("break"===L(I))break}t.placement!==x&&(t.modifiersData[r]._skip=!0,t.placement=x,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,y=void 0===h?0:h,v=Zt(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:l}),m=Pt(t.placement),g=jt(t.placement),b=!g,w=Mt(m),_="x"===w?"y":"x",E=t.modifiersData.popperOffsets,O=t.rects.reference,x=t.rects.popper,S="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,A={x:0,y:0};if(E){if(i||s){var T="y"===w?mt:wt,C="y"===w?gt:bt,k="y"===w?"height":"width",R=E[w],P=E[w]+v[T],j=E[w]-v[C],M=p?-x[k]/2:0,D="start"===g?O[k]:x[k],L="start"===g?-x[k]:-O[k],I=t.elements.arrow,N=p&&I?ft(I):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=q[T],W=q[C],B=Xt(0,O[k],N[k]),H=b?O[k]/2-M-B-U-S:D-B-U-S,F=b?-O[k]/2+M+B+W+S:L+B+W+S,z=t.elements.arrow&&vt(t.elements.arrow),G=z?"y"===w?z.clientTop||0:z.clientLeft||0:0,Y=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,V=E[w]+H-Y-G,K=E[w]+F-Y;if(i){var $=Xt(p?Nt(P,V):P,R,p?It(j,K):j);E[w]=$,A[w]=$-R}if(s){var Q="x"===w?mt:wt,J="x"===w?gt:bt,Z=E[_],X=Z+v[Q],ee=Z-v[J],te=Xt(p?Nt(X,V):X,Z,p?It(ee,K):ee);E[_]=te,A[_]=te-Z}}t.modifiersData[r]=A}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Pt(n.placement),u=Mt(s),c=[wt,bt].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(e,t){return Qt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Jt(e,_t))}(o.padding,n),f=ft(i),d="y"===u?mt:wt,p="y"===u?gt:bt,h=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],y=a[u]-n.rects.reference[u],v=vt(i),m=v?"y"===u?v.clientHeight||0:v.clientWidth||0:0,g=h/2-y/2,b=l[d],w=m-f[c]-l[p],_=m/2-f[c]/2+g,E=Xt(b,_,w),O=u;n.modifiersData[r]=((t={})[O]=E,t.centerOffset=E-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Yt(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Zt(t,{elementContext:"reference"}),s=Zt(t,{altBoundary:!0}),u=en(a,r),c=en(s,o,i),l=tn(u),f=tn(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}}]}),rn={passive:!0,capture:!0};function on(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function an(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function sn(e,t){return"function"==typeof e?e.apply(void 0,t):e}function un(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function cn(e){return[].concat(e)}function ln(e,t){-1===e.indexOf(t)&&e.push(t)}function fn(e){return e.split("-")[0]}function dn(e){return[].slice.call(e)}function pn(){return document.createElement("div")}function hn(e){return["Element","Fragment"].some((function(t){return an(e,t)}))}function yn(e){return an(e,"MouseEvent")}function vn(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function mn(e){return hn(e)?[e]:function(e){return an(e,"NodeList")}(e)?dn(e):Array.isArray(e)?e:dn(document.querySelectorAll(e))}function gn(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function bn(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function wn(e){var t,n=cn(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function _n(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var En={isTouch:!1},On=0;function xn(){En.isTouch||(En.isTouch=!0,window.performance&&document.addEventListener("mousemove",Sn))}function Sn(){var e=performance.now();e-On<20&&(En.isTouch=!1,document.removeEventListener("mousemove",Sn)),On=e}function An(){var e=document.activeElement;if(vn(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Tn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Cn=/MSIE |Trident\//.test(Tn);var kn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Rn=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kn,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Pn=Object.keys(Rn);function jn(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:o),t}),{});return Object.assign({},e,{},t)}function Mn(e,t){var n=Object.assign({},t,{content:sn(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(jn(Object.assign({},Rn,{plugins:t}))):Pn).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Rn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Dn(e,t){e.innerHTML=t}function Ln(e){var t=pn();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",hn(e)?t.appendChild(e):Dn(t,e)),t}function In(e,t){hn(t.content)?(Dn(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Dn(e,t.content):e.textContent=t.content)}function Nn(e){var t=e.firstElementChild,n=dn(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function qn(e){var t=pn(),n=pn();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=pn();function o(n,r){var o=Nn(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||In(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(Ln(r.arrow))):i.appendChild(Ln(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),In(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}qn.$$tippy=!0;var Un=1,Wn=[],Bn=[];function Hn(e,t){var n,r,o,i,a,s,u,c,l,f=Mn(e,Object.assign({},Rn,{},jn((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),d=!1,p=!1,h=!1,y=!1,v=[],m=un(K,f.interactiveDebounce),g=Un++,b=(l=f.plugins).filter((function(e,t){return l.indexOf(e)===t})),w={id:g,reference:e,popper:pn(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(t){0;if(w.state.isDestroyed)return;D("onBeforeUpdate",[w,t]),Y();var n=w.props,r=Mn(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,G(),n.interactiveDebounce!==r.interactiveDebounce&&(N(),m=un(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?cn(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");I(),M(),O&&O(n,r);w.popperInstance&&(Z(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));D("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=En.isTouch&&!w.props.touch,o=on(w.props.duration,0,Rn.duration);if(e||t||n||r)return;if(k().hasAttribute("disabled"))return;if(D("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(E.style.visibility="visible");M(),B(),w.state.isMounted||(E.style.transition="none");if(C()){var i=P(),a=i.box,s=i.content;gn([a,s],0)}u=function(){var e;if(w.state.isVisible&&!y){if(y=!0,E.offsetHeight,E.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;gn([n,r],o),bn([n,r],"visible")}L(),I(),ln(Bn,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,D("onMount",[w]),w.props.animation&&C()&&function(e,t){F(e,t)}(o,(function(){w.state.isShown=!0,D("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=k();e=w.props.interactive&&t===Rn.appendTo||"parent"===t?n.parentNode:sn(t,[n]);e.contains(E)||e.appendChild(E);Z(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=on(w.props.duration,1,Rn.duration);if(e||t||n)return;if(D("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,y=!1,d=!1,C()&&(E.style.visibility="hidden");if(N(),H(),M(),C()){var o=P(),i=o.box,a=o.content;w.props.animation&&(gn([i,a],r),bn([i,a],"hidden"))}L(),I(),w.props.animation?C()&&function(e,t){F(e,(function(){!w.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;R().addEventListener("mousemove",m),ln(Wn,m),m(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;X(),ee().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E);Bn=Bn.filter((function(e){return e!==w})),w.state.isMounted=!1,D("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),Y(),delete e._tippy,w.state.isDestroyed=!0,D("onDestroy",[w])}};if(!f.render)return w;var _=f.render(w),E=_.popper,O=_.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+w.id,w.popper=E,e._tippy=w,E._tippy=w;var x=b.map((function(e){return e.fn(w)})),S=e.hasAttribute("aria-expanded");return G(),I(),M(),D("onCreate",[w]),f.showOnCreate&&te(),E.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(R().addEventListener("mousemove",m),m(e))})),w;function A(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function T(){return"hold"===A()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function k(){return c||e}function R(){var e=k().parentNode;return e?wn(e):document}function P(){return Nn(E)}function j(e){return w.state.isMounted&&!w.state.isVisible||En.isTouch||a&&"focus"===a.type?0:on(w.props.delay,e?0:1,Rn.delay)}function M(){E.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",E.style.zIndex=""+w.props.zIndex}function D(e,t,n){var r;(void 0===n&&(n=!0),x.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function L(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=E.id;cn(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function I(){!S&&w.props.aria.expanded&&cn(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")}))}function N(){R().removeEventListener("mousemove",m),Wn=Wn.filter((function(e){return e!==m}))}function q(e){if(!(En.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&E.contains(e.target))){if(k().contains(e.target)){if(En.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),p=!0,setTimeout((function(){p=!1})),w.state.isMounted||H())}}function U(){h=!0}function W(){h=!1}function B(){var e=R();e.addEventListener("mousedown",q,!0),e.addEventListener("touchend",q,rn),e.addEventListener("touchstart",W,rn),e.addEventListener("touchmove",U,rn)}function H(){var e=R();e.removeEventListener("mousedown",q,!0),e.removeEventListener("touchend",q,rn),e.removeEventListener("touchstart",W,rn),e.removeEventListener("touchmove",U,rn)}function F(e,t){var n=P().box;function r(e){e.target===n&&(_n(n,"remove",r),t())}if(0===e)return t();_n(n,"remove",s),_n(n,"add",r),s=r}function z(t,n,r){void 0===r&&(r=!1),cn(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function G(){var e;T()&&(z("touchstart",V,{passive:!0}),z("touchend",$,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(z(e,V),e){case"mouseenter":z("mouseleave",$);break;case"focus":z(Cn?"focusout":"blur",Q);break;case"focusin":z("focusout",Q)}}))}function Y(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),v=[]}function V(e){var t,n=!1;if(w.state.isEnabled&&!J(e)&&!p){var r="focus"===(null==(t=a)?void 0:t.type);a=e,c=e.currentTarget,I(),!w.state.isVisible&&yn(e)&&Wn.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||d)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(d=!n),n&&!r&&ne(e)}}function K(e){var t=e.target,n=k().contains(t)||E.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=fn(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,l="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+u>i,p=r-t.bottom-c>i,h=t.left-n+l>i,y=n-t.right-f>i;return d||p||h||y}))}(ee().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:f}:null})).filter(Boolean),e)&&(N(),ne(e))}function $(e){J(e)||w.props.trigger.indexOf("click")>=0&&d||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function Q(e){w.props.trigger.indexOf("focusin")<0&&e.target!==k()||w.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||ne(e)}function J(e){return!!En.isTouch&&T()!==e.type.indexOf("touch")>=0}function Z(){X();var t=w.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,s=C()?Nn(E).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||k()}:e,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&l.push({name:"arrow",options:{element:s,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=nn(c,E,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:l}))}function X(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return dn(E.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&D("onTrigger",[w,e]),B();var t=j(!0),n=A(),o=n[0],i=n[1];En.isTouch&&"hold"===o&&i&&(t=i),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),D("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=j(!1);t?o=setTimeout((function(){w.state.isVisible&&w.hide()}),t):i=requestAnimationFrame((function(){w.hide()}))}}else H()}}function Fn(e,t){void 0===t&&(t={});var n=Rn.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",xn,rn),window.addEventListener("blur",An);var r=Object.assign({},t,{plugins:n}),o=mn(e).reduce((function(e,t){var n=t&&Hn(t,r);return n&&e.push(n),e}),[]);return hn(e)?o[0]:o}Fn.defaultProps=Rn,Fn.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Rn[t]=e[t]}))},Fn.currentInput=En;Object.assign({},Bt,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Fn.setDefaultProps({render:qn});var zn=Fn,Gn=n(29);function Yn(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}var Vn="undefined"!=typeof window&&"undefined"!=typeof document;function Kn(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function $n(){return Vn&&document.createElement("div")}function Qn(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,n){if(t===n)return!0;if("object"==typeof t&&null!=t&&"object"==typeof n&&null!=n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var r in t){if(!n.hasOwnProperty(r))return!1;if(!e(t[r],n[r]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function Jn(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Qn([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]))})})}var Zn=Vn?i.useLayoutEffect:i.useEffect;function Xn(e){var t=Object(i.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function er(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var tr={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||er(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&er(t,"remove",e.props.className)},onAfterUpdate:r}}};function nr(e){return function(t){var n=t.children,r=t.content,o=t.visible,s=t.singleton,u=t.render,c=t.reference,l=t.disabled,f=void 0!==l&&l,d=t.ignoreAttributes,p=void 0===d||d,h=(t.__source,t.__self,Yn(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),y=void 0!==o,v=void 0!==s,m=Object(i.useState)(!1),g=m[0],b=m[1],w=Object(i.useState)({}),_=w[0],E=w[1],O=Object(i.useState)(),x=O[0],S=O[1],A=Xn((function(){return{container:$n(),renders:1}})),T=Object.assign({ignoreAttributes:p},h,{content:A.container});y&&(T.trigger="manual",T.hideOnClick=!1),v&&(f=!0);var C=T,k=T.plugins||[];u&&(C=Object.assign({},T,{plugins:v?[].concat(k,[{fn:function(){return{onTrigger:function(e,t){var n=s.data.children.find((function(e){return e.instance.reference===t.currentTarget})).content;S(n)}}}}]):k,render:function(){return{popper:A.container}}}));var R=[c].concat(n?[n.type]:[]);return Zn((function(){var t=c;c&&c.hasOwnProperty("current")&&(t=c.current);var n=e(t||A.ref||$n(),Object.assign({},C,{plugins:[tr].concat(T.plugins||[])}));return A.instance=n,f&&n.disable(),o&&n.show(),v&&s.hook({instance:n,content:r,props:C}),b(!0),function(){n.destroy(),null==s||s.cleanup(n)}}),R),Zn((function(){var e;if(1!==A.renders){var t=A.instance;t.setProps(Jn(t.props,C)),null==(e=t.popperInstance)||e.forceUpdate(),f?t.disable():t.enable(),y&&(o?t.show():t.hide()),v&&s.hook({instance:t,content:r,props:C})}else A.renders++})),Zn((function(){var e;if(u){var t=A.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;_.placement===n.placement&&_.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&_.escaped===(null==r?void 0:r.hasPopperEscaped)||E({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[_.placement,_.referenceHidden,_.escaped].concat(R)),a.a.createElement(a.a.Fragment,null,n?Object(i.cloneElement)(n,{ref:function(e){A.ref=e,Kn(n.ref,e)}}):null,g&&Object(Gn.createPortal)(u?u(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(_),x,A.instance):r,A.container))}}var rr=function(e,t){return Object(i.forwardRef)((function(n,r){var o=n.children,s=Yn(n,["children"]);return a.a.createElement(e,Object.assign({},t,s),o?Object(i.cloneElement)(o,{ref:function(e){Kn(r,e),Kn(o.ref,e)}}):null)}))},or=rr(nr(zn)),ir=function(e,t){return a.a.createElement("div",{className:"spell-wrapper"},a.a.createElement("div",{className:"spelling-mistake"},"Spelling mistake"),a.a.createElement("div",{className:"spell-mistake-text"},"Possible spelling mistake found."),a.a.createElement("div",{style:{display:"flex"}},e.leaf["spell-check"].corrected_input&&e.leaf["spell-check"].corrected_input.map((function(t){return a.a.createElement("div",{className:"spell-suggestions-wrapper"},a.a.createElement("span",{className:"spell-suggestions",onClick:function(){e.setVisible(!1),e.handleClick(t)}},t))}))))},ar=function(){return(ar=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&Array.from(t).forEach((function(e){var t,n;e&&(null===(t=e[0])||void 0===t?void 0:t.contentToReplace)&&Array.from(null===(n=e[0])||void 0===n?void 0:n.contentToReplace).forEach((function(t){var n=je({},t);JSON.stringify(o)===JSON.stringify(e[1])&&i.push({"spell-check":n,anchor:{path:o,offset:t.start_offset},focus:{path:o,offset:t.end_offset+1}})}))})),i):i})),e.CIFeatures=u,{title:"Content Intelligence",icon:a.a.createElement(qe,null),render:function(e){return a.a.createElement(Ie,je({},e))},display:["toolbar"]}}));return n.on("exec",(function(e){var n,r;window.rte||(window.rte=e),(null===(r=null===(n=null==e?void 0:e.CI_Features)||void 0===n?void 0:n[1])||void 0===r?void 0:r.isEnabled)||(t=[],e.CIAppResponse.spellResponse=[])})),n.on("keydown",(function(e){return Me(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u;return De(this,(function(c){switch(c.label){case 0:return n=e.rte,r=e.event,o=n._adv.Editor.path(n._adv.editor,n.selection.get()),32!==r.keyCode?[3,6]:"Spell Correction"===(null==n?void 0:n.CIFeatures[1].name)&&!1===(null==n?void 0:n.CIFeatures[1].isEnabled)?[2]:(n._adv.Editor.nodes(n._adv.editor),(i=t.find((function(e){return JSON.stringify(o)===JSON.stringify(null==e?void 0:e[1])})))?(a=i,s=0,[4,d(""+n.getNode(n.selection.get())[0].text)]):[3,2]);case 1:a[s]=c.sent(),c.label=2;case 2:return i?(t.filter((function(e,n){JSON.stringify(o)===JSON.stringify(null==e?void 0:e[1])&&(t.indexOf(e),t.splice(t.indexOf(e),1))})),t.push(i),[3,5]):[3,3];case 3:return u=[t],[4,d(""+n.getNode(n.selection.get())[0].text)];case 4:t=Le.apply(void 0,u.concat([[[c.sent(),o]]])),c.label=5;case 5:t&&(n.CIAppResponse.spellResponse=t),c.label=6;case 6:return n.selection.get(),n.selection.set(n.selection.get()),[2]}}))}))})),n}(t),r=Je(t),o=function(e){var t=e("spell-check",(function(e){var t=function(t){var n,r,o,i,a,s,u,c,l,f,d,p,h=Array.from(null===(n=null==e?void 0:e.CIAppResponse)||void 0===n?void 0:n.spellResponse).find((function(t){return JSON.stringify(e.selection.get().anchor.path)===JSON.stringify(t[1])})),y=Array.from(null===(r=h[0])||void 0===r?void 0:r.contentToReplace).find((function(t){if(e.selection.get().anchor.offset>t.start_offset&&e.selection.get().anchor.offset<=t.end_offset)return t}));if(y){var v={anchor:{path:pr(e.selection.get().anchor.path),offset:y.start_offset},focus:{path:pr(e.selection.get().anchor.path),offset:y.end_offset+1}},m={anchor:{path:pr(e.selection.get().anchor.path),offset:y.start_offset},focus:{path:pr(e.selection.get().anchor.path),offset:y.start_offset}};e.selection.set(v),e.deleteText(),e.selection.set(m),e._adv.Editor.insertText(e._adv.editor,t);var g=Array.from(null===(o=null==e?void 0:e.CIAppResponse)||void 0===o?void 0:o.spellResponse).indexOf(h);if(g>-1){var b=null===(a=null===(i=null==e?void 0:e.CIAppResponse)||void 0===i?void 0:i.spellResponse)||void 0===a?void 0:a[g][0].contentToReplace.indexOf(y),w=e.selection.get().anchor.path;null===(l=null===(c=null===(u=null===(s=null==e?void 0:e.CIAppResponse)||void 0===s?void 0:s.spellResponse)||void 0===u?void 0:u[g])||void 0===c?void 0:c[0])||void 0===l||l.contentToReplace.splice(b,1),(null===(d=null===(f=null==e?void 0:e.CIAppResponse)||void 0===f?void 0:f.spellResponse)||void 0===d?void 0:d.length)>0&&Array.from(null===(p=null==e?void 0:e.CIAppResponse)||void 0===p?void 0:p.spellResponse).forEach((function(e){if(JSON.stringify(w)===JSON.stringify(null==e?void 0:e[1]))return Array.from(e[0].contentToReplace).forEach((function(e,n){if(t.length>y.incorrect_input.length){var r=t.length-y.incorrect_input.length;return n>=b&&(e.start_offset=e.start_offset+r,e.end_offset=e.end_offset+r),e}if(t.length=b&&(e.start_offset=e.start_offset-r,e.end_offset=e.end_offset-r),e}}))}))}}};return{display:[],elementType:["text"],render:function(e){return a.a.createElement(sr,lr({},e,{handleClick:t}))}}}));return t.on("keydown",(function(e){return fr(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c;return dr(this,(function(l){return t=e.rte,n=e.event,"Spell Correction"===(null==t?void 0:t.CIFeatures[1].name)&&!1===(null==t?void 0:t.CIFeatures[1].isEnabled)||(e.editor=t._adv.editor,r=function(e){return Array.from(e).find((function(e){return JSON.stringify(t.selection.get().anchor.path)===JSON.stringify(e[1])}))},(null===(s=null===(a=null==t?void 0:t.CIAppResponse)||void 0===a?void 0:a.spellResponse)||void 0===s?void 0:s.length)>0&&(o=String.fromCharCode(n.keyCode),!(/[a-zA-Z0-9-_ ]/.test(o)||n.keyCode>=186&&n.keyCode<=192||n.keyCode>=219&&n.keyCode<=222)&&cr()("ctrl+a")&&cr()("ctrl+c")&&cr()("ctrl+v")||(i=r(null===(u=null==t?void 0:t.CIAppResponse)||void 0===u?void 0:u.spellResponse))&&Array.from(i[0].contentToReplace).forEach((function(e){if((null==e?void 0:e.start_offset)>=t.selection.get().anchor.offset)return e.start_offset=e.start_offset+1,e.end_offset=e.end_offset+1,e})),8===n.keyCode&&(i=r(null===(c=null==t?void 0:t.CIAppResponse)||void 0===c?void 0:c.spellResponse))&&Array.from(i[0].contentToReplace).forEach((function(e){if((null==e?void 0:e.start_offset)>=t.selection.get().anchor.offset)return e.start_offset=e.start_offset-1,e.end_offset=e.end_offset-1,e})))),[2]}))}))})),t}(t),i=function(e){var t=e("grammar-check",(function(e){var t=function(){var t,n,r,o,i,a,s,u=Array.from(null===(t=null==e?void 0:e.CIAppResponse)||void 0===t?void 0:t.grammarResponse.contentToReplace).find((function(t){return e.selection.get().anchor.offset>t.start_offset&&e.selection.get().anchor.offset<=t.end_offset}));if(u){var c={anchor:{path:wr(e.selection.get().anchor.path),offset:u.start_offset},focus:{path:wr(e.selection.get().anchor.path),offset:u.end_offset+1}},l={anchor:{path:wr(e.selection.get().anchor.path),offset:u.start_offset},focus:{path:wr(e.selection.get().anchor.path),offset:u.start_offset}};e.selection.set(c),e.deleteText(),e.selection.set(l),e._adv.Editor.insertText(e._adv.editor,u.corrected_input);var f=null===(n=null==e?void 0:e.CIAppResponse)||void 0===n?void 0:n.grammarResponse.contentToReplace.indexOf(u);if(f>-1&&(null===(r=null==e?void 0:e.CIAppResponse)||void 0===r||r.grammarResponse.contentToReplace.splice(f,1),(null===(i=null===(o=null==e?void 0:e.CIAppResponse)||void 0===o?void 0:o.grammarResponse.contentToReplace)||void 0===i?void 0:i.length)>0)){if(u.corrected_input.length>u.incorrect_input.length){var d=u.corrected_input.length-u.incorrect_input.length;Array.from(null===(a=null==e?void 0:e.CIAppResponse)||void 0===a?void 0:a.grammarResponse.contentToReplace).map((function(e,t){return t>=f&&(e.start_offset=e.start_offset+d,e.end_offset=e.end_offset+d),e}))}if(u.corrected_input.length=f&&(e.start_offset=e.start_offset-p,e.end_offset=e.end_offset-p),e}))}}}};return{display:[],elementType:["text"],render:function(e){return a.a.createElement(vr,mr({},e,{handleClick:t}))}}}));return t.on("keydown",(function(e){return gr(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,l,f,d,p,h,y,v,m,g,b,w,_,E,O,x;return br(this,(function(S){return t=e.rte,n=e.event,"Grammar Correction"===(null==t?void 0:t.CIFeatures[1].name)&&!1===(null==t?void 0:t.CIFeatures[1].isEnabled)||(e.editor=t._adv.editor,(null===(u=null===(s=null===(a=null==t?void 0:t.CIAppResponse)||void 0===a?void 0:a.grammarResponse)||void 0===s?void 0:s.contentToReplace)||void 0===u?void 0:u.length)>0&&(r=String.fromCharCode(n.keyCode),!(/[a-zA-Z0-9-_ ]/.test(r)||n.keyCode>=186&&n.keyCode<=192||n.keyCode>=219&&n.keyCode<=222)&&cr()("ctrl+a")&&cr()("ctrl+c")&&cr()("ctrl+v")||(t.selection.get().anchor.offset<=(null===(l=null===(c=null==t?void 0:t.CIAppResponse)||void 0===c?void 0:c.grammarResponse)||void 0===l?void 0:l.contentToReplace[0].start_offset)?Array.from(null===(d=null===(f=null==t?void 0:t.CIAppResponse)||void 0===f?void 0:f.grammarResponse)||void 0===d?void 0:d.contentToReplace).map((function(e,t){return e.start_offset=e.start_offset+1,e.end_offset=e.end_offset+1,e})):(o=Array.from(null===(h=null===(p=null==t?void 0:t.CIAppResponse)||void 0===p?void 0:p.grammarResponse)||void 0===h?void 0:h.contentToReplace).find((function(e,n){var r,o;if(t.selection.get().anchor.offset<=e.start_offset&&t.selection.get().anchor.offset>=(null===(o=null===(r=null==t?void 0:t.CIAppResponse)||void 0===r?void 0:r.grammarResponse.contentToReplace[n-1])||void 0===o?void 0:o.end_offset))return e})))&&Array.from(null===(v=null===(y=null==t?void 0:t.CIAppResponse)||void 0===y?void 0:y.grammarResponse)||void 0===v?void 0:v.contentToReplace).map((function(e,n){var r,i;return n>=(null===(i=null===(r=null==t?void 0:t.CIAppResponse)||void 0===r?void 0:r.grammarResponse)||void 0===i?void 0:i.contentToReplace.indexOf(o))&&(e.start_offset=e.start_offset+1,e.end_offset=e.end_offset+1),e}))),8===n.keyCode&&(t.selection.get().anchor.offset<=(null===(g=null===(m=null==t?void 0:t.CIAppResponse)||void 0===m?void 0:m.grammarResponse)||void 0===g?void 0:g.contentToReplace[0].start_offset)?Array.from(null===(w=null===(b=null==t?void 0:t.CIAppResponse)||void 0===b?void 0:b.grammarResponse)||void 0===w?void 0:w.contentToReplace).map((function(e,t){return e.start_offset=e.start_offset-1,e.end_offset=e.end_offset-1,e})):(i=Array.from(null===(E=null===(_=null==t?void 0:t.CIAppResponse)||void 0===_?void 0:_.grammarResponse)||void 0===E?void 0:E.contentToReplace).find((function(e,n){var r,o;if(t.selection.get().anchor.offset<=e.start_offset&&t.selection.get().anchor.offset>=(null===(o=null===(r=null==t?void 0:t.CIAppResponse)||void 0===r?void 0:r.grammarResponse.contentToReplace[n-1])||void 0===o?void 0:o.end_offset))return e})))&&Array.from(null===(x=null===(O=null==t?void 0:t.CIAppResponse)||void 0===O?void 0:O.grammarResponse)||void 0===x?void 0:x.contentToReplace).map((function(e,n){var r,o;return n>=(null===(o=null===(r=null==t?void 0:t.CIAppResponse)||void 0===r?void 0:r.grammarResponse)||void 0===o?void 0:o.contentToReplace.indexOf(i))&&(e.start_offset=e.start_offset-1,e.end_offset=e.end_offset-1),e}))))),[2]}))}))})),t}(t),[2,{ContentIntelligence:n,GrammarCheck:i,SpellCheck:o,AutoSuggestion:r}]):[2]}}))}))}))}]))}}})); \ No newline at end of file +t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<>1,l=-7,f=n?o-1:0,d=n?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=h,s/=256,o-=8);for(a=a<0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*y}},function(e,t){},function(e,t,n){"use strict";var r=n(9).Buffer,o=n(42);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(44),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,h=String.fromCharCode;function y(e){throw new RangeError(d[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function m(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(f,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=h(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function E(e){var t,n,r,o,i,a,s,c,l,f,d,h=[],v=e.length,m=0,g=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=v&&y("invalid-input"),((c=(d=e.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||c>p((u-m)/a))&&y("overflow"),m+=c*a,!(c<(l=s<=w?1:s>=w+26?26:s-w));s+=36)a>p(u/(f=36-l))&&y("overflow"),a*=f;w=_(m-i,t=h.length+1,0==i),p(m/t)>u-g&&y("overflow"),g+=p(m/t),m%=t,h.splice(m++,0,g)}return b(h)}function x(e){var t,n,r,o,i,a,s,c,l,f,d,v,m,b,E,x=[];for(v=(e=g(e)).length,t=128,n=0,i=72,a=0;a=t&&dp((u-n)/(m=r+1))&&y("overflow"),n+=(s-t)*m,t=s,a=0;au&&y("overflow"),d==t){for(c=n,l=36;!(c<(f=l<=i?1:l>=i+26?26:l-i));l+=36)E=c-f,b=36-f,x.push(h(w(f+E%b,0))),c=p(E/b);x.push(h(w(c,0))),i=_(n,m,r==o),n=0,++r}++n,++t}return x.join("")}s={version:"1.4.1",ucs2:{decode:g,encode:b},decode:E,encode:x,toASCII:function(e){return m(e,(function(e){return l.test(e)?"xn--"+x(e):e}))},toUnicode:function(e){return m(e,(function(e){return c.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(51)(e),n(1))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(54),t.encode=t.stringify=n(55)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=y.substr(0,v),d=y.substr(v+1)):(f=y,d=""),p=decodeURIComponent(f),h=decodeURIComponent(d),r(a,p)?o(a[p])?a[p].push(h):a[p]=[a[p],h]:a[p]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r{e._adv.Editor.addMark(e._adv.editor,"spell-check-sync",!0),e._adv.Editor.removeMark(e._adv.editor,"spell-check-sync")},v=(e,t)=>h(void 0,void 0,void 0,(function*(){var n;const r=e.CIAppResponse.spellResponse;if(!(null===(n=null==e?void 0:e.CIFeatures)||void 0===n?void 0:n.spellCorrection)||!t.length)return[];const o=yield(i=t,p(void 0,void 0,void 0,(function*(){return window.postRobot.sendToParent("stackQuery",{action:"getSpellSuggestion",payload:{input_text:i},params:{urlKey:"AI_SERVICES_URL"}}).then(e=>e.data.contentToReplace?e.data:{contentToReplace:[]}).catch(e=>(console.error("Error while fetching spell response",e),{contentToReplace:[]}))})));var i;o.contentToReplace&&(o.contentToReplace.forEach(e=>{if(r.incorrectWithSuggestedResponseMap.has(e.incorrect_input)){const t=r.incorrectWithSuggestedResponseMap.get(e.incorrect_input);e.corrected_input.forEach(e=>{null==t||t.add(e)})}else r.incorrectWithSuggestedResponseMap.set(e.incorrect_input,new Set(e.corrected_input))}),e.CIAppResponse.spellResponse=r)})),m=d()(e=>h(void 0,void 0,void 0,(function*(){const[t]=e._adv.Editor.nodes(e._adv.editor,{match:(t,n)=>e._adv.Editor.isBlock(e._adv.editor,t),mode:"lowest"});if(!t)return;const n=t[1],r=e.string(n);v(e,r).finally(()=>{y(e)})})),500),g=e=>{const t=(e=>e._adv.Editor.string(e._adv.editor,[0],{voids:!0}))(e);v(e,t).finally(()=>{y(e)})},b=d()(g,500);var w=n(28);var _=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?M(z,--H):0,B--,10===F&&(B=1,W--),F}function $(){return F=H2||X(F)>3?"":" "}function re(e,t){for(;--t&&$()&&!(F<48||F>102||F>57&&F<65||F>70&&F<97););return Z(e,Q()+(t<6&&32==K()&&32==$()))}function oe(e,t){for(;$()&&e+F!==57&&(e+F!==84||47!==K()););return"/*"+Z(t,H-1)+"*"+k(47===e?e:$())}function ie(e){for(;!X(K());)$();return Z(e,H)}function ae(e){return ee(function e(t,n,r,o,i,a,s,u,c){var l=0,f=0,d=s,p=0,h=0,y=0,v=1,m=1,g=1,b=0,w="",_=i,E=a,x=o,O=w;for(;m;)switch(y=b,b=$()){case 34:case 39:case 91:case 40:O+=te(b);break;case 9:case 10:case 13:case 32:O+=ne(y);break;case 92:O+=re(Q()-1,7);continue;case 47:switch(K()){case 42:case 47:N(ue(oe($(),Q()),n,r),c);break;default:O+="/"}break;case 123*v:u[l++]=L(O)*g;case 125*v:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+f:h>0&&L(O)-d&&N(h>32?ce(O+";",o,r,d-1):ce(R(O," ","")+";",o,r,d-2),c);break;case 59:O+=";";default:if(N(x=se(O,n,r,l,f,i,u,w,_=[],E=[],d),a),123===b)if(0===f)e(O,n,x,x,_,a,d,u,E);else switch(p){case 100:case 109:case 115:e(t,x,x,o&&N(se(t,x,x,0,0,i,u,w,i,_=[],d),E),i,E,d,u,o?_:E);break;default:e(O,x,x,x,[""],E,d,u,E)}}l=f=h=0,v=g=1,w=O="",d=s;break;case 58:d=1+L(O),h=y;default:if(v<1)if(123==b)--v;else if(125==b&&0==v++&&125==V())continue;switch(O+=k(b),b*v){case 38:g=f>0?1:(O+="\f",-1);break;case 44:u[l++]=(L(O)-1)*g,g=1;break;case 64:45===K()&&(O+=te($())),p=K(),f=L(w=O+=ie(Q())),b++;break;case 45:45===y&&2==L(O)&&(v=0)}}return a}("",null,null,null,[""],e=J(e),0,[0],e))}function se(e,t,n,r,o,i,a,s,u,c,l){for(var f=o-1,d=0===o?i:[""],p=I(d),h=0,y=0,v=0;h0?d[m]+" "+g:R(g,/&\f/g,d[m])))&&(u[v++]=b);return G(e,t,n,0===o?T:s,u,c,l)}function ue(e,t,n){return G(e,t,n,S,k(F),D(e,2,-2),0)}function ce(e,t,n,r){return G(e,t,n,A,D(e,0,r),D(e,r+1,-1),r)}function le(e,t){switch(function(e,t){return(((t<<2^M(e,0))<<2^M(e,1))<<2^M(e,2))<<2^M(e,3)}(e,t)){case 5103:return O+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return O+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return O+e+x+e+E+e+e;case 6828:case 4268:return O+e+E+e+e;case 6165:return O+e+E+"flex-"+e+e;case 5187:return O+e+R(e,/(\w+).+(:[^]+)/,O+"box-$1$2"+E+"flex-$1$2")+e;case 5443:return O+e+E+"flex-item-"+R(e,/flex-|-self/,"")+e;case 4675:return O+e+E+"flex-line-pack"+R(e,/align-content|flex-|-self/,"")+e;case 5548:return O+e+E+R(e,"shrink","negative")+e;case 5292:return O+e+E+R(e,"basis","preferred-size")+e;case 6060:return O+"box-"+R(e,"-grow","")+O+e+E+R(e,"grow","positive")+e;case 4554:return O+R(e,/([^-])(transform)/g,"$1"+O+"$2")+e;case 6187:return R(R(R(e,/(zoom-|grab)/,O+"$1"),/(image-set)/,O+"$1"),e,"")+e;case 5495:case 3959:return R(e,/(image-set\([^]*)/,O+"$1$`$1");case 4968:return R(R(e,/(.+:)(flex-)?(.*)/,O+"box-pack:$3"+E+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+O+e+e;case 4095:case 3583:case 4068:case 2532:return R(e,/(.+)-inline(.+)/,O+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(e)-1-t>6)switch(M(e,t+1)){case 109:if(45!==M(e,t+4))break;case 102:return R(e,/(.+:)(.+)-([^]+)/,"$1"+O+"$2-$3$1"+x+(108==M(e,t+3)?"$3":"$2-$3"))+e;case 115:return~j(e,"stretch")?le(R(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==M(e,t+1))break;case 6444:switch(M(e,L(e)-3-(~j(e,"!important")&&10))){case 107:return R(e,":",":"+O)+e;case 101:return R(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+O+(45===M(e,14)?"inline-":"")+"box$3$1"+O+"$2$3$1"+E+"$2box$3")+e}break;case 5936:switch(M(e,t+11)){case 114:return O+e+E+R(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return O+e+E+R(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return O+e+E+R(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return O+e+E+e+e}return e}function fe(e,t){for(var n="",r=I(e),o=0;o=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Ee={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},xe=/[A-Z]|^ms/g,Oe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Se=function(e){return 45===e.charCodeAt(1)},Te=function(e){return null!=e&&"boolean"!=typeof e},Ae=he((function(e){return Se(e)?e:e.replace(xe,"-$&").toLowerCase()})),Ce=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Oe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===Ee[e]||Se(e)||"number"!=typeof t||0===t?t:t+"px"};function ke(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{const t=Object.keys(l).map(t=>({label:a.a.createElement(He,{featureName:t,rte:e})}));return a.a.createElement(w.Dropdown,{list:t,type:"click"},a.a.createElement(Be,null))},He=e=>{const{featureName:t,rte:n}=e,[r,o]=Object(i.useState)(n.CIFeatures[t]);return a.a.createElement("span",{"data-testid":"table-header-btn",className:"table-header-btn",onMouseDown:e=>{o(!r),n.CIFeatures[t]=!r}},a.a.createElement("span",null,c[t]),a.a.createElement("span",{style:{display:"flex"}},a.a.createElement(Fe,{enabled:r,featureName:t})))},Fe=e=>{const{enabled:t,featureName:n}=e;return a.a.createElement("div",{id:"ci_"+n,"data-testid":"switch-toggle",className:We("toggle-btn",{active:t})},a.a.createElement("span",{className:"round-btn"}))},ze=e=>a.a.createElement("span",Object.assign({},e.attrs,e.attributes),e.children);var Ge=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};var Ye=n(29),Ve=new(n.n(Ye).a)("your-openai-key");var $e=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Ke={"open-ai":e=>Ve.CompletionsCreate(e).then((function(e){return e.choices[0].text})).catch((function(e){console.log(e)})),"data-api":e=>$e(void 0,void 0,void 0,(function*(){return window.postRobot.sendToParent("stackQuery",{action:"getAutoSuggestion",payload:{input_text:e},params:{urlKey:"AI_SERVICES_URL"}}).then(t=>{if(t.data)return t.data.substr(e.length)}).catch(e=>e)}))},Qe=(e,t)=>{let n=Ke[t](e);if(n)return n.then(e=>e)};var Ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Xe=(e,t,n,r)=>{const o=document.createRange();let i=document.getElementById("shadowDiv");if(i){const e=null==i?void 0:i.childNodes[0];if("Shift"===n||!e)return;n===t[0]?e.textContent=t.substr(1):e.textContent=r?t:""}else{const i=document.createElement("div");i.style.display="inline",i.id="shadowDiv",i.contentEditable="false";const a=document.createElement("span");a.style.fontSize="14px",a.style.color="gray",i.appendChild(a),t=n===t[0]?t.substr(1):r?t:"",a.appendChild(document.createTextNode(t)),o.setStartAfter(e),o.setEndAfter(e),o.collapse(!1),o.insertNode(i)}};let Je;const et=e=>{const t=e("auto-suggestion",e=>({displayOn:[]}));return t.on("keydown",e=>{var t,n,r;const{rte:o,event:i}=e;if(!(null===(t=null==o?void 0:o.CIFeatures)||void 0===t?void 0:t.autoSuggestion))return;e.editor=o._adv.editor,Je=i.key;const a=document.getElementById("shadowDiv"),s=null===(n=null==a?void 0:a.childNodes[0])||void 0===n?void 0:n.textContent;"Tab"===i.key&&(null==s?void 0:s.length)>0&&(i.preventDefault(),o.insertText(s,{at:o.selection.get()}),null==a||(a.childNodes[0].innerHTML="")),32===i.keyCode?((e,t)=>{Ze(void 0,void 0,void 0,(function*(){var n,r,o,i;if(!e.selection.get()||"Tab"===t)return;let a=e.getNode(e.selection.get())[0].text,s=document.getElementById("shadowDiv");if(a&&0!==a.trim().length)if(s)if(""===(null===(r=null==s?void 0:s.childNodes[0])||void 0===r?void 0:r.textContent)){let e=yield Qe(a,"data-api");e&&Xe(null===(o=window.getSelection())||void 0===o?void 0:o.anchorNode,e,t,!0)}else Xe(null===(i=window.getSelection())||void 0===i?void 0:i.anchorNode,null==s?void 0:s.childNodes[0].textContent,t,!1);else{let e=yield Qe(a,"data-api");e&&Xe(null===(n=window.getSelection())||void 0===n?void 0:n.anchorNode,e,t,!0)}}))})(o,Je):(null==s?void 0:s.length)>0&&Xe(null===(r=window.getSelection())||void 0===r?void 0:r.anchorNode,s,Je,!1)}),t.on("change",({event:e,rte:t})=>{}),t};n(25);function tt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function nt(e){return e instanceof tt(e).Element||e instanceof Element}function rt(e){return e instanceof tt(e).HTMLElement||e instanceof HTMLElement}function ot(e){return"undefined"!=typeof ShadowRoot&&(e instanceof tt(e).ShadowRoot||e instanceof ShadowRoot)}var it=Math.round;function at(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;return rt(e)&&t&&(r=n.width/e.offsetWidth||1,o=n.height/e.offsetHeight||1),{width:it(n.width/r),height:it(n.height/o),top:it(n.top/o),right:it(n.right/r),bottom:it(n.bottom/o),left:it(n.left/r),x:it(n.left/r),y:it(n.top/o)}}function st(e){var t=tt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ut(e){return e?(e.nodeName||"").toLowerCase():null}function ct(e){return((nt(e)?e.ownerDocument:e.document)||window.document).documentElement}function lt(e){return at(ct(e)).left+st(e).scrollLeft}function ft(e){return tt(e).getComputedStyle(e)}function dt(e){var t=ft(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function pt(e,t,n){void 0===n&&(n=!1);var r,o,i=rt(t),a=rt(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return 1!==n||1!==r}(t),s=ct(t),u=at(e,a),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==ut(t)||dt(s))&&(c=(r=t)!==tt(r)&&rt(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:st(r)),rt(t)?((l=at(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=lt(s))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function ht(e){var t=at(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function yt(e){return"html"===ut(e)?e:e.assignedSlot||e.parentNode||(ot(e)?e.host:null)||ct(e)}function vt(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(ut(t))>=0?t.ownerDocument.body:rt(t)&&dt(t)?t:e(yt(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=tt(r),a=o?[i].concat(i.visualViewport||[],dt(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(vt(yt(a)))}function mt(e){return["table","td","th"].indexOf(ut(e))>=0}function gt(e){return rt(e)&&"fixed"!==ft(e).position?e.offsetParent:null}function bt(e){for(var t=tt(e),n=gt(e);n&&mt(n)&&"static"===ft(n).position;)n=gt(n);return n&&("html"===ut(n)||"body"===ut(n)&&"static"===ft(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&rt(e)&&"fixed"===ft(e).position)return null;for(var n=yt(e);rt(n)&&["html","body"].indexOf(ut(n))<0;){var r=ft(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var wt="top",_t="bottom",Et="right",xt="left",Ot=[wt,_t,Et,xt],St=Ot.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),Tt=[].concat(Ot,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),At=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Ct(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=t.get(r);o&&e(o)}})),r.push(o)}(e)})),r}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Pt(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Nt(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Dt(o):null,a=o?Lt(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case wt:t={x:s,y:n.y-r.height};break;case _t:t={x:s,y:n.y+n.height};break;case Et:t={x:n.x+n.width,y:u};break;case xt:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var c=i?It(i):null;if(null!=c){var l="y"===c?"height":"width";switch(a){case"start":t[c]=t[c]-(n[l]/2-r[l]/2);break;case"end":t[c]=t[c]+(n[l]/2-r[l]/2)}}return t}var qt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Nt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Wt=Math.max,Bt=Math.min,Ut=Math.round,Ht={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ft(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,s=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,l=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Ut(Ut(t*r)/r)||0,y:Ut(Ut(n*r)/r)||0}}(i):"function"==typeof c?c(i):i,f=l.x,d=void 0===f?0:f,p=l.y,h=void 0===p?0:p,y=i.hasOwnProperty("x"),v=i.hasOwnProperty("y"),m=xt,g=wt,b=window;if(u){var w=bt(n),_="clientHeight",E="clientWidth";w===tt(n)&&"static"!==ft(w=ct(n)).position&&(_="scrollHeight",E="scrollWidth"),w=w,o===wt&&(g=_t,h-=w[_]-r.height,h*=s?1:-1),o===xt&&(m=Et,d-=w[E]-r.width,d*=s?1:-1)}var x,O=Object.assign({position:a},u&&Ht);return s?Object.assign({},O,((x={})[g]=v?"0":"",x[m]=y?"0":"",x.transform=(b.devicePixelRatio||1)<2?"translate("+d+"px, "+h+"px)":"translate3d("+d+"px, "+h+"px, 0)",x)):Object.assign({},O,((t={})[g]=v?h+"px":"",t[m]=y?d+"px":"",t.transform="",t))}var zt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];rt(o)&&ut(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});rt(r)&&ut(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Gt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(e){return e.replace(/left|right|bottom|top/g,(function(e){return Gt[e]}))}var Vt={start:"end",end:"start"};function $t(e){return e.replace(/start|end/g,(function(e){return Vt[e]}))}function Kt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ot(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Qt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Zt(e,t){return"viewport"===t?Qt(function(e){var t=tt(e),n=ct(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+lt(e),y:s}}(e)):rt(t)?function(e){var t=at(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Qt(function(e){var t,n=ct(e),r=st(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Wt(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Wt(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+lt(e),u=-r.scrollTop;return"rtl"===ft(o||n).direction&&(s+=Wt(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(ct(e)))}function Xt(e,t,n){var r="clippingParents"===t?function(e){var t=vt(yt(e)),n=["absolute","fixed"].indexOf(ft(e).position)>=0&&rt(e)?bt(e):e;return nt(n)?t.filter((function(e){return nt(e)&&Kt(e,n)&&"body"!==ut(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Zt(e,n);return t.top=Wt(r.top,t.top),t.right=Bt(r.right,t.right),t.bottom=Bt(r.bottom,t.bottom),t.left=Wt(r.left,t.left),t}),Zt(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Jt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function en(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function tn(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?"viewport":s,c=n.elementContext,l=void 0===c?"popper":c,f=n.altBoundary,d=void 0!==f&&f,p=n.padding,h=void 0===p?0:p,y=Jt("number"!=typeof h?h:en(h,Ot)),v="popper"===l?"reference":"popper",m=e.elements.reference,g=e.rects.popper,b=e.elements[d?v:l],w=Xt(nt(b)?b:b.contextElement||ct(e.elements.popper),a,u),_=at(m),E=Nt({reference:_,element:g,strategy:"absolute",placement:o}),x=Qt(Object.assign({},g,E)),O="popper"===l?x:_,S={top:w.top-O.top+y.top,bottom:O.bottom-w.bottom+y.bottom,left:w.left-O.left+y.left,right:O.right-w.right+y.right},T=e.modifiersData.offset;if("popper"===l&&T){var A=T[o];Object.keys(S).forEach((function(e){var t=[Et,_t].indexOf(e)>=0?1:-1,n=[wt,_t].indexOf(e)>=0?"y":"x";S[e]+=A[n]*t}))}return S}function nn(e,t,n){return Wt(e,Bt(t,n))}function rn(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function on(e){return[wt,Et,_t,xt].some((function(t){return e[t]>=0}))}var an=Rt({defaultModifiers:[Mt,qt,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s,c={placement:Dt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ft(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ft(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},zt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Tt.reduce((function(e,n){return e[n]=function(e,t,n){var r=Dt(e),o=[xt,wt].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[xt,Et].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,y=n.allowedAutoPlacements,v=t.options.placement,m=Dt(v),g=u||(m===v||!h?[Yt(v)]:function(e){if("auto"===Dt(e))return[];var t=Yt(e);return[$t(e),t,$t(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat("auto"===Dt(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?Tt:u,l=Lt(r),f=l?s?St:St.filter((function(e){return Lt(e)===l})):Ot,d=f.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=tn(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Dt(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:y}):n)}),[]),w=t.rects.reference,_=t.rects.popper,E=new Map,x=!0,O=b[0],S=0;S=0,P=k?"width":"height",R=tn(t,{placement:T,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),j=k?C?Et:xt:C?_t:wt;w[P]>_[P]&&(j=Yt(j));var M=Yt(j),D=[];if(i&&D.push(R[A]<=0),s&&D.push(R[j]<=0,R[M]<=0),D.every((function(e){return e}))){O=T,x=!1;break}E.set(T,D)}if(x)for(var L=function(e){var t=b.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},I=h?3:1;I>0;I--){if("break"===L(I))break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,y=void 0===h?0:h,v=tn(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:l}),m=Dt(t.placement),g=Lt(t.placement),b=!g,w=It(m),_="x"===w?"y":"x",E=t.modifiersData.popperOffsets,x=t.rects.reference,O=t.rects.popper,S="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,T={x:0,y:0};if(E){if(i||s){var A="y"===w?wt:xt,C="y"===w?_t:Et,k="y"===w?"height":"width",P=E[w],R=E[w]+v[A],j=E[w]-v[C],M=p?-O[k]/2:0,D="start"===g?x[k]:O[k],L="start"===g?-O[k]:-x[k],I=t.elements.arrow,N=p&&I?ht(I):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=q[A],B=q[C],U=nn(0,x[k],N[k]),H=b?x[k]/2-M-U-W-S:D-U-W-S,F=b?-x[k]/2+M+U+B+S:L+U+B+S,z=t.elements.arrow&&bt(t.elements.arrow),G=z?"y"===w?z.clientTop||0:z.clientLeft||0:0,Y=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,V=E[w]+H-Y-G,$=E[w]+F-Y;if(i){var K=nn(p?Bt(R,V):R,P,p?Wt(j,$):j);E[w]=K,T[w]=K-P}if(s){var Q="x"===w?wt:xt,Z="x"===w?_t:Et,X=E[_],J=X+v[Q],ee=X-v[Z],te=nn(p?Bt(J,V):J,X,p?Wt(ee,$):ee);E[_]=te,T[_]=te-X}}t.modifiersData[r]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Dt(n.placement),u=It(s),c=[xt,Et].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(e,t){return Jt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:en(e,Ot))}(o.padding,n),f=ht(i),d="y"===u?wt:xt,p="y"===u?_t:Et,h=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],y=a[u]-n.rects.reference[u],v=bt(i),m=v?"y"===u?v.clientHeight||0:v.clientWidth||0:0,g=h/2-y/2,b=l[d],w=m-f[c]-l[p],_=m/2-f[c]/2+g,E=nn(b,_,w),x=u;n.modifiersData[r]=((t={})[x]=E,t.centerOffset=E-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Kt(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=tn(t,{elementContext:"reference"}),s=tn(t,{altBoundary:!0}),u=rn(a,r),c=rn(s,o,i),l=on(u),f=on(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}}]}),sn={passive:!0,capture:!0};function un(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function cn(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ln(e,t){return"function"==typeof e?e.apply(void 0,t):e}function fn(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function dn(e){return[].concat(e)}function pn(e,t){-1===e.indexOf(t)&&e.push(t)}function hn(e){return e.split("-")[0]}function yn(e){return[].slice.call(e)}function vn(){return document.createElement("div")}function mn(e){return["Element","Fragment"].some((function(t){return cn(e,t)}))}function gn(e){return cn(e,"MouseEvent")}function bn(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function wn(e){return mn(e)?[e]:function(e){return cn(e,"NodeList")}(e)?yn(e):Array.isArray(e)?e:yn(document.querySelectorAll(e))}function _n(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function En(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function xn(e){var t,n=dn(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function On(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Sn={isTouch:!1},Tn=0;function An(){Sn.isTouch||(Sn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Cn))}function Cn(){var e=performance.now();e-Tn<20&&(Sn.isTouch=!1,document.removeEventListener("mousemove",Cn)),Tn=e}function kn(){var e=document.activeElement;if(bn(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Pn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Rn=/MSIE |Trident\//.test(Pn);var jn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mn=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},jn,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Dn=Object.keys(Mn);function Ln(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:o),t}),{});return Object.assign({},e,{},t)}function In(e,t){var n=Object.assign({},t,{content:ln(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ln(Object.assign({},Mn,{plugins:t}))):Dn).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Mn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Nn(e,t){e.innerHTML=t}function qn(e){var t=vn();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",mn(e)?t.appendChild(e):Nn(t,e)),t}function Wn(e,t){mn(t.content)?(Nn(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Nn(e,t.content):e.textContent=t.content)}function Bn(e){var t=e.firstElementChild,n=yn(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Un(e){var t=vn(),n=vn();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=vn();function o(n,r){var o=Bn(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Wn(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(qn(r.arrow))):i.appendChild(qn(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),Wn(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Un.$$tippy=!0;var Hn=1,Fn=[],zn=[];function Gn(e,t){var n,r,o,i,a,s,u,c,l,f=In(e,Object.assign({},Mn,{},Ln((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),d=!1,p=!1,h=!1,y=!1,v=[],m=fn($,f.interactiveDebounce),g=Hn++,b=(l=f.plugins).filter((function(e,t){return l.indexOf(e)===t})),w={id:g,reference:e,popper:vn(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(t){0;if(w.state.isDestroyed)return;D("onBeforeUpdate",[w,t]),Y();var n=w.props,r=In(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,G(),n.interactiveDebounce!==r.interactiveDebounce&&(N(),m=fn($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?dn(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");I(),M(),x&&x(n,r);w.popperInstance&&(X(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));D("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Sn.isTouch&&!w.props.touch,o=un(w.props.duration,0,Mn.duration);if(e||t||n||r)return;if(k().hasAttribute("disabled"))return;if(D("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(E.style.visibility="visible");M(),U(),w.state.isMounted||(E.style.transition="none");if(C()){var i=R(),a=i.box,s=i.content;_n([a,s],0)}u=function(){var e;if(w.state.isVisible&&!y){if(y=!0,E.offsetHeight,E.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=R(),n=t.box,r=t.content;_n([n,r],o),En([n,r],"visible")}L(),I(),pn(zn,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,D("onMount",[w]),w.props.animation&&C()&&function(e,t){F(e,t)}(o,(function(){w.state.isShown=!0,D("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=k();e=w.props.interactive&&t===Mn.appendTo||"parent"===t?n.parentNode:ln(t,[n]);e.contains(E)||e.appendChild(E);X(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=un(w.props.duration,1,Mn.duration);if(e||t||n)return;if(D("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,y=!1,d=!1,C()&&(E.style.visibility="hidden");if(N(),H(),M(),C()){var o=R(),i=o.box,a=o.content;w.props.animation&&(_n([i,a],r),En([i,a],"hidden"))}L(),I(),w.props.animation?C()&&function(e,t){F(e,(function(){!w.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",m),pn(Fn,m),m(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;J(),ee().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E);zn=zn.filter((function(e){return e!==w})),w.state.isMounted=!1,D("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),Y(),delete e._tippy,w.state.isDestroyed=!0,D("onDestroy",[w])}};if(!f.render)return w;var _=f.render(w),E=_.popper,x=_.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+w.id,w.popper=E,e._tippy=w,E._tippy=w;var O=b.map((function(e){return e.fn(w)})),S=e.hasAttribute("aria-expanded");return G(),I(),M(),D("onCreate",[w]),f.showOnCreate&&te(),E.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(P().addEventListener("mousemove",m),m(e))})),w;function T(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===T()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function k(){return c||e}function P(){var e=k().parentNode;return e?xn(e):document}function R(){return Bn(E)}function j(e){return w.state.isMounted&&!w.state.isVisible||Sn.isTouch||a&&"focus"===a.type?0:un(w.props.delay,e?0:1,Mn.delay)}function M(){E.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",E.style.zIndex=""+w.props.zIndex}function D(e,t,n){var r;(void 0===n&&(n=!0),O.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function L(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=E.id;dn(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function I(){!S&&w.props.aria.expanded&&dn(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")}))}function N(){P().removeEventListener("mousemove",m),Fn=Fn.filter((function(e){return e!==m}))}function q(e){if(!(Sn.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&E.contains(e.target))){if(k().contains(e.target)){if(Sn.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),p=!0,setTimeout((function(){p=!1})),w.state.isMounted||H())}}function W(){h=!0}function B(){h=!1}function U(){var e=P();e.addEventListener("mousedown",q,!0),e.addEventListener("touchend",q,sn),e.addEventListener("touchstart",B,sn),e.addEventListener("touchmove",W,sn)}function H(){var e=P();e.removeEventListener("mousedown",q,!0),e.removeEventListener("touchend",q,sn),e.removeEventListener("touchstart",B,sn),e.removeEventListener("touchmove",W,sn)}function F(e,t){var n=R().box;function r(e){e.target===n&&(On(n,"remove",r),t())}if(0===e)return t();On(n,"remove",s),On(n,"add",r),s=r}function z(t,n,r){void 0===r&&(r=!1),dn(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function G(){var e;A()&&(z("touchstart",V,{passive:!0}),z("touchend",K,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(z(e,V),e){case"mouseenter":z("mouseleave",K);break;case"focus":z(Rn?"focusout":"blur",Q);break;case"focusin":z("focusout",Q)}}))}function Y(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),v=[]}function V(e){var t,n=!1;if(w.state.isEnabled&&!Z(e)&&!p){var r="focus"===(null==(t=a)?void 0:t.type);a=e,c=e.currentTarget,I(),!w.state.isVisible&&gn(e)&&Fn.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||d)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(d=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=k().contains(t)||E.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=hn(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,l="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+u>i,p=r-t.bottom-c>i,h=t.left-n+l>i,y=n-t.right-f>i;return d||p||h||y}))}(ee().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:f}:null})).filter(Boolean),e)&&(N(),ne(e))}function K(e){Z(e)||w.props.trigger.indexOf("click")>=0&&d||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function Q(e){w.props.trigger.indexOf("focusin")<0&&e.target!==k()||w.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||ne(e)}function Z(e){return!!Sn.isTouch&&A()!==e.type.indexOf("touch")>=0}function X(){J();var t=w.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,s=C()?Bn(E).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||k()}:e,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=R().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&l.push({name:"arrow",options:{element:s,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=an(c,E,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:l}))}function J(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return yn(E.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&D("onTrigger",[w,e]),U();var t=j(!0),n=T(),o=n[0],i=n[1];Sn.isTouch&&"hold"===o&&i&&(t=i),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),D("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=j(!1);t?o=setTimeout((function(){w.state.isVisible&&w.hide()}),t):i=requestAnimationFrame((function(){w.hide()}))}}else H()}}function Yn(e,t){void 0===t&&(t={});var n=Mn.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",An,sn),window.addEventListener("blur",kn);var r=Object.assign({},t,{plugins:n}),o=wn(e).reduce((function(e,t){var n=t&&Gn(t,r);return n&&e.push(n),e}),[]);return mn(e)?o[0]:o}Yn.defaultProps=Mn,Yn.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Mn[t]=e[t]}))},Yn.currentInput=Sn;Object.assign({},zt,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Yn.setDefaultProps({render:Un});var Vn=Yn,$n=n(30);function Kn(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}var Qn="undefined"!=typeof window&&"undefined"!=typeof document;function Zn(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Xn(){return Qn&&document.createElement("div")}function Jn(e){var t=[];return e.forEach((function(e){t.find((function(t){return function e(t,n){if(t===n)return!0;if("object"==typeof t&&null!=t&&"object"==typeof n&&null!=n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var r in t){if(!n.hasOwnProperty(r))return!1;if(!e(t[r],n[r]))return!1}return!0}return!1}(e,t)}))||t.push(e)})),t}function er(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Jn([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]))})})}var tr=Qn?i.useLayoutEffect:i.useEffect;function nr(e){var t=Object(i.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function rr(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var or={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||rr(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&rr(t,"remove",e.props.className)},onAfterUpdate:r}}};function ir(e){return function(t){var n=t.children,r=t.content,o=t.visible,s=t.singleton,u=t.render,c=t.reference,l=t.disabled,f=void 0!==l&&l,d=t.ignoreAttributes,p=void 0===d||d,h=(t.__source,t.__self,Kn(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),y=void 0!==o,v=void 0!==s,m=Object(i.useState)(!1),g=m[0],b=m[1],w=Object(i.useState)({}),_=w[0],E=w[1],x=Object(i.useState)(),O=x[0],S=x[1],T=nr((function(){return{container:Xn(),renders:1}})),A=Object.assign({ignoreAttributes:p},h,{content:T.container});y&&(A.trigger="manual",A.hideOnClick=!1),v&&(f=!0);var C=A,k=A.plugins||[];u&&(C=Object.assign({},A,{plugins:v?[].concat(k,[{fn:function(){return{onTrigger:function(e,t){var n=s.data.children.find((function(e){return e.instance.reference===t.currentTarget})).content;S(n)}}}}]):k,render:function(){return{popper:T.container}}}));var P=[c].concat(n?[n.type]:[]);return tr((function(){var t=c;c&&c.hasOwnProperty("current")&&(t=c.current);var n=e(t||T.ref||Xn(),Object.assign({},C,{plugins:[or].concat(A.plugins||[])}));return T.instance=n,f&&n.disable(),o&&n.show(),v&&s.hook({instance:n,content:r,props:C}),b(!0),function(){n.destroy(),null==s||s.cleanup(n)}}),P),tr((function(){var e;if(1!==T.renders){var t=T.instance;t.setProps(er(t.props,C)),null==(e=t.popperInstance)||e.forceUpdate(),f?t.disable():t.enable(),y&&(o?t.show():t.hide()),v&&s.hook({instance:t,content:r,props:C})}else T.renders++})),tr((function(){var e;if(u){var t=T.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;_.placement===n.placement&&_.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&_.escaped===(null==r?void 0:r.hasPopperEscaped)||E({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[_.placement,_.referenceHidden,_.escaped].concat(P)),a.a.createElement(a.a.Fragment,null,n?Object(i.cloneElement)(n,{ref:function(e){T.ref=e,Zn(n.ref,e)}}):null,g&&Object($n.createPortal)(u?u(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(_),O,T.instance):r,T.container))}}var ar=function(e,t){return Object(i.forwardRef)((function(n,r){var o=n.children,s=Kn(n,["children"]);return a.a.createElement(e,Object.assign({},t,s),o?Object(i.cloneElement)(o,{ref:function(e){Zn(r,e),Zn(o.ref,e)}}):null)}))},sr=ar(ir(Vn));var ur=e=>{var t;const n=(null===(t=null==e?void 0:e.leaf)||void 0===t?void 0:t["spell-check"])||new Set,r=Array.from(n);return a.a.createElement("div",{className:"spell-wrapper"},a.a.createElement("div",{className:"spelling-mistake"},"Spelling mistake"),a.a.createElement("div",{className:"spell-mistake-text"},"Possible spelling mistake found."),a.a.createElement("div",{style:{display:"flex"}},r.map(t=>a.a.createElement("div",{className:"spell-suggestions-wrapper",key:t},a.a.createElement("span",{className:"spell-suggestions",onClick:()=>{e.setVisible(!1),e.handleClick(e.leaf.text,t)}},t)))))};var cr=e=>{const[t,n]=Object(i.useState)(!1);return a.a.createElement("span",{className:"tippy-inline"},a.a.createElement(sr,{appendTo:document.body,className:"p-0",placement:"bottom-start",trigger:"click",visible:t,interactive:!0,onClickOutside:()=>n(!1),content:a.a.createElement(ur,Object.assign({},e,{handleClick:e.handleClick,setVisible:n}))},a.a.createElement("span",{style:{borderBottom:"2px solid #D62400",background:"#FFEEEB"},onClick:()=>n(!0)},e.children)))};n(26);var lr=(e,t)=>a.a.createElement("div",{className:"tooltip-wrapper"},a.a.createElement("div",{className:"grammar-wrapper"},"Grammer"),a.a.createElement("div",{className:"grammar-text"},'Use "',e.leaf["grammar-check"].corrected_input,'" instead of "',e.leaf["grammar-check"].incorrect_input,'".'),a.a.createElement("div",{className:"grammar-suggestion-wrapper"},a.a.createElement("span",{className:"grammar-suggestions",onClick:()=>{e.setVisible(!1),e.handleClick()}},e.leaf["grammar-check"].corrected_input)));var fr=(e,t)=>{const[n,r]=Object(i.useState)(!1);return a.a.createElement("span",{className:"tippy-inline"},a.a.createElement(sr,{appendTo:document.body,className:"p-0",placement:"bottom-start",trigger:"click",visible:n,interactive:!0,onClickOutside:()=>r(!1),content:a.a.createElement(lr,Object.assign({},e,{handleClick:e.handleClick,setVisible:r}))},a.a.createElement("span",{style:{borderBottom:"2px solid #FFAE0A",background:"#FFF8EB"},onClick:()=>r(!0)},e.children)))},dr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};var pr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};t.default=o.a.init().then(e=>pr(void 0,void 0,void 0,(function*(){const t=yield e.location,n=yield t.RTEPlugin;if(!n)return;const r=(e=>{const t=e("content-intelligence",e=>{e.CIFeatures=l,e.CIAppResponse={spellResponse:{incorrectWithSuggestedResponseMap:new Map}};const t=(e=>([t,n])=>{var r,o;const i=null===(r=null==e?void 0:e.CIAppResponse)||void 0===r?void 0:r.spellResponse,a=[];if(!e._adv.Text.isText(t)||!(null===(o=null==t?void 0:t.text)||void 0===o?void 0:o.length))return a;t.text.split(/[ ,]/).reduce((e,t,r)=>{const o=t.toLowerCase();return i.incorrectWithSuggestedResponseMap.has(o)&&a.push({"spell-check":i.incorrectWithSuggestedResponseMap.get(o),anchor:{path:n,offset:e},focus:{path:n,offset:e+o.length}}),e+o.length+1},0);return a})(e);return e._adv.addToDecorate(t),g(e),{title:"Content Intelligence",icon:a.a.createElement(Ue,{rte:e}),render:e=>a.a.createElement(ze,Object.assign({},e)),display:["toolbar"]}});return t.on("exec",e=>{var t;window.rte||(window.rte=e),(null===(t=null==e?void 0:e.CIFeatures)||void 0===t?void 0:t.spellCorrection)||(e.CIAppResponse.spellResponse={incorrectWithSuggestedResponseMap:new Map})}),t.on("keydown",e=>Ge(void 0,void 0,void 0,(function*(){const{rte:t,event:n}=e,r=t;u()("mod",n)||(u()("mod+v",n)||u()("mod+x",n)?b(r):m(r))}))),t})(n),o=et(n),i=(e=>e("spell-check",e=>{const t=(t,n)=>{e._adv.Transforms.move(e._adv.editor,{unit:"word"}),e._adv.editor.deleteBackward("word"),e._adv.Editor.insertText(e._adv.editor,n)};return{display:[],elementType:["text"],render:e=>a.a.createElement(cr,Object.assign({},e,{handleClick:t}))}}))(n);return{ContentIntelligence:r,GrammarCheck:(e=>{const t=e("grammar-check",e=>{const t=()=>{var t,n,r,o,i,a,s;let u=Array.from(null===(t=null==e?void 0:e.CIAppResponse)||void 0===t?void 0:t.grammarResponse.contentToReplace).find(t=>e.selection.get().anchor.offset>t.start_offset&&e.selection.get().anchor.offset<=t.end_offset);if(u){let t={anchor:{path:[...e.selection.get().anchor.path],offset:u.start_offset},focus:{path:[...e.selection.get().anchor.path],offset:u.end_offset+1}},c={anchor:{path:[...e.selection.get().anchor.path],offset:u.start_offset},focus:{path:[...e.selection.get().anchor.path],offset:u.start_offset}};e.selection.set(t),e.deleteText(),e.selection.set(c),e._adv.Editor.insertText(e._adv.editor,u.corrected_input);const l=null===(n=null==e?void 0:e.CIAppResponse)||void 0===n?void 0:n.grammarResponse.contentToReplace.indexOf(u);if(l>-1&&(null===(r=null==e?void 0:e.CIAppResponse)||void 0===r||r.grammarResponse.contentToReplace.splice(l,1),(null===(i=null===(o=null==e?void 0:e.CIAppResponse)||void 0===o?void 0:o.grammarResponse.contentToReplace)||void 0===i?void 0:i.length)>0)){if(u.corrected_input.length>u.incorrect_input.length){let t=u.corrected_input.length-u.incorrect_input.length;Array.from(null===(a=null==e?void 0:e.CIAppResponse)||void 0===a?void 0:a.grammarResponse.contentToReplace).map((e,n)=>(n>=l&&(e.start_offset=e.start_offset+t,e.end_offset=e.end_offset+t),e))}if(u.corrected_input.length(n>=l&&(e.start_offset=e.start_offset-t,e.end_offset=e.end_offset-t),e))}}}};return{display:[],elementType:["text"],render:e=>a.a.createElement(fr,Object.assign({},e,{handleClick:t}))}});return t.on("keydown",e=>dr(void 0,void 0,void 0,(function*(){var t,n,r,o,i,a,s,c,l,f,d,p,h,y,v,m,g,b,w;const{rte:_,event:E}=e;if((null==_?void 0:_.CIFeatures.grammarCorrection)&&(e.editor=_._adv.editor,(null===(r=null===(n=null===(t=null==_?void 0:_.CIAppResponse)||void 0===t?void 0:t.grammarResponse)||void 0===n?void 0:n.contentToReplace)||void 0===r?void 0:r.length)>0)){const e=String.fromCharCode(E.keyCode);if(/[a-zA-Z0-9-_ ]/.test(e)||E.keyCode>=186&&E.keyCode<=192||E.keyCode>=219&&E.keyCode<=222||!u()("ctrl+a")||!u()("ctrl+c")||!u()("ctrl+v"))if(_.selection.get().anchor.offset<=(null===(i=null===(o=null==_?void 0:_.CIAppResponse)||void 0===o?void 0:o.grammarResponse)||void 0===i?void 0:i.contentToReplace[0].start_offset))Array.from(null===(s=null===(a=null==_?void 0:_.CIAppResponse)||void 0===a?void 0:a.grammarResponse)||void 0===s?void 0:s.contentToReplace).map((e,t)=>(e.start_offset=e.start_offset+1,e.end_offset=e.end_offset+1,e));else{let e=Array.from(null===(l=null===(c=null==_?void 0:_.CIAppResponse)||void 0===c?void 0:c.grammarResponse)||void 0===l?void 0:l.contentToReplace).find((e,t)=>{var n,r;if(_.selection.get().anchor.offset<=e.start_offset&&_.selection.get().anchor.offset>=(null===(r=null===(n=null==_?void 0:_.CIAppResponse)||void 0===n?void 0:n.grammarResponse.contentToReplace[t-1])||void 0===r?void 0:r.end_offset))return e});e&&Array.from(null===(d=null===(f=null==_?void 0:_.CIAppResponse)||void 0===f?void 0:f.grammarResponse)||void 0===d?void 0:d.contentToReplace).map((t,n)=>{var r,o;return n>=(null===(o=null===(r=null==_?void 0:_.CIAppResponse)||void 0===r?void 0:r.grammarResponse)||void 0===o?void 0:o.contentToReplace.indexOf(e))&&(t.start_offset=t.start_offset+1,t.end_offset=t.end_offset+1),t})}if(8===E.keyCode)if(_.selection.get().anchor.offset<=(null===(h=null===(p=null==_?void 0:_.CIAppResponse)||void 0===p?void 0:p.grammarResponse)||void 0===h?void 0:h.contentToReplace[0].start_offset))Array.from(null===(v=null===(y=null==_?void 0:_.CIAppResponse)||void 0===y?void 0:y.grammarResponse)||void 0===v?void 0:v.contentToReplace).map((e,t)=>(e.start_offset=e.start_offset-1,e.end_offset=e.end_offset-1,e));else{let e=Array.from(null===(g=null===(m=null==_?void 0:_.CIAppResponse)||void 0===m?void 0:m.grammarResponse)||void 0===g?void 0:g.contentToReplace).find((e,t)=>{var n,r;if(_.selection.get().anchor.offset<=e.start_offset&&_.selection.get().anchor.offset>=(null===(r=null===(n=null==_?void 0:_.CIAppResponse)||void 0===n?void 0:n.grammarResponse.contentToReplace[t-1])||void 0===r?void 0:r.end_offset))return e});e&&Array.from(null===(w=null===(b=null==_?void 0:_.CIAppResponse)||void 0===b?void 0:b.grammarResponse)||void 0===w?void 0:w.contentToReplace).map((t,n)=>{var r,o;return n>=(null===(o=null===(r=null==_?void 0:_.CIAppResponse)||void 0===r?void 0:r.grammarResponse)||void 0===o?void 0:o.contentToReplace.indexOf(e))&&(t.start_offset=t.start_offset-1,t.end_offset=t.end_offset-1),t})}}}))),t})(n),SpellCheck:i,AutoSuggestion:o}})))}]))}}})); \ No newline at end of file diff --git a/content-intelligence/dist/types/auto-suggestion/getSuggestionFromProvider/Provider/getApiSuggestion.d.ts b/content-intelligence/dist/types/auto-suggestion/getSuggestionFromProvider/Provider/getApiSuggestion.d.ts index 228a0049..357fb4bf 100644 --- a/content-intelligence/dist/types/auto-suggestion/getSuggestionFromProvider/Provider/getApiSuggestion.d.ts +++ b/content-intelligence/dist/types/auto-suggestion/getSuggestionFromProvider/Provider/getApiSuggestion.d.ts @@ -1,6 +1,8 @@ +import { IAIRTEInstance } from "../../../content-intelligence/types"; declare global { interface Window { postRobot: any; + rte: IAIRTEInstance; } } export declare const getAPISuggestion: (text: any) => Promise; diff --git a/content-intelligence/dist/types/content-intelligence/ciFeatures.d.ts b/content-intelligence/dist/types/content-intelligence/ciFeatures.d.ts index 3b2905d1..11c022e7 100644 --- a/content-intelligence/dist/types/content-intelligence/ciFeatures.d.ts +++ b/content-intelligence/dist/types/content-intelligence/ciFeatures.d.ts @@ -1,5 +1,7 @@ -declare const CI_Features: { - name: string; - isEnabled: boolean; -}[]; +import { ICIFeatures } from "./types"; +declare const CI_Features: ICIFeatures; +export declare const CIFeatureName: { + autoSuggestion: string; + spellCorrection: string; +}; export default CI_Features; diff --git a/content-intelligence/dist/types/content-intelligence/components/index.d.ts b/content-intelligence/dist/types/content-intelligence/components/index.d.ts new file mode 100644 index 00000000..a3028bf8 --- /dev/null +++ b/content-intelligence/dist/types/content-intelligence/components/index.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import { IAIRTEInstance } from '../types'; +export declare const CIIcon: React.FC<{ + rte: IAIRTEInstance; +}>; +export declare const CIComponent: (props: any) => JSX.Element; diff --git a/content-intelligence/dist/types/content-intelligence/index.d.ts b/content-intelligence/dist/types/content-intelligence/index.d.ts index 79ad0a0b..fd00a578 100644 --- a/content-intelligence/dist/types/content-intelligence/index.d.ts +++ b/content-intelligence/dist/types/content-intelligence/index.d.ts @@ -1,2 +1,3 @@ import './style.css'; -export declare const contentIntelligenceIcon: (RTE: any) => any; +import { IRTEPluginInitializer } from '@contentstack/app-sdk/dist/src/RTE/types'; +export declare const contentIntelligenceIcon: (RTE: IRTEPluginInitializer) => import("@contentstack/app-sdk/dist/src/RTE").RTEPlugin; diff --git a/content-intelligence/dist/types/content-intelligence/types.d.ts b/content-intelligence/dist/types/content-intelligence/types.d.ts new file mode 100644 index 00000000..923989a3 --- /dev/null +++ b/content-intelligence/dist/types/content-intelligence/types.d.ts @@ -0,0 +1,26 @@ +import { IRteParam } from "@contentstack/app-sdk/dist/src/RTE/types"; +import { Node, NodeEntry } from "slate/dist/interfaces/node"; +import { BaseRange } from "slate/dist/interfaces/range"; +import { Text, TextInterface } from "slate/dist/interfaces/text"; +import { EditorInterface } from "slate/dist/interfaces/editor"; +interface IAdvRte { + Text: TextInterface; + Editor: EditorInterface; + addToDecorate: Function; +} +export interface ICIFeatures { + "autoSuggestion": boolean; + "spellCorrection": boolean; +} +interface extendedRTEParams { + CIFeatures: ICIFeatures; + CIAppResponse: { + spellResponse: { + incorrectWithSuggestedResponseMap: Map>; + }; + }; + _adv: IRteParam['_adv'] & IAdvRte; +} +export declare type IAIRTEInstance = IRteParam & extendedRTEParams; +export declare type IRTEDecorate = (entry: NodeEntry) => Array; +export {}; diff --git a/content-intelligence/dist/types/plugin.d.ts b/content-intelligence/dist/types/plugin.d.ts index c5096bb0..7eb2af2d 100644 --- a/content-intelligence/dist/types/plugin.d.ts +++ b/content-intelligence/dist/types/plugin.d.ts @@ -1,7 +1,7 @@ declare const _default: Promise<{ - ContentIntelligence: any; + ContentIntelligence: import("@contentstack/app-sdk/dist/src/RTE").RTEPlugin; GrammarCheck: any; - SpellCheck: any; + SpellCheck: import("@contentstack/app-sdk/dist/src/RTE").RTEPlugin; AutoSuggestion: any; } | undefined>; export default _default; diff --git a/content-intelligence/dist/types/spell-check/SpellCheckTooltip.d.ts b/content-intelligence/dist/types/spell-check/SpellCheckTooltip.d.ts index c91828bd..284bdc52 100644 --- a/content-intelligence/dist/types/spell-check/SpellCheckTooltip.d.ts +++ b/content-intelligence/dist/types/spell-check/SpellCheckTooltip.d.ts @@ -1,3 +1,3 @@ import "./style.css"; -declare const SpellCheckTooltip: (props: any, handleClick: any) => JSX.Element; +declare const SpellCheckTooltip: (props: any) => JSX.Element; export default SpellCheckTooltip; diff --git a/content-intelligence/dist/types/spell-check/SpellComponent.d.ts b/content-intelligence/dist/types/spell-check/SpellComponent.d.ts index e10326d7..579dd217 100644 --- a/content-intelligence/dist/types/spell-check/SpellComponent.d.ts +++ b/content-intelligence/dist/types/spell-check/SpellComponent.d.ts @@ -1,2 +1,2 @@ -declare const SpellComponent: (props: any, handleClick: any) => JSX.Element; +declare const SpellComponent: (props: any) => JSX.Element; export default SpellComponent; diff --git a/content-intelligence/dist/types/spell-check/getSpellSuggestion.d.ts b/content-intelligence/dist/types/spell-check/getSpellSuggestion.d.ts index 8d987a5f..6b24d6a1 100644 --- a/content-intelligence/dist/types/spell-check/getSpellSuggestion.d.ts +++ b/content-intelligence/dist/types/spell-check/getSpellSuggestion.d.ts @@ -3,4 +3,14 @@ declare global { postRobot: any; } } -export declare const getSpellSuggestion: (text: any) => Promise; +interface ISpellCorrectionDTO { + "incorrect_input": string; + "corrected_input": Array; + "start_offset": number; + "end_offset": number; +} +interface ISpellCheckResponse { + contentToReplace: Array; +} +export declare const getSpellSuggestion: (body: string) => Promise; +export {}; diff --git a/content-intelligence/dist/types/spell-check/index.d.ts b/content-intelligence/dist/types/spell-check/index.d.ts index 9cbe8ded..598ec90a 100644 --- a/content-intelligence/dist/types/spell-check/index.d.ts +++ b/content-intelligence/dist/types/spell-check/index.d.ts @@ -1,2 +1,3 @@ import "./style.css"; -export declare const createSpellCheck: (RTE: any) => any; +import { IRTEPluginInitializer } from "@contentstack/app-sdk/dist/src/RTE/types"; +export declare const createSpellCheck: (RTE: IRTEPluginInitializer) => import("@contentstack/app-sdk/dist/src/RTE").RTEPlugin; diff --git a/content-intelligence/dist/types/spell-check/utils/index.d.ts b/content-intelligence/dist/types/spell-check/utils/index.d.ts new file mode 100644 index 00000000..003c3491 --- /dev/null +++ b/content-intelligence/dist/types/spell-check/utils/index.d.ts @@ -0,0 +1,16 @@ +import { IAIRTEInstance, IRTEDecorate } from '../../content-intelligence/types'; +export declare const reRenderElement: (rte: IAIRTEInstance) => void; +export declare const triggerSpellCheck: (rte: IAIRTEInstance, text: string) => Promise; +export declare const debouncedTriggerSpellCheck: ((updatedRTE: IAIRTEInstance) => Promise) & { + clear(): void; +} & { + flush(): void; +}; +export declare const spellCheckDecorate: (rte: IAIRTEInstance) => IRTEDecorate; +export declare const getEntriesStringForRTE: (rte: IAIRTEInstance) => string; +export declare const triggerSpellCheckForCompleteRTE: (rte: IAIRTEInstance) => void; +export declare const debouncedTriggerSpellCheckForCompleteRTE: ((rte: IAIRTEInstance) => void) & { + clear(): void; +} & { + flush(): void; +}; diff --git a/content-intelligence/src/content-intelligence/index.tsx b/content-intelligence/src/content-intelligence/index.tsx index 1b9122c5..f6118db1 100644 --- a/content-intelligence/src/content-intelligence/index.tsx +++ b/content-intelligence/src/content-intelligence/index.tsx @@ -1,10 +1,11 @@ import React from 'react'; +import isHotkey from 'is-hotkey' import CI_Features from './ciFeatures'; import './style.css' import { IRTEPluginInitializer } from '@contentstack/app-sdk/dist/src/RTE/types'; import { IAIRTEInstance } from './types'; -import { debouncedTriggerSpellCheck, getEntriesStringForRTE, spellCheckDecorate, triggerSpellCheck } from '../spell-check/utils'; +import { debouncedTriggerSpellCheck, debouncedTriggerSpellCheckForCompleteRTE, getEntriesStringForRTE, spellCheckDecorate, triggerSpellCheck, triggerSpellCheckForCompleteRTE } from '../spell-check/utils'; import { CIComponent, CIIcon } from './components'; export const contentIntelligenceIcon = (RTE: IRTEPluginInitializer) => { @@ -20,8 +21,7 @@ export const contentIntelligenceIcon = (RTE: IRTEPluginInitializer) => { rte._adv.addToDecorate(handleDecorate); // To execute the spell check for first time. - const initialRTEStringContent = getEntriesStringForRTE(rte) - triggerSpellCheck(rte, initialRTEStringContent) + triggerSpellCheckForCompleteRTE(rte) return ({ title: 'Content Intelligence', @@ -43,8 +43,16 @@ export const contentIntelligenceIcon = (RTE: IRTEPluginInitializer) => { }) ContentIntelligence.on('keydown', async (props) => { - const { rte } = props + const { rte, event } = props const updatedRTE: IAIRTEInstance = rte as any + if(isHotkey('mod',event)){ + // Early return if ctrl + return + } + if(isHotkey('mod+v',event) || isHotkey('mod+x',event)){ + debouncedTriggerSpellCheckForCompleteRTE(updatedRTE) + return + } debouncedTriggerSpellCheck(updatedRTE) }) return ContentIntelligence diff --git a/content-intelligence/src/spell-check/SpellCheckTooltip.tsx b/content-intelligence/src/spell-check/SpellCheckTooltip.tsx index f0f320ca..cdd5879e 100644 --- a/content-intelligence/src/spell-check/SpellCheckTooltip.tsx +++ b/content-intelligence/src/spell-check/SpellCheckTooltip.tsx @@ -2,7 +2,7 @@ import React from "react"; //@ts-ignore import "./style.css"; -const SpellCheckTooltip = (props: any, handleClick: any) => { +const SpellCheckTooltip = (props: any) => { const correctOptionsSet: Set = props?.leaf?.['spell-check'] || new Set() const correctOptionsArray = Array.from(correctOptionsSet) return ( @@ -15,13 +15,13 @@ const SpellCheckTooltip = (props: any, handleClick: any) => {
{ - correctOptionsArray.map((spelling: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined) => { + correctOptionsArray.map((spelling) => { return( -
+
{ props.setVisible(false) - props.handleClick(spelling) + props.handleClick(props.leaf.text, spelling) }} > {spelling} diff --git a/content-intelligence/src/spell-check/index.tsx b/content-intelligence/src/spell-check/index.tsx index fbe8dad3..218b091e 100644 --- a/content-intelligence/src/spell-check/index.tsx +++ b/content-intelligence/src/spell-check/index.tsx @@ -3,14 +3,13 @@ import React from "react"; import { getSpellSuggestion } from "./getSpellSuggestion"; import "./style.css"; import SpellComponent from "./SpellComponent"; -import isHotkey from 'is-hotkey' import { IRTEPluginInitializer } from "@contentstack/app-sdk/dist/src/RTE/types"; import { IAIRTEInstance } from "../content-intelligence/types"; export const createSpellCheck = (RTE: IRTEPluginInitializer) => { //@ts-ignore const SpellCheckPlugin = RTE("spell-check", (rte: IAIRTEInstance) => { - const handleClick = (spelling:string) => { + const handleClick = (incorrectSpell:string,spelling:string) => { rte._adv.Transforms.move(rte._adv.editor,{unit:"word"}) rte._adv.editor.deleteBackward("word") rte._adv.Editor.insertText(rte._adv.editor, spelling); diff --git a/content-intelligence/src/spell-check/utils/index.ts b/content-intelligence/src/spell-check/utils/index.ts index b5da990c..584e238b 100644 --- a/content-intelligence/src/spell-check/utils/index.ts +++ b/content-intelligence/src/spell-check/utils/index.ts @@ -55,17 +55,18 @@ export const spellCheckDecorate = (rte: IAIRTEInstance) => { return ranges; } - const wordsInText = node.text.split(" ") - wordsInText.reduce((actualIndex, word, indexOfWordInArray) => { - if (spellResponse.incorrectWithSuggestedResponseMap.has(word)) { + const wordsInText = node.text.split(/[ ,]/) + const _totalLength = wordsInText.reduce((actualIndex, word, _indexOfWordInArray) => { + const lowerCaseWord = word.toLowerCase() + if (spellResponse.incorrectWithSuggestedResponseMap.has(lowerCaseWord)) { ranges.push({ //@ts-ignore - "spell-check": spellResponse.incorrectWithSuggestedResponseMap.get(word), + "spell-check": spellResponse.incorrectWithSuggestedResponseMap.get(lowerCaseWord), anchor: { path, offset: actualIndex }, - focus: { path, offset: actualIndex + word.length }, + focus: { path, offset: actualIndex + lowerCaseWord.length }, }); } - return actualIndex + word.length + 1 + return actualIndex + lowerCaseWord.length + 1 }, 0) return ranges; }; @@ -74,4 +75,13 @@ export const spellCheckDecorate = (rte: IAIRTEInstance) => { export const getEntriesStringForRTE = (rte: IAIRTEInstance) => { return rte._adv.Editor.string(rte._adv.editor, [0], { voids: true }) -} \ No newline at end of file +} + +export const triggerSpellCheckForCompleteRTE = (rte: IAIRTEInstance) => { + const initialRTEStringContent = getEntriesStringForRTE(rte) + triggerSpellCheck(rte, initialRTEStringContent) + .finally(() => { + reRenderElement(rte) + }) +} +export const debouncedTriggerSpellCheckForCompleteRTE = debounce(triggerSpellCheckForCompleteRTE, 500) \ No newline at end of file