Skip to content

Instantly share code, notes, and snippets.

@mimalef70
Last active September 19, 2023 19:24
Show Gist options
  • Save mimalef70/6ff3a49e86596f158c1cf2d4b80644a7 to your computer and use it in GitHub Desktop.
Save mimalef70/6ff3a49e86596f158c1cf2d4b80644a7 to your computer and use it in GitHub Desktop.
import {
j as g,
r as N,
R as _,
a as ws,
b as Ss,
g as Cs,
c as Ds,
} from '../../../assets/tailwind-c7e7a826.js';
function Is({ onClick: e, selectedTab: t }) {
return g.jsxs('div', {
className: 'pt-5 px-10 flex justify-center items-center gap-5 text-base h-[15h] mx-auto z-10',
children: [
g.jsx('div', {
children: g.jsxs('a', {
href: 'https://quickyai.com',
target: '_blank',
className: 'flex flex-col justify-center items-center',
rel: 'noreferrer',
children: [
g.jsx('img', { src: '/icon-32.png', alt: 'QuickyAI', className: 'w-10 h-10 ' }),
g.jsx('span', { children: 'QuickyAI' }),
],
}),
}),
g.jsxs('div', {
className: 'inline-flex rounded-md shadow-sm self-center shrink-0',
children: [
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border border-gray-200 rounded-l-lg hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'prompts' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('prompts'),
children: 'Prompts',
}),
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border-y border-r border-gray-200 hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'shortcuts' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('shortcuts'),
children: 'Shortcuts',
}),
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border-y border-r border-gray-200 hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'history' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('history'),
children: 'History',
}),
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border-y border-r border-gray-200 hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'guide' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('guide'),
children: 'How to use',
}),
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border-y border-gray-200 hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'settings' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('settings'),
children: 'Settings',
}),
g.jsx('a', {
className:
'px-4 py-2 text-sm font-medium bg-white border border-gray-200 rounded-r-md hover:bg-gray-100 focus:z-10 focus:ring-2 focus:ring-gray-400 cursor-pointer',
style: t === 'keys' ? { backgroundColor: '#3b82f6', color: '#f9fafb' } : {},
onClick: () => e('keys'),
children: 'Keys',
}),
],
}),
],
});
}
const $i = (e) => e.slice(0, 4) + '...' + e.slice(-4),
ks = 'https://api.openai.com/v1/chat/completions',
Es = 'https://api.quickyai.com/activate';
function Ps() {
const [e, t] = N.useState({ license: '', openAIkey: '' }),
[n, r] = N.useState({ liStatus: !1, keyStatus: !1 }),
[i, a] = N.useState(!1),
[o, l] = N.useState({ liError: '', keyError: '' }),
[s, c] = N.useState(!1),
[d, u] = N.useState({ liLoading: 'no', keyLoading: 'no' }),
f = () => {
a(() => !0);
},
p = async (x) => {
x.preventDefault();
const { license: b } = e;
if (b) {
l((C) => ({ ...C, liError: '' }));
try {
u((D) => ({ ...D, liLoading: 'yes' }));
const S = await (
await fetch(`${Es}/${b}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({}),
})
).json();
if (!S.error && S.message === 'OK') {
const D = S.isSubscription || !1,
E = { liStatus: !0, license: b, isSubscription: D };
chrome.storage.sync.set(E),
r((w) => ({ ...w, liStatus: !0 })),
u((w) => ({ ...w, liLoading: 'success' })),
c(D);
} else u((D) => ({ ...D, liLoading: 'no' })), l((D) => ({ ...D, liError: S.error }));
} catch {
u((S) => ({ ...S, liLoading: 'no' })),
l((S) => ({ ...S, liError: 'Something went wrong' }));
}
}
},
m = async (x) => {
if ((x.preventDefault(), n.keyStatus && !i)) return;
const { openAIkey: b } = e;
if (!b) return;
const C = { model: 'gpt-3.5-turbo', messages: [{ role: 'user', content: 'hello world' }] };
l((S) => ({ ...S, keyError: '' }));
try {
if (
(u((E) => ({ ...E, keyLoading: 'yes' })),
(
await (
await fetch(ks, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${b}` },
body: JSON.stringify(C),
})
).json()
).error)
)
u((E) => ({ ...E, keyLoading: 'no' })), l((E) => ({ ...E, keyError: 'Invalid API key' }));
else {
const E = { keyStatus: !0, openAIkey: b };
chrome.storage.sync.set(E),
u((w) => ({ ...w, keyLoading: 'success' })),
r((w) => ({ ...w, keyStatus: !0 }));
}
} catch {
u((D) => ({ ...D, keyLoading: 'no' })), l((D) => ({ ...D, keyError: 'Invalid API key' }));
}
},
h = () => {
chrome.storage.sync.get(['license', 'liStatus'], (x) => {
const b = x == null ? void 0 : x.license;
t((C) => ({ ...C, license: b })), r((C) => ({ ...C, liStatus: !1 }));
});
};
return (
N.useEffect(() => {
chrome.storage.sync.get(
['openAIkey', 'license', 'keyStatus', 'liStatus', 'isSubscription'],
(x) => {
const b = x == null ? void 0 : x.openAIkey,
C = x == null ? void 0 : x.license,
S = x == null ? void 0 : x.liStatus,
D = x == null ? void 0 : x.keyStatus,
E = (x == null ? void 0 : x.isSubscription) || !1;
if (C) {
const w = S ? $i(C) : C;
t((O) => ({ ...O, license: w }));
}
if (b) {
const w = D ? $i(b) : b;
t((O) => ({ ...O, openAIkey: w })), D && a(!1);
}
r(() => ({ liStatus: S, keyStatus: D })), c(E);
}
);
}, []),
g.jsxs('div', {
className: 'px-10 relative text-base h-full mx-auto',
children: [
g.jsx('h1', {
className: 'text-3xl font-semibold text-center font-sans mt-6',
children: 'Keys',
}),
g.jsx('div', {
className: 'mt-6 flex flex-col',
children: g.jsxs('div', {
className: 'flex flex-col gap-10 w-full items-center mx-auto',
children: [
g.jsxs('form', {
className: 'w-[450px]',
children: [
g.jsxs('div', {
className: 'mb-2 text-left',
children: [
g.jsx('span', { className: 'font-medium text-md', children: 'License key' }),
' (',
g.jsx('a', {
href: 'https://app.lemonsqueezy.com/my-orders/',
target: '_blank',
className: 'text-blue-500 hover:text-blue-600 text-sm',
rel: 'noreferrer',
children: n.liStatus ? 'Manage license here' : 'Get license here',
}),
')',
],
}),
g.jsxs('div', {
className: 'flex justify-between gap-4',
children: [
g.jsx('input', {
type: 'text',
id: 'text',
className:
' bg-gray-50 border border-gray-300 text-gray-800 rounded-lg focus:ring-blue-400 focus:ring-2 block w-full p-2.5 py-2 focus:outline-none disabled:bg-gray-200',
placeholder: 'Your license key',
value: e.license,
onChange: (x) => t((b) => ({ ...b, license: x.target.value })),
disabled: n.liStatus,
spellCheck: !1,
autoComplete: 'off',
autoCorrect: 'off',
autoCapitalize: 'off',
}),
g.jsxs('button', {
type: 'submit',
className: `transform rounded-lg ${
d.liLoading === 'success' || n.liStatus
? 'bg-green-500'
: 'bg-blue-600/95 hover:bg-blue-700'
} px-10 py-2 font-medium text-white transition-colors duration-200 w-28 flex justify-center items-center whitespace-nowrap gap-2 disabled:bg-gray-400`,
onClick: p,
disabled: n.liStatus,
children: [
d.liLoading === 'yes' &&
g.jsx('span', {
className: 'flex items-center',
children: g.jsxs('svg', {
'aria-hidden': 'true',
role: 'status',
className: 'inline w-4 h-4 text-white animate-spin',
viewBox: '0 0 100 101',
fill: 'none',
xmlns: 'http://www.w3.org/2000/svg',
children: [
g.jsx('path', {
d: 'M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z',
fill: '#E5E7EB',
}),
g.jsx('path', {
d: 'M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z',
fill: 'currentColor',
}),
],
}),
}),
n.liStatus ? 'Saved' : 'Save',
],
}),
],
}),
g.jsxs('div', {
children: [
o.liError &&
g.jsx('small', { className: 'text-red-600', children: o.liError }),
n.liStatus &&
!o.liError &&
g.jsx('small', {
className: 'text-gray-600 hover:text-gray-900 cursor-pointer',
onClick: h,
children: 'Click to edit license',
}),
],
}),
],
}),
n.liStatus &&
!s &&
g.jsxs('form', {
className: 'w-[450px]',
children: [
g.jsxs('div', {
className: 'mb-2 text-left',
children: [
g.jsx('span', { className: 'font-medium text-md', children: 'OpenAI key' }),
' (',
g.jsx('a', {
href: 'https://platform.openai.com/account/api-keys',
target: '_blank',
className: 'text-blue-500 hover:text-blue-600 text-sm',
rel: 'noreferrer',
children: 'Get key here',
}),
')',
],
}),
g.jsxs('div', {
className: 'flex justify-between gap-4',
children: [
g.jsx('input', {
type: 'text',
className:
' bg-gray-50 border border-gray-300 text-gray-800 rounded-lg focus:ring-blue-400 focus:ring-2 block w-full p-2.5 py-2 focus:outline-none disabled:bg-gray-200',
placeholder: 'sk-xxxxxxxxxxxxxxx',
value: e.openAIkey,
onChange: (x) => t((b) => ({ ...b, openAIkey: x.target.value })),
disabled: n.keyStatus && !i,
spellCheck: !1,
autoComplete: 'off',
autoCorrect: 'off',
autoCapitalize: 'off',
}),
g.jsxs('button', {
type: 'submit',
className: `transform rounded-lg ${
d.keyLoading === 'success' || (!i && n.keyStatus)
? 'bg-green-500'
: 'bg-blue-600/95 hover:bg-blue-700'
} px-10 py-2 font-medium text-white transition-colors duration-200 w-28 whitespace-nowrap flex items-center justify-center gap-2 disabled:bg-gray-400`,
onClick: m,
disabled: n.keyStatus && !i,
children: [
d.keyLoading === 'yes' &&
g.jsx('span', {
className: 'flex items-center',
children: g.jsxs('svg', {
'aria-hidden': 'true',
role: 'status',
className: 'inline w-4 h-4 text-white animate-spin',
viewBox: '0 0 100 101',
fill: 'none',
xmlns: 'http://www.w3.org/2000/svg',
children: [
g.jsx('path', {
d: 'M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z',
fill: '#E5E7EB',
}),
g.jsx('path', {
d: 'M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z',
fill: 'currentColor',
}),
],
}),
}),
g.jsx('span', {
children:
d.keyLoading === 'success' || (n.keyStatus && !i)
? 'Saved'
: 'Save',
}),
],
}),
],
}),
g.jsxs('div', {
children: [
o.keyError &&
g.jsx('small', { className: 'text-red-600', children: o.keyError }),
n.keyStatus &&
!i &&
g.jsx('small', {
className: 'text-gray-600 hover:text-gray-900 cursor-pointer',
onClick: f,
children: 'Click to edit key',
}),
],
}),
],
}),
],
}),
}),
g.jsx('div', { className: 'bso-container' }),
],
})
);
}
function Fr(e, t) {
return (
(Fr = Object.setPrototypeOf
? Object.setPrototypeOf.bind()
: function (r, i) {
return (r.__proto__ = i), r;
}),
Fr(e, t)
);
}
function xo(e, t) {
(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), Fr(e, t);
}
function j() {
return (
(j = Object.assign
? Object.assign.bind()
: function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
}
return e;
}),
j.apply(this, arguments)
);
}
function qt(e) {
return (
(qt =
typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
? function (t) {
return typeof t;
}
: function (t) {
return t &&
typeof Symbol == 'function' &&
t.constructor === Symbol &&
t !== Symbol.prototype
? 'symbol'
: typeof t;
}),
qt(e)
);
}
function As(e, t) {
if (qt(e) !== 'object' || e === null) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var r = n.call(e, t || 'default');
if (qt(r) !== 'object') return r;
throw new TypeError('@@toPrimitive must return a primitive value.');
}
return (t === 'string' ? String : Number)(e);
}
function Ns(e) {
var t = As(e, 'string');
return qt(t) === 'symbol' ? t : String(t);
}
function Os(e, t, n) {
return (
(t = Ns(t)),
t in e
? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
: (e[t] = n),
e
);
}
function Hi(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t &&
(r = r.filter(function (i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})),
n.push.apply(n, r);
}
return n;
}
function Ui(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2
? Hi(Object(n), !0).forEach(function (r) {
Os(e, r, n[r]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
: Hi(Object(n)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
});
}
return e;
}
function ke(e) {
return (
'Minified Redux error #' +
e +
'; visit https://redux.js.org/Errors?code=' +
e +
' for the full message or use the non-minified dev environment for full errors. '
);
}
var Gi = (function () {
return (typeof Symbol == 'function' && Symbol.observable) || '@@observable';
})(),
pr = function () {
return Math.random().toString(36).substring(7).split('').join('.');
},
Wi = {
INIT: '@@redux/INIT' + pr(),
REPLACE: '@@redux/REPLACE' + pr(),
PROBE_UNKNOWN_ACTION: function () {
return '@@redux/PROBE_UNKNOWN_ACTION' + pr();
},
};
function Ts(e) {
if (typeof e != 'object' || e === null) return !1;
for (var t = e; Object.getPrototypeOf(t) !== null; ) t = Object.getPrototypeOf(t);
return Object.getPrototypeOf(e) === t;
}
function wo(e, t, n) {
var r;
if (
(typeof t == 'function' && typeof n == 'function') ||
(typeof n == 'function' && typeof arguments[3] == 'function')
)
throw new Error(ke(0));
if ((typeof t == 'function' && typeof n > 'u' && ((n = t), (t = void 0)), typeof n < 'u')) {
if (typeof n != 'function') throw new Error(ke(1));
return n(wo)(e, t);
}
if (typeof e != 'function') throw new Error(ke(2));
var i = e,
a = t,
o = [],
l = o,
s = !1;
function c() {
l === o && (l = o.slice());
}
function d() {
if (s) throw new Error(ke(3));
return a;
}
function u(h) {
if (typeof h != 'function') throw new Error(ke(4));
if (s) throw new Error(ke(5));
var x = !0;
return (
c(),
l.push(h),
function () {
if (x) {
if (s) throw new Error(ke(6));
(x = !1), c();
var C = l.indexOf(h);
l.splice(C, 1), (o = null);
}
}
);
}
function f(h) {
if (!Ts(h)) throw new Error(ke(7));
if (typeof h.type > 'u') throw new Error(ke(8));
if (s) throw new Error(ke(9));
try {
(s = !0), (a = i(a, h));
} finally {
s = !1;
}
for (var x = (o = l), b = 0; b < x.length; b++) {
var C = x[b];
C();
}
return h;
}
function p(h) {
if (typeof h != 'function') throw new Error(ke(10));
(i = h), f({ type: Wi.REPLACE });
}
function m() {
var h,
x = u;
return (
(h = {
subscribe: function (C) {
if (typeof C != 'object' || C === null) throw new Error(ke(11));
function S() {
C.next && C.next(d());
}
S();
var D = x(S);
return { unsubscribe: D };
},
}),
(h[Gi] = function () {
return this;
}),
h
);
}
return (
f({ type: Wi.INIT }),
(r = { dispatch: f, subscribe: u, getState: d, replaceReducer: p }),
(r[Gi] = m),
r
);
}
function qi(e, t) {
return function () {
return t(e.apply(this, arguments));
};
}
function Vi(e, t) {
if (typeof e == 'function') return qi(e, t);
if (typeof e != 'object' || e === null) throw new Error(ke(16));
var n = {};
for (var r in e) {
var i = e[r];
typeof i == 'function' && (n[r] = qi(i, t));
}
return n;
}
function So() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
return t.length === 0
? function (r) {
return r;
}
: t.length === 1
? t[0]
: t.reduce(function (r, i) {
return function () {
return r(i.apply(void 0, arguments));
};
});
}
function Bs() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
return function (r) {
return function () {
var i = r.apply(void 0, arguments),
a = function () {
throw new Error(ke(15));
},
o = {
getState: i.getState,
dispatch: function () {
return a.apply(void 0, arguments);
},
},
l = t.map(function (s) {
return s(o);
});
return (a = So.apply(void 0, l)(i.dispatch)), Ui(Ui({}, i), {}, { dispatch: a });
};
};
}
var W = {},
Rs = {
get exports() {
return W;
},
set exports(e) {
W = e;
},
},
Fs = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED',
Ls = Fs,
Ms = Ls;
function Co() {}
function Do() {}
Do.resetWarningCache = Co;
var js = function () {
function e(r, i, a, o, l, s) {
if (s !== Ms) {
var c = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types'
);
throw ((c.name = 'Invariant Violation'), c);
}
}
e.isRequired = e;
function t() {
return e;
}
var n = {
array: e,
bigint: e,
bool: e,
func: e,
number: e,
object: e,
string: e,
symbol: e,
any: e,
arrayOf: t,
element: e,
elementType: e,
instanceOf: t,
node: e,
objectOf: t,
oneOf: t,
oneOfType: t,
shape: t,
exact: t,
checkPropTypes: Do,
resetWarningCache: Co,
};
return (n.PropTypes = n), n;
};
Rs.exports = js();
var Io = _.createContext(null);
function zs(e) {
e();
}
var ko = zs,
$s = function (t) {
return (ko = t);
},
Hs = function () {
return ko;
};
function Us() {
var e = Hs(),
t = null,
n = null;
return {
clear: function () {
(t = null), (n = null);
},
notify: function () {
e(function () {
for (var i = t; i; ) i.callback(), (i = i.next);
});
},
get: function () {
for (var i = [], a = t; a; ) i.push(a), (a = a.next);
return i;
},
subscribe: function (i) {
var a = !0,
o = (n = { callback: i, next: null, prev: n });
return (
o.prev ? (o.prev.next = o) : (t = o),
function () {
!a ||
t === null ||
((a = !1),
o.next ? (o.next.prev = o.prev) : (n = o.prev),
o.prev ? (o.prev.next = o.next) : (t = o.next));
}
);
},
};
}
var Ki = {
notify: function () {},
get: function () {
return [];
},
};
function Eo(e, t) {
var n,
r = Ki;
function i(u) {
return s(), r.subscribe(u);
}
function a() {
r.notify();
}
function o() {
d.onStateChange && d.onStateChange();
}
function l() {
return !!n;
}
function s() {
n || ((n = t ? t.addNestedSub(o) : e.subscribe(o)), (r = Us()));
}
function c() {
n && (n(), (n = void 0), r.clear(), (r = Ki));
}
var d = {
addNestedSub: i,
notifyNestedSubs: a,
handleChangeWrapper: o,
isSubscribed: l,
trySubscribe: s,
tryUnsubscribe: c,
getListeners: function () {
return r;
},
};
return d;
}
var Po =
typeof window < 'u' && typeof window.document < 'u' && typeof window.document.createElement < 'u'
? N.useLayoutEffect
: N.useEffect;
function Gs(e) {
var t = e.store,
n = e.context,
r = e.children,
i = N.useMemo(
function () {
var l = Eo(t);
return { store: t, subscription: l };
},
[t]
),
a = N.useMemo(
function () {
return t.getState();
},
[t]
);
Po(
function () {
var l = i.subscription;
return (
(l.onStateChange = l.notifyNestedSubs),
l.trySubscribe(),
a !== t.getState() && l.notifyNestedSubs(),
function () {
l.tryUnsubscribe(), (l.onStateChange = null);
}
);
},
[i, a]
);
var o = n || Io;
return _.createElement(o.Provider, { value: i }, r);
}
function Dn(e, t) {
if (e == null) return {};
var n = {},
r = Object.keys(e),
i,
a;
for (a = 0; a < r.length; a++) (i = r[a]), !(t.indexOf(i) >= 0) && (n[i] = e[i]);
return n;
}
var Lr = {},
Ws = {
get exports() {
return Lr;
},
set exports(e) {
Lr = e;
},
},
te = {};
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ var ye = typeof Symbol == 'function' && Symbol.for,
ei = ye ? Symbol.for('react.element') : 60103,
ti = ye ? Symbol.for('react.portal') : 60106,
Fn = ye ? Symbol.for('react.fragment') : 60107,
Ln = ye ? Symbol.for('react.strict_mode') : 60108,
Mn = ye ? Symbol.for('react.profiler') : 60114,
jn = ye ? Symbol.for('react.provider') : 60109,
zn = ye ? Symbol.for('react.context') : 60110,
ni = ye ? Symbol.for('react.async_mode') : 60111,
$n = ye ? Symbol.for('react.concurrent_mode') : 60111,
Hn = ye ? Symbol.for('react.forward_ref') : 60112,
Un = ye ? Symbol.for('react.suspense') : 60113,
qs = ye ? Symbol.for('react.suspense_list') : 60120,
Gn = ye ? Symbol.for('react.memo') : 60115,
Wn = ye ? Symbol.for('react.lazy') : 60116,
Vs = ye ? Symbol.for('react.block') : 60121,
Ks = ye ? Symbol.for('react.fundamental') : 60117,
Ys = ye ? Symbol.for('react.responder') : 60118,
Qs = ye ? Symbol.for('react.scope') : 60119;
function Fe(e) {
if (typeof e == 'object' && e !== null) {
var t = e.$$typeof;
switch (t) {
case ei:
switch (((e = e.type), e)) {
case ni:
case $n:
case Fn:
case Mn:
case Ln:
case Un:
return e;
default:
switch (((e = e && e.$$typeof), e)) {
case zn:
case Hn:
case Wn:
case Gn:
case jn:
return e;
default:
return t;
}
}
case ti:
return t;
}
}
}
function Ao(e) {
return Fe(e) === $n;
}
te.AsyncMode = ni;
te.ConcurrentMode = $n;
te.ContextConsumer = zn;
te.ContextProvider = jn;
te.Element = ei;
te.ForwardRef = Hn;
te.Fragment = Fn;
te.Lazy = Wn;
te.Memo = Gn;
te.Portal = ti;
te.Profiler = Mn;
te.StrictMode = Ln;
te.Suspense = Un;
te.isAsyncMode = function (e) {
return Ao(e) || Fe(e) === ni;
};
te.isConcurrentMode = Ao;
te.isContextConsumer = function (e) {
return Fe(e) === zn;
};
te.isContextProvider = function (e) {
return Fe(e) === jn;
};
te.isElement = function (e) {
return typeof e == 'object' && e !== null && e.$$typeof === ei;
};
te.isForwardRef = function (e) {
return Fe(e) === Hn;
};
te.isFragment = function (e) {
return Fe(e) === Fn;
};
te.isLazy = function (e) {
return Fe(e) === Wn;
};
te.isMemo = function (e) {
return Fe(e) === Gn;
};
te.isPortal = function (e) {
return Fe(e) === ti;
};
te.isProfiler = function (e) {
return Fe(e) === Mn;
};
te.isStrictMode = function (e) {
return Fe(e) === Ln;
};
te.isSuspense = function (e) {
return Fe(e) === Un;
};
te.isValidElementType = function (e) {
return (
typeof e == 'string' ||
typeof e == 'function' ||
e === Fn ||
e === $n ||
e === Mn ||
e === Ln ||
e === Un ||
e === qs ||
(typeof e == 'object' &&
e !== null &&
(e.$$typeof === Wn ||
e.$$typeof === Gn ||
e.$$typeof === jn ||
e.$$typeof === zn ||
e.$$typeof === Hn ||
e.$$typeof === Ks ||
e.$$typeof === Ys ||
e.$$typeof === Qs ||
e.$$typeof === Vs))
);
};
te.typeOf = Fe;
(function (e) {
e.exports = te;
})(Ws);
var ri = Lr,
Xs = {
childContextTypes: !0,
contextType: !0,
contextTypes: !0,
defaultProps: !0,
displayName: !0,
getDefaultProps: !0,
getDerivedStateFromError: !0,
getDerivedStateFromProps: !0,
mixins: !0,
propTypes: !0,
type: !0,
},
Js = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 },
_s = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 },
No = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 },
ii = {};
ii[ri.ForwardRef] = _s;
ii[ri.Memo] = No;
function Yi(e) {
return ri.isMemo(e) ? No : ii[e.$$typeof] || Xs;
}
var Zs = Object.defineProperty,
eu = Object.getOwnPropertyNames,
Qi = Object.getOwnPropertySymbols,
tu = Object.getOwnPropertyDescriptor,
nu = Object.getPrototypeOf,
Xi = Object.prototype;
function Oo(e, t, n) {
if (typeof t != 'string') {
if (Xi) {
var r = nu(t);
r && r !== Xi && Oo(e, r, n);
}
var i = eu(t);
Qi && (i = i.concat(Qi(t)));
for (var a = Yi(e), o = Yi(t), l = 0; l < i.length; ++l) {
var s = i[l];
if (!Js[s] && !(n && n[s]) && !(o && o[s]) && !(a && a[s])) {
var c = tu(t, s);
try {
Zs(e, s, c);
} catch {}
}
}
}
return e;
}
var Ji = Oo,
Mr = {},
ru = {
get exports() {
return Mr;
},
set exports(e) {
Mr = e;
},
},
re = {};
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ var qn = 60103,
Vn = 60106,
Jt = 60107,
_t = 60108,
Zt = 60114,
en = 60109,
tn = 60110,
nn = 60112,
rn = 60113,
ai = 60120,
an = 60115,
on = 60116,
To = 60121,
Bo = 60122,
Ro = 60117,
Fo = 60129,
Lo = 60131;
if (typeof Symbol == 'function' && Symbol.for) {
var xe = Symbol.for;
(qn = xe('react.element')),
(Vn = xe('react.portal')),
(Jt = xe('react.fragment')),
(_t = xe('react.strict_mode')),
(Zt = xe('react.profiler')),
(en = xe('react.provider')),
(tn = xe('react.context')),
(nn = xe('react.forward_ref')),
(rn = xe('react.suspense')),
(ai = xe('react.suspense_list')),
(an = xe('react.memo')),
(on = xe('react.lazy')),
(To = xe('react.block')),
(Bo = xe('react.server.block')),
(Ro = xe('react.fundamental')),
(Fo = xe('react.debug_trace_mode')),
(Lo = xe('react.legacy_hidden'));
}
function qe(e) {
if (typeof e == 'object' && e !== null) {
var t = e.$$typeof;
switch (t) {
case qn:
switch (((e = e.type), e)) {
case Jt:
case Zt:
case _t:
case rn:
case ai:
return e;
default:
switch (((e = e && e.$$typeof), e)) {
case tn:
case nn:
case on:
case an:
case en:
return e;
default:
return t;
}
}
case Vn:
return t;
}
}
}
var iu = en,
au = qn,
ou = nn,
lu = Jt,
su = on,
uu = an,
cu = Vn,
du = Zt,
pu = _t,
fu = rn;
re.ContextConsumer = tn;
re.ContextProvider = iu;
re.Element = au;
re.ForwardRef = ou;
re.Fragment = lu;
re.Lazy = su;
re.Memo = uu;
re.Portal = cu;
re.Profiler = du;
re.StrictMode = pu;
re.Suspense = fu;
re.isAsyncMode = function () {
return !1;
};
re.isConcurrentMode = function () {
return !1;
};
re.isContextConsumer = function (e) {
return qe(e) === tn;
};
re.isContextProvider = function (e) {
return qe(e) === en;
};
re.isElement = function (e) {
return typeof e == 'object' && e !== null && e.$$typeof === qn;
};
re.isForwardRef = function (e) {
return qe(e) === nn;
};
re.isFragment = function (e) {
return qe(e) === Jt;
};
re.isLazy = function (e) {
return qe(e) === on;
};
re.isMemo = function (e) {
return qe(e) === an;
};
re.isPortal = function (e) {
return qe(e) === Vn;
};
re.isProfiler = function (e) {
return qe(e) === Zt;
};
re.isStrictMode = function (e) {
return qe(e) === _t;
};
re.isSuspense = function (e) {
return qe(e) === rn;
};
re.isValidElementType = function (e) {
return (
typeof e == 'string' ||
typeof e == 'function' ||
e === Jt ||
e === Zt ||
e === Fo ||
e === _t ||
e === rn ||
e === ai ||
e === Lo ||
(typeof e == 'object' &&
e !== null &&
(e.$$typeof === on ||
e.$$typeof === an ||
e.$$typeof === en ||
e.$$typeof === tn ||
e.$$typeof === nn ||
e.$$typeof === Ro ||
e.$$typeof === To ||
e[0] === Bo))
);
};
re.typeOf = qe;
(function (e) {
e.exports = re;
})(ru);
var gu = [
'getDisplayName',
'methodName',
'renderCountProp',
'shouldHandleStateChanges',
'storeKey',
'withRef',
'forwardRef',
'context',
],
mu = ['reactReduxForwardedRef'],
hu = [],
vu = [null, null];
function bu(e, t) {
var n = e[1];
return [t.payload, n + 1];
}
function _i(e, t, n) {
Po(function () {
return e.apply(void 0, t);
}, n);
}
function yu(e, t, n, r, i, a, o) {
(e.current = r), (t.current = i), (n.current = !1), a.current && ((a.current = null), o());
}
function xu(e, t, n, r, i, a, o, l, s, c) {
if (e) {
var d = !1,
u = null,
f = function () {
if (!d) {
var h = t.getState(),
x,
b;
try {
x = r(h, i.current);
} catch (C) {
(b = C), (u = C);
}
b || (u = null),
x === a.current
? o.current || s()
: ((a.current = x),
(l.current = x),
(o.current = !0),
c({ type: 'STORE_UPDATED', payload: { error: b } }));
}
};
(n.onStateChange = f), n.trySubscribe(), f();
var p = function () {
if (((d = !0), n.tryUnsubscribe(), (n.onStateChange = null), u)) throw u;
};
return p;
}
}
var wu = function () {
return [null, 0];
};
function Su(e, t) {
t === void 0 && (t = {});
var n = t,
r = n.getDisplayName,
i =
r === void 0
? function (S) {
return 'ConnectAdvanced(' + S + ')';
}
: r,
a = n.methodName,
o = a === void 0 ? 'connectAdvanced' : a,
l = n.renderCountProp,
s = l === void 0 ? void 0 : l,
c = n.shouldHandleStateChanges,
d = c === void 0 ? !0 : c,
u = n.storeKey,
f = u === void 0 ? 'store' : u;
n.withRef;
var p = n.forwardRef,
m = p === void 0 ? !1 : p,
h = n.context,
x = h === void 0 ? Io : h,
b = Dn(n, gu),
C = x;
return function (D) {
var E = D.displayName || D.name || 'Component',
w = i(E),
O = j({}, b, {
getDisplayName: i,
methodName: o,
renderCountProp: s,
shouldHandleStateChanges: d,
storeKey: f,
displayName: w,
wrappedComponentName: E,
WrappedComponent: D,
}),
L = b.pure;
function F(q) {
return e(q.dispatch, O);
}
var V = L
? N.useMemo
: function (q) {
return q();
};
function A(q) {
var $ = N.useMemo(
function () {
var Ke = q.reactReduxForwardedRef,
it = Dn(q, mu);
return [q.context, Ke, it];
},
[q]
),
J = $[0],
ie = $[1],
ce = $[2],
me = N.useMemo(
function () {
return J && J.Consumer && Mr.isContextConsumer(_.createElement(J.Consumer, null))
? J
: C;
},
[J, C]
),
y = N.useContext(me),
pe = !!q.store && !!q.store.getState && !!q.store.dispatch;
y && y.store;
var k = pe ? q.store : y.store,
v = N.useMemo(
function () {
return F(k);
},
[k]
),
Q = N.useMemo(
function () {
if (!d) return vu;
var Ke = Eo(k, pe ? null : y.subscription),
it = Ke.notifyNestedSubs.bind(Ke);
return [Ke, it];
},
[k, pe, y]
),
oe = Q[0],
ee = Q[1],
he = N.useMemo(
function () {
return pe ? y : j({}, y, { subscription: oe });
},
[pe, y, oe]
),
fe = N.useReducer(bu, hu, wu),
Le = fe[0],
Se = Le[0],
Ve = fe[1];
if (Se && Se.error) throw Se.error;
var et = N.useRef(),
ft = N.useRef(ce),
tt = N.useRef(),
Je = N.useRef(!1),
nt = V(
function () {
return tt.current && ce === ft.current ? tt.current : v(k.getState(), ce);
},
[k, Se, ce]
);
_i(yu, [ft, et, Je, ce, nt, tt, ee]),
_i(xu, [d, k, oe, v, ft, et, Je, tt, ee, Ve], [k, oe, v]);
var rt = N.useMemo(
function () {
return _.createElement(D, j({}, nt, { ref: ie }));
},
[ie, D, nt]
),
Ft = N.useMemo(
function () {
return d ? _.createElement(me.Provider, { value: he }, rt) : rt;
},
[me, rt, he]
);
return Ft;
}
var R = L ? _.memo(A) : A;
if (((R.WrappedComponent = D), (R.displayName = A.displayName = w), m)) {
var Y = _.forwardRef(function ($, J) {
return _.createElement(R, j({}, $, { reactReduxForwardedRef: J }));
});
return (Y.displayName = w), (Y.WrappedComponent = D), Ji(Y, D);
}
return Ji(R, D);
};
}
function Zi(e, t) {
return e === t ? e !== 0 || t !== 0 || 1 / e === 1 / t : e !== e && t !== t;
}
function fr(e, t) {
if (Zi(e, t)) return !0;
if (typeof e != 'object' || e === null || typeof t != 'object' || t === null) return !1;
var n = Object.keys(e),
r = Object.keys(t);
if (n.length !== r.length) return !1;
for (var i = 0; i < n.length; i++)
if (!Object.prototype.hasOwnProperty.call(t, n[i]) || !Zi(e[n[i]], t[n[i]])) return !1;
return !0;
}
function Cu(e, t) {
var n = {},
r = function (o) {
var l = e[o];
typeof l == 'function' &&
(n[o] = function () {
return t(l.apply(void 0, arguments));
});
};
for (var i in e) r(i);
return n;
}
function oi(e) {
return function (n, r) {
var i = e(n, r);
function a() {
return i;
}
return (a.dependsOnOwnProps = !1), a;
};
}
function ea(e) {
return e.dependsOnOwnProps !== null && e.dependsOnOwnProps !== void 0
? !!e.dependsOnOwnProps
: e.length !== 1;
}
function Mo(e, t) {
return function (r, i) {
i.displayName;
var a = function (l, s) {
return a.dependsOnOwnProps ? a.mapToProps(l, s) : a.mapToProps(l);
};
return (
(a.dependsOnOwnProps = !0),
(a.mapToProps = function (l, s) {
(a.mapToProps = e), (a.dependsOnOwnProps = ea(e));
var c = a(l, s);
return (
typeof c == 'function' &&
((a.mapToProps = c), (a.dependsOnOwnProps = ea(c)), (c = a(l, s))),
c
);
}),
a
);
};
}
function Du(e) {
return typeof e == 'function' ? Mo(e) : void 0;
}
function Iu(e) {
return e
? void 0
: oi(function (t) {
return { dispatch: t };
});
}
function ku(e) {
return e && typeof e == 'object'
? oi(function (t) {
return Cu(e, t);
})
: void 0;
}
const Eu = [Du, Iu, ku];
function Pu(e) {
return typeof e == 'function' ? Mo(e) : void 0;
}
function Au(e) {
return e
? void 0
: oi(function () {
return {};
});
}
const Nu = [Pu, Au];
function Ou(e, t, n) {
return j({}, n, e, t);
}
function Tu(e) {
return function (n, r) {
r.displayName;
var i = r.pure,
a = r.areMergedPropsEqual,
o = !1,
l;
return function (c, d, u) {
var f = e(c, d, u);
return o ? (!i || !a(f, l)) && (l = f) : ((o = !0), (l = f)), l;
};
};
}
function Bu(e) {
return typeof e == 'function' ? Tu(e) : void 0;
}
function Ru(e) {
return e
? void 0
: function () {
return Ou;
};
}
const Fu = [Bu, Ru];
var Lu = ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps'];
function Mu(e, t, n, r) {
return function (a, o) {
return n(e(a, o), t(r, o), o);
};
}
function ju(e, t, n, r, i) {
var a = i.areStatesEqual,
o = i.areOwnPropsEqual,
l = i.areStatePropsEqual,
s = !1,
c,
d,
u,
f,
p;
function m(S, D) {
return (c = S), (d = D), (u = e(c, d)), (f = t(r, d)), (p = n(u, f, d)), (s = !0), p;
}
function h() {
return (u = e(c, d)), t.dependsOnOwnProps && (f = t(r, d)), (p = n(u, f, d)), p;
}
function x() {
return (
e.dependsOnOwnProps && (u = e(c, d)),
t.dependsOnOwnProps && (f = t(r, d)),
(p = n(u, f, d)),
p
);
}
function b() {
var S = e(c, d),
D = !l(S, u);
return (u = S), D && (p = n(u, f, d)), p;
}
function C(S, D) {
var E = !o(D, d),
w = !a(S, c, D, d);
return (c = S), (d = D), E && w ? h() : E ? x() : w ? b() : p;
}
return function (D, E) {
return s ? C(D, E) : m(D, E);
};
}
function zu(e, t) {
var n = t.initMapStateToProps,
r = t.initMapDispatchToProps,
i = t.initMergeProps,
a = Dn(t, Lu),
o = n(e, a),
l = r(e, a),
s = i(e, a),
c = a.pure ? ju : Mu;
return c(o, l, s, e, a);
}
var $u = [
'pure',
'areStatesEqual',
'areOwnPropsEqual',
'areStatePropsEqual',
'areMergedPropsEqual',
];
function gr(e, t, n) {
for (var r = t.length - 1; r >= 0; r--) {
var i = t[r](e);
if (i) return i;
}
return function (a, o) {
throw new Error(
'Invalid value of type ' +
typeof e +
' for ' +
n +
' argument when connecting component ' +
o.wrappedComponentName +
'.'
);
};
}
function Hu(e, t) {
return e === t;
}
function Uu(e) {
var t = e === void 0 ? {} : e,
n = t.connectHOC,
r = n === void 0 ? Su : n,
i = t.mapStateToPropsFactories,
a = i === void 0 ? Nu : i,
o = t.mapDispatchToPropsFactories,
l = o === void 0 ? Eu : o,
s = t.mergePropsFactories,
c = s === void 0 ? Fu : s,
d = t.selectorFactory,
u = d === void 0 ? zu : d;
return function (p, m, h, x) {
x === void 0 && (x = {});
var b = x,
C = b.pure,
S = C === void 0 ? !0 : C,
D = b.areStatesEqual,
E = D === void 0 ? Hu : D,
w = b.areOwnPropsEqual,
O = w === void 0 ? fr : w,
L = b.areStatePropsEqual,
F = L === void 0 ? fr : L,
V = b.areMergedPropsEqual,
A = V === void 0 ? fr : V,
R = Dn(b, $u),
Y = gr(p, a, 'mapStateToProps'),
q = gr(m, l, 'mapDispatchToProps'),
$ = gr(h, c, 'mergeProps');
return r(
u,
j(
{
methodName: 'connect',
getDisplayName: function (ie) {
return 'Connect(' + ie + ')';
},
shouldHandleStateChanges: !!p,
initMapStateToProps: Y,
initMapDispatchToProps: q,
initMergeProps: $,
pure: S,
areStatesEqual: E,
areOwnPropsEqual: O,
areStatePropsEqual: F,
areMergedPropsEqual: A,
},
R
)
);
};
}
const jo = Uu();
$s(ws.unstable_batchedUpdates);
function Gu(e, t) {
if (e.length !== t.length) return !1;
for (var n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
return !0;
}
function zo(e, t) {
var n = N.useState(function () {
return { inputs: t, result: e() };
})[0],
r = N.useRef(!0),
i = N.useRef(n),
a = r.current || !!(t && i.current.inputs && Gu(t, i.current.inputs)),
o = a ? i.current : { inputs: t, result: e() };
return (
N.useEffect(
function () {
(r.current = !1), (i.current = o);
},
[o]
),
o.result
);
}
function Wu(e, t) {
return zo(function () {
return e;
}, t);
}
var X = zo,
M = Wu,
qu = !0,
mr = 'Invariant failed';
function Vu(e, t) {
if (!e) {
if (qu) throw new Error(mr);
var n = typeof t == 'function' ? t() : t,
r = n ? ''.concat(mr, ': ').concat(n) : mr;
throw new Error(r);
}
}
var We = function (t) {
var n = t.top,
r = t.right,
i = t.bottom,
a = t.left,
o = r - a,
l = i - n,
s = {
top: n,
right: r,
bottom: i,
left: a,
width: o,
height: l,
x: a,
y: n,
center: { x: (r + a) / 2, y: (i + n) / 2 },
};
return s;
},
li = function (t, n) {
return {
top: t.top - n.top,
left: t.left - n.left,
bottom: t.bottom + n.bottom,
right: t.right + n.right,
};
},
ta = function (t, n) {
return {
top: t.top + n.top,
left: t.left + n.left,
bottom: t.bottom - n.bottom,
right: t.right - n.right,
};
},
Ku = function (t, n) {
return { top: t.top + n.y, left: t.left + n.x, bottom: t.bottom + n.y, right: t.right + n.x };
},
hr = { top: 0, right: 0, bottom: 0, left: 0 },
si = function (t) {
var n = t.borderBox,
r = t.margin,
i = r === void 0 ? hr : r,
a = t.border,
o = a === void 0 ? hr : a,
l = t.padding,
s = l === void 0 ? hr : l,
c = We(li(n, i)),
d = We(ta(n, o)),
u = We(ta(d, s));
return {
marginBox: c,
borderBox: We(n),
paddingBox: d,
contentBox: u,
margin: i,
border: o,
padding: s,
};
},
Me = function (t) {
var n = t.slice(0, -2),
r = t.slice(-2);
if (r !== 'px') return 0;
var i = Number(n);
return isNaN(i) && Vu(!1), i;
},
Yu = function () {
return { x: window.pageXOffset, y: window.pageYOffset };
},
In = function (t, n) {
var r = t.borderBox,
i = t.border,
a = t.margin,
o = t.padding,
l = Ku(r, n);
return si({ borderBox: l, border: i, margin: a, padding: o });
},
kn = function (t, n) {
return n === void 0 && (n = Yu()), In(t, n);
},
$o = function (t, n) {
var r = {
top: Me(n.marginTop),
right: Me(n.marginRight),
bottom: Me(n.marginBottom),
left: Me(n.marginLeft),
},
i = {
top: Me(n.paddingTop),
right: Me(n.paddingRight),
bottom: Me(n.paddingBottom),
left: Me(n.paddingLeft),
},
a = {
top: Me(n.borderTopWidth),
right: Me(n.borderRightWidth),
bottom: Me(n.borderBottomWidth),
left: Me(n.borderLeftWidth),
};
return si({ borderBox: t, margin: r, padding: i, border: a });
},
Ho = function (t) {
var n = t.getBoundingClientRect(),
r = window.getComputedStyle(t);
return $o(n, r);
},
na =
Number.isNaN ||
function (t) {
return typeof t == 'number' && t !== t;
};
function Qu(e, t) {
return !!(e === t || (na(e) && na(t)));
}
function Xu(e, t) {
if (e.length !== t.length) return !1;
for (var n = 0; n < e.length; n++) if (!Qu(e[n], t[n])) return !1;
return !0;
}
function ve(e, t) {
t === void 0 && (t = Xu);
var n,
r = [],
i,
a = !1;
function o() {
for (var l = [], s = 0; s < arguments.length; s++) l[s] = arguments[s];
return (
(a && n === this && t(l, r)) || ((i = e.apply(this, l)), (a = !0), (n = this), (r = l)), i
);
}
return o;
}
var Ju = function (t) {
var n = [],
r = null,
i = function () {
for (var o = arguments.length, l = new Array(o), s = 0; s < o; s++) l[s] = arguments[s];
(n = l),
!r &&
(r = requestAnimationFrame(function () {
(r = null), t.apply(void 0, n);
}));
};
return (
(i.cancel = function () {
r && (cancelAnimationFrame(r), (r = null));
}),
i
);
};
const Vt = Ju;
function Uo(e, t) {}
Uo.bind(null, 'warn');
Uo.bind(null, 'error');
function lt() {}
function _u(e, t) {
return j({}, e, {}, t);
}
function ze(e, t, n) {
var r = t.map(function (i) {
var a = _u(n, i.options);
return (
e.addEventListener(i.eventName, i.fn, a),
function () {
e.removeEventListener(i.eventName, i.fn, a);
}
);
});
return function () {
r.forEach(function (a) {
a();
});
};
}
var Zu = 'Invariant failed';
function En(e) {
this.message = e;
}
En.prototype.toString = function () {
return this.message;
};
function B(e, t) {
if (!e) throw new En(Zu);
}
var ec = (function (e) {
xo(t, e);
function t() {
for (var r, i = arguments.length, a = new Array(i), o = 0; o < i; o++) a[o] = arguments[o];
return (
(r = e.call.apply(e, [this].concat(a)) || this),
(r.callbacks = null),
(r.unbind = lt),
(r.onWindowError = function (l) {
var s = r.getCallbacks();
s.isDragging() && s.tryAbort();
var c = l.error;
c instanceof En && l.preventDefault();
}),
(r.getCallbacks = function () {
if (!r.callbacks) throw new Error('Unable to find AppCallbacks in <ErrorBoundary/>');
return r.callbacks;
}),
(r.setCallbacks = function (l) {
r.callbacks = l;
}),
r
);
}
var n = t.prototype;
return (
(n.componentDidMount = function () {
this.unbind = ze(window, [{ eventName: 'error', fn: this.onWindowError }]);
}),
(n.componentDidCatch = function (i) {
if (i instanceof En) {
this.setState({});
return;
}
throw i;
}),
(n.componentWillUnmount = function () {
this.unbind();
}),
(n.render = function () {
return this.props.children(this.setCallbacks);
}),
t
);
})(_.Component),
tc = `
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,
Pn = function (t) {
return t + 1;
},
nc = function (t) {
return (
`
You have lifted an item in position ` +
Pn(t.source.index) +
`
`
);
},
Go = function (t, n) {
var r = t.droppableId === n.droppableId,
i = Pn(t.index),
a = Pn(n.index);
return r
? `
You have moved the item from position ` +
i +
`
to position ` +
a +
`
`
: `
You have moved the item from position ` +
i +
`
in list ` +
t.droppableId +
`
to list ` +
n.droppableId +
`
in position ` +
a +
`
`;
},
Wo = function (t, n, r) {
var i = n.droppableId === r.droppableId;
return i
? `
The item ` +
t +
`
has been combined with ` +
r.draggableId
: `
The item ` +
t +
`
in list ` +
n.droppableId +
`
has been combined with ` +
r.draggableId +
`
in list ` +
r.droppableId +
`
`;
},
rc = function (t) {
var n = t.destination;
if (n) return Go(t.source, n);
var r = t.combine;
return r ? Wo(t.draggableId, t.source, r) : 'You are over an area that cannot be dropped on';
},
ra = function (t) {
return (
`
The item has returned to its starting position
of ` +
Pn(t.index) +
`
`
);
},
ic = function (t) {
if (t.reason === 'CANCEL')
return (
`
Movement cancelled.
` +
ra(t.source) +
`
`
);
var n = t.destination,
r = t.combine;
return n
? `
You have dropped the item.
` +
Go(t.source, n) +
`
`
: r
? `
You have dropped the item.
` +
Wo(t.draggableId, t.source, r) +
`
`
: `
The item has been dropped while not over a drop area.
` +
ra(t.source) +
`
`;
},
wn = { dragHandleUsageInstructions: tc, onDragStart: nc, onDragUpdate: rc, onDragEnd: ic },
be = { x: 0, y: 0 },
we = function (t, n) {
return { x: t.x + n.x, y: t.y + n.y };
},
Oe = function (t, n) {
return { x: t.x - n.x, y: t.y - n.y };
},
st = function (t, n) {
return t.x === n.x && t.y === n.y;
},
Nt = function (t) {
return { x: t.x !== 0 ? -t.x : 0, y: t.y !== 0 ? -t.y : 0 };
},
wt = function (t, n, r) {
var i;
return r === void 0 && (r = 0), (i = {}), (i[t] = n), (i[t === 'x' ? 'y' : 'x'] = r), i;
},
Kt = function (t, n) {
return Math.sqrt(Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2));
},
ia = function (t, n) {
return Math.min.apply(
Math,
n.map(function (r) {
return Kt(t, r);
})
);
},
qo = function (t) {
return function (n) {
return { x: t(n.x), y: t(n.y) };
};
},
ac = function (e, t) {
var n = We({
top: Math.max(t.top, e.top),
right: Math.min(t.right, e.right),
bottom: Math.min(t.bottom, e.bottom),
left: Math.max(t.left, e.left),
});
return n.width <= 0 || n.height <= 0 ? null : n;
},
ln = function (t, n) {
return { top: t.top + n.y, left: t.left + n.x, bottom: t.bottom + n.y, right: t.right + n.x };
},
aa = function (t) {
return [
{ x: t.left, y: t.top },
{ x: t.right, y: t.top },
{ x: t.left, y: t.bottom },
{ x: t.right, y: t.bottom },
];
},
oc = { top: 0, right: 0, bottom: 0, left: 0 },
lc = function (t, n) {
return n ? ln(t, n.scroll.diff.displacement) : t;
},
sc = function (t, n, r) {
if (r && r.increasedBy) {
var i;
return j({}, t, ((i = {}), (i[n.end] = t[n.end] + r.increasedBy[n.line]), i));
}
return t;
},
uc = function (t, n) {
return n && n.shouldClipSubject ? ac(n.pageMarginBox, t) : We(t);
},
Et = function (e) {
var t = e.page,
n = e.withPlaceholder,
r = e.axis,
i = e.frame,
a = lc(t.marginBox, i),
o = sc(a, r, n),
l = uc(o, i);
return { page: t, withPlaceholder: n, active: l };
},
ui = function (e, t) {
e.frame || B(!1);
var n = e.frame,
r = Oe(t, n.scroll.initial),
i = Nt(r),
a = j({}, n, {
scroll: {
initial: n.scroll.initial,
current: t,
diff: { value: r, displacement: i },
max: n.scroll.max,
},
}),
o = Et({
page: e.subject.page,
withPlaceholder: e.subject.withPlaceholder,
axis: e.axis,
frame: a,
}),
l = j({}, e, { frame: a, subject: o });
return l;
};
function An(e) {
return Object.values
? Object.values(e)
: Object.keys(e).map(function (t) {
return e[t];
});
}
function ci(e, t) {
if (e.findIndex) return e.findIndex(t);
for (var n = 0; n < e.length; n++) if (t(e[n])) return n;
return -1;
}
function dt(e, t) {
if (e.find) return e.find(t);
var n = ci(e, t);
if (n !== -1) return e[n];
}
function Vo(e) {
return Array.prototype.slice.call(e);
}
var Ko = ve(function (e) {
return e.reduce(function (t, n) {
return (t[n.descriptor.id] = n), t;
}, {});
}),
Yo = ve(function (e) {
return e.reduce(function (t, n) {
return (t[n.descriptor.id] = n), t;
}, {});
}),
Kn = ve(function (e) {
return An(e);
}),
cc = ve(function (e) {
return An(e);
}),
Ot = ve(function (e, t) {
var n = cc(t)
.filter(function (r) {
return e === r.descriptor.droppableId;
})
.sort(function (r, i) {
return r.descriptor.index - i.descriptor.index;
});
return n;
});
function di(e) {
return e.at && e.at.type === 'REORDER' ? e.at.destination : null;
}
function Yn(e) {
return e.at && e.at.type === 'COMBINE' ? e.at.combine : null;
}
var Qn = ve(function (e, t) {
return t.filter(function (n) {
return n.descriptor.id !== e.descriptor.id;
});
}),
dc = function (e) {
var t = e.isMovingForward,
n = e.draggable,
r = e.destination,
i = e.insideDestination,
a = e.previousImpact;
if (!r.isCombineEnabled) return null;
var o = di(a);
if (!o) return null;
function l(h) {
var x = { type: 'COMBINE', combine: { draggableId: h, droppableId: r.descriptor.id } };
return j({}, a, { at: x });
}
var s = a.displaced.all,
c = s.length ? s[0] : null;
if (t) return c ? l(c) : null;
var d = Qn(n, i);
if (!c) {
if (!d.length) return null;
var u = d[d.length - 1];
return l(u.descriptor.id);
}
var f = ci(d, function (h) {
return h.descriptor.id === c;
});
f === -1 && B(!1);
var p = f - 1;
if (p < 0) return null;
var m = d[p];
return l(m.descriptor.id);
},
Tt = function (e, t) {
return e.descriptor.droppableId === t.descriptor.id;
},
Qo = { point: be, value: 0 },
Yt = { invisible: {}, visible: {}, all: [] },
pc = { displaced: Yt, displacedBy: Qo, at: null },
$e = function (e, t) {
return function (n) {
return e <= n && n <= t;
};
},
Xo = function (e) {
var t = $e(e.top, e.bottom),
n = $e(e.left, e.right);
return function (r) {
var i = t(r.top) && t(r.bottom) && n(r.left) && n(r.right);
if (i) return !0;
var a = t(r.top) || t(r.bottom),
o = n(r.left) || n(r.right),
l = a && o;
if (l) return !0;
var s = r.top < e.top && r.bottom > e.bottom,
c = r.left < e.left && r.right > e.right,
d = s && c;
if (d) return !0;
var u = (s && o) || (c && a);
return u;
};
},
fc = function (e) {
var t = $e(e.top, e.bottom),
n = $e(e.left, e.right);
return function (r) {
var i = t(r.top) && t(r.bottom) && n(r.left) && n(r.right);
return i;
};
},
pi = {
direction: 'vertical',
line: 'y',
crossAxisLine: 'x',
start: 'top',
end: 'bottom',
size: 'height',
crossAxisStart: 'left',
crossAxisEnd: 'right',
crossAxisSize: 'width',
},
Jo = {
direction: 'horizontal',
line: 'x',
crossAxisLine: 'y',
start: 'left',
end: 'right',
size: 'width',
crossAxisStart: 'top',
crossAxisEnd: 'bottom',
crossAxisSize: 'height',
},
gc = function (e) {
return function (t) {
var n = $e(t.top, t.bottom),
r = $e(t.left, t.right);
return function (i) {
return e === pi ? n(i.top) && n(i.bottom) : r(i.left) && r(i.right);
};
};
},
mc = function (t, n) {
var r = n.frame ? n.frame.scroll.diff.displacement : be;
return ln(t, r);
},
hc = function (t, n, r) {
return n.subject.active ? r(n.subject.active)(t) : !1;
},
vc = function (t, n, r) {
return r(n)(t);
},
fi = function (t) {
var n = t.target,
r = t.destination,
i = t.viewport,
a = t.withDroppableDisplacement,
o = t.isVisibleThroughFrameFn,
l = a ? mc(n, r) : n;
return hc(l, r, o) && vc(l, i, o);
},
bc = function (t) {
return fi(j({}, t, { isVisibleThroughFrameFn: Xo }));
},
_o = function (t) {
return fi(j({}, t, { isVisibleThroughFrameFn: fc }));
},
yc = function (t) {
return fi(j({}, t, { isVisibleThroughFrameFn: gc(t.destination.axis) }));
},
xc = function (t, n, r) {
if (typeof r == 'boolean') return r;
if (!n) return !0;
var i = n.invisible,
a = n.visible;
if (i[t]) return !1;
var o = a[t];
return o ? o.shouldAnimate : !0;
};
function wc(e, t) {
var n = e.page.marginBox,
r = { top: t.point.y, right: 0, bottom: 0, left: t.point.x };
return We(li(n, r));
}
function Qt(e) {
var t = e.afterDragging,
n = e.destination,
r = e.displacedBy,
i = e.viewport,
a = e.forceShouldAnimate,
o = e.last;
return t.reduce(
function (s, c) {
var d = wc(c, r),
u = c.descriptor.id;
s.all.push(u);
var f = bc({ target: d, destination: n, viewport: i, withDroppableDisplacement: !0 });
if (!f) return (s.invisible[c.descriptor.id] = !0), s;
var p = xc(u, o, a),
m = { draggableId: u, shouldAnimate: p };
return (s.visible[u] = m), s;
},
{ all: [], visible: {}, invisible: {} }
);
}
function Sc(e, t) {
if (!e.length) return 0;
var n = e[e.length - 1].descriptor.index;
return t.inHomeList ? n : n + 1;
}
function oa(e) {
var t = e.insideDestination,
n = e.inHomeList,
r = e.displacedBy,
i = e.destination,
a = Sc(t, { inHomeList: n });
return {
displaced: Yt,
displacedBy: r,
at: { type: 'REORDER', destination: { droppableId: i.descriptor.id, index: a } },
};
}
function Nn(e) {
var t = e.draggable,
n = e.insideDestination,
r = e.destination,
i = e.viewport,
a = e.displacedBy,
o = e.last,
l = e.index,
s = e.forceShouldAnimate,
c = Tt(t, r);
if (l == null) return oa({ insideDestination: n, inHomeList: c, displacedBy: a, destination: r });
var d = dt(n, function (h) {
return h.descriptor.index === l;
});
if (!d) return oa({ insideDestination: n, inHomeList: c, displacedBy: a, destination: r });
var u = Qn(t, n),
f = n.indexOf(d),
p = u.slice(f),
m = Qt({
afterDragging: p,
destination: r,
displacedBy: a,
last: o,
viewport: i.frame,
forceShouldAnimate: s,
});
return {
displaced: m,
displacedBy: a,
at: { type: 'REORDER', destination: { droppableId: r.descriptor.id, index: l } },
};
}
function ct(e, t) {
return !!t.effected[e];
}
var Cc = function (e) {
var t = e.isMovingForward,
n = e.destination,
r = e.draggables,
i = e.combine,
a = e.afterCritical;
if (!n.isCombineEnabled) return null;
var o = i.draggableId,
l = r[o],
s = l.descriptor.index,
c = ct(o, a);
return c ? (t ? s : s - 1) : t ? s + 1 : s;
},
Dc = function (e) {
var t = e.isMovingForward,
n = e.isInHomeList,
r = e.insideDestination,
i = e.location;
if (!r.length) return null;
var a = i.index,
o = t ? a + 1 : a - 1,
l = r[0].descriptor.index,
s = r[r.length - 1].descriptor.index,
c = n ? s : s + 1;
return o < l || o > c ? null : o;
},
Ic = function (e) {
var t = e.isMovingForward,
n = e.isInHomeList,
r = e.draggable,
i = e.draggables,
a = e.destination,
o = e.insideDestination,
l = e.previousImpact,
s = e.viewport,
c = e.afterCritical,
d = l.at;
if ((d || B(!1), d.type === 'REORDER')) {
var u = Dc({
isMovingForward: t,
isInHomeList: n,
location: d.destination,
insideDestination: o,
});
return u == null
? null
: Nn({
draggable: r,
insideDestination: o,
destination: a,
viewport: s,
last: l.displaced,
displacedBy: l.displacedBy,
index: u,
});
}
var f = Cc({
isMovingForward: t,
destination: a,
displaced: l.displaced,
draggables: i,
combine: d.combine,
afterCritical: c,
});
return f == null
? null
: Nn({
draggable: r,
insideDestination: o,
destination: a,
viewport: s,
last: l.displaced,
displacedBy: l.displacedBy,
index: f,
});
},
kc = function (e) {
var t = e.displaced,
n = e.afterCritical,
r = e.combineWith,
i = e.displacedBy,
a = !!(t.visible[r] || t.invisible[r]);
return ct(r, n) ? (a ? be : Nt(i.point)) : a ? i.point : be;
},
Ec = function (e) {
var t = e.afterCritical,
n = e.impact,
r = e.draggables,
i = Yn(n);
i || B(!1);
var a = i.draggableId,
o = r[a].page.borderBox.center,
l = kc({
displaced: n.displaced,
afterCritical: t,
combineWith: a,
displacedBy: n.displacedBy,
});
return we(o, l);
},
Zo = function (t, n) {
return n.margin[t.start] + n.borderBox[t.size] / 2;
},
Pc = function (t, n) {
return n.margin[t.end] + n.borderBox[t.size] / 2;
},
gi = function (t, n, r) {
return n[t.crossAxisStart] + r.margin[t.crossAxisStart] + r.borderBox[t.crossAxisSize] / 2;
},
la = function (t) {
var n = t.axis,
r = t.moveRelativeTo,
i = t.isMoving;
return wt(n.line, r.marginBox[n.end] + Zo(n, i), gi(n, r.marginBox, i));
},
sa = function (t) {
var n = t.axis,
r = t.moveRelativeTo,
i = t.isMoving;
return wt(n.line, r.marginBox[n.start] - Pc(n, i), gi(n, r.marginBox, i));
},
Ac = function (t) {
var n = t.axis,
r = t.moveInto,
i = t.isMoving;
return wt(n.line, r.contentBox[n.start] + Zo(n, i), gi(n, r.contentBox, i));
},
Nc = function (e) {
var t = e.impact,
n = e.draggable,
r = e.draggables,
i = e.droppable,
a = e.afterCritical,
o = Ot(i.descriptor.id, r),
l = n.page,
s = i.axis;
if (!o.length) return Ac({ axis: s, moveInto: i.page, isMoving: l });
var c = t.displaced,
d = t.displacedBy,
u = c.all[0];
if (u) {
var f = r[u];
if (ct(u, a)) return sa({ axis: s, moveRelativeTo: f.page, isMoving: l });
var p = In(f.page, d.point);
return sa({ axis: s, moveRelativeTo: p, isMoving: l });
}
var m = o[o.length - 1];
if (m.descriptor.id === n.descriptor.id) return l.borderBox.center;
if (ct(m.descriptor.id, a)) {
var h = In(m.page, Nt(a.displacedBy.point));
return la({ axis: s, moveRelativeTo: h, isMoving: l });
}
return la({ axis: s, moveRelativeTo: m.page, isMoving: l });
},
jr = function (e, t) {
var n = e.frame;
return n ? we(t, n.scroll.diff.displacement) : t;
},
Oc = function (t) {
var n = t.impact,
r = t.draggable,
i = t.droppable,
a = t.draggables,
o = t.afterCritical,
l = r.page.borderBox.center,
s = n.at;
return !i || !s
? l
: s.type === 'REORDER'
? Nc({ impact: n, draggable: r, draggables: a, droppable: i, afterCritical: o })
: Ec({ impact: n, draggables: a, afterCritical: o });
},
Xn = function (e) {
var t = Oc(e),
n = e.droppable,
r = n ? jr(n, t) : t;
return r;
},
el = function (e, t) {
var n = Oe(t, e.scroll.initial),
r = Nt(n),
i = We({ top: t.y, bottom: t.y + e.frame.height, left: t.x, right: t.x + e.frame.width }),
a = {
frame: i,
scroll: {
initial: e.scroll.initial,
max: e.scroll.max,
current: t,
diff: { value: n, displacement: r },
},
};
return a;
};
function ua(e, t) {
return e.map(function (n) {
return t[n];
});
}
function Tc(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n].visible[e];
if (r) return r;
}
return null;
}
var Bc = function (e) {
var t = e.impact,
n = e.viewport,
r = e.destination,
i = e.draggables,
a = e.maxScrollChange,
o = el(n, we(n.scroll.current, a)),
l = r.frame ? ui(r, we(r.frame.scroll.current, a)) : r,
s = t.displaced,
c = Qt({
afterDragging: ua(s.all, i),
destination: r,
displacedBy: t.displacedBy,
viewport: o.frame,
last: s,
forceShouldAnimate: !1,
}),
d = Qt({
afterDragging: ua(s.all, i),
destination: l,
displacedBy: t.displacedBy,
viewport: n.frame,
last: s,
forceShouldAnimate: !1,
}),
u = {},
f = {},
p = [s, c, d];
s.all.forEach(function (h) {
var x = Tc(h, p);
if (x) {
f[h] = x;
return;
}
u[h] = !0;
});
var m = j({}, t, { displaced: { all: s.all, invisible: u, visible: f } });
return m;
},
Rc = function (e, t) {
return we(e.scroll.diff.displacement, t);
},
mi = function (e) {
var t = e.pageBorderBoxCenter,
n = e.draggable,
r = e.viewport,
i = Rc(r, t),
a = Oe(i, n.page.borderBox.center);
return we(n.client.borderBox.center, a);
},
tl = function (e) {
var t = e.draggable,
n = e.destination,
r = e.newPageBorderBoxCenter,
i = e.viewport,
a = e.withDroppableDisplacement,
o = e.onlyOnMainAxis,
l = o === void 0 ? !1 : o,
s = Oe(r, t.page.borderBox.center),
c = ln(t.page.borderBox, s),
d = { target: c, destination: n, withDroppableDisplacement: a, viewport: i };
return l ? yc(d) : _o(d);
},
Fc = function (e) {
var t = e.isMovingForward,
n = e.draggable,
r = e.destination,
i = e.draggables,
a = e.previousImpact,
o = e.viewport,
l = e.previousPageBorderBoxCenter,
s = e.previousClientSelection,
c = e.afterCritical;
if (!r.isEnabled) return null;
var d = Ot(r.descriptor.id, i),
u = Tt(n, r),
f =
dc({
isMovingForward: t,
draggable: n,
destination: r,
insideDestination: d,
previousImpact: a,
}) ||
Ic({
isMovingForward: t,
isInHomeList: u,
draggable: n,
draggables: i,
destination: r,
insideDestination: d,
previousImpact: a,
viewport: o,
afterCritical: c,
});
if (!f) return null;
var p = Xn({ impact: f, draggable: n, droppable: r, draggables: i, afterCritical: c }),
m = tl({
draggable: n,
destination: r,
newPageBorderBoxCenter: p,
viewport: o.frame,
withDroppableDisplacement: !1,
onlyOnMainAxis: !0,
});
if (m) {
var h = mi({ pageBorderBoxCenter: p, draggable: n, viewport: o });
return { clientSelection: h, impact: f, scrollJumpRequest: null };
}
var x = Oe(p, l),
b = Bc({ impact: f, viewport: o, destination: r, draggables: i, maxScrollChange: x });
return { clientSelection: s, impact: b, scrollJumpRequest: x };
},
Ce = function (t) {
var n = t.subject.active;
return n || B(!1), n;
},
Lc = function (e) {
var t = e.isMovingForward,
n = e.pageBorderBoxCenter,
r = e.source,
i = e.droppables,
a = e.viewport,
o = r.subject.active;
if (!o) return null;
var l = r.axis,
s = $e(o[l.start], o[l.end]),
c = Kn(i)
.filter(function (u) {
return u !== r;
})
.filter(function (u) {
return u.isEnabled;
})
.filter(function (u) {
return !!u.subject.active;
})
.filter(function (u) {
return Xo(a.frame)(Ce(u));
})
.filter(function (u) {
var f = Ce(u);
return t
? o[l.crossAxisEnd] < f[l.crossAxisEnd]
: f[l.crossAxisStart] < o[l.crossAxisStart];
})
.filter(function (u) {
var f = Ce(u),
p = $e(f[l.start], f[l.end]);
return s(f[l.start]) || s(f[l.end]) || p(o[l.start]) || p(o[l.end]);
})
.sort(function (u, f) {
var p = Ce(u)[l.crossAxisStart],
m = Ce(f)[l.crossAxisStart];
return t ? p - m : m - p;
})
.filter(function (u, f, p) {
return Ce(u)[l.crossAxisStart] === Ce(p[0])[l.crossAxisStart];
});
if (!c.length) return null;
if (c.length === 1) return c[0];
var d = c.filter(function (u) {
var f = $e(Ce(u)[l.start], Ce(u)[l.end]);
return f(n[l.line]);
});
return d.length === 1
? d[0]
: d.length > 1
? d.sort(function (u, f) {
return Ce(u)[l.start] - Ce(f)[l.start];
})[0]
: c.sort(function (u, f) {
var p = ia(n, aa(Ce(u))),
m = ia(n, aa(Ce(f)));
return p !== m ? p - m : Ce(u)[l.start] - Ce(f)[l.start];
})[0];
},
ca = function (t, n) {
var r = t.page.borderBox.center;
return ct(t.descriptor.id, n) ? Oe(r, n.displacedBy.point) : r;
},
Mc = function (t, n) {
var r = t.page.borderBox;
return ct(t.descriptor.id, n) ? ln(r, Nt(n.displacedBy.point)) : r;
},
jc = function (e) {
var t = e.pageBorderBoxCenter,
n = e.viewport,
r = e.destination,
i = e.insideDestination,
a = e.afterCritical,
o = i
.filter(function (l) {
return _o({
target: Mc(l, a),
destination: r,
viewport: n.frame,
withDroppableDisplacement: !0,
});
})
.sort(function (l, s) {
var c = Kt(t, jr(r, ca(l, a))),
d = Kt(t, jr(r, ca(s, a)));
return c < d ? -1 : d < c ? 1 : l.descriptor.index - s.descriptor.index;
});
return o[0] || null;
},
sn = ve(function (t, n) {
var r = n[t.line];
return { value: r, point: wt(t.line, r) };
}),
zc = function (t, n, r) {
var i = t.axis;
if (t.descriptor.mode === 'virtual') return wt(i.line, n[i.line]);
var a = t.subject.page.contentBox[i.size],
o = Ot(t.descriptor.id, r),
l = o.reduce(function (d, u) {
return d + u.client.marginBox[i.size];
}, 0),
s = l + n[i.line],
c = s - a;
return c <= 0 ? null : wt(i.line, c);
},
nl = function (t, n) {
return j({}, t, { scroll: j({}, t.scroll, { max: n }) });
},
rl = function (t, n, r) {
var i = t.frame;
Tt(n, t) && B(!1), t.subject.withPlaceholder && B(!1);
var a = sn(t.axis, n.displaceBy).point,
o = zc(t, a, r),
l = {
placeholderSize: a,
increasedBy: o,
oldFrameMaxScroll: t.frame ? t.frame.scroll.max : null,
};
if (!i) {
var s = Et({ page: t.subject.page, withPlaceholder: l, axis: t.axis, frame: t.frame });
return j({}, t, { subject: s });
}
var c = o ? we(i.scroll.max, o) : i.scroll.max,
d = nl(i, c),
u = Et({ page: t.subject.page, withPlaceholder: l, axis: t.axis, frame: d });
return j({}, t, { subject: u, frame: d });
},
$c = function (t) {
var n = t.subject.withPlaceholder;
n || B(!1);
var r = t.frame;
if (!r) {
var i = Et({ page: t.subject.page, axis: t.axis, frame: null, withPlaceholder: null });
return j({}, t, { subject: i });
}
var a = n.oldFrameMaxScroll;
a || B(!1);
var o = nl(r, a),
l = Et({ page: t.subject.page, axis: t.axis, frame: o, withPlaceholder: null });
return j({}, t, { subject: l, frame: o });
},
Hc = function (e) {
var t = e.previousPageBorderBoxCenter,
n = e.moveRelativeTo,
r = e.insideDestination,
i = e.draggable,
a = e.draggables,
o = e.destination,
l = e.viewport,
s = e.afterCritical;
if (!n) {
if (r.length) return null;
var c = {
displaced: Yt,
displacedBy: Qo,
at: { type: 'REORDER', destination: { droppableId: o.descriptor.id, index: 0 } },
},
d = Xn({ impact: c, draggable: i, droppable: o, draggables: a, afterCritical: s }),
u = Tt(i, o) ? o : rl(o, i, a),
f = tl({
draggable: i,
destination: u,
newPageBorderBoxCenter: d,
viewport: l.frame,
withDroppableDisplacement: !1,
onlyOnMainAxis: !0,
});
return f ? c : null;
}
var p = t[o.axis.line] <= n.page.borderBox.center[o.axis.line],
m = (function () {
var x = n.descriptor.index;
return n.descriptor.id === i.descriptor.id || p ? x : x + 1;
})(),
h = sn(o.axis, i.displaceBy);
return Nn({
draggable: i,
insideDestination: r,
destination: o,
viewport: l,
displacedBy: h,
last: Yt,
index: m,
});
},
Uc = function (e) {
var t = e.isMovingForward,
n = e.previousPageBorderBoxCenter,
r = e.draggable,
i = e.isOver,
a = e.draggables,
o = e.droppables,
l = e.viewport,
s = e.afterCritical,
c = Lc({ isMovingForward: t, pageBorderBoxCenter: n, source: i, droppables: o, viewport: l });
if (!c) return null;
var d = Ot(c.descriptor.id, a),
u = jc({
pageBorderBoxCenter: n,
viewport: l,
destination: c,
insideDestination: d,
afterCritical: s,
}),
f = Hc({
previousPageBorderBoxCenter: n,
destination: c,
draggable: r,
draggables: a,
moveRelativeTo: u,
insideDestination: d,
viewport: l,
afterCritical: s,
});
if (!f) return null;
var p = Xn({ impact: f, draggable: r, droppable: c, draggables: a, afterCritical: s }),
m = mi({ pageBorderBoxCenter: p, draggable: r, viewport: l });
return { clientSelection: m, impact: f, scrollJumpRequest: null };
},
Be = function (e) {
var t = e.at;
return t ? (t.type === 'REORDER' ? t.destination.droppableId : t.combine.droppableId) : null;
},
Gc = function (t, n) {
var r = Be(t);
return r ? n[r] : null;
},
Wc = function (e) {
var t = e.state,
n = e.type,
r = Gc(t.impact, t.dimensions.droppables),
i = !!r,
a = t.dimensions.droppables[t.critical.droppable.id],
o = r || a,
l = o.axis.direction,
s =
(l === 'vertical' && (n === 'MOVE_UP' || n === 'MOVE_DOWN')) ||
(l === 'horizontal' && (n === 'MOVE_LEFT' || n === 'MOVE_RIGHT'));
if (s && !i) return null;
var c = n === 'MOVE_DOWN' || n === 'MOVE_RIGHT',
d = t.dimensions.draggables[t.critical.draggable.id],
u = t.current.page.borderBoxCenter,
f = t.dimensions,
p = f.draggables,
m = f.droppables;
return s
? Fc({
isMovingForward: c,
previousPageBorderBoxCenter: u,
draggable: d,
destination: o,
draggables: p,
viewport: t.viewport,
previousClientSelection: t.current.client.selection,
previousImpact: t.impact,
afterCritical: t.afterCritical,
})
: Uc({
isMovingForward: c,
previousPageBorderBoxCenter: u,
draggable: d,
isOver: o,
draggables: p,
droppables: m,
viewport: t.viewport,
afterCritical: t.afterCritical,
});
};
function yt(e) {
return e.phase === 'DRAGGING' || e.phase === 'COLLECTING';
}
function il(e) {
var t = $e(e.top, e.bottom),
n = $e(e.left, e.right);
return function (i) {
return t(i.y) && n(i.x);
};
}
function qc(e, t) {
return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
}
function Vc(e) {
var t = e.pageBorderBox,
n = e.draggable,
r = e.candidates,
i = n.page.borderBox.center,
a = r
.map(function (o) {
var l = o.axis,
s = wt(o.axis.line, t.center[l.line], o.page.borderBox.center[l.crossAxisLine]);
return { id: o.descriptor.id, distance: Kt(i, s) };
})
.sort(function (o, l) {
return l.distance - o.distance;
});
return a[0] ? a[0].id : null;
}
function Kc(e) {
var t = e.pageBorderBox,
n = e.draggable,
r = e.droppables,
i = Kn(r).filter(function (a) {
if (!a.isEnabled) return !1;
var o = a.subject.active;
if (!o || !qc(t, o)) return !1;
if (il(o)(t.center)) return !0;
var l = a.axis,
s = o.center[l.crossAxisLine],
c = t[l.crossAxisStart],
d = t[l.crossAxisEnd],
u = $e(o[l.crossAxisStart], o[l.crossAxisEnd]),
f = u(c),
p = u(d);
return !f && !p ? !0 : f ? c < s : d > s;
});
return i.length
? i.length === 1
? i[0].descriptor.id
: Vc({ pageBorderBox: t, draggable: n, candidates: i })
: null;
}
var al = function (t, n) {
return We(ln(t, n));
},
Yc = function (e, t) {
var n = e.frame;
return n ? al(t, n.scroll.diff.value) : t;
};
function ol(e) {
var t = e.displaced,
n = e.id;
return !!(t.visible[n] || t.invisible[n]);
}
function Qc(e) {
var t = e.draggable,
n = e.closest,
r = e.inHomeList;
return n
? r && n.descriptor.index > t.descriptor.index
? n.descriptor.index - 1
: n.descriptor.index
: null;
}
var Xc = function (e) {
var t = e.pageBorderBoxWithDroppableScroll,
n = e.draggable,
r = e.destination,
i = e.insideDestination,
a = e.last,
o = e.viewport,
l = e.afterCritical,
s = r.axis,
c = sn(r.axis, n.displaceBy),
d = c.value,
u = t[s.start],
f = t[s.end],
p = Qn(n, i),
m = dt(p, function (x) {
var b = x.descriptor.id,
C = x.page.borderBox.center[s.line],
S = ct(b, l),
D = ol({ displaced: a, id: b });
return S ? (D ? f <= C : u < C - d) : D ? f <= C + d : u < C;
}),
h = Qc({ draggable: n, closest: m, inHomeList: Tt(n, r) });
return Nn({
draggable: n,
insideDestination: i,
destination: r,
viewport: o,
last: a,
displacedBy: c,
index: h,
});
},
Jc = 4,
_c = function (e) {
var t = e.draggable,
n = e.pageBorderBoxWithDroppableScroll,
r = e.previousImpact,
i = e.destination,
a = e.insideDestination,
o = e.afterCritical;
if (!i.isCombineEnabled) return null;
var l = i.axis,
s = sn(i.axis, t.displaceBy),
c = s.value,
d = n[l.start],
u = n[l.end],
f = Qn(t, a),
p = dt(f, function (h) {
var x = h.descriptor.id,
b = h.page.borderBox,
C = b[l.size],
S = C / Jc,
D = ct(x, o),
E = ol({ displaced: r.displaced, id: x });
return D
? E
? u > b[l.start] + S && u < b[l.end] - S
: d > b[l.start] - c + S && d < b[l.end] - c - S
: E
? u > b[l.start] + c + S && u < b[l.end] + c - S
: d > b[l.start] + S && d < b[l.end] - S;
});
if (!p) return null;
var m = {
displacedBy: s,
displaced: r.displaced,
at: {
type: 'COMBINE',
combine: { draggableId: p.descriptor.id, droppableId: i.descriptor.id },
},
};
return m;
},
ll = function (e) {
var t = e.pageOffset,
n = e.draggable,
r = e.draggables,
i = e.droppables,
a = e.previousImpact,
o = e.viewport,
l = e.afterCritical,
s = al(n.page.borderBox, t),
c = Kc({ pageBorderBox: s, draggable: n, droppables: i });
if (!c) return pc;
var d = i[c],
u = Ot(d.descriptor.id, r),
f = Yc(d, s);
return (
_c({
pageBorderBoxWithDroppableScroll: f,
draggable: n,
previousImpact: a,
destination: d,
insideDestination: u,
afterCritical: l,
}) ||
Xc({
pageBorderBoxWithDroppableScroll: f,
draggable: n,
destination: d,
insideDestination: u,
last: a.displaced,
viewport: o,
afterCritical: l,
})
);
},
hi = function (e, t) {
var n;
return j({}, e, ((n = {}), (n[t.descriptor.id] = t), n));
},
Zc = function (t) {
var n = t.previousImpact,
r = t.impact,
i = t.droppables,
a = Be(n),
o = Be(r);
if (!a || a === o) return i;
var l = i[a];
if (!l.subject.withPlaceholder) return i;
var s = $c(l);
return hi(i, s);
},
ed = function (e) {
var t = e.draggable,
n = e.draggables,
r = e.droppables,
i = e.previousImpact,
a = e.impact,
o = Zc({ previousImpact: i, impact: a, droppables: r }),
l = Be(a);
if (!l) return o;
var s = r[l];
if (Tt(t, s) || s.subject.withPlaceholder) return o;
var c = rl(s, t, n);
return hi(o, c);
},
Ht = function (e) {
var t = e.state,
n = e.clientSelection,
r = e.dimensions,
i = e.viewport,
a = e.impact,
o = e.scrollJumpRequest,
l = i || t.viewport,
s = r || t.dimensions,
c = n || t.current.client.selection,
d = Oe(c, t.initial.client.selection),
u = { offset: d, selection: c, borderBoxCenter: we(t.initial.client.borderBoxCenter, d) },
f = {
selection: we(u.selection, l.scroll.current),
borderBoxCenter: we(u.borderBoxCenter, l.scroll.current),
offset: we(u.offset, l.scroll.diff.value),
},
p = { client: u, page: f };
if (t.phase === 'COLLECTING')
return j({ phase: 'COLLECTING' }, t, { dimensions: s, viewport: l, current: p });
var m = s.draggables[t.critical.draggable.id],
h =
a ||
ll({
pageOffset: f.offset,
draggable: m,
draggables: s.draggables,
droppables: s.droppables,
previousImpact: t.impact,
viewport: l,
afterCritical: t.afterCritical,
}),
x = ed({
draggable: m,
impact: h,
previousImpact: t.impact,
draggables: s.draggables,
droppables: s.droppables,
}),
b = j({}, t, {
current: p,
dimensions: { draggables: s.draggables, droppables: x },
impact: h,
viewport: l,
scrollJumpRequest: o || null,
forceShouldAnimate: o ? !1 : null,
});
return b;
};
function td(e, t) {
return e.map(function (n) {
return t[n];
});
}
var sl = function (e) {
var t = e.impact,
n = e.viewport,
r = e.draggables,
i = e.destination,
a = e.forceShouldAnimate,
o = t.displaced,
l = td(o.all, r),
s = Qt({
afterDragging: l,
destination: i,
displacedBy: t.displacedBy,
viewport: n.frame,
forceShouldAnimate: a,
last: o,
});
return j({}, t, { displaced: s });
},
ul = function (e) {
var t = e.impact,
n = e.draggable,
r = e.droppable,
i = e.draggables,
a = e.viewport,
o = e.afterCritical,
l = Xn({ impact: t, draggable: n, draggables: i, droppable: r, afterCritical: o });
return mi({ pageBorderBoxCenter: l, draggable: n, viewport: a });
},
cl = function (e) {
var t = e.state,
n = e.dimensions,
r = e.viewport;
t.movementMode !== 'SNAP' && B(!1);
var i = t.impact,
a = r || t.viewport,
o = n || t.dimensions,
l = o.draggables,
s = o.droppables,
c = l[t.critical.draggable.id],
d = Be(i);
d || B(!1);
var u = s[d],
f = sl({ impact: i, viewport: a, destination: u, draggables: l }),
p = ul({
impact: f,
draggable: c,
droppable: u,
draggables: l,
viewport: a,
afterCritical: t.afterCritical,
});
return Ht({ impact: f, clientSelection: p, state: t, dimensions: o, viewport: a });
},
nd = function (e) {
return { index: e.index, droppableId: e.droppableId };
},
dl = function (e) {
var t = e.draggable,
n = e.home,
r = e.draggables,
i = e.viewport,
a = sn(n.axis, t.displaceBy),
o = Ot(n.descriptor.id, r),
l = o.indexOf(t);
l === -1 && B(!1);
var s = o.slice(l + 1),
c = s.reduce(function (p, m) {
return (p[m.descriptor.id] = !0), p;
}, {}),
d = { inVirtualList: n.descriptor.mode === 'virtual', displacedBy: a, effected: c },
u = Qt({
afterDragging: s,
destination: n,
displacedBy: a,
last: null,
viewport: i.frame,
forceShouldAnimate: !1,
}),
f = { displaced: u, displacedBy: a, at: { type: 'REORDER', destination: nd(t.descriptor) } };
return { impact: f, afterCritical: d };
},
rd = function (e, t) {
return { draggables: e.draggables, droppables: hi(e.droppables, t) };
},
id = function (e) {
var t = e.draggable,
n = e.offset,
r = e.initialWindowScroll,
i = In(t.client, n),
a = kn(i, r),
o = j({}, t, { placeholder: j({}, t.placeholder, { client: i }), client: i, page: a });
return o;
},
ad = function (e) {
var t = e.frame;
return t || B(!1), t;
},
od = function (e) {
var t = e.additions,
n = e.updatedDroppables,
r = e.viewport,
i = r.scroll.diff.value;
return t.map(function (a) {
var o = a.descriptor.droppableId,
l = n[o],
s = ad(l),
c = s.scroll.diff.value,
d = we(i, c),
u = id({ draggable: a, offset: d, initialWindowScroll: r.scroll.initial });
return u;
});
},
ld = function (e) {
var t = e.state,
n = e.published,
r = n.modified.map(function (S) {
var D = t.dimensions.droppables[S.droppableId],
E = ui(D, S.scroll);
return E;
}),
i = j({}, t.dimensions.droppables, {}, Ko(r)),
a = Yo(od({ additions: n.additions, updatedDroppables: i, viewport: t.viewport })),
o = j({}, t.dimensions.draggables, {}, a);
n.removals.forEach(function (S) {
delete o[S];
});
var l = { droppables: i, draggables: o },
s = Be(t.impact),
c = s ? l.droppables[s] : null,
d = l.draggables[t.critical.draggable.id],
u = l.droppables[t.critical.droppable.id],
f = dl({ draggable: d, home: u, draggables: o, viewport: t.viewport }),
p = f.impact,
m = f.afterCritical,
h = c && c.isCombineEnabled ? t.impact : p,
x = ll({
pageOffset: t.current.page.offset,
draggable: l.draggables[t.critical.draggable.id],
draggables: l.draggables,
droppables: l.droppables,
previousImpact: h,
viewport: t.viewport,
afterCritical: m,
}),
b = j({ phase: 'DRAGGING' }, t, {
phase: 'DRAGGING',
impact: x,
onLiftImpact: p,
dimensions: l,
afterCritical: m,
forceShouldAnimate: !1,
});
if (t.phase === 'COLLECTING') return b;
var C = j({ phase: 'DROP_PENDING' }, b, {
phase: 'DROP_PENDING',
reason: t.reason,
isWaiting: !1,
});
return C;
},
zr = function (t) {
return t.movementMode === 'SNAP';
},
vr = function (t, n, r) {
var i = rd(t.dimensions, n);
return !zr(t) || r ? Ht({ state: t, dimensions: i }) : cl({ state: t, dimensions: i });
};
function br(e) {
return e.isDragging && e.movementMode === 'SNAP'
? j({ phase: 'DRAGGING' }, e, { scrollJumpRequest: null })
: e;
}
var da = { phase: 'IDLE', completed: null, shouldFlush: !1 },
sd = function (e, t) {
if ((e === void 0 && (e = da), t.type === 'FLUSH')) return j({}, da, { shouldFlush: !0 });
if (t.type === 'INITIAL_PUBLISH') {
e.phase !== 'IDLE' && B(!1);
var n = t.payload,
r = n.critical,
i = n.clientSelection,
a = n.viewport,
o = n.dimensions,
l = n.movementMode,
s = o.draggables[r.draggable.id],
c = o.droppables[r.droppable.id],
d = { selection: i, borderBoxCenter: s.client.borderBox.center, offset: be },
u = {
client: d,
page: {
selection: we(d.selection, a.scroll.initial),
borderBoxCenter: we(d.selection, a.scroll.initial),
offset: we(d.selection, a.scroll.diff.value),
},
},
f = Kn(o.droppables).every(function (Ve) {
return !Ve.isFixedOnPage;
}),
p = dl({ draggable: s, home: c, draggables: o.draggables, viewport: a }),
m = p.impact,
h = p.afterCritical,
x = {
phase: 'DRAGGING',
isDragging: !0,
critical: r,
movementMode: l,
dimensions: o,
initial: u,
current: u,
isWindowScrollAllowed: f,
impact: m,
afterCritical: h,
onLiftImpact: m,
viewport: a,
scrollJumpRequest: null,
forceShouldAnimate: null,
};
return x;
}
if (t.type === 'COLLECTION_STARTING') {
if (e.phase === 'COLLECTING' || e.phase === 'DROP_PENDING') return e;
e.phase !== 'DRAGGING' && B(!1);
var b = j({ phase: 'COLLECTING' }, e, { phase: 'COLLECTING' });
return b;
}
if (t.type === 'PUBLISH_WHILE_DRAGGING')
return (
e.phase === 'COLLECTING' || e.phase === 'DROP_PENDING' || B(!1),
ld({ state: e, published: t.payload })
);
if (t.type === 'MOVE') {
if (e.phase === 'DROP_PENDING') return e;
yt(e) || B(!1);
var C = t.payload.client;
return st(C, e.current.client.selection)
? e
: Ht({ state: e, clientSelection: C, impact: zr(e) ? e.impact : null });
}
if (t.type === 'UPDATE_DROPPABLE_SCROLL') {
if (e.phase === 'DROP_PENDING' || e.phase === 'COLLECTING') return br(e);
yt(e) || B(!1);
var S = t.payload,
D = S.id,
E = S.newScroll,
w = e.dimensions.droppables[D];
if (!w) return e;
var O = ui(w, E);
return vr(e, O, !1);
}
if (t.type === 'UPDATE_DROPPABLE_IS_ENABLED') {
if (e.phase === 'DROP_PENDING') return e;
yt(e) || B(!1);
var L = t.payload,
F = L.id,
V = L.isEnabled,
A = e.dimensions.droppables[F];
A || B(!1), A.isEnabled === V && B(!1);
var R = j({}, A, { isEnabled: V });
return vr(e, R, !0);
}
if (t.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {
if (e.phase === 'DROP_PENDING') return e;
yt(e) || B(!1);
var Y = t.payload,
q = Y.id,
$ = Y.isCombineEnabled,
J = e.dimensions.droppables[q];
J || B(!1), J.isCombineEnabled === $ && B(!1);
var ie = j({}, J, { isCombineEnabled: $ });
return vr(e, ie, !0);
}
if (t.type === 'MOVE_BY_WINDOW_SCROLL') {
if (e.phase === 'DROP_PENDING' || e.phase === 'DROP_ANIMATING') return e;
yt(e) || B(!1), e.isWindowScrollAllowed || B(!1);
var ce = t.payload.newScroll;
if (st(e.viewport.scroll.current, ce)) return br(e);
var me = el(e.viewport, ce);
return zr(e) ? cl({ state: e, viewport: me }) : Ht({ state: e, viewport: me });
}
if (t.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {
if (!yt(e)) return e;
var y = t.payload.maxScroll;
if (st(y, e.viewport.scroll.max)) return e;
var pe = j({}, e.viewport, { scroll: j({}, e.viewport.scroll, { max: y }) });
return j({ phase: 'DRAGGING' }, e, { viewport: pe });
}
if (
t.type === 'MOVE_UP' ||
t.type === 'MOVE_DOWN' ||
t.type === 'MOVE_LEFT' ||
t.type === 'MOVE_RIGHT'
) {
if (e.phase === 'COLLECTING' || e.phase === 'DROP_PENDING') return e;
e.phase !== 'DRAGGING' && B(!1);
var k = Wc({ state: e, type: t.type });
return k
? Ht({
state: e,
impact: k.impact,
clientSelection: k.clientSelection,
scrollJumpRequest: k.scrollJumpRequest,
})
: e;
}
if (t.type === 'DROP_PENDING') {
var v = t.payload.reason;
e.phase !== 'COLLECTING' && B(!1);
var Q = j({ phase: 'DROP_PENDING' }, e, { phase: 'DROP_PENDING', isWaiting: !0, reason: v });
return Q;
}
if (t.type === 'DROP_ANIMATE') {
var oe = t.payload,
ee = oe.completed,
he = oe.dropDuration,
fe = oe.newHomeClientOffset;
e.phase === 'DRAGGING' || e.phase === 'DROP_PENDING' || B(!1);
var Le = {
phase: 'DROP_ANIMATING',
completed: ee,
dropDuration: he,
newHomeClientOffset: fe,
dimensions: e.dimensions,
};
return Le;
}
if (t.type === 'DROP_COMPLETE') {
var Se = t.payload.completed;
return { phase: 'IDLE', completed: Se, shouldFlush: !1 };
}
return e;
},
ud = function (t) {
return { type: 'BEFORE_INITIAL_CAPTURE', payload: t };
},
cd = function (t) {
return { type: 'LIFT', payload: t };
},
dd = function (t) {
return { type: 'INITIAL_PUBLISH', payload: t };
},
pd = function (t) {
return { type: 'PUBLISH_WHILE_DRAGGING', payload: t };
},
fd = function () {
return { type: 'COLLECTION_STARTING', payload: null };
},
gd = function (t) {
return { type: 'UPDATE_DROPPABLE_SCROLL', payload: t };
},
md = function (t) {
return { type: 'UPDATE_DROPPABLE_IS_ENABLED', payload: t };
},
hd = function (t) {
return { type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED', payload: t };
},
pl = function (t) {
return { type: 'MOVE', payload: t };
},
vd = function (t) {
return { type: 'MOVE_BY_WINDOW_SCROLL', payload: t };
},
bd = function (t) {
return { type: 'UPDATE_VIEWPORT_MAX_SCROLL', payload: t };
},
yd = function () {
return { type: 'MOVE_UP', payload: null };
},
xd = function () {
return { type: 'MOVE_DOWN', payload: null };
},
wd = function () {
return { type: 'MOVE_RIGHT', payload: null };
},
Sd = function () {
return { type: 'MOVE_LEFT', payload: null };
},
vi = function () {
return { type: 'FLUSH', payload: null };
},
Cd = function (t) {
return { type: 'DROP_ANIMATE', payload: t };
},
bi = function (t) {
return { type: 'DROP_COMPLETE', payload: t };
},
fl = function (t) {
return { type: 'DROP', payload: t };
},
Dd = function (t) {
return { type: 'DROP_PENDING', payload: t };
},
gl = function () {
return { type: 'DROP_ANIMATION_FINISHED', payload: null };
},
Id = function (e) {
return function (t) {
var n = t.getState,
r = t.dispatch;
return function (i) {
return function (a) {
if (a.type !== 'LIFT') {
i(a);
return;
}
var o = a.payload,
l = o.id,
s = o.clientSelection,
c = o.movementMode,
d = n();
d.phase === 'DROP_ANIMATING' && r(bi({ completed: d.completed })),
n().phase !== 'IDLE' && B(!1),
r(vi()),
r(ud({ draggableId: l, movementMode: c }));
var u = { shouldPublishImmediately: c === 'SNAP' },
f = { draggableId: l, scrollOptions: u },
p = e.startPublishing(f),
m = p.critical,
h = p.dimensions,
x = p.viewport;
r(dd({ critical: m, dimensions: h, clientSelection: s, movementMode: c, viewport: x }));
};
};
};
},
kd = function (e) {
return function () {
return function (t) {
return function (n) {
n.type === 'INITIAL_PUBLISH' && e.dragging(),
n.type === 'DROP_ANIMATE' && e.dropping(n.payload.completed.result.reason),
(n.type === 'FLUSH' || n.type === 'DROP_COMPLETE') && e.resting(),
t(n);
};
};
};
},
yi = { outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)', drop: 'cubic-bezier(.2,1,.1,1)' },
Xt = { opacity: { drop: 0, combining: 0.7 }, scale: { drop: 0.75 } },
xi = { outOfTheWay: 0.2, minDropTime: 0.33, maxDropTime: 0.55 },
vt = xi.outOfTheWay + 's ' + yi.outOfTheWay,
Ut = {
fluid: 'opacity ' + vt,
snap: 'transform ' + vt + ', opacity ' + vt,
drop: function (t) {
var n = t + 's ' + yi.drop;
return 'transform ' + n + ', opacity ' + n;
},
outOfTheWay: 'transform ' + vt,
placeholder: 'height ' + vt + ', width ' + vt + ', margin ' + vt,
},
pa = function (t) {
return st(t, be) ? null : 'translate(' + t.x + 'px, ' + t.y + 'px)';
},
$r = {
moveTo: pa,
drop: function (t, n) {
var r = pa(t);
return r ? (n ? r + ' scale(' + Xt.scale.drop + ')' : r) : null;
},
},
Hr = xi.minDropTime,
ml = xi.maxDropTime,
Ed = ml - Hr,
fa = 1500,
Pd = 0.6,
Ad = function (e) {
var t = e.current,
n = e.destination,
r = e.reason,
i = Kt(t, n);
if (i <= 0) return Hr;
if (i >= fa) return ml;
var a = i / fa,
o = Hr + Ed * a,
l = r === 'CANCEL' ? o * Pd : o;
return Number(l.toFixed(2));
},
Nd = function (e) {
var t = e.impact,
n = e.draggable,
r = e.dimensions,
i = e.viewport,
a = e.afterCritical,
o = r.draggables,
l = r.droppables,
s = Be(t),
c = s ? l[s] : null,
d = l[n.descriptor.droppableId],
u = ul({
impact: t,
draggable: n,
draggables: o,
afterCritical: a,
droppable: c || d,
viewport: i,
}),
f = Oe(u, n.client.borderBox.center);
return f;
},
Od = function (e) {
var t = e.draggables,
n = e.reason,
r = e.lastImpact,
i = e.home,
a = e.viewport,
o = e.onLiftImpact;
if (!r.at || n !== 'DROP') {
var l = sl({ draggables: t, impact: o, destination: i, viewport: a, forceShouldAnimate: !0 });
return { impact: l, didDropInsideDroppable: !1 };
}
if (r.at.type === 'REORDER') return { impact: r, didDropInsideDroppable: !0 };
var s = j({}, r, { displaced: Yt });
return { impact: s, didDropInsideDroppable: !0 };
},
Td = function (e) {
var t = e.getState,
n = e.dispatch;
return function (r) {
return function (i) {
if (i.type !== 'DROP') {
r(i);
return;
}
var a = t(),
o = i.payload.reason;
if (a.phase === 'COLLECTING') {
n(Dd({ reason: o }));
return;
}
if (a.phase !== 'IDLE') {
var l = a.phase === 'DROP_PENDING' && a.isWaiting;
l && B(!1), a.phase === 'DRAGGING' || a.phase === 'DROP_PENDING' || B(!1);
var s = a.critical,
c = a.dimensions,
d = c.draggables[a.critical.draggable.id],
u = Od({
reason: o,
lastImpact: a.impact,
afterCritical: a.afterCritical,
onLiftImpact: a.onLiftImpact,
home: a.dimensions.droppables[a.critical.droppable.id],
viewport: a.viewport,
draggables: a.dimensions.draggables,
}),
f = u.impact,
p = u.didDropInsideDroppable,
m = p ? di(f) : null,
h = p ? Yn(f) : null,
x = { index: s.draggable.index, droppableId: s.droppable.id },
b = {
draggableId: d.descriptor.id,
type: d.descriptor.type,
source: x,
reason: o,
mode: a.movementMode,
destination: m,
combine: h,
},
C = Nd({
impact: f,
draggable: d,
dimensions: c,
viewport: a.viewport,
afterCritical: a.afterCritical,
}),
S = { critical: a.critical, afterCritical: a.afterCritical, result: b, impact: f },
D = !st(a.current.client.offset, C) || !!b.combine;
if (!D) {
n(bi({ completed: S }));
return;
}
var E = Ad({ current: a.current.client.offset, destination: C, reason: o }),
w = { newHomeClientOffset: C, dropDuration: E, completed: S };
n(Cd(w));
}
};
};
},
hl = function () {
return { x: window.pageXOffset, y: window.pageYOffset };
};
function Bd(e) {
return {
eventName: 'scroll',
options: { passive: !0, capture: !1 },
fn: function (n) {
(n.target !== window && n.target !== window.document) || e();
},
};
}
function Rd(e) {
var t = e.onWindowScroll;
function n() {
t(hl());
}
var r = Vt(n),
i = Bd(r),
a = lt;
function o() {
return a !== lt;
}
function l() {
o() && B(!1), (a = ze(window, [i]));
}
function s() {
o() || B(!1), r.cancel(), a(), (a = lt);
}
return { start: l, stop: s, isActive: o };
}
var Fd = function (t) {
return t.type === 'DROP_COMPLETE' || t.type === 'DROP_ANIMATE' || t.type === 'FLUSH';
},
Ld = function (e) {
var t = Rd({
onWindowScroll: function (r) {
e.dispatch(vd({ newScroll: r }));
},
});
return function (n) {
return function (r) {
!t.isActive() && r.type === 'INITIAL_PUBLISH' && t.start(),
t.isActive() && Fd(r) && t.stop(),
n(r);
};
};
},
Md = function (e) {
var t = !1,
n = !1,
r = setTimeout(function () {
n = !0;
}),
i = function (o) {
t || n || ((t = !0), e(o), clearTimeout(r));
};
return (
(i.wasCalled = function () {
return t;
}),
i
);
},
jd = function () {
var e = [],
t = function (a) {
var o = ci(e, function (c) {
return c.timerId === a;
});
o === -1 && B(!1);
var l = e.splice(o, 1),
s = l[0];
s.callback();
},
n = function (a) {
var o = setTimeout(function () {
return t(o);
}),
l = { timerId: o, callback: a };
e.push(l);
},
r = function () {
if (e.length) {
var a = [].concat(e);
(e.length = 0),
a.forEach(function (o) {
clearTimeout(o.timerId), o.callback();
});
}
};
return { add: n, flush: r };
},
zd = function (t, n) {
return t == null && n == null
? !0
: t == null || n == null
? !1
: t.droppableId === n.droppableId && t.index === n.index;
},
$d = function (t, n) {
return t == null && n == null
? !0
: t == null || n == null
? !1
: t.draggableId === n.draggableId && t.droppableId === n.droppableId;
},
Hd = function (t, n) {
if (t === n) return !0;
var r =
t.draggable.id === n.draggable.id &&
t.draggable.droppableId === n.draggable.droppableId &&
t.draggable.type === n.draggable.type &&
t.draggable.index === n.draggable.index,
i = t.droppable.id === n.droppable.id && t.droppable.type === n.droppable.type;
return r && i;
},
Mt = function (t, n) {
n();
},
gn = function (t, n) {
return {
draggableId: t.draggable.id,
type: t.droppable.type,
source: { droppableId: t.droppable.id, index: t.draggable.index },
mode: n,
};
},
yr = function (t, n, r, i) {
if (!t) {
r(i(n));
return;
}
var a = Md(r),
o = { announce: a };
t(n, o), a.wasCalled() || r(i(n));
},
Ud = function (e, t) {
var n = jd(),
r = null,
i = function (f, p) {
r && B(!1),
Mt('onBeforeCapture', function () {
var m = e().onBeforeCapture;
if (m) {
var h = { draggableId: f, mode: p };
m(h);
}
});
},
a = function (f, p) {
r && B(!1),
Mt('onBeforeDragStart', function () {
var m = e().onBeforeDragStart;
m && m(gn(f, p));
});
},
o = function (f, p) {
r && B(!1);
var m = gn(f, p);
(r = { mode: p, lastCritical: f, lastLocation: m.source, lastCombine: null }),
n.add(function () {
Mt('onDragStart', function () {
return yr(e().onDragStart, m, t, wn.onDragStart);
});
});
},
l = function (f, p) {
var m = di(p),
h = Yn(p);
r || B(!1);
var x = !Hd(f, r.lastCritical);
x && (r.lastCritical = f);
var b = !zd(r.lastLocation, m);
b && (r.lastLocation = m);
var C = !$d(r.lastCombine, h);
if ((C && (r.lastCombine = h), !(!x && !b && !C))) {
var S = j({}, gn(f, r.mode), { combine: h, destination: m });
n.add(function () {
Mt('onDragUpdate', function () {
return yr(e().onDragUpdate, S, t, wn.onDragUpdate);
});
});
}
},
s = function () {
r || B(!1), n.flush();
},
c = function (f) {
r || B(!1),
(r = null),
Mt('onDragEnd', function () {
return yr(e().onDragEnd, f, t, wn.onDragEnd);
});
},
d = function () {
if (r) {
var f = j({}, gn(r.lastCritical, r.mode), {
combine: null,
destination: null,
reason: 'CANCEL',
});
c(f);
}
};
return { beforeCapture: i, beforeStart: a, start: o, update: l, flush: s, drop: c, abort: d };
},
Gd = function (e, t) {
var n = Ud(e, t);
return function (r) {
return function (i) {
return function (a) {
if (a.type === 'BEFORE_INITIAL_CAPTURE') {
n.beforeCapture(a.payload.draggableId, a.payload.movementMode);
return;
}
if (a.type === 'INITIAL_PUBLISH') {
var o = a.payload.critical;
n.beforeStart(o, a.payload.movementMode), i(a), n.start(o, a.payload.movementMode);
return;
}
if (a.type === 'DROP_COMPLETE') {
var l = a.payload.completed.result;
n.flush(), i(a), n.drop(l);
return;
}
if ((i(a), a.type === 'FLUSH')) {
n.abort();
return;
}
var s = r.getState();
s.phase === 'DRAGGING' && n.update(s.critical, s.impact);
};
};
};
},
Wd = function (e) {
return function (t) {
return function (n) {
if (n.type !== 'DROP_ANIMATION_FINISHED') {
t(n);
return;
}
var r = e.getState();
r.phase !== 'DROP_ANIMATING' && B(!1), e.dispatch(bi({ completed: r.completed }));
};
};
},
qd = function (e) {
var t = null,
n = null;
function r() {
n && (cancelAnimationFrame(n), (n = null)), t && (t(), (t = null));
}
return function (i) {
return function (a) {
if (
((a.type === 'FLUSH' ||
a.type === 'DROP_COMPLETE' ||
a.type === 'DROP_ANIMATION_FINISHED') &&
r(),
i(a),
a.type === 'DROP_ANIMATE')
) {
var o = {
eventName: 'scroll',
options: { capture: !0, passive: !1, once: !0 },
fn: function () {
var s = e.getState();
s.phase === 'DROP_ANIMATING' && e.dispatch(gl());
},
};
n = requestAnimationFrame(function () {
(n = null), (t = ze(window, [o]));
});
}
};
};
},
Vd = function (e) {
return function () {
return function (t) {
return function (n) {
(n.type === 'DROP_COMPLETE' || n.type === 'FLUSH' || n.type === 'DROP_ANIMATE') &&
e.stopPublishing(),
t(n);
};
};
};
},
Kd = function (e) {
var t = !1;
return function () {
return function (n) {
return function (r) {
if (r.type === 'INITIAL_PUBLISH') {
(t = !0),
e.tryRecordFocus(r.payload.critical.draggable.id),
n(r),
e.tryRestoreFocusRecorded();
return;
}
if ((n(r), !!t)) {
if (r.type === 'FLUSH') {
(t = !1), e.tryRestoreFocusRecorded();
return;
}
if (r.type === 'DROP_COMPLETE') {
t = !1;
var i = r.payload.completed.result;
i.combine && e.tryShiftRecord(i.draggableId, i.combine.draggableId),
e.tryRestoreFocusRecorded();
}
}
};
};
};
},
Yd = function (t) {
return t.type === 'DROP_COMPLETE' || t.type === 'DROP_ANIMATE' || t.type === 'FLUSH';
},
Qd = function (e) {
return function (t) {
return function (n) {
return function (r) {
if (Yd(r)) {
e.stop(), n(r);
return;
}
if (r.type === 'INITIAL_PUBLISH') {
n(r);
var i = t.getState();
i.phase !== 'DRAGGING' && B(!1), e.start(i);
return;
}
n(r), e.scroll(t.getState());
};
};
};
},
Xd = function (e) {
return function (t) {
return function (n) {
if ((t(n), n.type === 'PUBLISH_WHILE_DRAGGING')) {
var r = e.getState();
r.phase === 'DROP_PENDING' && (r.isWaiting || e.dispatch(fl({ reason: r.reason })));
}
};
};
},
Jd = So,
_d = function (e) {
var t = e.dimensionMarshal,
n = e.focusMarshal,
r = e.styleMarshal,
i = e.getResponders,
a = e.announce,
o = e.autoScroller;
return wo(sd, Jd(Bs(kd(r), Vd(t), Id(t), Td, Wd, qd, Xd, Qd(o), Ld, Kd(n), Gd(i, a))));
},
xr = function () {
return { additions: {}, removals: {}, modified: {} };
};
function Zd(e) {
var t = e.registry,
n = e.callbacks,
r = xr(),
i = null,
a = function () {
i ||
(n.collectionStarting(),
(i = requestAnimationFrame(function () {
i = null;
var d = r,
u = d.additions,
f = d.removals,
p = d.modified,
m = Object.keys(u)
.map(function (b) {
return t.draggable.getById(b).getDimension(be);
})
.sort(function (b, C) {
return b.descriptor.index - C.descriptor.index;
}),
h = Object.keys(p).map(function (b) {
var C = t.droppable.getById(b),
S = C.callbacks.getScrollWhileDragging();
return { droppableId: b, scroll: S };
}),
x = { additions: m, removals: Object.keys(f), modified: h };
(r = xr()), n.publish(x);
})));
},
o = function (d) {
var u = d.descriptor.id;
(r.additions[u] = d),
(r.modified[d.descriptor.droppableId] = !0),
r.removals[u] && delete r.removals[u],
a();
},
l = function (d) {
var u = d.descriptor;
(r.removals[u.id] = !0),
(r.modified[u.droppableId] = !0),
r.additions[u.id] && delete r.additions[u.id],
a();
},
s = function () {
i && (cancelAnimationFrame(i), (i = null), (r = xr()));
};
return { add: o, remove: l, stop: s };
}
var vl = function (e) {
var t = e.scrollHeight,
n = e.scrollWidth,
r = e.height,
i = e.width,
a = Oe({ x: n, y: t }, { x: i, y: r }),
o = { x: Math.max(0, a.x), y: Math.max(0, a.y) };
return o;
},
bl = function () {
var e = document.documentElement;
return e || B(!1), e;
},
yl = function () {
var e = bl(),
t = vl({
scrollHeight: e.scrollHeight,
scrollWidth: e.scrollWidth,
width: e.clientWidth,
height: e.clientHeight,
});
return t;
},
ep = function () {
var e = hl(),
t = yl(),
n = e.y,
r = e.x,
i = bl(),
a = i.clientWidth,
o = i.clientHeight,
l = r + a,
s = n + o,
c = We({ top: n, left: r, right: l, bottom: s }),
d = {
frame: c,
scroll: { initial: e, current: e, max: t, diff: { value: be, displacement: be } },
};
return d;
},
tp = function (e) {
var t = e.critical,
n = e.scrollOptions,
r = e.registry,
i = ep(),
a = i.scroll.current,
o = t.droppable,
l = r.droppable.getAllByType(o.type).map(function (u) {
return u.callbacks.getDimensionAndWatchScroll(a, n);
}),
s = r.draggable.getAllByType(t.draggable.type).map(function (u) {
return u.getDimension(a);
}),
c = { draggables: Yo(s), droppables: Ko(l) },
d = { dimensions: c, critical: t, viewport: i };
return d;
};
function ga(e, t, n) {
if (n.descriptor.id === t.id || n.descriptor.type !== t.type) return !1;
var r = e.droppable.getById(n.descriptor.droppableId);
return r.descriptor.mode === 'virtual';
}
var np = function (e, t) {
var n = null,
r = Zd({
callbacks: { publish: t.publishWhileDragging, collectionStarting: t.collectionStarting },
registry: e,
}),
i = function (p, m) {
e.droppable.exists(p) || B(!1), n && t.updateDroppableIsEnabled({ id: p, isEnabled: m });
},
a = function (p, m) {
n &&
(e.droppable.exists(p) || B(!1),
t.updateDroppableIsCombineEnabled({ id: p, isCombineEnabled: m }));
},
o = function (p, m) {
n && (e.droppable.exists(p) || B(!1), t.updateDroppableScroll({ id: p, newScroll: m }));
},
l = function (p, m) {
n && e.droppable.getById(p).callbacks.scroll(m);
},
s = function () {
if (n) {
r.stop();
var p = n.critical.droppable;
e.droppable.getAllByType(p.type).forEach(function (m) {
return m.callbacks.dragStopped();
}),
n.unsubscribe(),
(n = null);
}
},
c = function (p) {
n || B(!1);
var m = n.critical.draggable;
p.type === 'ADDITION' && ga(e, m, p.value) && r.add(p.value),
p.type === 'REMOVAL' && ga(e, m, p.value) && r.remove(p.value);
},
d = function (p) {
n && B(!1);
var m = e.draggable.getById(p.draggableId),
h = e.droppable.getById(m.descriptor.droppableId),
x = { draggable: m.descriptor, droppable: h.descriptor },
b = e.subscribe(c);
return (
(n = { critical: x, unsubscribe: b }),
tp({ critical: x, registry: e, scrollOptions: p.scrollOptions })
);
},
u = {
updateDroppableIsEnabled: i,
updateDroppableIsCombineEnabled: a,
scrollDroppable: l,
updateDroppableScroll: o,
startPublishing: d,
stopPublishing: s,
};
return u;
},
xl = function (e, t) {
return e.phase === 'IDLE'
? !0
: e.phase !== 'DROP_ANIMATING' || e.completed.result.draggableId === t
? !1
: e.completed.result.reason === 'DROP';
},
rp = function (e) {
window.scrollBy(e.x, e.y);
},
ip = ve(function (e) {
return Kn(e).filter(function (t) {
return !(!t.isEnabled || !t.frame);
});
}),
ap = function (t, n) {
var r = dt(ip(n), function (i) {
return i.frame || B(!1), il(i.frame.pageMarginBox)(t);
});
return r;
},
op = function (e) {
var t = e.center,
n = e.destination,
r = e.droppables;
if (n) {
var i = r[n];
return i.frame ? i : null;
}
var a = ap(t, r);
return a;
},
ut = {
startFromPercentage: 0.25,
maxScrollAtPercentage: 0.05,
maxPixelScroll: 28,
ease: function (t) {
return Math.pow(t, 2);
},
durationDampening: { stopDampeningAt: 1200, accelerateAt: 360 },
},
lp = function (e, t) {
var n = e[t.size] * ut.startFromPercentage,
r = e[t.size] * ut.maxScrollAtPercentage,
i = { startScrollingFrom: n, maxScrollValueAt: r };
return i;
},
wl = function (e) {
var t = e.startOfRange,
n = e.endOfRange,
r = e.current,
i = n - t;
if (i === 0) return 0;
var a = r - t,
o = a / i;
return o;
},
wi = 1,
sp = function (e, t) {
if (e > t.startScrollingFrom) return 0;
if (e <= t.maxScrollValueAt) return ut.maxPixelScroll;
if (e === t.startScrollingFrom) return wi;
var n = wl({ startOfRange: t.maxScrollValueAt, endOfRange: t.startScrollingFrom, current: e }),
r = 1 - n,
i = ut.maxPixelScroll * ut.ease(r);
return Math.ceil(i);
},
ma = ut.durationDampening.accelerateAt,
ha = ut.durationDampening.stopDampeningAt,
up = function (e, t) {
var n = t,
r = ha,
i = Date.now(),
a = i - n;
if (a >= ha) return e;
if (a < ma) return wi;
var o = wl({ startOfRange: ma, endOfRange: r, current: a }),
l = e * ut.ease(o);
return Math.ceil(l);
},
va = function (e) {
var t = e.distanceToEdge,
n = e.thresholds,
r = e.dragStartTime,
i = e.shouldUseTimeDampening,
a = sp(t, n);
return a === 0 ? 0 : i ? Math.max(up(a, r), wi) : a;
},
ba = function (e) {
var t = e.container,
n = e.distanceToEdges,
r = e.dragStartTime,
i = e.axis,
a = e.shouldUseTimeDampening,
o = lp(t, i),
l = n[i.end] < n[i.start];
return l
? va({ distanceToEdge: n[i.end], thresholds: o, dragStartTime: r, shouldUseTimeDampening: a })
: -1 *
va({
distanceToEdge: n[i.start],
thresholds: o,
dragStartTime: r,
shouldUseTimeDampening: a,
});
},
cp = function (e) {
var t = e.container,
n = e.subject,
r = e.proposedScroll,
i = n.height > t.height,
a = n.width > t.width;
return !a && !i ? r : a && i ? null : { x: a ? 0 : r.x, y: i ? 0 : r.y };
},
dp = qo(function (e) {
return e === 0 ? 0 : e;
}),
Sl = function (e) {
var t = e.dragStartTime,
n = e.container,
r = e.subject,
i = e.center,
a = e.shouldUseTimeDampening,
o = { top: i.y - n.top, right: n.right - i.x, bottom: n.bottom - i.y, left: i.x - n.left },
l = ba({
container: n,
distanceToEdges: o,
dragStartTime: t,
axis: pi,
shouldUseTimeDampening: a,
}),
s = ba({
container: n,
distanceToEdges: o,
dragStartTime: t,
axis: Jo,
shouldUseTimeDampening: a,
}),
c = dp({ x: s, y: l });
if (st(c, be)) return null;
var d = cp({ container: n, subject: r, proposedScroll: c });
return d ? (st(d, be) ? null : d) : null;
},
pp = qo(function (e) {
return e === 0 ? 0 : e > 0 ? 1 : -1;
}),
Si = (function () {
var e = function (n, r) {
return n < 0 ? n : n > r ? n - r : 0;
};
return function (t) {
var n = t.current,
r = t.max,
i = t.change,
a = we(n, i),
o = { x: e(a.x, r.x), y: e(a.y, r.y) };
return st(o, be) ? null : o;
};
})(),
Cl = function (t) {
var n = t.max,
r = t.current,
i = t.change,
a = { x: Math.max(r.x, n.x), y: Math.max(r.y, n.y) },
o = pp(i),
l = Si({ max: a, current: r, change: o });
return !l || (o.x !== 0 && l.x === 0) || (o.y !== 0 && l.y === 0);
},
Ci = function (t, n) {
return Cl({ current: t.scroll.current, max: t.scroll.max, change: n });
},
fp = function (t, n) {
if (!Ci(t, n)) return null;
var r = t.scroll.max,
i = t.scroll.current;
return Si({ current: i, max: r, change: n });
},
Di = function (t, n) {
var r = t.frame;
return r ? Cl({ current: r.scroll.current, max: r.scroll.max, change: n }) : !1;
},
gp = function (t, n) {
var r = t.frame;
return !r || !Di(t, n) ? null : Si({ current: r.scroll.current, max: r.scroll.max, change: n });
},
mp = function (e) {
var t = e.viewport,
n = e.subject,
r = e.center,
i = e.dragStartTime,
a = e.shouldUseTimeDampening,
o = Sl({
dragStartTime: i,
container: t.frame,
subject: n,
center: r,
shouldUseTimeDampening: a,
});
return o && Ci(t, o) ? o : null;
},
hp = function (e) {
var t = e.droppable,
n = e.subject,
r = e.center,
i = e.dragStartTime,
a = e.shouldUseTimeDampening,
o = t.frame;
if (!o) return null;
var l = Sl({
dragStartTime: i,
container: o.pageMarginBox,
subject: n,
center: r,
shouldUseTimeDampening: a,
});
return l && Di(t, l) ? l : null;
},
ya = function (e) {
var t = e.state,
n = e.dragStartTime,
r = e.shouldUseTimeDampening,
i = e.scrollWindow,
a = e.scrollDroppable,
o = t.current.page.borderBoxCenter,
l = t.dimensions.draggables[t.critical.draggable.id],
s = l.page.marginBox;
if (t.isWindowScrollAllowed) {
var c = t.viewport,
d = mp({ dragStartTime: n, viewport: c, subject: s, center: o, shouldUseTimeDampening: r });
if (d) {
i(d);
return;
}
}
var u = op({ center: o, destination: Be(t.impact), droppables: t.dimensions.droppables });
if (u) {
var f = hp({
dragStartTime: n,
droppable: u,
subject: s,
center: o,
shouldUseTimeDampening: r,
});
f && a(u.descriptor.id, f);
}
},
vp = function (e) {
var t = e.scrollWindow,
n = e.scrollDroppable,
r = Vt(t),
i = Vt(n),
a = null,
o = function (d) {
a || B(!1);
var u = a,
f = u.shouldUseTimeDampening,
p = u.dragStartTime;
ya({
state: d,
scrollWindow: r,
scrollDroppable: i,
dragStartTime: p,
shouldUseTimeDampening: f,
});
},
l = function (d) {
a && B(!1);
var u = Date.now(),
f = !1,
p = function () {
f = !0;
};
ya({
state: d,
dragStartTime: 0,
shouldUseTimeDampening: !1,
scrollWindow: p,
scrollDroppable: p,
}),
(a = { dragStartTime: u, shouldUseTimeDampening: f }),
f && o(d);
},
s = function () {
a && (r.cancel(), i.cancel(), (a = null));
};
return { start: l, stop: s, scroll: o };
},
bp = function (e) {
var t = e.move,
n = e.scrollDroppable,
r = e.scrollWindow,
i = function (c, d) {
var u = we(c.current.client.selection, d);
t({ client: u });
},
a = function (c, d) {
if (!Di(c, d)) return d;
var u = gp(c, d);
if (!u) return n(c.descriptor.id, d), null;
var f = Oe(d, u);
n(c.descriptor.id, f);
var p = Oe(d, f);
return p;
},
o = function (c, d, u) {
if (!c || !Ci(d, u)) return u;
var f = fp(d, u);
if (!f) return r(u), null;
var p = Oe(u, f);
r(p);
var m = Oe(u, p);
return m;
},
l = function (c) {
var d = c.scrollJumpRequest;
if (d) {
var u = Be(c.impact);
u || B(!1);
var f = a(c.dimensions.droppables[u], d);
if (f) {
var p = c.viewport,
m = o(c.isWindowScrollAllowed, p, f);
m && i(c, m);
}
}
};
return l;
},
yp = function (e) {
var t = e.scrollDroppable,
n = e.scrollWindow,
r = e.move,
i = vp({ scrollWindow: n, scrollDroppable: t }),
a = bp({ move: r, scrollWindow: n, scrollDroppable: t }),
o = function (c) {
if (c.phase === 'DRAGGING') {
if (c.movementMode === 'FLUID') {
i.scroll(c);
return;
}
c.scrollJumpRequest && a(c);
}
},
l = { scroll: o, start: i.start, stop: i.stop };
return l;
},
Pt = 'data-rbd',
At = (function () {
var e = Pt + '-drag-handle';
return { base: e, draggableId: e + '-draggable-id', contextId: e + '-context-id' };
})(),
Ur = (function () {
var e = Pt + '-draggable';
return { base: e, contextId: e + '-context-id', id: e + '-id' };
})(),
xp = (function () {
var e = Pt + '-droppable';
return { base: e, contextId: e + '-context-id', id: e + '-id' };
})(),
xa = { contextId: Pt + '-scroll-container-context-id' },
wp = function (t) {
return function (n) {
return '[' + n + '="' + t + '"]';
};
},
jt = function (t, n) {
return t
.map(function (r) {
var i = r.styles[n];
return i ? r.selector + ' { ' + i + ' }' : '';
})
.join(' ');
},
Sp = 'pointer-events: none;',
Cp = function (e) {
var t = wp(e),
n = (function () {
var l = `
cursor: -webkit-grab;
cursor: grab;
`;
return {
selector: t(At.contextId),
styles: {
always: `
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,
resting: l,
dragging: Sp,
dropAnimating: l,
},
};
})(),
r = (function () {
var l =
`
transition: ` +
Ut.outOfTheWay +
`;
`;
return {
selector: t(Ur.contextId),
styles: { dragging: l, dropAnimating: l, userCancel: l },
};
})(),
i = { selector: t(xp.contextId), styles: { always: 'overflow-anchor: none;' } },
a = {
selector: 'body',
styles: {
dragging: `
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`,
},
},
o = [r, n, i, a];
return {
always: jt(o, 'always'),
resting: jt(o, 'resting'),
dragging: jt(o, 'dragging'),
dropAnimating: jt(o, 'dropAnimating'),
userCancel: jt(o, 'userCancel'),
};
},
Re =
typeof window < 'u' &&
typeof window.document < 'u' &&
typeof window.document.createElement < 'u'
? N.useLayoutEffect
: N.useEffect,
wr = function () {
var t = document.querySelector('head');
return t || B(!1), t;
},
wa = function (t) {
var n = document.createElement('style');
return t && n.setAttribute('nonce', t), (n.type = 'text/css'), n;
};
function Dp(e, t) {
var n = X(
function () {
return Cp(e);
},
[e]
),
r = N.useRef(null),
i = N.useRef(null),
a = M(
ve(function (u) {
var f = i.current;
f || B(!1), (f.textContent = u);
}),
[]
),
o = M(function (u) {
var f = r.current;
f || B(!1), (f.textContent = u);
}, []);
Re(
function () {
(!r.current && !i.current) || B(!1);
var u = wa(t),
f = wa(t);
return (
(r.current = u),
(i.current = f),
u.setAttribute(Pt + '-always', e),
f.setAttribute(Pt + '-dynamic', e),
wr().appendChild(u),
wr().appendChild(f),
o(n.always),
a(n.resting),
function () {
var p = function (h) {
var x = h.current;
x || B(!1), wr().removeChild(x), (h.current = null);
};
p(r), p(i);
}
);
},
[t, o, a, n.always, n.resting, e]
);
var l = M(
function () {
return a(n.dragging);
},
[a, n.dragging]
),
s = M(
function (u) {
if (u === 'DROP') {
a(n.dropAnimating);
return;
}
a(n.userCancel);
},
[a, n.dropAnimating, n.userCancel]
),
c = M(
function () {
i.current && a(n.resting);
},
[a, n.resting]
),
d = X(
function () {
return { dragging: l, dropping: s, resting: c };
},
[l, s, c]
);
return d;
}
var Dl = function (e) {
return e && e.ownerDocument ? e.ownerDocument.defaultView : window;
};
function Jn(e) {
return e instanceof Dl(e).HTMLElement;
}
function Ip(e, t) {
var n = '[' + At.contextId + '="' + e + '"]',
r = Vo(document.querySelectorAll(n));
if (!r.length) return null;
var i = dt(r, function (a) {
return a.getAttribute(At.draggableId) === t;
});
return !i || !Jn(i) ? null : i;
}
function kp(e) {
var t = N.useRef({}),
n = N.useRef(null),
r = N.useRef(null),
i = N.useRef(!1),
a = M(function (f, p) {
var m = { id: f, focus: p };
return (
(t.current[f] = m),
function () {
var x = t.current,
b = x[f];
b !== m && delete x[f];
}
);
}, []),
o = M(
function (f) {
var p = Ip(e, f);
p && p !== document.activeElement && p.focus();
},
[e]
),
l = M(function (f, p) {
n.current === f && (n.current = p);
}, []),
s = M(
function () {
r.current ||
(i.current &&
(r.current = requestAnimationFrame(function () {
r.current = null;
var f = n.current;
f && o(f);
})));
},
[o]
),
c = M(function (f) {
n.current = null;
var p = document.activeElement;
p && p.getAttribute(At.draggableId) === f && (n.current = f);
}, []);
Re(function () {
return (
(i.current = !0),
function () {
i.current = !1;
var f = r.current;
f && cancelAnimationFrame(f);
}
);
}, []);
var d = X(
function () {
return { register: a, tryRecordFocus: c, tryRestoreFocusRecorded: s, tryShiftRecord: l };
},
[a, c, s, l]
);
return d;
}
function Ep() {
var e = { draggables: {}, droppables: {} },
t = [];
function n(u) {
return (
t.push(u),
function () {
var p = t.indexOf(u);
p !== -1 && t.splice(p, 1);
}
);
}
function r(u) {
t.length &&
t.forEach(function (f) {
return f(u);
});
}
function i(u) {
return e.draggables[u] || null;
}
function a(u) {
var f = i(u);
return f || B(!1), f;
}
var o = {
register: function (f) {
(e.draggables[f.descriptor.id] = f), r({ type: 'ADDITION', value: f });
},
update: function (f, p) {
var m = e.draggables[p.descriptor.id];
m &&
m.uniqueId === f.uniqueId &&
(delete e.draggables[p.descriptor.id], (e.draggables[f.descriptor.id] = f));
},
unregister: function (f) {
var p = f.descriptor.id,
m = i(p);
m && f.uniqueId === m.uniqueId && (delete e.draggables[p], r({ type: 'REMOVAL', value: f }));
},
getById: a,
findById: i,
exists: function (f) {
return !!i(f);
},
getAllByType: function (f) {
return An(e.draggables).filter(function (p) {
return p.descriptor.type === f;
});
},
};
function l(u) {
return e.droppables[u] || null;
}
function s(u) {
var f = l(u);
return f || B(!1), f;
}
var c = {
register: function (f) {
e.droppables[f.descriptor.id] = f;
},
unregister: function (f) {
var p = l(f.descriptor.id);
p && f.uniqueId === p.uniqueId && delete e.droppables[f.descriptor.id];
},
getById: s,
findById: l,
exists: function (f) {
return !!l(f);
},
getAllByType: function (f) {
return An(e.droppables).filter(function (p) {
return p.descriptor.type === f;
});
},
};
function d() {
(e.draggables = {}), (e.droppables = {}), (t.length = 0);
}
return { draggable: o, droppable: c, subscribe: n, clean: d };
}
function Pp() {
var e = X(Ep, []);
return (
N.useEffect(
function () {
return function () {
requestAnimationFrame(e.clean);
};
},
[e]
),
e
);
}
var Ii = _.createContext(null),
On = function () {
var e = document.body;
return e || B(!1), e;
},
Ap = {
position: 'absolute',
width: '1px',
height: '1px',
margin: '-1px',
border: '0',
padding: '0',
overflow: 'hidden',
clip: 'rect(0 0 0 0)',
'clip-path': 'inset(100%)',
},
Np = function (t) {
return 'rbd-announcement-' + t;
};
function Op(e) {
var t = X(
function () {
return Np(e);
},
[e]
),
n = N.useRef(null);
N.useEffect(
function () {
var a = document.createElement('div');
return (
(n.current = a),
(a.id = t),
a.setAttribute('aria-live', 'assertive'),
a.setAttribute('aria-atomic', 'true'),
j(a.style, Ap),
On().appendChild(a),
function () {
setTimeout(function () {
var s = On();
s.contains(a) && s.removeChild(a), a === n.current && (n.current = null);
});
}
);
},
[t]
);
var r = M(function (i) {
var a = n.current;
if (a) {
a.textContent = i;
return;
}
}, []);
return r;
}
var Tp = 0,
Bp = { separator: '::' };
function ki(e, t) {
return (
t === void 0 && (t = Bp),
X(
function () {
return '' + e + t.separator + Tp++;
},
[t.separator, e]
)
);
}
function Rp(e) {
var t = e.contextId,
n = e.uniqueId;
return 'rbd-hidden-text-' + t + '-' + n;
}
function Fp(e) {
var t = e.contextId,
n = e.text,
r = ki('hidden-text', { separator: '-' }),
i = X(
function () {
return Rp({ contextId: t, uniqueId: r });
},
[r, t]
);
return (
N.useEffect(
function () {
var o = document.createElement('div');
return (
(o.id = i),
(o.textContent = n),
(o.style.display = 'none'),
On().appendChild(o),
function () {
var s = On();
s.contains(o) && s.removeChild(o);
}
);
},
[i, n]
),
i
);
}
var _n = _.createContext(null);
function Il(e) {
var t = N.useRef(e);
return (
N.useEffect(function () {
t.current = e;
}),
t
);
}
function Lp() {
var e = null;
function t() {
return !!e;
}
function n(o) {
return o === e;
}
function r(o) {
e && B(!1);
var l = { abandon: o };
return (e = l), l;
}
function i() {
e || B(!1), (e = null);
}
function a() {
e && (e.abandon(), i());
}
return { isClaimed: t, isActive: n, claim: r, release: i, tryAbandon: a };
}
var Mp = 9,
jp = 13,
Ei = 27,
kl = 32,
zp = 33,
$p = 34,
Hp = 35,
Up = 36,
Gp = 37,
Wp = 38,
qp = 39,
Vp = 40,
mn,
Kp = ((mn = {}), (mn[jp] = !0), (mn[Mp] = !0), mn),
El = function (e) {
Kp[e.keyCode] && e.preventDefault();
},
Zn = (function () {
var e = 'visibilitychange';
if (typeof document > 'u') return e;
var t = [e, 'ms' + e, 'webkit' + e, 'moz' + e, 'o' + e],
n = dt(t, function (r) {
return 'on' + r in document;
});
return n || e;
})(),
Pl = 0,
Sa = 5;
function Yp(e, t) {
return Math.abs(t.x - e.x) >= Sa || Math.abs(t.y - e.y) >= Sa;
}
var Ca = { type: 'IDLE' };
function Qp(e) {
var t = e.cancel,
n = e.completed,
r = e.getPhase,
i = e.setPhase;
return [
{
eventName: 'mousemove',
fn: function (o) {
var l = o.button,
s = o.clientX,
c = o.clientY;
if (l === Pl) {
var d = { x: s, y: c },
u = r();
if (u.type === 'DRAGGING') {
o.preventDefault(), u.actions.move(d);
return;
}
u.type !== 'PENDING' && B(!1);
var f = u.point;
if (Yp(f, d)) {
o.preventDefault();
var p = u.actions.fluidLift(d);
i({ type: 'DRAGGING', actions: p });
}
}
},
},
{
eventName: 'mouseup',
fn: function (o) {
var l = r();
if (l.type !== 'DRAGGING') {
t();
return;
}
o.preventDefault(), l.actions.drop({ shouldBlockNextClick: !0 }), n();
},
},
{
eventName: 'mousedown',
fn: function (o) {
r().type === 'DRAGGING' && o.preventDefault(), t();
},
},
{
eventName: 'keydown',
fn: function (o) {
var l = r();
if (l.type === 'PENDING') {
t();
return;
}
if (o.keyCode === Ei) {
o.preventDefault(), t();
return;
}
El(o);
},
},
{ eventName: 'resize', fn: t },
{
eventName: 'scroll',
options: { passive: !0, capture: !1 },
fn: function () {
r().type === 'PENDING' && t();
},
},
{
eventName: 'webkitmouseforcedown',
fn: function (o) {
var l = r();
if ((l.type === 'IDLE' && B(!1), l.actions.shouldRespectForcePress())) {
t();
return;
}
o.preventDefault();
},
},
{ eventName: Zn, fn: t },
];
}
function Xp(e) {
var t = N.useRef(Ca),
n = N.useRef(lt),
r = X(
function () {
return {
eventName: 'mousedown',
fn: function (u) {
if (
!u.defaultPrevented &&
u.button === Pl &&
!(u.ctrlKey || u.metaKey || u.shiftKey || u.altKey)
) {
var f = e.findClosestDraggableId(u);
if (f) {
var p = e.tryGetLock(f, o, { sourceEvent: u });
if (p) {
u.preventDefault();
var m = { x: u.clientX, y: u.clientY };
n.current(), c(p, m);
}
}
}
},
};
},
[e]
),
i = X(
function () {
return {
eventName: 'webkitmouseforcewillbegin',
fn: function (u) {
if (!u.defaultPrevented) {
var f = e.findClosestDraggableId(u);
if (f) {
var p = e.findOptionsForDraggable(f);
p && (p.shouldRespectForcePress || (e.canGetLock(f) && u.preventDefault()));
}
}
},
};
},
[e]
),
a = M(
function () {
var u = { passive: !1, capture: !0 };
n.current = ze(window, [i, r], u);
},
[i, r]
),
o = M(
function () {
var d = t.current;
d.type !== 'IDLE' && ((t.current = Ca), n.current(), a());
},
[a]
),
l = M(
function () {
var d = t.current;
o(),
d.type === 'DRAGGING' && d.actions.cancel({ shouldBlockNextClick: !0 }),
d.type === 'PENDING' && d.actions.abort();
},
[o]
),
s = M(
function () {
var u = { capture: !0, passive: !1 },
f = Qp({
cancel: l,
completed: o,
getPhase: function () {
return t.current;
},
setPhase: function (m) {
t.current = m;
},
});
n.current = ze(window, f, u);
},
[l, o]
),
c = M(
function (u, f) {
t.current.type !== 'IDLE' && B(!1),
(t.current = { type: 'PENDING', point: f, actions: u }),
s();
},
[s]
);
Re(
function () {
return (
a(),
function () {
n.current();
}
);
},
[a]
);
}
var Dt;
function Jp() {}
var _p = ((Dt = {}), (Dt[$p] = !0), (Dt[zp] = !0), (Dt[Up] = !0), (Dt[Hp] = !0), Dt);
function Zp(e, t) {
function n() {
t(), e.cancel();
}
function r() {
t(), e.drop();
}
return [
{
eventName: 'keydown',
fn: function (a) {
if (a.keyCode === Ei) {
a.preventDefault(), n();
return;
}
if (a.keyCode === kl) {
a.preventDefault(), r();
return;
}
if (a.keyCode === Vp) {
a.preventDefault(), e.moveDown();
return;
}
if (a.keyCode === Wp) {
a.preventDefault(), e.moveUp();
return;
}
if (a.keyCode === qp) {
a.preventDefault(), e.moveRight();
return;
}
if (a.keyCode === Gp) {
a.preventDefault(), e.moveLeft();
return;
}
if (_p[a.keyCode]) {
a.preventDefault();
return;
}
El(a);
},
},
{ eventName: 'mousedown', fn: n },
{ eventName: 'mouseup', fn: n },
{ eventName: 'click', fn: n },
{ eventName: 'touchstart', fn: n },
{ eventName: 'resize', fn: n },
{ eventName: 'wheel', fn: n, options: { passive: !0 } },
{ eventName: Zn, fn: n },
];
}
function ef(e) {
var t = N.useRef(Jp),
n = X(
function () {
return {
eventName: 'keydown',
fn: function (a) {
if (a.defaultPrevented || a.keyCode !== kl) return;
var o = e.findClosestDraggableId(a);
if (!o) return;
var l = e.tryGetLock(o, d, { sourceEvent: a });
if (!l) return;
a.preventDefault();
var s = !0,
c = l.snapLift();
t.current();
function d() {
s || B(!1), (s = !1), t.current(), r();
}
t.current = ze(window, Zp(c, d), { capture: !0, passive: !1 });
},
};
},
[e]
),
r = M(
function () {
var a = { passive: !1, capture: !0 };
t.current = ze(window, [n], a);
},
[n]
);
Re(
function () {
return (
r(),
function () {
t.current();
}
);
},
[r]
);
}
var Sr = { type: 'IDLE' },
tf = 120,
nf = 0.15;
function rf(e) {
var t = e.cancel,
n = e.getPhase;
return [
{ eventName: 'orientationchange', fn: t },
{ eventName: 'resize', fn: t },
{
eventName: 'contextmenu',
fn: function (i) {
i.preventDefault();
},
},
{
eventName: 'keydown',
fn: function (i) {
if (n().type !== 'DRAGGING') {
t();
return;
}
i.keyCode === Ei && i.preventDefault(), t();
},
},
{ eventName: Zn, fn: t },
];
}
function af(e) {
var t = e.cancel,
n = e.completed,
r = e.getPhase;
return [
{
eventName: 'touchmove',
options: { capture: !1 },
fn: function (a) {
var o = r();
if (o.type !== 'DRAGGING') {
t();
return;
}
o.hasMoved = !0;
var l = a.touches[0],
s = l.clientX,
c = l.clientY,
d = { x: s, y: c };
a.preventDefault(), o.actions.move(d);
},
},
{
eventName: 'touchend',
fn: function (a) {
var o = r();
if (o.type !== 'DRAGGING') {
t();
return;
}
a.preventDefault(), o.actions.drop({ shouldBlockNextClick: !0 }), n();
},
},
{
eventName: 'touchcancel',
fn: function (a) {
if (r().type !== 'DRAGGING') {
t();
return;
}
a.preventDefault(), t();
},
},
{
eventName: 'touchforcechange',
fn: function (a) {
var o = r();
o.type === 'IDLE' && B(!1);
var l = a.touches[0];
if (l) {
var s = l.force >= nf;
if (s) {
var c = o.actions.shouldRespectForcePress();
if (o.type === 'PENDING') {
c && t();
return;
}
if (c) {
if (o.hasMoved) {
a.preventDefault();
return;
}
t();
return;
}
a.preventDefault();
}
}
},
},
{ eventName: Zn, fn: t },
];
}
function of(e) {
var t = N.useRef(Sr),
n = N.useRef(lt),
r = M(function () {
return t.current;
}, []),
i = M(function (p) {
t.current = p;
}, []),
a = X(
function () {
return {
eventName: 'touchstart',
fn: function (p) {
if (!p.defaultPrevented) {
var m = e.findClosestDraggableId(p);
if (m) {
var h = e.tryGetLock(m, l, { sourceEvent: p });
if (h) {
var x = p.touches[0],
b = x.clientX,
C = x.clientY,
S = { x: b, y: C };
n.current(), u(h, S);
}
}
}
},
};
},
[e]
),
o = M(
function () {
var p = { capture: !0, passive: !1 };
n.current = ze(window, [a], p);
},
[a]
),
l = M(
function () {
var f = t.current;
f.type !== 'IDLE' &&
(f.type === 'PENDING' && clearTimeout(f.longPressTimerId), i(Sr), n.current(), o());
},
[o, i]
),
s = M(
function () {
var f = t.current;
l(),
f.type === 'DRAGGING' && f.actions.cancel({ shouldBlockNextClick: !0 }),
f.type === 'PENDING' && f.actions.abort();
},
[l]
),
c = M(
function () {
var p = { capture: !0, passive: !1 },
m = { cancel: s, completed: l, getPhase: r },
h = ze(window, af(m), p),
x = ze(window, rf(m), p);
n.current = function () {
h(), x();
};
},
[s, r, l]
),
d = M(
function () {
var p = r();
p.type !== 'PENDING' && B(!1);
var m = p.actions.fluidLift(p.point);
i({ type: 'DRAGGING', actions: m, hasMoved: !1 });
},
[r, i]
),
u = M(
function (p, m) {
r().type !== 'IDLE' && B(!1);
var h = setTimeout(d, tf);
i({ type: 'PENDING', point: m, actions: p, longPressTimerId: h }), c();
},
[c, r, i, d]
);
Re(
function () {
return (
o(),
function () {
n.current();
var m = r();
m.type === 'PENDING' && (clearTimeout(m.longPressTimerId), i(Sr));
}
);
},
[r, o, i]
),
Re(function () {
var p = ze(window, [
{ eventName: 'touchmove', fn: function () {}, options: { capture: !1, passive: !1 } },
]);
return p;
}, []);
}
var lf = {
input: !0,
button: !0,
textarea: !0,
select: !0,
option: !0,
optgroup: !0,
video: !0,
audio: !0,
};
function Al(e, t) {
if (t == null) return !1;
var n = !!lf[t.tagName.toLowerCase()];
if (n) return !0;
var r = t.getAttribute('contenteditable');
return r === 'true' || r === '' ? !0 : t === e ? !1 : Al(e, t.parentElement);
}
function sf(e, t) {
var n = t.target;
return Jn(n) ? Al(e, n) : !1;
}
var uf = function (e) {
return We(e.getBoundingClientRect()).center;
};
function cf(e) {
return e instanceof Dl(e).Element;
}
var df = (function () {
var e = 'matches';
if (typeof document > 'u') return e;
var t = [e, 'msMatchesSelector', 'webkitMatchesSelector'],
n = dt(t, function (r) {
return r in Element.prototype;
});
return n || e;
})();
function Nl(e, t) {
return e == null ? null : e[df](t) ? e : Nl(e.parentElement, t);
}
function pf(e, t) {
return e.closest ? e.closest(t) : Nl(e, t);
}
function ff(e) {
return '[' + At.contextId + '="' + e + '"]';
}
function gf(e, t) {
var n = t.target;
if (!cf(n)) return null;
var r = ff(e),
i = pf(n, r);
return !i || !Jn(i) ? null : i;
}
function mf(e, t) {
var n = gf(e, t);
return n ? n.getAttribute(At.draggableId) : null;
}
function hf(e, t) {
var n = '[' + Ur.contextId + '="' + e + '"]',
r = Vo(document.querySelectorAll(n)),
i = dt(r, function (a) {
return a.getAttribute(Ur.id) === t;
});
return !i || !Jn(i) ? null : i;
}
function vf(e) {
e.preventDefault();
}
function hn(e) {
var t = e.expected,
n = e.phase,
r = e.isLockActive;
return e.shouldWarn, !(!r() || t !== n);
}
function Ol(e) {
var t = e.lockAPI,
n = e.store,
r = e.registry,
i = e.draggableId;
if (t.isClaimed()) return !1;
var a = r.draggable.findById(i);
return !(!a || !a.options.isEnabled || !xl(n.getState(), i));
}
function bf(e) {
var t = e.lockAPI,
n = e.contextId,
r = e.store,
i = e.registry,
a = e.draggableId,
o = e.forceSensorStop,
l = e.sourceEvent,
s = Ol({ lockAPI: t, store: r, registry: i, draggableId: a });
if (!s) return null;
var c = i.draggable.getById(a),
d = hf(n, c.descriptor.id);
if (!d || (l && !c.options.canDragInteractiveElements && sf(d, l))) return null;
var u = t.claim(o || lt),
f = 'PRE_DRAG';
function p() {
return c.options.shouldRespectForcePress;
}
function m() {
return t.isActive(u);
}
function h(w, O) {
hn({ expected: w, phase: f, isLockActive: m, shouldWarn: !0 }) && r.dispatch(O());
}
var x = h.bind(null, 'DRAGGING');
function b(w) {
function O() {
t.release(), (f = 'COMPLETED');
}
f !== 'PRE_DRAG' && (O(), f !== 'PRE_DRAG' && B(!1)),
r.dispatch(cd(w.liftActionArgs)),
(f = 'DRAGGING');
function L(F, V) {
if (
(V === void 0 && (V = { shouldBlockNextClick: !1 }), w.cleanup(), V.shouldBlockNextClick)
) {
var A = ze(window, [
{ eventName: 'click', fn: vf, options: { once: !0, passive: !1, capture: !0 } },
]);
setTimeout(A);
}
O(), r.dispatch(fl({ reason: F }));
}
return j(
{
isActive: function () {
return hn({ expected: 'DRAGGING', phase: f, isLockActive: m, shouldWarn: !1 });
},
shouldRespectForcePress: p,
drop: function (V) {
return L('DROP', V);
},
cancel: function (V) {
return L('CANCEL', V);
},
},
w.actions
);
}
function C(w) {
var O = Vt(function (F) {
x(function () {
return pl({ client: F });
});
}),
L = b({
liftActionArgs: { id: a, clientSelection: w, movementMode: 'FLUID' },
cleanup: function () {
return O.cancel();
},
actions: { move: O },
});
return j({}, L, { move: O });
}
function S() {
var w = {
moveUp: function () {
return x(yd);
},
moveRight: function () {
return x(wd);
},
moveDown: function () {
return x(xd);
},
moveLeft: function () {
return x(Sd);
},
};
return b({
liftActionArgs: { id: a, clientSelection: uf(d), movementMode: 'SNAP' },
cleanup: lt,
actions: w,
});
}
function D() {
var w = hn({ expected: 'PRE_DRAG', phase: f, isLockActive: m, shouldWarn: !0 });
w && t.release();
}
var E = {
isActive: function () {
return hn({ expected: 'PRE_DRAG', phase: f, isLockActive: m, shouldWarn: !1 });
},
shouldRespectForcePress: p,
fluidLift: C,
snapLift: S,
abort: D,
};
return E;
}
var yf = [Xp, ef, of];
function xf(e) {
var t = e.contextId,
n = e.store,
r = e.registry,
i = e.customSensors,
a = e.enableDefaultSensors,
o = [].concat(a ? yf : [], i || []),
l = N.useState(function () {
return Lp();
})[0],
s = M(
function (C, S) {
C.isDragging && !S.isDragging && l.tryAbandon();
},
[l]
);
Re(
function () {
var C = n.getState(),
S = n.subscribe(function () {
var D = n.getState();
s(C, D), (C = D);
});
return S;
},
[l, n, s]
),
Re(
function () {
return l.tryAbandon;
},
[l.tryAbandon]
);
for (
var c = M(
function (b) {
return Ol({ lockAPI: l, registry: r, store: n, draggableId: b });
},
[l, r, n]
),
d = M(
function (b, C, S) {
return bf({
lockAPI: l,
registry: r,
contextId: t,
store: n,
draggableId: b,
forceSensorStop: C,
sourceEvent: S && S.sourceEvent ? S.sourceEvent : null,
});
},
[t, l, r, n]
),
u = M(
function (b) {
return mf(t, b);
},
[t]
),
f = M(
function (b) {
var C = r.draggable.findById(b);
return C ? C.options : null;
},
[r.draggable]
),
p = M(
function () {
l.isClaimed() && (l.tryAbandon(), n.getState().phase !== 'IDLE' && n.dispatch(vi()));
},
[l, n]
),
m = M(l.isClaimed, [l]),
h = X(
function () {
return {
canGetLock: c,
tryGetLock: d,
findClosestDraggableId: u,
findOptionsForDraggable: f,
tryReleaseLock: p,
isLockClaimed: m,
};
},
[c, d, u, f, p, m]
),
x = 0;
x < o.length;
x++
)
o[x](h);
}
var wf = function (t) {
return {
onBeforeCapture: t.onBeforeCapture,
onBeforeDragStart: t.onBeforeDragStart,
onDragStart: t.onDragStart,
onDragEnd: t.onDragEnd,
onDragUpdate: t.onDragUpdate,
};
};
function zt(e) {
return e.current || B(!1), e.current;
}
function Sf(e) {
var t = e.contextId,
n = e.setCallbacks,
r = e.sensors,
i = e.nonce,
a = e.dragHandleUsageInstructions,
o = N.useRef(null),
l = Il(e),
s = M(
function () {
return wf(l.current);
},
[l]
),
c = Op(t),
d = Fp({ contextId: t, text: a }),
u = Dp(t, i),
f = M(function (F) {
zt(o).dispatch(F);
}, []),
p = X(
function () {
return Vi(
{
publishWhileDragging: pd,
updateDroppableScroll: gd,
updateDroppableIsEnabled: md,
updateDroppableIsCombineEnabled: hd,
collectionStarting: fd,
},
f
);
},
[f]
),
m = Pp(),
h = X(
function () {
return np(m, p);
},
[m, p]
),
x = X(
function () {
return yp(j({ scrollWindow: rp, scrollDroppable: h.scrollDroppable }, Vi({ move: pl }, f)));
},
[h.scrollDroppable, f]
),
b = kp(t),
C = X(
function () {
return _d({
announce: c,
autoScroller: x,
dimensionMarshal: h,
focusMarshal: b,
getResponders: s,
styleMarshal: u,
});
},
[c, x, h, b, s, u]
);
o.current = C;
var S = M(function () {
var F = zt(o),
V = F.getState();
V.phase !== 'IDLE' && F.dispatch(vi());
}, []),
D = M(function () {
var F = zt(o).getState();
return F.isDragging || F.phase === 'DROP_ANIMATING';
}, []),
E = X(
function () {
return { isDragging: D, tryAbort: S };
},
[D, S]
);
n(E);
var w = M(function (F) {
return xl(zt(o).getState(), F);
}, []),
O = M(function () {
return yt(zt(o).getState());
}, []),
L = X(
function () {
return {
marshal: h,
focus: b,
contextId: t,
canLift: w,
isMovementAllowed: O,
dragHandleUsageInstructionsId: d,
registry: m,
};
},
[t, h, d, b, w, O, m]
);
return (
xf({
contextId: t,
store: C,
registry: m,
customSensors: r,
enableDefaultSensors: e.enableDefaultSensors !== !1,
}),
N.useEffect(
function () {
return S;
},
[S]
),
_.createElement(
_n.Provider,
{ value: L },
_.createElement(Gs, { context: Ii, store: C }, e.children)
)
);
}
var Cf = 0;
function Df() {
return X(function () {
return '' + Cf++;
}, []);
}
function If(e) {
var t = Df(),
n = e.dragHandleUsageInstructions || wn.dragHandleUsageInstructions;
return _.createElement(ec, null, function (r) {
return _.createElement(
Sf,
{
nonce: e.nonce,
contextId: t,
setCallbacks: r,
dragHandleUsageInstructions: n,
enableDefaultSensors: e.enableDefaultSensors,
sensors: e.sensors,
onBeforeCapture: e.onBeforeCapture,
onBeforeDragStart: e.onBeforeDragStart,
onDragStart: e.onDragStart,
onDragUpdate: e.onDragUpdate,
onDragEnd: e.onDragEnd,
},
e.children
);
});
}
var Tl = function (t) {
return function (n) {
return t === n;
};
},
kf = Tl('scroll'),
Ef = Tl('auto'),
Da = function (t, n) {
return n(t.overflowX) || n(t.overflowY);
},
Pf = function (t) {
var n = window.getComputedStyle(t),
r = { overflowX: n.overflowX, overflowY: n.overflowY };
return Da(r, kf) || Da(r, Ef);
},
Af = function () {
return !1;
},
Nf = function e(t) {
return t == null
? null
: t === document.body
? Af()
? t
: null
: t === document.documentElement
? null
: Pf(t)
? t
: e(t.parentElement);
},
Gr = function (e) {
return { x: e.scrollLeft, y: e.scrollTop };
},
Of = function e(t) {
if (!t) return !1;
var n = window.getComputedStyle(t);
return n.position === 'fixed' ? !0 : e(t.parentElement);
},
Tf = function (e) {
var t = Nf(e),
n = Of(e);
return { closestScrollable: t, isFixedOnPage: n };
},
Bf = function (e) {
var t = e.descriptor,
n = e.isEnabled,
r = e.isCombineEnabled,
i = e.isFixedOnPage,
a = e.direction,
o = e.client,
l = e.page,
s = e.closest,
c = (function () {
if (!s) return null;
var p = s.scrollSize,
m = s.client,
h = vl({
scrollHeight: p.scrollHeight,
scrollWidth: p.scrollWidth,
height: m.paddingBox.height,
width: m.paddingBox.width,
});
return {
pageMarginBox: s.page.marginBox,
frameClient: m,
scrollSize: p,
shouldClipSubject: s.shouldClipSubject,
scroll: {
initial: s.scroll,
current: s.scroll,
max: h,
diff: { value: be, displacement: be },
},
};
})(),
d = a === 'vertical' ? pi : Jo,
u = Et({ page: l, withPlaceholder: null, axis: d, frame: c }),
f = {
descriptor: t,
isCombineEnabled: r,
isFixedOnPage: i,
axis: d,
isEnabled: n,
client: o,
page: l,
frame: c,
subject: u,
};
return f;
},
Rf = function (t, n) {
var r = Ho(t);
if (!n || t !== n) return r;
var i = r.paddingBox.top - n.scrollTop,
a = r.paddingBox.left - n.scrollLeft,
o = i + n.scrollHeight,
l = a + n.scrollWidth,
s = { top: i, right: l, bottom: o, left: a },
c = li(s, r.border),
d = si({ borderBox: c, margin: r.margin, border: r.border, padding: r.padding });
return d;
},
Ff = function (e) {
var t = e.ref,
n = e.descriptor,
r = e.env,
i = e.windowScroll,
a = e.direction,
o = e.isDropDisabled,
l = e.isCombineEnabled,
s = e.shouldClipSubject,
c = r.closestScrollable,
d = Rf(t, c),
u = kn(d, i),
f = (function () {
if (!c) return null;
var m = Ho(c),
h = { scrollHeight: c.scrollHeight, scrollWidth: c.scrollWidth };
return { client: m, page: kn(m, i), scroll: Gr(c), scrollSize: h, shouldClipSubject: s };
})(),
p = Bf({
descriptor: n,
isEnabled: !o,
isCombineEnabled: l,
isFixedOnPage: r.isFixedOnPage,
direction: a,
client: d,
page: u,
closest: f,
});
return p;
},
Lf = { passive: !1 },
Mf = { passive: !0 },
Ia = function (e) {
return e.shouldPublishImmediately ? Lf : Mf;
};
function Tn(e) {
var t = N.useContext(e);
return t || B(!1), t;
}
var vn = function (t) {
return (t && t.env.closestScrollable) || null;
};
function jf(e) {
var t = N.useRef(null),
n = Tn(_n),
r = ki('droppable'),
i = n.registry,
a = n.marshal,
o = Il(e),
l = X(
function () {
return { id: e.droppableId, type: e.type, mode: e.mode };
},
[e.droppableId, e.mode, e.type]
),
s = N.useRef(l),
c = X(
function () {
return ve(function (D, E) {
t.current || B(!1);
var w = { x: D, y: E };
a.updateDroppableScroll(l.id, w);
});
},
[l.id, a]
),
d = M(function () {
var D = t.current;
return !D || !D.env.closestScrollable ? be : Gr(D.env.closestScrollable);
}, []),
u = M(
function () {
var D = d();
c(D.x, D.y);
},
[d, c]
),
f = X(
function () {
return Vt(u);
},
[u]
),
p = M(
function () {
var D = t.current,
E = vn(D);
(D && E) || B(!1);
var w = D.scrollOptions;
if (w.shouldPublishImmediately) {
u();
return;
}
f();
},
[f, u]
),
m = M(
function (D, E) {
t.current && B(!1);
var w = o.current,
O = w.getDroppableRef();
O || B(!1);
var L = Tf(O),
F = { ref: O, descriptor: l, env: L, scrollOptions: E };
t.current = F;
var V = Ff({
ref: O,
descriptor: l,
env: L,
windowScroll: D,
direction: w.direction,
isDropDisabled: w.isDropDisabled,
isCombineEnabled: w.isCombineEnabled,
shouldClipSubject: !w.ignoreContainerClipping,
}),
A = L.closestScrollable;
return (
A &&
(A.setAttribute(xa.contextId, n.contextId),
A.addEventListener('scroll', p, Ia(F.scrollOptions))),
V
);
},
[n.contextId, l, p, o]
),
h = M(function () {
var D = t.current,
E = vn(D);
return (D && E) || B(!1), Gr(E);
}, []),
x = M(
function () {
var D = t.current;
D || B(!1);
var E = vn(D);
(t.current = null),
E &&
(f.cancel(),
E.removeAttribute(xa.contextId),
E.removeEventListener('scroll', p, Ia(D.scrollOptions)));
},
[p, f]
),
b = M(function (D) {
var E = t.current;
E || B(!1);
var w = vn(E);
w || B(!1), (w.scrollTop += D.y), (w.scrollLeft += D.x);
}, []),
C = X(
function () {
return {
getDimensionAndWatchScroll: m,
getScrollWhileDragging: h,
dragStopped: x,
scroll: b,
};
},
[x, m, h, b]
),
S = X(
function () {
return { uniqueId: r, descriptor: l, callbacks: C };
},
[C, l, r]
);
Re(
function () {
return (
(s.current = S.descriptor),
i.droppable.register(S),
function () {
t.current && x(), i.droppable.unregister(S);
}
);
},
[C, l, x, S, a, i.droppable]
),
Re(
function () {
t.current && a.updateDroppableIsEnabled(s.current.id, !e.isDropDisabled);
},
[e.isDropDisabled, a]
),
Re(
function () {
t.current && a.updateDroppableIsCombineEnabled(s.current.id, e.isCombineEnabled);
},
[e.isCombineEnabled, a]
);
}
function Cr() {}
var ka = { width: 0, height: 0, margin: oc },
zf = function (t) {
var n = t.isAnimatingOpenOnMount,
r = t.placeholder,
i = t.animate;
return n || i === 'close'
? ka
: {
height: r.client.borderBox.height,
width: r.client.borderBox.width,
margin: r.client.margin,
};
},
$f = function (t) {
var n = t.isAnimatingOpenOnMount,
r = t.placeholder,
i = t.animate,
a = zf({ isAnimatingOpenOnMount: n, placeholder: r, animate: i });
return {
display: r.display,
boxSizing: 'border-box',
width: a.width,
height: a.height,
marginTop: a.margin.top,
marginRight: a.margin.right,
marginBottom: a.margin.bottom,
marginLeft: a.margin.left,
flexShrink: '0',
flexGrow: '0',
pointerEvents: 'none',
transition: i !== 'none' ? Ut.placeholder : null,
};
};
function Hf(e) {
var t = N.useRef(null),
n = M(function () {
t.current && (clearTimeout(t.current), (t.current = null));
}, []),
r = e.animate,
i = e.onTransitionEnd,
a = e.onClose,
o = e.contextId,
l = N.useState(e.animate === 'open'),
s = l[0],
c = l[1];
N.useEffect(
function () {
return s
? r !== 'open'
? (n(), c(!1), Cr)
: t.current
? Cr
: ((t.current = setTimeout(function () {
(t.current = null), c(!1);
})),
n)
: Cr;
},
[r, s, n]
);
var d = M(
function (f) {
f.propertyName === 'height' && (i(), r === 'close' && a());
},
[r, a, i]
),
u = $f({ isAnimatingOpenOnMount: s, animate: e.animate, placeholder: e.placeholder });
return _.createElement(e.placeholder.tagName, {
style: u,
'data-rbd-placeholder-context-id': o,
onTransitionEnd: d,
ref: e.innerRef,
});
}
var Uf = _.memo(Hf),
Pi = _.createContext(null),
Gf = (function (e) {
xo(t, e);
function t() {
for (var r, i = arguments.length, a = new Array(i), o = 0; o < i; o++) a[o] = arguments[o];
return (
(r = e.call.apply(e, [this].concat(a)) || this),
(r.state = {
isVisible: !!r.props.on,
data: r.props.on,
animate: r.props.shouldAnimate && r.props.on ? 'open' : 'none',
}),
(r.onClose = function () {
r.state.animate === 'close' && r.setState({ isVisible: !1 });
}),
r
);
}
t.getDerivedStateFromProps = function (i, a) {
return i.shouldAnimate
? i.on
? { isVisible: !0, data: i.on, animate: 'open' }
: a.isVisible
? { isVisible: !0, data: a.data, animate: 'close' }
: { isVisible: !1, animate: 'close', data: null }
: { isVisible: !!i.on, data: i.on, animate: 'none' };
};
var n = t.prototype;
return (
(n.render = function () {
if (!this.state.isVisible) return null;
var i = { onClose: this.onClose, data: this.state.data, animate: this.state.animate };
return this.props.children(i);
}),
t
);
})(_.PureComponent),
Ea = { dragging: 5e3, dropAnimating: 4500 },
Wf = function (t, n) {
return n ? Ut.drop(n.duration) : t ? Ut.snap : Ut.fluid;
},
qf = function (t, n) {
return t ? (n ? Xt.opacity.drop : Xt.opacity.combining) : null;
},
Vf = function (t) {
return t.forceShouldAnimate != null ? t.forceShouldAnimate : t.mode === 'SNAP';
};
function Kf(e) {
var t = e.dimension,
n = t.client,
r = e.offset,
i = e.combineWith,
a = e.dropping,
o = !!i,
l = Vf(e),
s = !!a,
c = s ? $r.drop(r, o) : $r.moveTo(r),
d = {
position: 'fixed',
top: n.marginBox.top,
left: n.marginBox.left,
boxSizing: 'border-box',
width: n.borderBox.width,
height: n.borderBox.height,
transition: Wf(l, a),
transform: c,
opacity: qf(o, s),
zIndex: s ? Ea.dropAnimating : Ea.dragging,
pointerEvents: 'none',
};
return d;
}
function Yf(e) {
return {
transform: $r.moveTo(e.offset),
transition: e.shouldAnimateDisplacement ? null : 'none',
};
}
function Qf(e) {
return e.type === 'DRAGGING' ? Kf(e) : Yf(e);
}
function Xf(e, t, n) {
n === void 0 && (n = be);
var r = window.getComputedStyle(t),
i = t.getBoundingClientRect(),
a = $o(i, r),
o = kn(a, n),
l = { client: a, tagName: t.tagName.toLowerCase(), display: r.display },
s = { x: a.marginBox.width, y: a.marginBox.height },
c = { descriptor: e, placeholder: l, displaceBy: s, client: a, page: o };
return c;
}
function Jf(e) {
var t = ki('draggable'),
n = e.descriptor,
r = e.registry,
i = e.getDraggableRef,
a = e.canDragInteractiveElements,
o = e.shouldRespectForcePress,
l = e.isEnabled,
s = X(
function () {
return { canDragInteractiveElements: a, shouldRespectForcePress: o, isEnabled: l };
},
[a, l, o]
),
c = M(
function (p) {
var m = i();
return m || B(!1), Xf(n, m, p);
},
[n, i]
),
d = X(
function () {
return { uniqueId: t, descriptor: n, options: s, getDimension: c };
},
[n, c, s, t]
),
u = N.useRef(d),
f = N.useRef(!0);
Re(
function () {
return (
r.draggable.register(u.current),
function () {
return r.draggable.unregister(u.current);
}
);
},
[r.draggable]
),
Re(
function () {
if (f.current) {
f.current = !1;
return;
}
var p = u.current;
(u.current = d), r.draggable.update(d, p);
},
[d, r.draggable]
);
}
function _f(e) {
e.preventDefault();
}
function Zf(e) {
var t = N.useRef(null),
n = M(function (F) {
t.current = F;
}, []),
r = M(function () {
return t.current;
}, []),
i = Tn(_n),
a = i.contextId,
o = i.dragHandleUsageInstructionsId,
l = i.registry,
s = Tn(Pi),
c = s.type,
d = s.droppableId,
u = X(
function () {
return { id: e.draggableId, index: e.index, type: c, droppableId: d };
},
[e.draggableId, e.index, c, d]
),
f = e.children,
p = e.draggableId,
m = e.isEnabled,
h = e.shouldRespectForcePress,
x = e.canDragInteractiveElements,
b = e.isClone,
C = e.mapped,
S = e.dropAnimationFinished;
if (!b) {
var D = X(
function () {
return {
descriptor: u,
registry: l,
getDraggableRef: r,
canDragInteractiveElements: x,
shouldRespectForcePress: h,
isEnabled: m,
};
},
[u, l, r, x, h, m]
);
Jf(D);
}
var E = X(
function () {
return m
? {
tabIndex: 0,
role: 'button',
'aria-describedby': o,
'data-rbd-drag-handle-draggable-id': p,
'data-rbd-drag-handle-context-id': a,
draggable: !1,
onDragStart: _f,
}
: null;
},
[a, o, p, m]
),
w = M(
function (F) {
C.type === 'DRAGGING' && C.dropping && F.propertyName === 'transform' && S();
},
[S, C]
),
O = X(
function () {
var F = Qf(C),
V = C.type === 'DRAGGING' && C.dropping ? w : null,
A = {
innerRef: n,
draggableProps: {
'data-rbd-draggable-context-id': a,
'data-rbd-draggable-id': p,
style: F,
onTransitionEnd: V,
},
dragHandleProps: E,
};
return A;
},
[a, E, p, C, w, n]
),
L = X(
function () {
return {
draggableId: u.id,
type: u.type,
source: { index: u.index, droppableId: u.droppableId },
};
},
[u.droppableId, u.id, u.index, u.type]
);
return f(O, C.snapshot, L);
}
var Bl = function (e, t) {
return e === t;
},
Rl = function (e) {
var t = e.combine,
n = e.destination;
return n ? n.droppableId : t ? t.droppableId : null;
},
eg = function (t) {
return t.combine ? t.combine.draggableId : null;
},
tg = function (t) {
return t.at && t.at.type === 'COMBINE' ? t.at.combine.draggableId : null;
};
function ng() {
var e = ve(function (i, a) {
return { x: i, y: a };
}),
t = ve(function (i, a, o, l, s) {
return {
isDragging: !0,
isClone: a,
isDropAnimating: !!s,
dropAnimation: s,
mode: i,
draggingOver: o,
combineWith: l,
combineTargetFor: null,
};
}),
n = ve(function (i, a, o, l, s, c, d) {
return {
mapped: {
type: 'DRAGGING',
dropping: null,
draggingOver: s,
combineWith: c,
mode: a,
offset: i,
dimension: o,
forceShouldAnimate: d,
snapshot: t(a, l, s, c, null),
},
};
}),
r = function (a, o) {
if (a.isDragging) {
if (a.critical.draggable.id !== o.draggableId) return null;
var l = a.current.client.offset,
s = a.dimensions.draggables[o.draggableId],
c = Be(a.impact),
d = tg(a.impact),
u = a.forceShouldAnimate;
return n(e(l.x, l.y), a.movementMode, s, o.isClone, c, d, u);
}
if (a.phase === 'DROP_ANIMATING') {
var f = a.completed;
if (f.result.draggableId !== o.draggableId) return null;
var p = o.isClone,
m = a.dimensions.draggables[o.draggableId],
h = f.result,
x = h.mode,
b = Rl(h),
C = eg(h),
S = a.dropDuration,
D = {
duration: S,
curve: yi.drop,
moveTo: a.newHomeClientOffset,
opacity: C ? Xt.opacity.drop : null,
scale: C ? Xt.scale.drop : null,
};
return {
mapped: {
type: 'DRAGGING',
offset: a.newHomeClientOffset,
dimension: m,
dropping: D,
draggingOver: b,
combineWith: C,
mode: x,
forceShouldAnimate: null,
snapshot: t(x, p, b, C, D),
},
};
}
return null;
};
return r;
}
function Fl(e) {
return {
isDragging: !1,
isDropAnimating: !1,
isClone: !1,
dropAnimation: null,
mode: null,
draggingOver: null,
combineTargetFor: e,
combineWith: null,
};
}
var rg = {
mapped: {
type: 'SECONDARY',
offset: be,
combineTargetFor: null,
shouldAnimateDisplacement: !0,
snapshot: Fl(null),
},
};
function ig() {
var e = ve(function (o, l) {
return { x: o, y: l };
}),
t = ve(Fl),
n = ve(function (o, l, s) {
return (
l === void 0 && (l = null),
{
mapped: {
type: 'SECONDARY',
offset: o,
combineTargetFor: l,
shouldAnimateDisplacement: s,
snapshot: t(l),
},
}
);
}),
r = function (l) {
return l ? n(be, l, !0) : null;
},
i = function (l, s, c, d) {
var u = c.displaced.visible[l],
f = !!(d.inVirtualList && d.effected[l]),
p = Yn(c),
m = p && p.draggableId === l ? s : null;
if (!u) {
if (!f) return r(m);
if (c.displaced.invisible[l]) return null;
var h = Nt(d.displacedBy.point),
x = e(h.x, h.y);
return n(x, m, !0);
}
if (f) return r(m);
var b = c.displacedBy.point,
C = e(b.x, b.y);
return n(C, m, u.shouldAnimate);
},
a = function (l, s) {
if (l.isDragging)
return l.critical.draggable.id === s.draggableId
? null
: i(s.draggableId, l.critical.draggable.id, l.impact, l.afterCritical);
if (l.phase === 'DROP_ANIMATING') {
var c = l.completed;
return c.result.draggableId === s.draggableId
? null
: i(s.draggableId, c.result.draggableId, c.impact, c.afterCritical);
}
return null;
};
return a;
}
var ag = function () {
var t = ng(),
n = ig(),
r = function (a, o) {
return t(a, o) || n(a, o) || rg;
};
return r;
},
og = { dropAnimationFinished: gl },
lg = jo(ag, og, null, { context: Ii, pure: !0, areStatePropsEqual: Bl })(Zf);
function Ll(e) {
var t = Tn(Pi),
n = t.isUsingCloneFor;
return n === e.draggableId && !e.isClone ? null : _.createElement(lg, e);
}
function sg(e) {
var t = typeof e.isDragDisabled == 'boolean' ? !e.isDragDisabled : !0,
n = !!e.disableInteractiveElementBlocking,
r = !!e.shouldRespectForcePress;
return _.createElement(
Ll,
j({}, e, {
isClone: !1,
isEnabled: t,
canDragInteractiveElements: n,
shouldRespectForcePress: r,
})
);
}
function ug(e) {
var t = N.useContext(_n);
t || B(!1);
var n = t.contextId,
r = t.isMovementAllowed,
i = N.useRef(null),
a = N.useRef(null),
o = e.children,
l = e.droppableId,
s = e.type,
c = e.mode,
d = e.direction,
u = e.ignoreContainerClipping,
f = e.isDropDisabled,
p = e.isCombineEnabled,
m = e.snapshot,
h = e.useClone,
x = e.updateViewportMaxScroll,
b = e.getContainerForClone,
C = M(function () {
return i.current;
}, []),
S = M(function (A) {
i.current = A;
}, []);
M(function () {
return a.current;
}, []);
var D = M(function (A) {
a.current = A;
}, []),
E = M(
function () {
r() && x({ maxScroll: yl() });
},
[r, x]
);
jf({
droppableId: l,
type: s,
mode: c,
direction: d,
isDropDisabled: f,
isCombineEnabled: p,
ignoreContainerClipping: u,
getDroppableRef: C,
});
var w = _.createElement(
Gf,
{ on: e.placeholder, shouldAnimate: e.shouldAnimatePlaceholder },
function (A) {
var R = A.onClose,
Y = A.data,
q = A.animate;
return _.createElement(Uf, {
placeholder: Y,
onClose: R,
innerRef: D,
animate: q,
contextId: n,
onTransitionEnd: E,
});
}
),
O = X(
function () {
return {
innerRef: S,
placeholder: w,
droppableProps: { 'data-rbd-droppable-id': l, 'data-rbd-droppable-context-id': n },
};
},
[n, l, w, S]
),
L = h ? h.dragging.draggableId : null,
F = X(
function () {
return { droppableId: l, type: s, isUsingCloneFor: L };
},
[l, L, s]
);
function V() {
if (!h) return null;
var A = h.dragging,
R = h.render,
Y = _.createElement(
Ll,
{
draggableId: A.draggableId,
index: A.source.index,
isClone: !0,
isEnabled: !0,
shouldRespectForcePress: !1,
canDragInteractiveElements: !0,
},
function (q, $) {
return R(q, $, A);
}
);
return Ss.createPortal(Y, b());
}
return _.createElement(Pi.Provider, { value: F }, o(O, m), V());
}
var Dr = function (t, n) {
return t === n.droppable.type;
},
Pa = function (t, n) {
return n.draggables[t.draggable.id];
},
cg = function () {
var t = {
placeholder: null,
shouldAnimatePlaceholder: !0,
snapshot: {
isDraggingOver: !1,
draggingOverWith: null,
draggingFromThisWith: null,
isUsingPlaceholder: !1,
},
useClone: null,
},
n = j({}, t, { shouldAnimatePlaceholder: !1 }),
r = ve(function (o) {
return {
draggableId: o.id,
type: o.type,
source: { index: o.index, droppableId: o.droppableId },
};
}),
i = ve(function (o, l, s, c, d, u) {
var f = d.descriptor.id,
p = d.descriptor.droppableId === o;
if (p) {
var m = u ? { render: u, dragging: r(d.descriptor) } : null,
h = {
isDraggingOver: s,
draggingOverWith: s ? f : null,
draggingFromThisWith: f,
isUsingPlaceholder: !0,
};
return {
placeholder: d.placeholder,
shouldAnimatePlaceholder: !1,
snapshot: h,
useClone: m,
};
}
if (!l) return n;
if (!c) return t;
var x = {
isDraggingOver: s,
draggingOverWith: f,
draggingFromThisWith: null,
isUsingPlaceholder: !0,
};
return {
placeholder: d.placeholder,
shouldAnimatePlaceholder: !0,
snapshot: x,
useClone: null,
};
}),
a = function (l, s) {
var c = s.droppableId,
d = s.type,
u = !s.isDropDisabled,
f = s.renderClone;
if (l.isDragging) {
var p = l.critical;
if (!Dr(d, p)) return n;
var m = Pa(p, l.dimensions),
h = Be(l.impact) === c;
return i(c, u, h, h, m, f);
}
if (l.phase === 'DROP_ANIMATING') {
var x = l.completed;
if (!Dr(d, x.critical)) return n;
var b = Pa(x.critical, l.dimensions);
return i(c, u, Rl(x.result) === c, Be(x.impact) === c, b, f);
}
if (l.phase === 'IDLE' && l.completed && !l.shouldFlush) {
var C = l.completed;
if (!Dr(d, C.critical)) return n;
var S = Be(C.impact) === c,
D = !!(C.impact.at && C.impact.at.type === 'COMBINE'),
E = C.critical.droppable.id === c;
return S ? (D ? t : n) : E ? t : n;
}
return n;
};
return a;
},
dg = { updateViewportMaxScroll: bd };
function pg() {
return document.body || B(!1), document.body;
}
var fg = {
mode: 'standard',
type: 'DEFAULT',
direction: 'vertical',
isDropDisabled: !1,
isCombineEnabled: !1,
ignoreContainerClipping: !1,
renderClone: null,
getContainerForClone: pg,
},
Ml = jo(cg, dg, null, { context: Ii, pure: !0, areStatePropsEqual: Bl })(ug);
Ml.defaultProps = fg;
const gg = () => Math.random().toString(36).slice(2, 5),
bn = { id: '', name: '', prompt: '' },
mg = () => {
const [e, t] = N.useState([]),
[n, r] = N.useState(bn),
[i, a] = N.useState(!1);
N.useEffect(() => {
chrome.storage.sync.get(['rolesList'], (f) => {
const p = f.rolesList;
p.length > 0 && t(p);
});
}, []);
const o = (f) => {
const { name: p, value: m } = f.target;
r((h) => ({ ...h, [p]: m }));
},
l = () => {
if (!n.name) return;
const f = [...e, { ...n, id: gg() }];
t(f), r(bn);
const p = { rolesList: f };
chrome.storage.sync.set(p);
},
s = () => {
const f = e.findIndex((h) => h.id === n.id),
p = [...e];
(p[f] = n), t(p), r(bn), a(!1);
const m = { rolesList: p };
chrome.storage.sync.set(m);
},
c = (f) => {
const p = e.filter((h) => h.id !== f);
t(p), r(bn);
const m = { rolesList: p };
chrome.storage.sync.set(m);
},
d = (f) => {
const p = e.find((m) => m.id === f);
p && (r(p), a(!0), window.scrollTo(0, 0));
},
u = (f) => {
if (!f.destination) return;
const p = Array.from(e),
[m] = p.splice(f.source.index, 1);
p.splice(f.destination.index, 0, m), t(p);
const h = { rolesList: p };
chrome.storage.sync.set(h);
};
return g.jsxs('div', {
className: 'mx-auto pb-20 px-6 max-w-[86rem]',
children: [
g.jsxs('div', {
className: 'my-6',
children: [
g.jsx('h1', { className: 'text-3xl font-semibold', children: 'Customize prompts' }),
g.jsxs('div', {
className: 'mt-6',
children: [
g.jsxs('div', {
className: 'flex items-center space-x-4 mb-4',
children: [
g.jsx('input', {
type: 'text',
name: 'name',
value: n.name,
onChange: o,
placeholder: 'Name of the prompt',
className:
'w-1/3 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 text-base',
}),
g.jsx('input', {
type: 'text',
name: 'prompt',
value: n.prompt,
onChange: o,
placeholder: 'Enter the prompt',
className:
'w-2/3 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 text-base',
}),
g.jsx('button', {
onClick: i ? s : l,
className:
'px-6 py-2 bg-green-500 hover:bg-green-600 text-white text-base rounded-lg',
children: i ? 'Update' : 'Add',
}),
],
}),
g.jsx('div', {
className: '',
children: g.jsx(If, {
onDragEnd: u,
children: g.jsxs('table', {
className: 'w-full rounded-lg shadow-lg overflow-hidden',
children: [
g.jsx('thead', {
children: g.jsxs('tr', {
className: 'bg-blue-500',
children: [
g.jsx('th', {
className:
'px-6 py-3 text-left text-base font-medium text-gray-50 tracking-wider w-1/5',
children: 'Name',
}),
g.jsx('th', {
className:
'px-6 py-3 text-left text-base font-medium text-gray-50 tracking-wider w-3/5 max-w-xl',
children: 'Prompt',
}),
g.jsx('th', {
className:
'px-6 py-3 text-center text-base font-medium text-gray-50 tracking-wider w-1/5',
children: 'Actions',
}),
],
}),
}),
g.jsx(Ml, {
droppableId: 'prompts',
direction: 'vertical',
children: (f) =>
g.jsx('tbody', {
className: 'bg-white divide-y divide-gray-200',
...f.droppableProps,
ref: f.innerRef,
children: e.map((p, m) =>
g.jsx(
sg,
{
draggableId: p.id.toString(),
index: m,
children: (h) =>
g.jsxs(
'tr',
{
ref: h.innerRef,
...h.draggableProps,
...h.dragHandleProps,
children: [
g.jsx('td', {
className:
'px-6 py-4 whitespace-nowrap text-base font-medium text-gray-900 w-1/5',
children: p.name,
}),
g.jsx('td', {
className:
'px-6 py-4 text-base text-gray-800 max-w-xl',
children: p.prompt,
}),
g.jsxs('td', {
className:
'px-6 py-4 whitespace-nowrap text-center text-sm font-medium w-1/5',
children: [
g.jsx('button', {
onClick: () => d(p.id),
className:
'px-3 py-1 bg-purple-500 hover:bg-purple-600 text-white rounded-lg mr-2',
children: 'Edit',
}),
g.jsx('button', {
onClick: () => c(p.id),
className:
'px-3 py-1 bg-red-400 hover:bg-red-500 text-white rounded-lg',
children: 'Delete',
}),
],
}),
],
},
p.id
),
},
p.id
)
),
}),
}),
],
}),
}),
}),
],
}),
],
}),
g.jsx('div', {
className: 'text-base font-medium text-gray-800',
children: '* Drag rows to sort the order of prompts',
}),
],
});
};
function hg({ children: e }) {
return g.jsx('kbd', {
className:
'px-2 py-0.5 text-sm font-semibold text-gray-800 bg-blue-100/90 font-code shadow-sm rounded-md border border-gray-300 border-b-[3px]',
children: e,
});
}
function vg() {
const [e, t] = N.useState([]),
n = { name: 'Escape', shortcut: 'Esc', description: 'To close the response window' };
N.useEffect(() => {
chrome.commands.getAll((i) => {
t([...i, n]);
});
}, []);
const r = () => {
chrome.tabs.create({ url: 'chrome://extensions/shortcuts' });
};
return g.jsxs('div', {
className: 'px-20 mx-auto pb-20 max-w-4xl',
children: [
g.jsx('h1', {
className: 'text-3xl font-semibold text-center font-sans mt-6',
children: 'Shortcuts',
}),
g.jsxs('div', {
className: 'p-8 pb-6 bg-white shadow mt-6 rounded-lg border border-gray-200',
children: [
e.map((i, a) =>
g.jsxs(
'div',
{
className: 'flex items-center gap-4 mb-5',
children: [
g.jsx('div', {
className: 'flex items-center w-[40%]',
children: i.shortcut
.split('+')
.map((o, l, s) =>
g.jsxs(
'span',
{
className: 'flex items-center',
children: [
g.jsx(hg, { children: o || '-' }),
' ',
l < s.length - 1 &&
g.jsx('span', { className: 'px-2 font-bold', children: '+' }),
],
},
l
)
),
}),
g.jsx('div', {
className: 'text-base w-[60%]',
children:
i.name === '_execute_action'
? 'Activate/open extension popup'
: i.description,
}),
],
},
a
)
),
g.jsx('div', {
className: 'flex justify-end',
children: g.jsx('button', {
onClick: r,
className: 'text-gray-600 hover:text-gray-900 text-base',
children: '↬ Update the shortcuts here',
}),
}),
],
}),
],
});
}
function bg() {
const e = () => {
chrome.tabs.create({ url: 'chrome://extensions/shortcuts' });
};
return g.jsxs('div', {
className: 'px-6 mx-auto pb-20 max-w-4xl',
children: [
g.jsx('h1', {
className: 'text-3xl font-semibold text-center font-sans mt-6',
children: 'QuickyAI guide',
}),
g.jsxs('div', {
className: 'p-6 bg-white shadow mt-6 rounded-lg border border-gray-200',
children: [
g.jsxs('div', {
className: 'text-base',
children: [
g.jsx('h2', { className: 'text-2xl font-medium', children: 'Getting started' }),
g.jsx('p', {
children:
"First setup the extension with License and OpenAI keys(API key is not required for Subscribers). Once they are set, you can see the green colored key with text 'Keys added' in the bottom left of extension popup.",
}),
' ',
g.jsx('p', {
className: 'text-lg font-medium',
children: 'There are 3 ways to use QuickyAI:',
}),
g.jsx('h3', { children: '1. Using right click' }),
g.jsx('p', {
children:
'→ Visit any web page right click to see the "Trigger QuickyAI" option with QuickyAI logo',
}),
g.jsx('p', {
children: `→ Once you click the "Trigger QuickyAI", you can start typing your query in the response window that gets opened and click "Trigger QuickyAI" from right click context menu by keeeping the cursor in the text to get the AI response.(Hence, it's called response window)`,
}),
g.jsx('h3', { children: '2. Using selection menu' }),
g.jsxs('p', {
children: [
'→ Enable selection menu from the extension popup or use the shortcut you set (',
g.jsx('button', {
onClick: e,
className: 'text-blue-500 hover:text-blue-600',
children: 'Update shortcuts here',
}),
')',
],
}),
g.jsx('p', {
children:
'→ You can select text on any website and select a suitable default prompt and length of the response and click the Trigger icon (⚡) to get the response',
}),
g.jsx('h3', { children: '3. Using shortcut' }),
g.jsxs('p', {
children: [
"→ In the extension popup you can find the shortcut to Trigger AI, if it doesn't exists, you can",
' ',
g.jsx('button', {
onClick: e,
className: 'text-blue-500 hover:text-blue-600',
children: 'set one here',
}),
],
}),
g.jsx('p', {
children:
'→ Visit any webpage, click the Trigger AI shortcut to open the response window and after typing text, keep the cursor within the textbox and enter the shortcut to get the response',
}),
g.jsxs('p', {
children: [
g.jsx('b', { children: 'Note' }),
': You can use the above three methods interchangeably anywhere you want.',
],
}),
g.jsx('h3', { children: 'Direct trigger without selection' }),
g.jsx('p', {
children:
'→ You can get AI response without selecting the text if you are in the response window or in any text box where you enter text, such that you put your cursor after your text',
}),
g.jsxs('p', {
children: [
'→ You can choose default prompt and length directly in the text(',
g.jsx('span', { className: 'font-semibold', children: 'which are optional' }),
'). To set the default prompt append ',
g.jsx('span', { className: 'font-bold', children: "'/'" }),
' ',
'followed by the prompt name and to set the length append',
' ',
g.jsx('span', { className: 'font-bold', children: "'#'" }),
' followed by a number or length',
],
}),
g.jsxs('p', {
children: [
g.jsx('b', { children: 'Note' }),
': You can open any number of response windows on a page and close them easily just by pressing ',
g.jsx('b', { children: 'Escape' }),
' key.',
],
}),
],
}),
g.jsxs('div', {
className: 'text-base',
children: [
g.jsx('h2', { className: 'text-2xl font-medium', children: 'Customized query' }),
g.jsx('img', {
src: '/guide.png',
draggable: 'false',
className: 'select-none',
alt: 'Quicky AI text guide',
}),
g.jsx('p', { children: 'Text or query → any text that that you ask AI' }),
g.jsxs('p', {
children: [
'Prompt name → any prompt name listed in the default prompts (',
g.jsx('a', {
href: chrome.runtime.getURL('/src/pages/options/index.html?id=prompts'),
className: 'text-blue-500 hover:text-blue-600',
children: 'add new prompts here',
}),
')',
],
}),
g.jsx('p', {
children:
'Limit on tokens → to get answers under the given limit (any number, s, small, l, long, ll, longer)',
}),
g.jsxs('div', {
className: 'text-black',
children: [
g.jsx('h3', { children: 'Examples:' }),
g.jsxs('p', {
children: [
'→ What is global warming/ask#s ',
g.jsx('br', {}),
g.jsx('span', {
className: 'text-gray-600',
children: "(For response based on prompt: 'ask' & length: 'small')",
}),
],
}),
g.jsxs('p', {
children: [
'→ Give me a story about elephants/reply#medium ',
g.jsx('br', {}),
g.jsx('span', {
className: 'text-gray-600',
children: "(For response based on prompt: 'reply' & length: 'medium')",
}),
],
}),
g.jsxs('p', {
children: [
'→ How to learn marketing?/explain#100 ',
g.jsx('br', {}),
g.jsx('span', {
className: 'text-gray-600',
children:
"(For response based on prompt: 'explain' & length: under 100 tokens or words)",
}),
],
}),
g.jsxs('p', {
children: [
'→ why roses are red#50 ',
g.jsx('br', {}),
g.jsxs('span', {
className: 'text-gray-600',
children: [
' ',
'(For response under 50 tokens or words, based on selected prompt)',
],
}),
],
}),
g.jsxs('p', {
children: [
'→ why apples are red',
g.jsx('br', {}),
g.jsxs('span', {
className: 'text-gray-600',
children: [' ', '(For response based on selected prompt and length)'],
}),
],
}),
],
}),
],
}),
g.jsxs('div', {
className: 'text-base mt-10',
children: [
'For more guides check the',
' ',
g.jsx('a', {
href: 'https://quickyai.com/demo?ref=guide',
target: '_blank',
className: 'text-blue-400 hover:text-blue-500',
rel: 'noreferrer',
children: '🎥 demos',
}),
],
}),
],
}),
],
});
}
function yg({ isOpen: e, onDelete: t, onClose: n }) {
return g.jsx('div', {
className:
'fixed z-50 p-4 overflow-x-hidden overflow-y-auto inset-0 h-[100vh] max-h-full bg-gray-700/50 flex justify-center items-center',
onClick: n,
style: { display: e ? 'flex' : 'none' },
children: g.jsx('div', {
className: 'relative w-full max-w-md max-h-full -mt-32',
onClick: (r) => r.stopPropagation(),
children: g.jsxs('div', {
className: 'relative bg-white rounded-lg shadow dark:bg-gray-700',
children: [
g.jsxs('button', {
type: 'button',
className:
'absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white',
onClick: n,
children: [
g.jsx('svg', {
'aria-hidden': 'true',
className: 'w-5 h-5',
fill: 'currentColor',
viewBox: '0 0 20 20',
xmlns: 'http://www.w3.org/2000/svg',
children: g.jsx('path', {
fillRule: 'evenodd',
d: 'M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z',
clipRule: 'evenodd',
}),
}),
g.jsx('span', { className: 'sr-only', children: 'Close modal' }),
],
}),
g.jsxs('div', {
className: 'p-6 text-center',
children: [
g.jsx('svg', {
'aria-hidden': 'true',
className: 'mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200',
fill: 'none',
stroke: 'currentColor',
viewBox: '0 0 24 24',
xmlns: 'http://www.w3.org/2000/svg',
children: g.jsx('path', {
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: '2',
d: 'M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
}),
}),
g.jsx('h3', {
className: 'text-lg font-normal text-gray-500 dark:text-gray-400 mb-1',
children: 'Are you sure you want to delete all chat history?',
}),
g.jsx('h4', {
className: 'text-center mb-5 text-gray-600',
children: '(You can backup using export button)',
}),
g.jsx('button', {
'data-modal-hide': 'popup-modal',
type: 'button',
className:
'text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2',
onClick: t,
children: "Yes, I'm sure",
}),
g.jsx('button', {
'data-modal-hide': 'popup-modal',
type: 'button',
className:
'text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600',
onClick: n,
children: 'No, cancel',
}),
],
}),
],
}),
}),
});
}
const Aa = ['http', 'https', 'mailto', 'tel'];
function xg(e) {
const t = (e || '').trim(),
n = t.charAt(0);
if (n === '#' || n === '/') return t;
const r = t.indexOf(':');
if (r === -1) return t;
let i = -1;
for (; ++i < Aa.length; ) {
const a = Aa[i];
if (r === a.length && t.slice(0, a.length).toLowerCase() === a) return t;
}
return (
(i = t.indexOf('?')),
(i !== -1 && r > i) || ((i = t.indexOf('#')), i !== -1 && r > i) ? t : 'javascript:void(0)'
);
}
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/ var wg = function (t) {
return (
t != null &&
t.constructor != null &&
typeof t.constructor.isBuffer == 'function' &&
t.constructor.isBuffer(t)
);
};
const jl = wg;
function Gt(e) {
return !e || typeof e != 'object'
? ''
: 'position' in e || 'type' in e
? Na(e.position)
: 'start' in e || 'end' in e
? Na(e)
: 'line' in e || 'column' in e
? Wr(e)
: '';
}
function Wr(e) {
return Oa(e && e.line) + ':' + Oa(e && e.column);
}
function Na(e) {
return Wr(e && e.start) + '-' + Wr(e && e.end);
}
function Oa(e) {
return e && typeof e == 'number' ? e : 1;
}
class He extends Error {
constructor(t, n, r) {
const i = [null, null];
let a = { start: { line: null, column: null }, end: { line: null, column: null } };
if ((super(), typeof n == 'string' && ((r = n), (n = void 0)), typeof r == 'string')) {
const o = r.indexOf(':');
o === -1 ? (i[1] = r) : ((i[0] = r.slice(0, o)), (i[1] = r.slice(o + 1)));
}
n &&
('type' in n || 'position' in n
? n.position && (a = n.position)
: 'start' in n || 'end' in n
? (a = n)
: ('line' in n || 'column' in n) && (a.start = n)),
(this.name = Gt(n) || '1:1'),
(this.message = typeof t == 'object' ? t.message : t),
(this.stack = ''),
typeof t == 'object' && t.stack && (this.stack = t.stack),
(this.reason = this.message),
this.fatal,
(this.line = a.start.line),
(this.column = a.start.column),
(this.position = a),
(this.source = i[0]),
(this.ruleId = i[1]),
this.file,
this.actual,
this.expected,
this.url,
this.note;
}
}
He.prototype.file = '';
He.prototype.name = '';
He.prototype.reason = '';
He.prototype.message = '';
He.prototype.stack = '';
He.prototype.fatal = null;
He.prototype.column = null;
He.prototype.line = null;
He.prototype.source = null;
He.prototype.ruleId = null;
He.prototype.position = null;
const Ye = { basename: Sg, dirname: Cg, extname: Dg, join: Ig, sep: '/' };
function Sg(e, t) {
if (t !== void 0 && typeof t != 'string') throw new TypeError('"ext" argument must be a string');
un(e);
let n = 0,
r = -1,
i = e.length,
a;
if (t === void 0 || t.length === 0 || t.length > e.length) {
for (; i--; )
if (e.charCodeAt(i) === 47) {
if (a) {
n = i + 1;
break;
}
} else r < 0 && ((a = !0), (r = i + 1));
return r < 0 ? '' : e.slice(n, r);
}
if (t === e) return '';
let o = -1,
l = t.length - 1;
for (; i--; )
if (e.charCodeAt(i) === 47) {
if (a) {
n = i + 1;
break;
}
} else
o < 0 && ((a = !0), (o = i + 1)),
l > -1 && (e.charCodeAt(i) === t.charCodeAt(l--) ? l < 0 && (r = i) : ((l = -1), (r = o)));
return n === r ? (r = o) : r < 0 && (r = e.length), e.slice(n, r);
}
function Cg(e) {
if ((un(e), e.length === 0)) return '.';
let t = -1,
n = e.length,
r;
for (; --n; )
if (e.charCodeAt(n) === 47) {
if (r) {
t = n;
break;
}
} else r || (r = !0);
return t < 0
? e.charCodeAt(0) === 47
? '/'
: '.'
: t === 1 && e.charCodeAt(0) === 47
? '//'
: e.slice(0, t);
}
function Dg(e) {
un(e);
let t = e.length,
n = -1,
r = 0,
i = -1,
a = 0,
o;
for (; t--; ) {
const l = e.charCodeAt(t);
if (l === 47) {
if (o) {
r = t + 1;
break;
}
continue;
}
n < 0 && ((o = !0), (n = t + 1)),
l === 46 ? (i < 0 ? (i = t) : a !== 1 && (a = 1)) : i > -1 && (a = -1);
}
return i < 0 || n < 0 || a === 0 || (a === 1 && i === n - 1 && i === r + 1) ? '' : e.slice(i, n);
}
function Ig(...e) {
let t = -1,
n;
for (; ++t < e.length; ) un(e[t]), e[t] && (n = n === void 0 ? e[t] : n + '/' + e[t]);
return n === void 0 ? '.' : kg(n);
}
function kg(e) {
un(e);
const t = e.charCodeAt(0) === 47;
let n = Eg(e, !t);
return (
n.length === 0 && !t && (n = '.'),
n.length > 0 && e.charCodeAt(e.length - 1) === 47 && (n += '/'),
t ? '/' + n : n
);
}
function Eg(e, t) {
let n = '',
r = 0,
i = -1,
a = 0,
o = -1,
l,
s;
for (; ++o <= e.length; ) {
if (o < e.length) l = e.charCodeAt(o);
else {
if (l === 47) break;
l = 47;
}
if (l === 47) {
if (!(i === o - 1 || a === 1))
if (i !== o - 1 && a === 2) {
if (
n.length < 2 ||
r !== 2 ||
n.charCodeAt(n.length - 1) !== 46 ||
n.charCodeAt(n.length - 2) !== 46
) {
if (n.length > 2) {
if (((s = n.lastIndexOf('/')), s !== n.length - 1)) {
s < 0
? ((n = ''), (r = 0))
: ((n = n.slice(0, s)), (r = n.length - 1 - n.lastIndexOf('/'))),
(i = o),
(a = 0);
continue;
}
} else if (n.length > 0) {
(n = ''), (r = 0), (i = o), (a = 0);
continue;
}
}
t && ((n = n.length > 0 ? n + '/..' : '..'), (r = 2));
} else
n.length > 0 ? (n += '/' + e.slice(i + 1, o)) : (n = e.slice(i + 1, o)), (r = o - i - 1);
(i = o), (a = 0);
} else l === 46 && a > -1 ? a++ : (a = -1);
}
return n;
}
function un(e) {
if (typeof e != 'string')
throw new TypeError('Path must be a string. Received ' + JSON.stringify(e));
}
const Pg = { cwd: Ag };
function Ag() {
return '/';
}
function qr(e) {
return e !== null && typeof e == 'object' && e.href && e.origin;
}
function Ng(e) {
if (typeof e == 'string') e = new URL(e);
else if (!qr(e)) {
const t = new TypeError(
'The "path" argument must be of type string or an instance of URL. Received `' + e + '`'
);
throw ((t.code = 'ERR_INVALID_ARG_TYPE'), t);
}
if (e.protocol !== 'file:') {
const t = new TypeError('The URL must be of scheme file');
throw ((t.code = 'ERR_INVALID_URL_SCHEME'), t);
}
return Og(e);
}
function Og(e) {
if (e.hostname !== '') {
const r = new TypeError('File URL host must be "localhost" or empty on darwin');
throw ((r.code = 'ERR_INVALID_FILE_URL_HOST'), r);
}
const t = e.pathname;
let n = -1;
for (; ++n < t.length; )
if (t.charCodeAt(n) === 37 && t.charCodeAt(n + 1) === 50) {
const r = t.charCodeAt(n + 2);
if (r === 70 || r === 102) {
const i = new TypeError('File URL path must not include encoded / characters');
throw ((i.code = 'ERR_INVALID_FILE_URL_PATH'), i);
}
}
return decodeURIComponent(t);
}
const Ir = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'];
class zl {
constructor(t) {
let n;
t
? typeof t == 'string' || Tg(t)
? (n = { value: t })
: qr(t)
? (n = { path: t })
: (n = t)
: (n = {}),
(this.data = {}),
(this.messages = []),
(this.history = []),
(this.cwd = Pg.cwd()),
this.value,
this.stored,
this.result,
this.map;
let r = -1;
for (; ++r < Ir.length; ) {
const a = Ir[r];
a in n && n[a] !== void 0 && n[a] !== null && (this[a] = a === 'history' ? [...n[a]] : n[a]);
}
let i;
for (i in n) Ir.includes(i) || (this[i] = n[i]);
}
get path() {
return this.history[this.history.length - 1];
}
set path(t) {
qr(t) && (t = Ng(t)), Er(t, 'path'), this.path !== t && this.history.push(t);
}
get dirname() {
return typeof this.path == 'string' ? Ye.dirname(this.path) : void 0;
}
set dirname(t) {
Ta(this.basename, 'dirname'), (this.path = Ye.join(t || '', this.basename));
}
get basename() {
return typeof this.path == 'string' ? Ye.basename(this.path) : void 0;
}
set basename(t) {
Er(t, 'basename'), kr(t, 'basename'), (this.path = Ye.join(this.dirname || '', t));
}
get extname() {
return typeof this.path == 'string' ? Ye.extname(this.path) : void 0;
}
set extname(t) {
if ((kr(t, 'extname'), Ta(this.dirname, 'extname'), t)) {
if (t.charCodeAt(0) !== 46) throw new Error('`extname` must start with `.`');
if (t.includes('.', 1)) throw new Error('`extname` cannot contain multiple dots');
}
this.path = Ye.join(this.dirname, this.stem + (t || ''));
}
get stem() {
return typeof this.path == 'string' ? Ye.basename(this.path, this.extname) : void 0;
}
set stem(t) {
Er(t, 'stem'),
kr(t, 'stem'),
(this.path = Ye.join(this.dirname || '', t + (this.extname || '')));
}
toString(t) {
return (this.value || '').toString(t || void 0);
}
message(t, n, r) {
const i = new He(t, n, r);
return (
this.path && ((i.name = this.path + ':' + i.name), (i.file = this.path)),
(i.fatal = !1),
this.messages.push(i),
i
);
}
info(t, n, r) {
const i = this.message(t, n, r);
return (i.fatal = null), i;
}
fail(t, n, r) {
const i = this.message(t, n, r);
throw ((i.fatal = !0), i);
}
}
function kr(e, t) {
if (e && e.includes(Ye.sep))
throw new Error('`' + t + '` cannot be a path: did not expect `' + Ye.sep + '`');
}
function Er(e, t) {
if (!e) throw new Error('`' + t + '` cannot be empty');
}
function Ta(e, t) {
if (!e) throw new Error('Setting `' + t + '` requires `path` to be set too');
}
function Tg(e) {
return jl(e);
}
function Ba(e) {
if (e) throw e;
}
var Sn = Object.prototype.hasOwnProperty,
$l = Object.prototype.toString,
Ra = Object.defineProperty,
Fa = Object.getOwnPropertyDescriptor,
La = function (t) {
return typeof Array.isArray == 'function' ? Array.isArray(t) : $l.call(t) === '[object Array]';
},
Ma = function (t) {
if (!t || $l.call(t) !== '[object Object]') return !1;
var n = Sn.call(t, 'constructor'),
r =
t.constructor &&
t.constructor.prototype &&
Sn.call(t.constructor.prototype, 'isPrototypeOf');
if (t.constructor && !n && !r) return !1;
var i;
for (i in t);
return typeof i > 'u' || Sn.call(t, i);
},
ja = function (t, n) {
Ra && n.name === '__proto__'
? Ra(t, n.name, { enumerable: !0, configurable: !0, value: n.newValue, writable: !0 })
: (t[n.name] = n.newValue);
},
za = function (t, n) {
if (n === '__proto__')
if (Sn.call(t, n)) {
if (Fa) return Fa(t, n).value;
} else return;
return t[n];
},
$a = function e() {
var t,
n,
r,
i,
a,
o,
l = arguments[0],
s = 1,
c = arguments.length,
d = !1;
for (
typeof l == 'boolean' && ((d = l), (l = arguments[1] || {}), (s = 2)),
(l == null || (typeof l != 'object' && typeof l != 'function')) && (l = {});
s < c;
++s
)
if (((t = arguments[s]), t != null))
for (n in t)
(r = za(l, n)),
(i = za(t, n)),
l !== i &&
(d && i && (Ma(i) || (a = La(i)))
? (a ? ((a = !1), (o = r && La(r) ? r : [])) : (o = r && Ma(r) ? r : {}),
ja(l, { name: n, newValue: e(d, o, i) }))
: typeof i < 'u' && ja(l, { name: n, newValue: i }));
return l;
};
function Vr(e) {
if (typeof e != 'object' || e === null) return !1;
const t = Object.getPrototypeOf(e);
return (
(t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) &&
!(Symbol.toStringTag in e) &&
!(Symbol.iterator in e)
);
}
function Bg() {
const e = [],
t = { run: n, use: r };
return t;
function n(...i) {
let a = -1;
const o = i.pop();
if (typeof o != 'function') throw new TypeError('Expected function as last argument, not ' + o);
l(null, ...i);
function l(s, ...c) {
const d = e[++a];
let u = -1;
if (s) {
o(s);
return;
}
for (; ++u < i.length; ) (c[u] === null || c[u] === void 0) && (c[u] = i[u]);
(i = c), d ? Rg(d, l)(...c) : o(null, ...c);
}
}
function r(i) {
if (typeof i != 'function')
throw new TypeError('Expected `middelware` to be a function, not ' + i);
return e.push(i), t;
}
}
function Rg(e, t) {
let n;
return r;
function r(...o) {
const l = e.length > o.length;
let s;
l && o.push(i);
try {
s = e.apply(this, o);
} catch (c) {
const d = c;
if (l && n) throw d;
return i(d);
}
l || (s instanceof Promise ? s.then(a, i) : s instanceof Error ? i(s) : a(s));
}
function i(o, ...l) {
n || ((n = !0), t(o, ...l));
}
function a(o) {
i(null, o);
}
}
const Fg = Ul().freeze(),
Hl = {}.hasOwnProperty;
function Ul() {
const e = Bg(),
t = [];
let n = {},
r,
i = -1;
return (
(a.data = o),
(a.Parser = void 0),
(a.Compiler = void 0),
(a.freeze = l),
(a.attachers = t),
(a.use = s),
(a.parse = c),
(a.stringify = d),
(a.run = u),
(a.runSync = f),
(a.process = p),
(a.processSync = m),
a
);
function a() {
const h = Ul();
let x = -1;
for (; ++x < t.length; ) h.use(...t[x]);
return h.data($a(!0, {}, n)), h;
}
function o(h, x) {
return typeof h == 'string'
? arguments.length === 2
? (Nr('data', r), (n[h] = x), a)
: (Hl.call(n, h) && n[h]) || null
: h
? (Nr('data', r), (n = h), a)
: n;
}
function l() {
if (r) return a;
for (; ++i < t.length; ) {
const [h, ...x] = t[i];
if (x[0] === !1) continue;
x[0] === !0 && (x[0] = void 0);
const b = h.call(a, ...x);
typeof b == 'function' && e.use(b);
}
return (r = !0), (i = Number.POSITIVE_INFINITY), a;
}
function s(h, ...x) {
let b;
if ((Nr('use', r), h != null))
if (typeof h == 'function') E(h, ...x);
else if (typeof h == 'object') Array.isArray(h) ? D(h) : S(h);
else throw new TypeError('Expected usable value, not `' + h + '`');
return b && (n.settings = Object.assign(n.settings || {}, b)), a;
function C(w) {
if (typeof w == 'function') E(w);
else if (typeof w == 'object')
if (Array.isArray(w)) {
const [O, ...L] = w;
E(O, ...L);
} else S(w);
else throw new TypeError('Expected usable value, not `' + w + '`');
}
function S(w) {
D(w.plugins), w.settings && (b = Object.assign(b || {}, w.settings));
}
function D(w) {
let O = -1;
if (w != null)
if (Array.isArray(w))
for (; ++O < w.length; ) {
const L = w[O];
C(L);
}
else throw new TypeError('Expected a list of plugins, not `' + w + '`');
}
function E(w, O) {
let L = -1,
F;
for (; ++L < t.length; )
if (t[L][0] === w) {
F = t[L];
break;
}
F ? (Vr(F[1]) && Vr(O) && (O = $a(!0, F[1], O)), (F[1] = O)) : t.push([...arguments]);
}
}
function c(h) {
a.freeze();
const x = $t(h),
b = a.Parser;
return Pr('parse', b), Ha(b, 'parse') ? new b(String(x), x).parse() : b(String(x), x);
}
function d(h, x) {
a.freeze();
const b = $t(x),
C = a.Compiler;
return Ar('stringify', C), Ua(h), Ha(C, 'compile') ? new C(h, b).compile() : C(h, b);
}
function u(h, x, b) {
if ((Ua(h), a.freeze(), !b && typeof x == 'function' && ((b = x), (x = void 0)), !b))
return new Promise(C);
C(null, b);
function C(S, D) {
e.run(h, $t(x), E);
function E(w, O, L) {
(O = O || h), w ? D(w) : S ? S(O) : b(null, O, L);
}
}
}
function f(h, x) {
let b, C;
return a.run(h, x, S), Ga('runSync', 'run', C), b;
function S(D, E) {
Ba(D), (b = E), (C = !0);
}
}
function p(h, x) {
if ((a.freeze(), Pr('process', a.Parser), Ar('process', a.Compiler), !x)) return new Promise(b);
b(null, x);
function b(C, S) {
const D = $t(h);
a.run(a.parse(D), D, (w, O, L) => {
if (w || !O || !L) E(w);
else {
const F = a.stringify(O, L);
F == null || (jg(F) ? (L.value = F) : (L.result = F)), E(w, L);
}
});
function E(w, O) {
w || !O ? S(w) : C ? C(O) : x(null, O);
}
}
}
function m(h) {
let x;
a.freeze(), Pr('processSync', a.Parser), Ar('processSync', a.Compiler);
const b = $t(h);
return a.process(b, C), Ga('processSync', 'process', x), b;
function C(S) {
(x = !0), Ba(S);
}
}
}
function Ha(e, t) {
return typeof e == 'function' && e.prototype && (Lg(e.prototype) || t in e.prototype);
}
function Lg(e) {
let t;
for (t in e) if (Hl.call(e, t)) return !0;
return !1;
}
function Pr(e, t) {
if (typeof t != 'function') throw new TypeError('Cannot `' + e + '` without `Parser`');
}
function Ar(e, t) {
if (typeof t != 'function') throw new TypeError('Cannot `' + e + '` without `Compiler`');
}
function Nr(e, t) {
if (t)
throw new Error(
'Cannot call `' +
e +
'` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'
);
}
function Ua(e) {
if (!Vr(e) || typeof e.type != 'string') throw new TypeError('Expected node, got `' + e + '`');
}
function Ga(e, t, n) {
if (!n) throw new Error('`' + e + '` finished async. Use `' + t + '` instead');
}
function $t(e) {
return Mg(e) ? e : new zl(e);
}
function Mg(e) {
return !!(e && typeof e == 'object' && 'message' in e && 'messages' in e);
}
function jg(e) {
return typeof e == 'string' || jl(e);
}
const zg = {};
function $g(e, t) {
const n = t || zg,
r = typeof n.includeImageAlt == 'boolean' ? n.includeImageAlt : !0,
i = typeof n.includeHtml == 'boolean' ? n.includeHtml : !0;
return Gl(e, r, i);
}
function Gl(e, t, n) {
if (Hg(e)) {
if ('value' in e) return e.type === 'html' && !n ? '' : e.value;
if (t && 'alt' in e && e.alt) return e.alt;
if ('children' in e) return Wa(e.children, t, n);
}
return Array.isArray(e) ? Wa(e, t, n) : '';
}
function Wa(e, t, n) {
const r = [];
let i = -1;
for (; ++i < e.length; ) r[i] = Gl(e[i], t, n);
return r.join('');
}
function Hg(e) {
return !!(e && typeof e == 'object');
}
function Xe(e, t, n, r) {
const i = e.length;
let a = 0,
o;
if ((t < 0 ? (t = -t > i ? 0 : i + t) : (t = t > i ? i : t), (n = n > 0 ? n : 0), r.length < 1e4))
(o = Array.from(r)), o.unshift(t, n), e.splice(...o);
else
for (n && e.splice(t, n); a < r.length; )
(o = r.slice(a, a + 1e4)), o.unshift(t, 0), e.splice(...o), (a += 1e4), (t += 1e4);
}
function je(e, t) {
return e.length > 0 ? (Xe(e, e.length, 0, t), e) : t;
}
const qa = {}.hasOwnProperty;
function Ug(e) {
const t = {};
let n = -1;
for (; ++n < e.length; ) Gg(t, e[n]);
return t;
}
function Gg(e, t) {
let n;
for (n in t) {
const i = (qa.call(e, n) ? e[n] : void 0) || (e[n] = {}),
a = t[n];
let o;
if (a)
for (o in a) {
qa.call(i, o) || (i[o] = []);
const l = a[o];
Wg(i[o], Array.isArray(l) ? l : l ? [l] : []);
}
}
}
function Wg(e, t) {
let n = -1;
const r = [];
for (; ++n < t.length; ) (t[n].add === 'after' ? e : r).push(t[n]);
Xe(e, 0, 0, r);
}
const qg =
/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,
Qe = pt(/[A-Za-z]/),
Te = pt(/[\dA-Za-z]/),
Vg = pt(/[#-'*+\--9=?A-Z^-~]/);
function Kr(e) {
return e !== null && (e < 32 || e === 127);
}
const Yr = pt(/\d/),
Kg = pt(/[\dA-Fa-f]/),
Yg = pt(/[!-/:-@[-`{-~]/);
function G(e) {
return e !== null && e < -2;
}
function Ee(e) {
return e !== null && (e < 0 || e === 32);
}
function Z(e) {
return e === -2 || e === -1 || e === 32;
}
const Qg = pt(qg),
Xg = pt(/\s/);
function pt(e) {
return t;
function t(n) {
return n !== null && e.test(String.fromCharCode(n));
}
}
function ae(e, t, n, r) {
const i = r ? r - 1 : Number.POSITIVE_INFINITY;
let a = 0;
return o;
function o(s) {
return Z(s) ? (e.enter(n), l(s)) : t(s);
}
function l(s) {
return Z(s) && a++ < i ? (e.consume(s), l) : (e.exit(n), t(s));
}
}
const Jg = { tokenize: _g };
function _g(e) {
const t = e.attempt(this.parser.constructs.contentInitial, r, i);
let n;
return t;
function r(l) {
if (l === null) {
e.consume(l);
return;
}
return e.enter('lineEnding'), e.consume(l), e.exit('lineEnding'), ae(e, t, 'linePrefix');
}
function i(l) {
return e.enter('paragraph'), a(l);
}
function a(l) {
const s = e.enter('chunkText', { contentType: 'text', previous: n });
return n && (n.next = s), (n = s), o(l);
}
function o(l) {
if (l === null) {
e.exit('chunkText'), e.exit('paragraph'), e.consume(l);
return;
}
return G(l) ? (e.consume(l), e.exit('chunkText'), a) : (e.consume(l), o);
}
}
const Zg = { tokenize: em },
Va = { tokenize: tm };
function em(e) {
const t = this,
n = [];
let r = 0,
i,
a,
o;
return l;
function l(S) {
if (r < n.length) {
const D = n[r];
return (t.containerState = D[1]), e.attempt(D[0].continuation, s, c)(S);
}
return c(S);
}
function s(S) {
if ((r++, t.containerState._closeFlow)) {
(t.containerState._closeFlow = void 0), i && C();
const D = t.events.length;
let E = D,
w;
for (; E--; )
if (t.events[E][0] === 'exit' && t.events[E][1].type === 'chunkFlow') {
w = t.events[E][1].end;
break;
}
b(r);
let O = D;
for (; O < t.events.length; ) (t.events[O][1].end = Object.assign({}, w)), O++;
return Xe(t.events, E + 1, 0, t.events.slice(D)), (t.events.length = O), c(S);
}
return l(S);
}
function c(S) {
if (r === n.length) {
if (!i) return f(S);
if (i.currentConstruct && i.currentConstruct.concrete) return m(S);
t.interrupt = !!(i.currentConstruct && !i._gfmTableDynamicInterruptHack);
}
return (t.containerState = {}), e.check(Va, d, u)(S);
}
function d(S) {
return i && C(), b(r), f(S);
}
function u(S) {
return (t.parser.lazy[t.now().line] = r !== n.length), (o = t.now().offset), m(S);
}
function f(S) {
return (t.containerState = {}), e.attempt(Va, p, m)(S);
}
function p(S) {
return r++, n.push([t.currentConstruct, t.containerState]), f(S);
}
function m(S) {
if (S === null) {
i && C(), b(0), e.consume(S);
return;
}
return (
(i = i || t.parser.flow(t.now())),
e.enter('chunkFlow', { contentType: 'flow', previous: a, _tokenizer: i }),
h(S)
);
}
function h(S) {
if (S === null) {
x(e.exit('chunkFlow'), !0), b(0), e.consume(S);
return;
}
return G(S)
? (e.consume(S), x(e.exit('chunkFlow')), (r = 0), (t.interrupt = void 0), l)
: (e.consume(S), h);
}
function x(S, D) {
const E = t.sliceStream(S);
if (
(D && E.push(null),
(S.previous = a),
a && (a.next = S),
(a = S),
i.defineSkip(S.start),
i.write(E),
t.parser.lazy[S.start.line])
) {
let w = i.events.length;
for (; w--; )
if (
i.events[w][1].start.offset < o &&
(!i.events[w][1].end || i.events[w][1].end.offset > o)
)
return;
const O = t.events.length;
let L = O,
F,
V;
for (; L--; )
if (t.events[L][0] === 'exit' && t.events[L][1].type === 'chunkFlow') {
if (F) {
V = t.events[L][1].end;
break;
}
F = !0;
}
for (b(r), w = O; w < t.events.length; ) (t.events[w][1].end = Object.assign({}, V)), w++;
Xe(t.events, L + 1, 0, t.events.slice(O)), (t.events.length = w);
}
}
function b(S) {
let D = n.length;
for (; D-- > S; ) {
const E = n[D];
(t.containerState = E[1]), E[0].exit.call(t, e);
}
n.length = S;
}
function C() {
i.write([null]), (a = void 0), (i = void 0), (t.containerState._closeFlow = void 0);
}
}
function tm(e, t, n) {
return ae(
e,
e.attempt(this.parser.constructs.document, t, n),
'linePrefix',
this.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4
);
}
function Ka(e) {
if (e === null || Ee(e) || Xg(e)) return 1;
if (Qg(e)) return 2;
}
function Ai(e, t, n) {
const r = [];
let i = -1;
for (; ++i < e.length; ) {
const a = e[i].resolveAll;
a && !r.includes(a) && ((t = a(t, n)), r.push(a));
}
return t;
}
const Qr = { name: 'attention', tokenize: rm, resolveAll: nm };
function nm(e, t) {
let n = -1,
r,
i,
a,
o,
l,
s,
c,
d;
for (; ++n < e.length; )
if (e[n][0] === 'enter' && e[n][1].type === 'attentionSequence' && e[n][1]._close) {
for (r = n; r--; )
if (
e[r][0] === 'exit' &&
e[r][1].type === 'attentionSequence' &&
e[r][1]._open &&
t.sliceSerialize(e[r][1]).charCodeAt(0) === t.sliceSerialize(e[n][1]).charCodeAt(0)
) {
if (
(e[r][1]._close || e[n][1]._open) &&
(e[n][1].end.offset - e[n][1].start.offset) % 3 &&
!(
(e[r][1].end.offset -
e[r][1].start.offset +
e[n][1].end.offset -
e[n][1].start.offset) %
3
)
)
continue;
s =
e[r][1].end.offset - e[r][1].start.offset > 1 &&
e[n][1].end.offset - e[n][1].start.offset > 1
? 2
: 1;
const u = Object.assign({}, e[r][1].end),
f = Object.assign({}, e[n][1].start);
Ya(u, -s),
Ya(f, s),
(o = {
type: s > 1 ? 'strongSequence' : 'emphasisSequence',
start: u,
end: Object.assign({}, e[r][1].end),
}),
(l = {
type: s > 1 ? 'strongSequence' : 'emphasisSequence',
start: Object.assign({}, e[n][1].start),
end: f,
}),
(a = {
type: s > 1 ? 'strongText' : 'emphasisText',
start: Object.assign({}, e[r][1].end),
end: Object.assign({}, e[n][1].start),
}),
(i = {
type: s > 1 ? 'strong' : 'emphasis',
start: Object.assign({}, o.start),
end: Object.assign({}, l.end),
}),
(e[r][1].end = Object.assign({}, o.start)),
(e[n][1].start = Object.assign({}, l.end)),
(c = []),
e[r][1].end.offset - e[r][1].start.offset &&
(c = je(c, [
['enter', e[r][1], t],
['exit', e[r][1], t],
])),
(c = je(c, [
['enter', i, t],
['enter', o, t],
['exit', o, t],
['enter', a, t],
])),
(c = je(c, Ai(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t))),
(c = je(c, [
['exit', a, t],
['enter', l, t],
['exit', l, t],
['exit', i, t],
])),
e[n][1].end.offset - e[n][1].start.offset
? ((d = 2),
(c = je(c, [
['enter', e[n][1], t],
['exit', e[n][1], t],
])))
: (d = 0),
Xe(e, r - 1, n - r + 3, c),
(n = r + c.length - d - 2);
break;
}
}
for (n = -1; ++n < e.length; ) e[n][1].type === 'attentionSequence' && (e[n][1].type = 'data');
return e;
}
function rm(e, t) {
const n = this.parser.constructs.attentionMarkers.null,
r = this.previous,
i = Ka(r);
let a;
return o;
function o(s) {
return (a = s), e.enter('attentionSequence'), l(s);
}
function l(s) {
if (s === a) return e.consume(s), l;
const c = e.exit('attentionSequence'),
d = Ka(s),
u = !d || (d === 2 && i) || n.includes(s),
f = !i || (i === 2 && d) || n.includes(r);
return (
(c._open = !!(a === 42 ? u : u && (i || !f))),
(c._close = !!(a === 42 ? f : f && (d || !u))),
t(s)
);
}
}
function Ya(e, t) {
(e.column += t), (e.offset += t), (e._bufferIndex += t);
}
const im = { name: 'autolink', tokenize: am };
function am(e, t, n) {
let r = 0;
return i;
function i(p) {
return (
e.enter('autolink'),
e.enter('autolinkMarker'),
e.consume(p),
e.exit('autolinkMarker'),
e.enter('autolinkProtocol'),
a
);
}
function a(p) {
return Qe(p) ? (e.consume(p), o) : c(p);
}
function o(p) {
return p === 43 || p === 45 || p === 46 || Te(p) ? ((r = 1), l(p)) : c(p);
}
function l(p) {
return p === 58
? (e.consume(p), (r = 0), s)
: (p === 43 || p === 45 || p === 46 || Te(p)) && r++ < 32
? (e.consume(p), l)
: ((r = 0), c(p));
}
function s(p) {
return p === 62
? (e.exit('autolinkProtocol'),
e.enter('autolinkMarker'),
e.consume(p),
e.exit('autolinkMarker'),
e.exit('autolink'),
t)
: p === null || p === 32 || p === 60 || Kr(p)
? n(p)
: (e.consume(p), s);
}
function c(p) {
return p === 64 ? (e.consume(p), d) : Vg(p) ? (e.consume(p), c) : n(p);
}
function d(p) {
return Te(p) ? u(p) : n(p);
}
function u(p) {
return p === 46
? (e.consume(p), (r = 0), d)
: p === 62
? ((e.exit('autolinkProtocol').type = 'autolinkEmail'),
e.enter('autolinkMarker'),
e.consume(p),
e.exit('autolinkMarker'),
e.exit('autolink'),
t)
: f(p);
}
function f(p) {
if ((p === 45 || Te(p)) && r++ < 63) {
const m = p === 45 ? f : u;
return e.consume(p), m;
}
return n(p);
}
}
const er = { tokenize: om, partial: !0 };
function om(e, t, n) {
return r;
function r(a) {
return Z(a) ? ae(e, i, 'linePrefix')(a) : i(a);
}
function i(a) {
return a === null || G(a) ? t(a) : n(a);
}
}
const Wl = { name: 'blockQuote', tokenize: lm, continuation: { tokenize: sm }, exit: um };
function lm(e, t, n) {
const r = this;
return i;
function i(o) {
if (o === 62) {
const l = r.containerState;
return (
l.open || (e.enter('blockQuote', { _container: !0 }), (l.open = !0)),
e.enter('blockQuotePrefix'),
e.enter('blockQuoteMarker'),
e.consume(o),
e.exit('blockQuoteMarker'),
a
);
}
return n(o);
}
function a(o) {
return Z(o)
? (e.enter('blockQuotePrefixWhitespace'),
e.consume(o),
e.exit('blockQuotePrefixWhitespace'),
e.exit('blockQuotePrefix'),
t)
: (e.exit('blockQuotePrefix'), t(o));
}
}
function sm(e, t, n) {
const r = this;
return i;
function i(o) {
return Z(o)
? ae(
e,
a,
'linePrefix',
r.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4
)(o)
: a(o);
}
function a(o) {
return e.attempt(Wl, t, n)(o);
}
}
function um(e) {
e.exit('blockQuote');
}
const ql = { name: 'characterEscape', tokenize: cm };
function cm(e, t, n) {
return r;
function r(a) {
return (
e.enter('characterEscape'), e.enter('escapeMarker'), e.consume(a), e.exit('escapeMarker'), i
);
}
function i(a) {
return Yg(a)
? (e.enter('characterEscapeValue'),
e.consume(a),
e.exit('characterEscapeValue'),
e.exit('characterEscape'),
t)
: n(a);
}
}
const Qa = document.createElement('i');
function Ni(e) {
const t = '&' + e + ';';
Qa.innerHTML = t;
const n = Qa.textContent;
return (n.charCodeAt(n.length - 1) === 59 && e !== 'semi') || n === t ? !1 : n;
}
const Vl = { name: 'characterReference', tokenize: dm };
function dm(e, t, n) {
const r = this;
let i = 0,
a,
o;
return l;
function l(u) {
return (
e.enter('characterReference'),
e.enter('characterReferenceMarker'),
e.consume(u),
e.exit('characterReferenceMarker'),
s
);
}
function s(u) {
return u === 35
? (e.enter('characterReferenceMarkerNumeric'),
e.consume(u),
e.exit('characterReferenceMarkerNumeric'),
c)
: (e.enter('characterReferenceValue'), (a = 31), (o = Te), d(u));
}
function c(u) {
return u === 88 || u === 120
? (e.enter('characterReferenceMarkerHexadecimal'),
e.consume(u),
e.exit('characterReferenceMarkerHexadecimal'),
e.enter('characterReferenceValue'),
(a = 6),
(o = Kg),
d)
: (e.enter('characterReferenceValue'), (a = 7), (o = Yr), d(u));
}
function d(u) {
if (u === 59 && i) {
const f = e.exit('characterReferenceValue');
return o === Te && !Ni(r.sliceSerialize(f))
? n(u)
: (e.enter('characterReferenceMarker'),
e.consume(u),
e.exit('characterReferenceMarker'),
e.exit('characterReference'),
t);
}
return o(u) && i++ < a ? (e.consume(u), d) : n(u);
}
}
const Xa = { tokenize: fm, partial: !0 },
Ja = { name: 'codeFenced', tokenize: pm, concrete: !0 };
function pm(e, t, n) {
const r = this,
i = { tokenize: E, partial: !0 };
let a = 0,
o = 0,
l;
return s;
function s(w) {
return c(w);
}
function c(w) {
const O = r.events[r.events.length - 1];
return (
(a = O && O[1].type === 'linePrefix' ? O[2].sliceSerialize(O[1], !0).length : 0),
(l = w),
e.enter('codeFenced'),
e.enter('codeFencedFence'),
e.enter('codeFencedFenceSequence'),
d(w)
);
}
function d(w) {
return w === l
? (o++, e.consume(w), d)
: o < 3
? n(w)
: (e.exit('codeFencedFenceSequence'), Z(w) ? ae(e, u, 'whitespace')(w) : u(w));
}
function u(w) {
return w === null || G(w)
? (e.exit('codeFencedFence'), r.interrupt ? t(w) : e.check(Xa, h, D)(w))
: (e.enter('codeFencedFenceInfo'), e.enter('chunkString', { contentType: 'string' }), f(w));
}
function f(w) {
return w === null || G(w)
? (e.exit('chunkString'), e.exit('codeFencedFenceInfo'), u(w))
: Z(w)
? (e.exit('chunkString'), e.exit('codeFencedFenceInfo'), ae(e, p, 'whitespace')(w))
: w === 96 && w === l
? n(w)
: (e.consume(w), f);
}
function p(w) {
return w === null || G(w)
? u(w)
: (e.enter('codeFencedFenceMeta'), e.enter('chunkString', { contentType: 'string' }), m(w));
}
function m(w) {
return w === null || G(w)
? (e.exit('chunkString'), e.exit('codeFencedFenceMeta'), u(w))
: w === 96 && w === l
? n(w)
: (e.consume(w), m);
}
function h(w) {
return e.attempt(i, D, x)(w);
}
function x(w) {
return e.enter('lineEnding'), e.consume(w), e.exit('lineEnding'), b;
}
function b(w) {
return a > 0 && Z(w) ? ae(e, C, 'linePrefix', a + 1)(w) : C(w);
}
function C(w) {
return w === null || G(w) ? e.check(Xa, h, D)(w) : (e.enter('codeFlowValue'), S(w));
}
function S(w) {
return w === null || G(w) ? (e.exit('codeFlowValue'), C(w)) : (e.consume(w), S);
}
function D(w) {
return e.exit('codeFenced'), t(w);
}
function E(w, O, L) {
let F = 0;
return V;
function V($) {
return w.enter('lineEnding'), w.consume($), w.exit('lineEnding'), A;
}
function A($) {
return (
w.enter('codeFencedFence'),
Z($)
? ae(
w,
R,
'linePrefix',
r.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4
)($)
: R($)
);
}
function R($) {
return $ === l ? (w.enter('codeFencedFenceSequence'), Y($)) : L($);
}
function Y($) {
return $ === l
? (F++, w.consume($), Y)
: F >= o
? (w.exit('codeFencedFenceSequence'), Z($) ? ae(w, q, 'whitespace')($) : q($))
: L($);
}
function q($) {
return $ === null || G($) ? (w.exit('codeFencedFence'), O($)) : L($);
}
}
}
function fm(e, t, n) {
const r = this;
return i;
function i(o) {
return o === null ? n(o) : (e.enter('lineEnding'), e.consume(o), e.exit('lineEnding'), a);
}
function a(o) {
return r.parser.lazy[r.now().line] ? n(o) : t(o);
}
}
const Or = { name: 'codeIndented', tokenize: mm },
gm = { tokenize: hm, partial: !0 };
function mm(e, t, n) {
const r = this;
return i;
function i(c) {
return e.enter('codeIndented'), ae(e, a, 'linePrefix', 4 + 1)(c);
}
function a(c) {
const d = r.events[r.events.length - 1];
return d && d[1].type === 'linePrefix' && d[2].sliceSerialize(d[1], !0).length >= 4
? o(c)
: n(c);
}
function o(c) {
return c === null ? s(c) : G(c) ? e.attempt(gm, o, s)(c) : (e.enter('codeFlowValue'), l(c));
}
function l(c) {
return c === null || G(c) ? (e.exit('codeFlowValue'), o(c)) : (e.consume(c), l);
}
function s(c) {
return e.exit('codeIndented'), t(c);
}
}
function hm(e, t, n) {
const r = this;
return i;
function i(o) {
return r.parser.lazy[r.now().line]
? n(o)
: G(o)
? (e.enter('lineEnding'), e.consume(o), e.exit('lineEnding'), i)
: ae(e, a, 'linePrefix', 4 + 1)(o);
}
function a(o) {
const l = r.events[r.events.length - 1];
return l && l[1].type === 'linePrefix' && l[2].sliceSerialize(l[1], !0).length >= 4
? t(o)
: G(o)
? i(o)
: n(o);
}
}
const vm = { name: 'codeText', tokenize: xm, resolve: bm, previous: ym };
function bm(e) {
let t = e.length - 4,
n = 3,
r,
i;
if (
(e[n][1].type === 'lineEnding' || e[n][1].type === 'space') &&
(e[t][1].type === 'lineEnding' || e[t][1].type === 'space')
) {
for (r = n; ++r < t; )
if (e[r][1].type === 'codeTextData') {
(e[n][1].type = 'codeTextPadding'), (e[t][1].type = 'codeTextPadding'), (n += 2), (t -= 2);
break;
}
}
for (r = n - 1, t++; ++r <= t; )
i === void 0
? r !== t && e[r][1].type !== 'lineEnding' && (i = r)
: (r === t || e[r][1].type === 'lineEnding') &&
((e[i][1].type = 'codeTextData'),
r !== i + 2 &&
((e[i][1].end = e[r - 1][1].end),
e.splice(i + 2, r - i - 2),
(t -= r - i - 2),
(r = i + 2)),
(i = void 0));
return e;
}
function ym(e) {
return e !== 96 || this.events[this.events.length - 1][1].type === 'characterEscape';
}
function xm(e, t, n) {
let r = 0,
i,
a;
return o;
function o(u) {
return e.enter('codeText'), e.enter('codeTextSequence'), l(u);
}
function l(u) {
return u === 96 ? (e.consume(u), r++, l) : (e.exit('codeTextSequence'), s(u));
}
function s(u) {
return u === null
? n(u)
: u === 32
? (e.enter('space'), e.consume(u), e.exit('space'), s)
: u === 96
? ((a = e.enter('codeTextSequence')), (i = 0), d(u))
: G(u)
? (e.enter('lineEnding'), e.consume(u), e.exit('lineEnding'), s)
: (e.enter('codeTextData'), c(u));
}
function c(u) {
return u === null || u === 32 || u === 96 || G(u)
? (e.exit('codeTextData'), s(u))
: (e.consume(u), c);
}
function d(u) {
return u === 96
? (e.consume(u), i++, d)
: i === r
? (e.exit('codeTextSequence'), e.exit('codeText'), t(u))
: ((a.type = 'codeTextData'), c(u));
}
}
function Kl(e) {
const t = {};
let n = -1,
r,
i,
a,
o,
l,
s,
c;
for (; ++n < e.length; ) {
for (; n in t; ) n = t[n];
if (
((r = e[n]),
n &&
r[1].type === 'chunkFlow' &&
e[n - 1][1].type === 'listItemPrefix' &&
((s = r[1]._tokenizer.events),
(a = 0),
a < s.length && s[a][1].type === 'lineEndingBlank' && (a += 2),
a < s.length && s[a][1].type === 'content'))
)
for (; ++a < s.length && s[a][1].type !== 'content'; )
s[a][1].type === 'chunkText' && ((s[a][1]._isInFirstContentOfListItem = !0), a++);
if (r[0] === 'enter') r[1].contentType && (Object.assign(t, wm(e, n)), (n = t[n]), (c = !0));
else if (r[1]._container) {
for (
a = n, i = void 0;
a-- && ((o = e[a]), o[1].type === 'lineEnding' || o[1].type === 'lineEndingBlank');
)
o[0] === 'enter' &&
(i && (e[i][1].type = 'lineEndingBlank'), (o[1].type = 'lineEnding'), (i = a));
i &&
((r[1].end = Object.assign({}, e[i][1].start)),
(l = e.slice(i, n)),
l.unshift(r),
Xe(e, i, n - i + 1, l));
}
}
return !c;
}
function wm(e, t) {
const n = e[t][1],
r = e[t][2];
let i = t - 1;
const a = [],
o = n._tokenizer || r.parser[n.contentType](n.start),
l = o.events,
s = [],
c = {};
let d,
u,
f = -1,
p = n,
m = 0,
h = 0;
const x = [h];
for (; p; ) {
for (; e[++i][1] !== p; );
a.push(i),
p._tokenizer ||
((d = r.sliceStream(p)),
p.next || d.push(null),
u && o.defineSkip(p.start),
p._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = !0),
o.write(d),
p._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = void 0)),
(u = p),
(p = p.next);
}
for (p = n; ++f < l.length; )
l[f][0] === 'exit' &&
l[f - 1][0] === 'enter' &&
l[f][1].type === l[f - 1][1].type &&
l[f][1].start.line !== l[f][1].end.line &&
((h = f + 1), x.push(h), (p._tokenizer = void 0), (p.previous = void 0), (p = p.next));
for (
o.events = [], p ? ((p._tokenizer = void 0), (p.previous = void 0)) : x.pop(), f = x.length;
f--;
) {
const b = l.slice(x[f], x[f + 1]),
C = a.pop();
s.unshift([C, C + b.length - 1]), Xe(e, C, 2, b);
}
for (f = -1; ++f < s.length; ) (c[m + s[f][0]] = m + s[f][1]), (m += s[f][1] - s[f][0] - 1);
return c;
}
const Sm = { tokenize: Im, resolve: Dm },
Cm = { tokenize: km, partial: !0 };
function Dm(e) {
return Kl(e), e;
}
function Im(e, t) {
let n;
return r;
function r(l) {
return e.enter('content'), (n = e.enter('chunkContent', { contentType: 'content' })), i(l);
}
function i(l) {
return l === null ? a(l) : G(l) ? e.check(Cm, o, a)(l) : (e.consume(l), i);
}
function a(l) {
return e.exit('chunkContent'), e.exit('content'), t(l);
}
function o(l) {
return (
e.consume(l),
e.exit('chunkContent'),
(n.next = e.enter('chunkContent', { contentType: 'content', previous: n })),
(n = n.next),
i
);
}
}
function km(e, t, n) {
const r = this;
return i;
function i(o) {
return (
e.exit('chunkContent'),
e.enter('lineEnding'),
e.consume(o),
e.exit('lineEnding'),
ae(e, a, 'linePrefix')
);
}
function a(o) {
if (o === null || G(o)) return n(o);
const l = r.events[r.events.length - 1];
return !r.parser.constructs.disable.null.includes('codeIndented') &&
l &&
l[1].type === 'linePrefix' &&
l[2].sliceSerialize(l[1], !0).length >= 4
? t(o)
: e.interrupt(r.parser.constructs.flow, n, t)(o);
}
}
function Yl(e, t, n, r, i, a, o, l, s) {
const c = s || Number.POSITIVE_INFINITY;
let d = 0;
return u;
function u(b) {
return b === 60
? (e.enter(r), e.enter(i), e.enter(a), e.consume(b), e.exit(a), f)
: b === null || b === 32 || b === 41 || Kr(b)
? n(b)
: (e.enter(r),
e.enter(o),
e.enter(l),
e.enter('chunkString', { contentType: 'string' }),
h(b));
}
function f(b) {
return b === 62
? (e.enter(a), e.consume(b), e.exit(a), e.exit(i), e.exit(r), t)
: (e.enter(l), e.enter('chunkString', { contentType: 'string' }), p(b));
}
function p(b) {
return b === 62
? (e.exit('chunkString'), e.exit(l), f(b))
: b === null || b === 60 || G(b)
? n(b)
: (e.consume(b), b === 92 ? m : p);
}
function m(b) {
return b === 60 || b === 62 || b === 92 ? (e.consume(b), p) : p(b);
}
function h(b) {
return !d && (b === null || b === 41 || Ee(b))
? (e.exit('chunkString'), e.exit(l), e.exit(o), e.exit(r), t(b))
: d < c && b === 40
? (e.consume(b), d++, h)
: b === 41
? (e.consume(b), d--, h)
: b === null || b === 32 || b === 40 || Kr(b)
? n(b)
: (e.consume(b), b === 92 ? x : h);
}
function x(b) {
return b === 40 || b === 41 || b === 92 ? (e.consume(b), h) : h(b);
}
}
function Ql(e, t, n, r, i, a) {
const o = this;
let l = 0,
s;
return c;
function c(p) {
return e.enter(r), e.enter(i), e.consume(p), e.exit(i), e.enter(a), d;
}
function d(p) {
return l > 999 ||
p === null ||
p === 91 ||
(p === 93 && !s) ||
(p === 94 && !l && '_hiddenFootnoteSupport' in o.parser.constructs)
? n(p)
: p === 93
? (e.exit(a), e.enter(i), e.consume(p), e.exit(i), e.exit(r), t)
: G(p)
? (e.enter('lineEnding'), e.consume(p), e.exit('lineEnding'), d)
: (e.enter('chunkString', { contentType: 'string' }), u(p));
}
function u(p) {
return p === null || p === 91 || p === 93 || G(p) || l++ > 999
? (e.exit('chunkString'), d(p))
: (e.consume(p), s || (s = !Z(p)), p === 92 ? f : u);
}
function f(p) {
return p === 91 || p === 92 || p === 93 ? (e.consume(p), l++, u) : u(p);
}
}
function Xl(e, t, n, r, i, a) {
let o;
return l;
function l(f) {
return f === 34 || f === 39 || f === 40
? (e.enter(r), e.enter(i), e.consume(f), e.exit(i), (o = f === 40 ? 41 : f), s)
: n(f);
}
function s(f) {
return f === o ? (e.enter(i), e.consume(f), e.exit(i), e.exit(r), t) : (e.enter(a), c(f));
}
function c(f) {
return f === o
? (e.exit(a), s(o))
: f === null
? n(f)
: G(f)
? (e.enter('lineEnding'), e.consume(f), e.exit('lineEnding'), ae(e, c, 'linePrefix'))
: (e.enter('chunkString', { contentType: 'string' }), d(f));
}
function d(f) {
return f === o || f === null || G(f)
? (e.exit('chunkString'), c(f))
: (e.consume(f), f === 92 ? u : d);
}
function u(f) {
return f === o || f === 92 ? (e.consume(f), d) : d(f);
}
}
function Wt(e, t) {
let n;
return r;
function r(i) {
return G(i)
? (e.enter('lineEnding'), e.consume(i), e.exit('lineEnding'), (n = !0), r)
: Z(i)
? ae(e, r, n ? 'linePrefix' : 'lineSuffix')(i)
: t(i);
}
}
function It(e) {
return e
.replace(/[\t\n\r ]+/g, ' ')
.replace(/^ | $/g, '')
.toLowerCase()
.toUpperCase();
}
const Em = { name: 'definition', tokenize: Am },
Pm = { tokenize: Nm, partial: !0 };
function Am(e, t, n) {
const r = this;
let i;
return a;
function a(p) {
return e.enter('definition'), o(p);
}
function o(p) {
return Ql.call(
r,
e,
l,
n,
'definitionLabel',
'definitionLabelMarker',
'definitionLabelString'
)(p);
}
function l(p) {
return (
(i = It(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))),
p === 58 ? (e.enter('definitionMarker'), e.consume(p), e.exit('definitionMarker'), s) : n(p)
);
}
function s(p) {
return Ee(p) ? Wt(e, c)(p) : c(p);
}
function c(p) {
return Yl(
e,
d,
n,
'definitionDestination',
'definitionDestinationLiteral',
'definitionDestinationLiteralMarker',
'definitionDestinationRaw',
'definitionDestinationString'
)(p);
}
function d(p) {
return e.attempt(Pm, u, u)(p);
}
function u(p) {
return Z(p) ? ae(e, f, 'whitespace')(p) : f(p);
}
function f(p) {
return p === null || G(p) ? (e.exit('definition'), r.parser.defined.push(i), t(p)) : n(p);
}
}
function Nm(e, t, n) {
return r;
function r(l) {
return Ee(l) ? Wt(e, i)(l) : n(l);
}
function i(l) {
return Xl(e, a, n, 'definitionTitle', 'definitionTitleMarker', 'definitionTitleString')(l);
}
function a(l) {
return Z(l) ? ae(e, o, 'whitespace')(l) : o(l);
}
function o(l) {
return l === null || G(l) ? t(l) : n(l);
}
}
const Om = { name: 'hardBreakEscape', tokenize: Tm };
function Tm(e, t, n) {
return r;
function r(a) {
return e.enter('hardBreakEscape'), e.consume(a), i;
}
function i(a) {
return G(a) ? (e.exit('hardBreakEscape'), t(a)) : n(a);
}
}
const Bm = { name: 'headingAtx', tokenize: Fm, resolve: Rm };
function Rm(e, t) {
let n = e.length - 2,
r = 3,
i,
a;
return (
e[r][1].type === 'whitespace' && (r += 2),
n - 2 > r && e[n][1].type === 'whitespace' && (n -= 2),
e[n][1].type === 'atxHeadingSequence' &&
(r === n - 1 || (n - 4 > r && e[n - 2][1].type === 'whitespace')) &&
(n -= r + 1 === n ? 2 : 4),
n > r &&
((i = { type: 'atxHeadingText', start: e[r][1].start, end: e[n][1].end }),
(a = { type: 'chunkText', start: e[r][1].start, end: e[n][1].end, contentType: 'text' }),
Xe(e, r, n - r + 1, [
['enter', i, t],
['enter', a, t],
['exit', a, t],
['exit', i, t],
])),
e
);
}
function Fm(e, t, n) {
let r = 0;
return i;
function i(d) {
return e.enter('atxHeading'), a(d);
}
function a(d) {
return e.enter('atxHeadingSequence'), o(d);
}
function o(d) {
return d === 35 && r++ < 6
? (e.consume(d), o)
: d === null || Ee(d)
? (e.exit('atxHeadingSequence'), l(d))
: n(d);
}
function l(d) {
return d === 35
? (e.enter('atxHeadingSequence'), s(d))
: d === null || G(d)
? (e.exit('atxHeading'), t(d))
: Z(d)
? ae(e, l, 'whitespace')(d)
: (e.enter('atxHeadingText'), c(d));
}
function s(d) {
return d === 35 ? (e.consume(d), s) : (e.exit('atxHeadingSequence'), l(d));
}
function c(d) {
return d === null || d === 35 || Ee(d) ? (e.exit('atxHeadingText'), l(d)) : (e.consume(d), c);
}
}
const Lm = [
'address',
'article',
'aside',
'base',
'basefont',
'blockquote',
'body',
'caption',
'center',
'col',
'colgroup',
'dd',
'details',
'dialog',
'dir',
'div',
'dl',
'dt',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'frame',
'frameset',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'head',
'header',
'hr',
'html',
'iframe',
'legend',
'li',
'link',
'main',
'menu',
'menuitem',
'nav',
'noframes',
'ol',
'optgroup',
'option',
'p',
'param',
'search',
'section',
'summary',
'table',
'tbody',
'td',
'tfoot',
'th',
'thead',
'title',
'tr',
'track',
'ul',
],
_a = ['pre', 'script', 'style', 'textarea'],
Mm = { name: 'htmlFlow', tokenize: Hm, resolveTo: $m, concrete: !0 },
jm = { tokenize: Gm, partial: !0 },
zm = { tokenize: Um, partial: !0 };
function $m(e) {
let t = e.length;
for (; t-- && !(e[t][0] === 'enter' && e[t][1].type === 'htmlFlow'); );
return (
t > 1 &&
e[t - 2][1].type === 'linePrefix' &&
((e[t][1].start = e[t - 2][1].start),
(e[t + 1][1].start = e[t - 2][1].start),
e.splice(t - 2, 2)),
e
);
}
function Hm(e, t, n) {
const r = this;
let i, a, o, l, s;
return c;
function c(v) {
return d(v);
}
function d(v) {
return e.enter('htmlFlow'), e.enter('htmlFlowData'), e.consume(v), u;
}
function u(v) {
return v === 33
? (e.consume(v), f)
: v === 47
? (e.consume(v), (a = !0), h)
: v === 63
? (e.consume(v), (i = 3), r.interrupt ? t : y)
: Qe(v)
? (e.consume(v), (o = String.fromCharCode(v)), x)
: n(v);
}
function f(v) {
return v === 45
? (e.consume(v), (i = 2), p)
: v === 91
? (e.consume(v), (i = 5), (l = 0), m)
: Qe(v)
? (e.consume(v), (i = 4), r.interrupt ? t : y)
: n(v);
}
function p(v) {
return v === 45 ? (e.consume(v), r.interrupt ? t : y) : n(v);
}
function m(v) {
const Q = 'CDATA[';
return v === Q.charCodeAt(l++)
? (e.consume(v), l === Q.length ? (r.interrupt ? t : R) : m)
: n(v);
}
function h(v) {
return Qe(v) ? (e.consume(v), (o = String.fromCharCode(v)), x) : n(v);
}
function x(v) {
if (v === null || v === 47 || v === 62 || Ee(v)) {
const Q = v === 47,
oe = o.toLowerCase();
return !Q && !a && _a.includes(oe)
? ((i = 1), r.interrupt ? t(v) : R(v))
: Lm.includes(o.toLowerCase())
? ((i = 6), Q ? (e.consume(v), b) : r.interrupt ? t(v) : R(v))
: ((i = 7), r.interrupt && !r.parser.lazy[r.now().line] ? n(v) : a ? C(v) : S(v));
}
return v === 45 || Te(v) ? (e.consume(v), (o += String.fromCharCode(v)), x) : n(v);
}
function b(v) {
return v === 62 ? (e.consume(v), r.interrupt ? t : R) : n(v);
}
function C(v) {
return Z(v) ? (e.consume(v), C) : V(v);
}
function S(v) {
return v === 47
? (e.consume(v), V)
: v === 58 || v === 95 || Qe(v)
? (e.consume(v), D)
: Z(v)
? (e.consume(v), S)
: V(v);
}
function D(v) {
return v === 45 || v === 46 || v === 58 || v === 95 || Te(v) ? (e.consume(v), D) : E(v);
}
function E(v) {
return v === 61 ? (e.consume(v), w) : Z(v) ? (e.consume(v), E) : S(v);
}
function w(v) {
return v === null || v === 60 || v === 61 || v === 62 || v === 96
? n(v)
: v === 34 || v === 39
? (e.consume(v), (s = v), O)
: Z(v)
? (e.consume(v), w)
: L(v);
}
function O(v) {
return v === s ? (e.consume(v), (s = null), F) : v === null || G(v) ? n(v) : (e.consume(v), O);
}
function L(v) {
return v === null ||
v === 34 ||
v === 39 ||
v === 47 ||
v === 60 ||
v === 61 ||
v === 62 ||
v === 96 ||
Ee(v)
? E(v)
: (e.consume(v), L);
}
function F(v) {
return v === 47 || v === 62 || Z(v) ? S(v) : n(v);
}
function V(v) {
return v === 62 ? (e.consume(v), A) : n(v);
}
function A(v) {
return v === null || G(v) ? R(v) : Z(v) ? (e.consume(v), A) : n(v);
}
function R(v) {
return v === 45 && i === 2
? (e.consume(v), J)
: v === 60 && i === 1
? (e.consume(v), ie)
: v === 62 && i === 4
? (e.consume(v), pe)
: v === 63 && i === 3
? (e.consume(v), y)
: v === 93 && i === 5
? (e.consume(v), me)
: G(v) && (i === 6 || i === 7)
? (e.exit('htmlFlowData'), e.check(jm, k, Y)(v))
: v === null || G(v)
? (e.exit('htmlFlowData'), Y(v))
: (e.consume(v), R);
}
function Y(v) {
return e.check(zm, q, k)(v);
}
function q(v) {
return e.enter('lineEnding'), e.consume(v), e.exit('lineEnding'), $;
}
function $(v) {
return v === null || G(v) ? Y(v) : (e.enter('htmlFlowData'), R(v));
}
function J(v) {
return v === 45 ? (e.consume(v), y) : R(v);
}
function ie(v) {
return v === 47 ? (e.consume(v), (o = ''), ce) : R(v);
}
function ce(v) {
if (v === 62) {
const Q = o.toLowerCase();
return _a.includes(Q) ? (e.consume(v), pe) : R(v);
}
return Qe(v) && o.length < 8 ? (e.consume(v), (o += String.fromCharCode(v)), ce) : R(v);
}
function me(v) {
return v === 93 ? (e.consume(v), y) : R(v);
}
function y(v) {
return v === 62 ? (e.consume(v), pe) : v === 45 && i === 2 ? (e.consume(v), y) : R(v);
}
function pe(v) {
return v === null || G(v) ? (e.exit('htmlFlowData'), k(v)) : (e.consume(v), pe);
}
function k(v) {
return e.exit('htmlFlow'), t(v);
}
}
function Um(e, t, n) {
const r = this;
return i;
function i(o) {
return G(o) ? (e.enter('lineEnding'), e.consume(o), e.exit('lineEnding'), a) : n(o);
}
function a(o) {
return r.parser.lazy[r.now().line] ? n(o) : t(o);
}
}
function Gm(e, t, n) {
return r;
function r(i) {
return e.enter('lineEnding'), e.consume(i), e.exit('lineEnding'), e.attempt(er, t, n);
}
}
const Wm = { name: 'htmlText', tokenize: qm };
function qm(e, t, n) {
const r = this;
let i, a, o;
return l;
function l(y) {
return e.enter('htmlText'), e.enter('htmlTextData'), e.consume(y), s;
}
function s(y) {
return y === 33
? (e.consume(y), c)
: y === 47
? (e.consume(y), E)
: y === 63
? (e.consume(y), S)
: Qe(y)
? (e.consume(y), L)
: n(y);
}
function c(y) {
return y === 45
? (e.consume(y), d)
: y === 91
? (e.consume(y), (a = 0), m)
: Qe(y)
? (e.consume(y), C)
: n(y);
}
function d(y) {
return y === 45 ? (e.consume(y), p) : n(y);
}
function u(y) {
return y === null
? n(y)
: y === 45
? (e.consume(y), f)
: G(y)
? ((o = u), ie(y))
: (e.consume(y), u);
}
function f(y) {
return y === 45 ? (e.consume(y), p) : u(y);
}
function p(y) {
return y === 62 ? J(y) : y === 45 ? f(y) : u(y);
}
function m(y) {
const pe = 'CDATA[';
return y === pe.charCodeAt(a++) ? (e.consume(y), a === pe.length ? h : m) : n(y);
}
function h(y) {
return y === null
? n(y)
: y === 93
? (e.consume(y), x)
: G(y)
? ((o = h), ie(y))
: (e.consume(y), h);
}
function x(y) {
return y === 93 ? (e.consume(y), b) : h(y);
}
function b(y) {
return y === 62 ? J(y) : y === 93 ? (e.consume(y), b) : h(y);
}
function C(y) {
return y === null || y === 62 ? J(y) : G(y) ? ((o = C), ie(y)) : (e.consume(y), C);
}
function S(y) {
return y === null
? n(y)
: y === 63
? (e.consume(y), D)
: G(y)
? ((o = S), ie(y))
: (e.consume(y), S);
}
function D(y) {
return y === 62 ? J(y) : S(y);
}
function E(y) {
return Qe(y) ? (e.consume(y), w) : n(y);
}
function w(y) {
return y === 45 || Te(y) ? (e.consume(y), w) : O(y);
}
function O(y) {
return G(y) ? ((o = O), ie(y)) : Z(y) ? (e.consume(y), O) : J(y);
}
function L(y) {
return y === 45 || Te(y) ? (e.consume(y), L) : y === 47 || y === 62 || Ee(y) ? F(y) : n(y);
}
function F(y) {
return y === 47
? (e.consume(y), J)
: y === 58 || y === 95 || Qe(y)
? (e.consume(y), V)
: G(y)
? ((o = F), ie(y))
: Z(y)
? (e.consume(y), F)
: J(y);
}
function V(y) {
return y === 45 || y === 46 || y === 58 || y === 95 || Te(y) ? (e.consume(y), V) : A(y);
}
function A(y) {
return y === 61 ? (e.consume(y), R) : G(y) ? ((o = A), ie(y)) : Z(y) ? (e.consume(y), A) : F(y);
}
function R(y) {
return y === null || y === 60 || y === 61 || y === 62 || y === 96
? n(y)
: y === 34 || y === 39
? (e.consume(y), (i = y), Y)
: G(y)
? ((o = R), ie(y))
: Z(y)
? (e.consume(y), R)
: (e.consume(y), q);
}
function Y(y) {
return y === i
? (e.consume(y), (i = void 0), $)
: y === null
? n(y)
: G(y)
? ((o = Y), ie(y))
: (e.consume(y), Y);
}
function q(y) {
return y === null || y === 34 || y === 39 || y === 60 || y === 61 || y === 96
? n(y)
: y === 47 || y === 62 || Ee(y)
? F(y)
: (e.consume(y), q);
}
function $(y) {
return y === 47 || y === 62 || Ee(y) ? F(y) : n(y);
}
function J(y) {
return y === 62 ? (e.consume(y), e.exit('htmlTextData'), e.exit('htmlText'), t) : n(y);
}
function ie(y) {
return e.exit('htmlTextData'), e.enter('lineEnding'), e.consume(y), e.exit('lineEnding'), ce;
}
function ce(y) {
return Z(y)
? ae(
e,
me,
'linePrefix',
r.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4
)(y)
: me(y);
}
function me(y) {
return e.enter('htmlTextData'), o(y);
}
}
const Oi = { name: 'labelEnd', tokenize: Jm, resolveTo: Xm, resolveAll: Qm },
Vm = { tokenize: _m },
Km = { tokenize: Zm },
Ym = { tokenize: eh };
function Qm(e) {
let t = -1;
for (; ++t < e.length; ) {
const n = e[t][1];
(n.type === 'labelImage' || n.type === 'labelLink' || n.type === 'labelEnd') &&
(e.splice(t + 1, n.type === 'labelImage' ? 4 : 2), (n.type = 'data'), t++);
}
return e;
}
function Xm(e, t) {
let n = e.length,
r = 0,
i,
a,
o,
l;
for (; n--; )
if (((i = e[n][1]), a)) {
if (i.type === 'link' || (i.type === 'labelLink' && i._inactive)) break;
e[n][0] === 'enter' && i.type === 'labelLink' && (i._inactive = !0);
} else if (o) {
if (
e[n][0] === 'enter' &&
(i.type === 'labelImage' || i.type === 'labelLink') &&
!i._balanced &&
((a = n), i.type !== 'labelLink')
) {
r = 2;
break;
}
} else i.type === 'labelEnd' && (o = n);
const s = {
type: e[a][1].type === 'labelLink' ? 'link' : 'image',
start: Object.assign({}, e[a][1].start),
end: Object.assign({}, e[e.length - 1][1].end),
},
c = {
type: 'label',
start: Object.assign({}, e[a][1].start),
end: Object.assign({}, e[o][1].end),
},
d = {
type: 'labelText',
start: Object.assign({}, e[a + r + 2][1].end),
end: Object.assign({}, e[o - 2][1].start),
};
return (
(l = [
['enter', s, t],
['enter', c, t],
]),
(l = je(l, e.slice(a + 1, a + r + 3))),
(l = je(l, [['enter', d, t]])),
(l = je(l, Ai(t.parser.constructs.insideSpan.null, e.slice(a + r + 4, o - 3), t))),
(l = je(l, [['exit', d, t], e[o - 2], e[o - 1], ['exit', c, t]])),
(l = je(l, e.slice(o + 1))),
(l = je(l, [['exit', s, t]])),
Xe(e, a, e.length, l),
e
);
}
function Jm(e, t, n) {
const r = this;
let i = r.events.length,
a,
o;
for (; i--; )
if (
(r.events[i][1].type === 'labelImage' || r.events[i][1].type === 'labelLink') &&
!r.events[i][1]._balanced
) {
a = r.events[i][1];
break;
}
return l;
function l(f) {
return a
? a._inactive
? u(f)
: ((o = r.parser.defined.includes(It(r.sliceSerialize({ start: a.end, end: r.now() })))),
e.enter('labelEnd'),
e.enter('labelMarker'),
e.consume(f),
e.exit('labelMarker'),
e.exit('labelEnd'),
s)
: n(f);
}
function s(f) {
return f === 40
? e.attempt(Vm, d, o ? d : u)(f)
: f === 91
? e.attempt(Km, d, o ? c : u)(f)
: o
? d(f)
: u(f);
}
function c(f) {
return e.attempt(Ym, d, u)(f);
}
function d(f) {
return t(f);
}
function u(f) {
return (a._balanced = !0), n(f);
}
}
function _m(e, t, n) {
return r;
function r(u) {
return (
e.enter('resource'), e.enter('resourceMarker'), e.consume(u), e.exit('resourceMarker'), i
);
}
function i(u) {
return Ee(u) ? Wt(e, a)(u) : a(u);
}
function a(u) {
return u === 41
? d(u)
: Yl(
e,
o,
l,
'resourceDestination',
'resourceDestinationLiteral',
'resourceDestinationLiteralMarker',
'resourceDestinationRaw',
'resourceDestinationString',
32
)(u);
}
function o(u) {
return Ee(u) ? Wt(e, s)(u) : d(u);
}
function l(u) {
return n(u);
}
function s(u) {
return u === 34 || u === 39 || u === 40
? Xl(e, c, n, 'resourceTitle', 'resourceTitleMarker', 'resourceTitleString')(u)
: d(u);
}
function c(u) {
return Ee(u) ? Wt(e, d)(u) : d(u);
}
function d(u) {
return u === 41
? (e.enter('resourceMarker'), e.consume(u), e.exit('resourceMarker'), e.exit('resource'), t)
: n(u);
}
}
function Zm(e, t, n) {
const r = this;
return i;
function i(l) {
return Ql.call(r, e, a, o, 'reference', 'referenceMarker', 'referenceString')(l);
}
function a(l) {
return r.parser.defined.includes(
It(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))
)
? t(l)
: n(l);
}
function o(l) {
return n(l);
}
}
function eh(e, t, n) {
return r;
function r(a) {
return (
e.enter('reference'), e.enter('referenceMarker'), e.consume(a), e.exit('referenceMarker'), i
);
}
function i(a) {
return a === 93
? (e.enter('referenceMarker'),
e.consume(a),
e.exit('referenceMarker'),
e.exit('reference'),
t)
: n(a);
}
}
const th = { name: 'labelStartImage', tokenize: nh, resolveAll: Oi.resolveAll };
function nh(e, t, n) {
const r = this;
return i;
function i(l) {
return (
e.enter('labelImage'),
e.enter('labelImageMarker'),
e.consume(l),
e.exit('labelImageMarker'),
a
);
}
function a(l) {
return l === 91
? (e.enter('labelMarker'), e.consume(l), e.exit('labelMarker'), e.exit('labelImage'), o)
: n(l);
}
function o(l) {
return l === 94 && '_hiddenFootnoteSupport' in r.parser.constructs ? n(l) : t(l);
}
}
const rh = { name: 'labelStartLink', tokenize: ih, resolveAll: Oi.resolveAll };
function ih(e, t, n) {
const r = this;
return i;
function i(o) {
return (
e.enter('labelLink'),
e.enter('labelMarker'),
e.consume(o),
e.exit('labelMarker'),
e.exit('labelLink'),
a
);
}
function a(o) {
return o === 94 && '_hiddenFootnoteSupport' in r.parser.constructs ? n(o) : t(o);
}
}
const Tr = { name: 'lineEnding', tokenize: ah };
function ah(e, t) {
return n;
function n(r) {
return e.enter('lineEnding'), e.consume(r), e.exit('lineEnding'), ae(e, t, 'linePrefix');
}
}
const Cn = { name: 'thematicBreak', tokenize: oh };
function oh(e, t, n) {
let r = 0,
i;
return a;
function a(c) {
return e.enter('thematicBreak'), o(c);
}
function o(c) {
return (i = c), l(c);
}
function l(c) {
return c === i
? (e.enter('thematicBreakSequence'), s(c))
: r >= 3 && (c === null || G(c))
? (e.exit('thematicBreak'), t(c))
: n(c);
}
function s(c) {
return c === i
? (e.consume(c), r++, s)
: (e.exit('thematicBreakSequence'), Z(c) ? ae(e, l, 'whitespace')(c) : l(c));
}
}
const Ie = { name: 'list', tokenize: uh, continuation: { tokenize: ch }, exit: ph },
lh = { tokenize: fh, partial: !0 },
sh = { tokenize: dh, partial: !0 };
function uh(e, t, n) {
const r = this,
i = r.events[r.events.length - 1];
let a = i && i[1].type === 'linePrefix' ? i[2].sliceSerialize(i[1], !0).length : 0,
o = 0;
return l;
function l(p) {
const m =
r.containerState.type || (p === 42 || p === 43 || p === 45 ? 'listUnordered' : 'listOrdered');
if (m === 'listUnordered' ? !r.containerState.marker || p === r.containerState.marker : Yr(p)) {
if (
(r.containerState.type || ((r.containerState.type = m), e.enter(m, { _container: !0 })),
m === 'listUnordered')
)
return e.enter('listItemPrefix'), p === 42 || p === 45 ? e.check(Cn, n, c)(p) : c(p);
if (!r.interrupt || p === 49)
return e.enter('listItemPrefix'), e.enter('listItemValue'), s(p);
}
return n(p);
}
function s(p) {
return Yr(p) && ++o < 10
? (e.consume(p), s)
: (!r.interrupt || o < 2) &&
(r.containerState.marker ? p === r.containerState.marker : p === 41 || p === 46)
? (e.exit('listItemValue'), c(p))
: n(p);
}
function c(p) {
return (
e.enter('listItemMarker'),
e.consume(p),
e.exit('listItemMarker'),
(r.containerState.marker = r.containerState.marker || p),
e.check(er, r.interrupt ? n : d, e.attempt(lh, f, u))
);
}
function d(p) {
return (r.containerState.initialBlankLine = !0), a++, f(p);
}
function u(p) {
return Z(p)
? (e.enter('listItemPrefixWhitespace'), e.consume(p), e.exit('listItemPrefixWhitespace'), f)
: n(p);
}
function f(p) {
return (
(r.containerState.size = a + r.sliceSerialize(e.exit('listItemPrefix'), !0).length), t(p)
);
}
}
function ch(e, t, n) {
const r = this;
return (r.containerState._closeFlow = void 0), e.check(er, i, a);
function i(l) {
return (
(r.containerState.furtherBlankLines =
r.containerState.furtherBlankLines || r.containerState.initialBlankLine),
ae(e, t, 'listItemIndent', r.containerState.size + 1)(l)
);
}
function a(l) {
return r.containerState.furtherBlankLines || !Z(l)
? ((r.containerState.furtherBlankLines = void 0),
(r.containerState.initialBlankLine = void 0),
o(l))
: ((r.containerState.furtherBlankLines = void 0),
(r.containerState.initialBlankLine = void 0),
e.attempt(sh, t, o)(l));
}
function o(l) {
return (
(r.containerState._closeFlow = !0),
(r.interrupt = void 0),
ae(
e,
e.attempt(Ie, t, n),
'linePrefix',
r.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4
)(l)
);
}
}
function dh(e, t, n) {
const r = this;
return ae(e, i, 'listItemIndent', r.containerState.size + 1);
function i(a) {
const o = r.events[r.events.length - 1];
return o &&
o[1].type === 'listItemIndent' &&
o[2].sliceSerialize(o[1], !0).length === r.containerState.size
? t(a)
: n(a);
}
}
function ph(e) {
e.exit(this.containerState.type);
}
function fh(e, t, n) {
const r = this;
return ae(
e,
i,
'listItemPrefixWhitespace',
r.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4 + 1
);
function i(a) {
const o = r.events[r.events.length - 1];
return !Z(a) && o && o[1].type === 'listItemPrefixWhitespace' ? t(a) : n(a);
}
}
const Za = { name: 'setextUnderline', tokenize: mh, resolveTo: gh };
function gh(e, t) {
let n = e.length,
r,
i,
a;
for (; n--; )
if (e[n][0] === 'enter') {
if (e[n][1].type === 'content') {
r = n;
break;
}
e[n][1].type === 'paragraph' && (i = n);
} else
e[n][1].type === 'content' && e.splice(n, 1), !a && e[n][1].type === 'definition' && (a = n);
const o = {
type: 'setextHeading',
start: Object.assign({}, e[i][1].start),
end: Object.assign({}, e[e.length - 1][1].end),
};
return (
(e[i][1].type = 'setextHeadingText'),
a
? (e.splice(i, 0, ['enter', o, t]),
e.splice(a + 1, 0, ['exit', e[r][1], t]),
(e[r][1].end = Object.assign({}, e[a][1].end)))
: (e[r][1] = o),
e.push(['exit', o, t]),
e
);
}
function mh(e, t, n) {
const r = this;
let i;
return a;
function a(c) {
let d = r.events.length,
u;
for (; d--; )
if (
r.events[d][1].type !== 'lineEnding' &&
r.events[d][1].type !== 'linePrefix' &&
r.events[d][1].type !== 'content'
) {
u = r.events[d][1].type === 'paragraph';
break;
}
return !r.parser.lazy[r.now().line] && (r.interrupt || u)
? (e.enter('setextHeadingLine'), (i = c), o(c))
: n(c);
}
function o(c) {
return e.enter('setextHeadingLineSequence'), l(c);
}
function l(c) {
return c === i
? (e.consume(c), l)
: (e.exit('setextHeadingLineSequence'), Z(c) ? ae(e, s, 'lineSuffix')(c) : s(c));
}
function s(c) {
return c === null || G(c) ? (e.exit('setextHeadingLine'), t(c)) : n(c);
}
}
const hh = { tokenize: vh };
function vh(e) {
const t = this,
n = e.attempt(
er,
r,
e.attempt(
this.parser.constructs.flowInitial,
i,
ae(e, e.attempt(this.parser.constructs.flow, i, e.attempt(Sm, i)), 'linePrefix')
)
);
return n;
function r(a) {
if (a === null) {
e.consume(a);
return;
}
return (
e.enter('lineEndingBlank'),
e.consume(a),
e.exit('lineEndingBlank'),
(t.currentConstruct = void 0),
n
);
}
function i(a) {
if (a === null) {
e.consume(a);
return;
}
return (
e.enter('lineEnding'), e.consume(a), e.exit('lineEnding'), (t.currentConstruct = void 0), n
);
}
}
const bh = { resolveAll: _l() },
yh = Jl('string'),
xh = Jl('text');
function Jl(e) {
return { tokenize: t, resolveAll: _l(e === 'text' ? wh : void 0) };
function t(n) {
const r = this,
i = this.parser.constructs[e],
a = n.attempt(i, o, l);
return o;
function o(d) {
return c(d) ? a(d) : l(d);
}
function l(d) {
if (d === null) {
n.consume(d);
return;
}
return n.enter('data'), n.consume(d), s;
}
function s(d) {
return c(d) ? (n.exit('data'), a(d)) : (n.consume(d), s);
}
function c(d) {
if (d === null) return !0;
const u = i[d];
let f = -1;
if (u)
for (; ++f < u.length; ) {
const p = u[f];
if (!p.previous || p.previous.call(r, r.previous)) return !0;
}
return !1;
}
}
}
function _l(e) {
return t;
function t(n, r) {
let i = -1,
a;
for (; ++i <= n.length; )
a === void 0
? n[i] && n[i][1].type === 'data' && ((a = i), i++)
: (!n[i] || n[i][1].type !== 'data') &&
(i !== a + 2 &&
((n[a][1].end = n[i - 1][1].end), n.splice(a + 2, i - a - 2), (i = a + 2)),
(a = void 0));
return e ? e(n, r) : n;
}
}
function wh(e, t) {
let n = 0;
for (; ++n <= e.length; )
if ((n === e.length || e[n][1].type === 'lineEnding') && e[n - 1][1].type === 'data') {
const r = e[n - 1][1],
i = t.sliceStream(r);
let a = i.length,
o = -1,
l = 0,
s;
for (; a--; ) {
const c = i[a];
if (typeof c == 'string') {
for (o = c.length; c.charCodeAt(o - 1) === 32; ) l++, o--;
if (o) break;
o = -1;
} else if (c === -2) (s = !0), l++;
else if (c !== -1) {
a++;
break;
}
}
if (l) {
const c = {
type: n === e.length || s || l < 2 ? 'lineSuffix' : 'hardBreakTrailing',
start: {
line: r.end.line,
column: r.end.column - l,
offset: r.end.offset - l,
_index: r.start._index + a,
_bufferIndex: a ? o : r.start._bufferIndex + o,
},
end: Object.assign({}, r.end),
};
(r.end = Object.assign({}, c.start)),
r.start.offset === r.end.offset
? Object.assign(r, c)
: (e.splice(n, 0, ['enter', c, t], ['exit', c, t]), (n += 2));
}
n++;
}
return e;
}
function Sh(e, t, n) {
let r = Object.assign(n ? Object.assign({}, n) : { line: 1, column: 1, offset: 0 }, {
_index: 0,
_bufferIndex: -1,
});
const i = {},
a = [];
let o = [],
l = [];
const s = {
consume: C,
enter: S,
exit: D,
attempt: O(E),
check: O(w),
interrupt: O(w, { interrupt: !0 }),
},
c = {
previous: null,
code: null,
containerState: {},
events: [],
parser: e,
sliceStream: p,
sliceSerialize: f,
now: m,
defineSkip: h,
write: u,
};
let d = t.tokenize.call(c, s);
return t.resolveAll && a.push(t), c;
function u(A) {
return (
(o = je(o, A)),
x(),
o[o.length - 1] !== null ? [] : (L(t, 0), (c.events = Ai(a, c.events, c)), c.events)
);
}
function f(A, R) {
return Dh(p(A), R);
}
function p(A) {
return Ch(o, A);
}
function m() {
const { line: A, column: R, offset: Y, _index: q, _bufferIndex: $ } = r;
return { line: A, column: R, offset: Y, _index: q, _bufferIndex: $ };
}
function h(A) {
(i[A.line] = A.column), V();
}
function x() {
let A;
for (; r._index < o.length; ) {
const R = o[r._index];
if (typeof R == 'string')
for (
A = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0);
r._index === A && r._bufferIndex < R.length;
)
b(R.charCodeAt(r._bufferIndex));
else b(R);
}
}
function b(A) {
d = d(A);
}
function C(A) {
G(A)
? (r.line++, (r.column = 1), (r.offset += A === -3 ? 2 : 1), V())
: A !== -1 && (r.column++, r.offset++),
r._bufferIndex < 0
? r._index++
: (r._bufferIndex++,
r._bufferIndex === o[r._index].length && ((r._bufferIndex = -1), r._index++)),
(c.previous = A);
}
function S(A, R) {
const Y = R || {};
return (Y.type = A), (Y.start = m()), c.events.push(['enter', Y, c]), l.push(Y), Y;
}
function D(A) {
const R = l.pop();
return (R.end = m()), c.events.push(['exit', R, c]), R;
}
function E(A, R) {
L(A, R.from);
}
function w(A, R) {
R.restore();
}
function O(A, R) {
return Y;
function Y(q, $, J) {
let ie, ce, me, y;
return Array.isArray(q) ? k(q) : 'tokenize' in q ? k([q]) : pe(q);
function pe(ee) {
return he;
function he(fe) {
const Le = fe !== null && ee[fe],
Se = fe !== null && ee.null,
Ve = [
...(Array.isArray(Le) ? Le : Le ? [Le] : []),
...(Array.isArray(Se) ? Se : Se ? [Se] : []),
];
return k(Ve)(fe);
}
}
function k(ee) {
return (ie = ee), (ce = 0), ee.length === 0 ? J : v(ee[ce]);
}
function v(ee) {
return he;
function he(fe) {
return (
(y = F()),
(me = ee),
ee.partial || (c.currentConstruct = ee),
ee.name && c.parser.constructs.disable.null.includes(ee.name)
? oe()
: ee.tokenize.call(R ? Object.assign(Object.create(c), R) : c, s, Q, oe)(fe)
);
}
}
function Q(ee) {
return A(me, y), $;
}
function oe(ee) {
return y.restore(), ++ce < ie.length ? v(ie[ce]) : J;
}
}
}
function L(A, R) {
A.resolveAll && !a.includes(A) && a.push(A),
A.resolve && Xe(c.events, R, c.events.length - R, A.resolve(c.events.slice(R), c)),
A.resolveTo && (c.events = A.resolveTo(c.events, c));
}
function F() {
const A = m(),
R = c.previous,
Y = c.currentConstruct,
q = c.events.length,
$ = Array.from(l);
return { restore: J, from: q };
function J() {
(r = A), (c.previous = R), (c.currentConstruct = Y), (c.events.length = q), (l = $), V();
}
}
function V() {
r.line in i && r.column < 2 && ((r.column = i[r.line]), (r.offset += i[r.line] - 1));
}
}
function Ch(e, t) {
const n = t.start._index,
r = t.start._bufferIndex,
i = t.end._index,
a = t.end._bufferIndex;
let o;
if (n === i) o = [e[n].slice(r, a)];
else {
if (((o = e.slice(n, i)), r > -1)) {
const l = o[0];
typeof l == 'string' ? (o[0] = l.slice(r)) : o.shift();
}
a > 0 && o.push(e[i].slice(0, a));
}
return o;
}
function Dh(e, t) {
let n = -1;
const r = [];
let i;
for (; ++n < e.length; ) {
const a = e[n];
let o;
if (typeof a == 'string') o = a;
else
switch (a) {
case -5: {
o = '\r';
break;
}
case -4: {
o = `
`;
break;
}
case -3: {
o = `\r
`;
break;
}
case -2: {
o = t ? ' ' : ' ';
break;
}
case -1: {
if (!t && i) continue;
o = ' ';
break;
}
default:
o = String.fromCharCode(a);
}
(i = a === -2), r.push(o);
}
return r.join('');
}
const Ih = {
[42]: Ie,
[43]: Ie,
[45]: Ie,
[48]: Ie,
[49]: Ie,
[50]: Ie,
[51]: Ie,
[52]: Ie,
[53]: Ie,
[54]: Ie,
[55]: Ie,
[56]: Ie,
[57]: Ie,
[62]: Wl,
},
kh = { [91]: Em },
Eh = { [-2]: Or, [-1]: Or, [32]: Or },
Ph = { [35]: Bm, [42]: Cn, [45]: [Za, Cn], [60]: Mm, [61]: Za, [95]: Cn, [96]: Ja, [126]: Ja },
Ah = { [38]: Vl, [92]: ql },
Nh = {
[-5]: Tr,
[-4]: Tr,
[-3]: Tr,
[33]: th,
[38]: Vl,
[42]: Qr,
[60]: [im, Wm],
[91]: rh,
[92]: [Om, ql],
[93]: Oi,
[95]: Qr,
[96]: vm,
},
Oh = { null: [Qr, bh] },
Th = { null: [42, 95] },
Bh = { null: [] },
Rh = Object.freeze(
Object.defineProperty(
{
__proto__: null,
attentionMarkers: Th,
contentInitial: kh,
disable: Bh,
document: Ih,
flow: Ph,
flowInitial: Eh,
insideSpan: Oh,
string: Ah,
text: Nh,
},
Symbol.toStringTag,
{ value: 'Module' }
)
);
function Fh(e) {
const n = Ug([Rh, ...((e || {}).extensions || [])]),
r = {
defined: [],
lazy: {},
constructs: n,
content: i(Jg),
document: i(Zg),
flow: i(hh),
string: i(yh),
text: i(xh),
};
return r;
function i(a) {
return o;
function o(l) {
return Sh(r, a, l);
}
}
}
const eo = /[\0\t\n\r]/g;
function Lh() {
let e = 1,
t = '',
n = !0,
r;
return i;
function i(a, o, l) {
const s = [];
let c, d, u, f, p;
for (
a = t + a.toString(o), u = 0, t = '', n && (a.charCodeAt(0) === 65279 && u++, (n = void 0));
u < a.length;
) {
if (
((eo.lastIndex = u),
(c = eo.exec(a)),
(f = c && c.index !== void 0 ? c.index : a.length),
(p = a.charCodeAt(f)),
!c)
) {
t = a.slice(u);
break;
}
if (p === 10 && u === f && r) s.push(-3), (r = void 0);
else
switch (
(r && (s.push(-5), (r = void 0)), u < f && (s.push(a.slice(u, f)), (e += f - u)), p)
) {
case 0: {
s.push(65533), e++;
break;
}
case 9: {
for (d = Math.ceil(e / 4) * 4, s.push(-2); e++ < d; ) s.push(-1);
break;
}
case 10: {
s.push(-4), (e = 1);
break;
}
default:
(r = !0), (e = 1);
}
u = f + 1;
}
return l && (r && s.push(-5), t && s.push(t), s.push(null)), s;
}
}
function Mh(e) {
for (; !Kl(e); );
return e;
}
function Zl(e, t) {
const n = Number.parseInt(e, t);
return n < 9 ||
n === 11 ||
(n > 13 && n < 32) ||
(n > 126 && n < 160) ||
(n > 55295 && n < 57344) ||
(n > 64975 && n < 65008) ||
(n & 65535) === 65535 ||
(n & 65535) === 65534 ||
n > 1114111
? '�'
: String.fromCharCode(n);
}
const jh = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
function zh(e) {
return e.replace(jh, $h);
}
function $h(e, t, n) {
if (t) return t;
if (n.charCodeAt(0) === 35) {
const i = n.charCodeAt(1),
a = i === 120 || i === 88;
return Zl(n.slice(a ? 2 : 1), a ? 16 : 10);
}
return Ni(n) || e;
}
const es = {}.hasOwnProperty,
Hh = function (e, t, n) {
return (
typeof t != 'string' && ((n = t), (t = void 0)),
Uh(n)(Mh(Fh(n).document().write(Lh()(e, t, !0))))
);
};
function Uh(e) {
const t = {
transforms: [],
canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],
enter: {
autolink: l(it),
autolinkProtocol: A,
autolinkEmail: A,
atxHeading: l(nt),
blockQuote: l(Ve),
characterEscape: A,
characterReference: A,
codeFenced: l(et),
codeFencedFenceInfo: s,
codeFencedFenceMeta: s,
codeIndented: l(et, s),
codeText: l(ft, s),
codeTextData: A,
data: A,
codeFlowValue: A,
definition: l(tt),
definitionDestinationString: s,
definitionLabelString: s,
definitionTitleString: s,
emphasis: l(Je),
hardBreakEscape: l(rt),
hardBreakTrailing: l(rt),
htmlFlow: l(Ft, s),
htmlFlowData: A,
htmlText: l(Ft, s),
htmlTextData: A,
image: l(Ke),
label: s,
link: l(it),
listItem: l(gt),
listItemValue: m,
listOrdered: l(dn, p),
listUnordered: l(dn),
paragraph: l(pn),
reference: oe,
referenceString: s,
resourceDestinationString: s,
resourceTitleString: s,
setextHeading: l(nt),
strong: l(_e),
thematicBreak: l(Ct),
},
exit: {
atxHeading: d(),
atxHeadingSequence: O,
autolink: d(),
autolinkEmail: Se,
autolinkProtocol: Le,
blockQuote: d(),
characterEscapeValue: R,
characterReferenceMarkerHexadecimal: he,
characterReferenceMarkerNumeric: he,
characterReferenceValue: fe,
codeFenced: d(C),
codeFencedFence: b,
codeFencedFenceInfo: h,
codeFencedFenceMeta: x,
codeFlowValue: R,
codeIndented: d(S),
codeText: d(ie),
codeTextData: R,
data: R,
definition: d(),
definitionDestinationString: w,
definitionLabelString: D,
definitionTitleString: E,
emphasis: d(),
hardBreakEscape: d(q),
hardBreakTrailing: d(q),
htmlFlow: d($),
htmlFlowData: R,
htmlText: d(J),
htmlTextData: R,
image: d(me),
label: pe,
labelText: y,
lineEnding: Y,
link: d(ce),
listItem: d(),
listOrdered: d(),
listUnordered: d(),
paragraph: d(),
referenceString: ee,
resourceDestinationString: k,
resourceTitleString: v,
resource: Q,
setextHeading: d(V),
setextHeadingLineSequence: F,
setextHeadingText: L,
strong: d(),
thematicBreak: d(),
},
};
ts(t, (e || {}).mdastExtensions || []);
const n = {};
return r;
function r(I) {
let T = { type: 'root', children: [] };
const z = {
stack: [T],
tokenStack: [],
config: t,
enter: c,
exit: u,
buffer: s,
resume: f,
setData: a,
getData: o,
},
U = [];
let H = -1;
for (; ++H < I.length; )
if (I[H][1].type === 'listOrdered' || I[H][1].type === 'listUnordered')
if (I[H][0] === 'enter') U.push(H);
else {
const de = U.pop();
H = i(I, de, H);
}
for (H = -1; ++H < I.length; ) {
const de = t[I[H][0]];
es.call(de, I[H][1].type) &&
de[I[H][1].type].call(
Object.assign({ sliceSerialize: I[H][2].sliceSerialize }, z),
I[H][1]
);
}
if (z.tokenStack.length > 0) {
const de = z.tokenStack[z.tokenStack.length - 1];
(de[1] || to).call(z, void 0, de[0]);
}
for (
T.position = {
start: ot(I.length > 0 ? I[0][1].start : { line: 1, column: 1, offset: 0 }),
end: ot(I.length > 0 ? I[I.length - 2][1].end : { line: 1, column: 1, offset: 0 }),
},
H = -1;
++H < t.transforms.length;
)
T = t.transforms[H](T) || T;
return T;
}
function i(I, T, z) {
let U = T - 1,
H = -1,
de = !1,
De,
Pe,
Ze,
Ae;
for (; ++U <= z; ) {
const le = I[U];
if (
(le[1].type === 'listUnordered' ||
le[1].type === 'listOrdered' ||
le[1].type === 'blockQuote'
? (le[0] === 'enter' ? H++ : H--, (Ae = void 0))
: le[1].type === 'lineEndingBlank'
? le[0] === 'enter' && (De && !Ae && !H && !Ze && (Ze = U), (Ae = void 0))
: le[1].type === 'linePrefix' ||
le[1].type === 'listItemValue' ||
le[1].type === 'listItemMarker' ||
le[1].type === 'listItemPrefix' ||
le[1].type === 'listItemPrefixWhitespace' ||
(Ae = void 0),
(!H && le[0] === 'enter' && le[1].type === 'listItemPrefix') ||
(H === -1 &&
le[0] === 'exit' &&
(le[1].type === 'listUnordered' || le[1].type === 'listOrdered')))
) {
if (De) {
let ht = U;
for (Pe = void 0; ht--; ) {
const ue = I[ht];
if (ue[1].type === 'lineEnding' || ue[1].type === 'lineEndingBlank') {
if (ue[0] === 'exit') continue;
Pe && ((I[Pe][1].type = 'lineEndingBlank'), (de = !0)),
(ue[1].type = 'lineEnding'),
(Pe = ht);
} else if (
!(
ue[1].type === 'linePrefix' ||
ue[1].type === 'blockQuotePrefix' ||
ue[1].type === 'blockQuotePrefixWhitespace' ||
ue[1].type === 'blockQuoteMarker' ||
ue[1].type === 'listItemIndent'
)
)
break;
}
Ze && (!Pe || Ze < Pe) && (De._spread = !0),
(De.end = Object.assign({}, Pe ? I[Pe][1].start : le[1].end)),
I.splice(Pe || U, 0, ['exit', De, le[2]]),
U++,
z++;
}
le[1].type === 'listItemPrefix' &&
((De = {
type: 'listItem',
_spread: !1,
start: Object.assign({}, le[1].start),
end: void 0,
}),
I.splice(U, 0, ['enter', De, le[2]]),
U++,
z++,
(Ze = void 0),
(Ae = !0));
}
}
return (I[T][1]._spread = de), z;
}
function a(I, T) {
n[I] = T;
}
function o(I) {
return n[I];
}
function l(I, T) {
return z;
function z(U) {
c.call(this, I(U), U), T && T.call(this, U);
}
}
function s() {
this.stack.push({ type: 'fragment', children: [] });
}
function c(I, T, z) {
return (
this.stack[this.stack.length - 1].children.push(I),
this.stack.push(I),
this.tokenStack.push([T, z]),
(I.position = { start: ot(T.start) }),
I
);
}
function d(I) {
return T;
function T(z) {
I && I.call(this, z), u.call(this, z);
}
}
function u(I, T) {
const z = this.stack.pop(),
U = this.tokenStack.pop();
if (U) U[0].type !== I.type && (T ? T.call(this, I, U[0]) : (U[1] || to).call(this, I, U[0]));
else
throw new Error(
'Cannot close `' + I.type + '` (' + Gt({ start: I.start, end: I.end }) + '): it’s not open'
);
return (z.position.end = ot(I.end)), z;
}
function f() {
return $g(this.stack.pop());
}
function p() {
a('expectingFirstListItemValue', !0);
}
function m(I) {
if (o('expectingFirstListItemValue')) {
const T = this.stack[this.stack.length - 2];
(T.start = Number.parseInt(this.sliceSerialize(I), 10)), a('expectingFirstListItemValue');
}
}
function h() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.lang = I;
}
function x() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.meta = I;
}
function b() {
o('flowCodeInside') || (this.buffer(), a('flowCodeInside', !0));
}
function C() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
(T.value = I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '')), a('flowCodeInside');
}
function S() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.value = I.replace(/(\r?\n|\r)$/g, '');
}
function D(I) {
const T = this.resume(),
z = this.stack[this.stack.length - 1];
(z.label = T), (z.identifier = It(this.sliceSerialize(I)).toLowerCase());
}
function E() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.title = I;
}
function w() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.url = I;
}
function O(I) {
const T = this.stack[this.stack.length - 1];
if (!T.depth) {
const z = this.sliceSerialize(I).length;
T.depth = z;
}
}
function L() {
a('setextHeadingSlurpLineEnding', !0);
}
function F(I) {
const T = this.stack[this.stack.length - 1];
T.depth = this.sliceSerialize(I).charCodeAt(0) === 61 ? 1 : 2;
}
function V() {
a('setextHeadingSlurpLineEnding');
}
function A(I) {
const T = this.stack[this.stack.length - 1];
let z = T.children[T.children.length - 1];
(!z || z.type !== 'text') &&
((z = mt()), (z.position = { start: ot(I.start) }), T.children.push(z)),
this.stack.push(z);
}
function R(I) {
const T = this.stack.pop();
(T.value += this.sliceSerialize(I)), (T.position.end = ot(I.end));
}
function Y(I) {
const T = this.stack[this.stack.length - 1];
if (o('atHardBreak')) {
const z = T.children[T.children.length - 1];
(z.position.end = ot(I.end)), a('atHardBreak');
return;
}
!o('setextHeadingSlurpLineEnding') &&
t.canContainEols.includes(T.type) &&
(A.call(this, I), R.call(this, I));
}
function q() {
a('atHardBreak', !0);
}
function $() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.value = I;
}
function J() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.value = I;
}
function ie() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.value = I;
}
function ce() {
const I = this.stack[this.stack.length - 1];
if (o('inReference')) {
const T = o('referenceType') || 'shortcut';
(I.type += 'Reference'), (I.referenceType = T), delete I.url, delete I.title;
} else delete I.identifier, delete I.label;
a('referenceType');
}
function me() {
const I = this.stack[this.stack.length - 1];
if (o('inReference')) {
const T = o('referenceType') || 'shortcut';
(I.type += 'Reference'), (I.referenceType = T), delete I.url, delete I.title;
} else delete I.identifier, delete I.label;
a('referenceType');
}
function y(I) {
const T = this.sliceSerialize(I),
z = this.stack[this.stack.length - 2];
(z.label = zh(T)), (z.identifier = It(T).toLowerCase());
}
function pe() {
const I = this.stack[this.stack.length - 1],
T = this.resume(),
z = this.stack[this.stack.length - 1];
if ((a('inReference', !0), z.type === 'link')) {
const U = I.children;
z.children = U;
} else z.alt = T;
}
function k() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.url = I;
}
function v() {
const I = this.resume(),
T = this.stack[this.stack.length - 1];
T.title = I;
}
function Q() {
a('inReference');
}
function oe() {
a('referenceType', 'collapsed');
}
function ee(I) {
const T = this.resume(),
z = this.stack[this.stack.length - 1];
(z.label = T),
(z.identifier = It(this.sliceSerialize(I)).toLowerCase()),
a('referenceType', 'full');
}
function he(I) {
a('characterReferenceType', I.type);
}
function fe(I) {
const T = this.sliceSerialize(I),
z = o('characterReferenceType');
let U;
z
? ((U = Zl(T, z === 'characterReferenceMarkerNumeric' ? 10 : 16)),
a('characterReferenceType'))
: (U = Ni(T));
const H = this.stack.pop();
(H.value += U), (H.position.end = ot(I.end));
}
function Le(I) {
R.call(this, I);
const T = this.stack[this.stack.length - 1];
T.url = this.sliceSerialize(I);
}
function Se(I) {
R.call(this, I);
const T = this.stack[this.stack.length - 1];
T.url = 'mailto:' + this.sliceSerialize(I);
}
function Ve() {
return { type: 'blockquote', children: [] };
}
function et() {
return { type: 'code', lang: null, meta: null, value: '' };
}
function ft() {
return { type: 'inlineCode', value: '' };
}
function tt() {
return { type: 'definition', identifier: '', label: null, title: null, url: '' };
}
function Je() {
return { type: 'emphasis', children: [] };
}
function nt() {
return { type: 'heading', depth: void 0, children: [] };
}
function rt() {
return { type: 'break' };
}
function Ft() {
return { type: 'html', value: '' };
}
function Ke() {
return { type: 'image', title: null, url: '', alt: null };
}
function it() {
return { type: 'link', title: null, url: '', children: [] };
}
function dn(I) {
return {
type: 'list',
ordered: I.type === 'listOrdered',
start: null,
spread: I._spread,
children: [],
};
}
function gt(I) {
return { type: 'listItem', spread: I._spread, checked: null, children: [] };
}
function pn() {
return { type: 'paragraph', children: [] };
}
function _e() {
return { type: 'strong', children: [] };
}
function mt() {
return { type: 'text', value: '' };
}
function Ct() {
return { type: 'thematicBreak' };
}
}
function ot(e) {
return { line: e.line, column: e.column, offset: e.offset };
}
function ts(e, t) {
let n = -1;
for (; ++n < t.length; ) {
const r = t[n];
Array.isArray(r) ? ts(e, r) : Gh(e, r);
}
}
function Gh(e, t) {
let n;
for (n in t)
if (es.call(t, n)) {
if (n === 'canContainEols') {
const r = t[n];
r && e[n].push(...r);
} else if (n === 'transforms') {
const r = t[n];
r && e[n].push(...r);
} else if (n === 'enter' || n === 'exit') {
const r = t[n];
r && Object.assign(e[n], r);
}
}
}
function to(e, t) {
throw e
? new Error(
'Cannot close `' +
e.type +
'` (' +
Gt({ start: e.start, end: e.end }) +
'): a different token (`' +
t.type +
'`, ' +
Gt({ start: t.start, end: t.end }) +
') is open'
)
: new Error(
'Cannot close document, a token (`' +
t.type +
'`, ' +
Gt({ start: t.start, end: t.end }) +
') is still open'
);
}
function Wh(e) {
Object.assign(this, {
Parser: (n) => {
const r = this.data('settings');
return Hh(
n,
Object.assign({}, r, e, {
extensions: this.data('micromarkExtensions') || [],
mdastExtensions: this.data('fromMarkdownExtensions') || [],
})
);
},
});
}
function qh(e, t) {
const n = {
type: 'element',
tagName: 'blockquote',
properties: {},
children: e.wrap(e.all(t), !0),
};
return e.patch(t, n), e.applyData(t, n);
}
function Vh(e, t) {
const n = { type: 'element', tagName: 'br', properties: {}, children: [] };
return (
e.patch(t, n),
[
e.applyData(t, n),
{
type: 'text',
value: `
`,
},
]
);
}
function Kh(e, t) {
const n = t.value
? t.value +
`
`
: '',
r = t.lang ? t.lang.match(/^[^ \t]+(?=[ \t]|$)/) : null,
i = {};
r && (i.className = ['language-' + r]);
let a = {
type: 'element',
tagName: 'code',
properties: i,
children: [{ type: 'text', value: n }],
};
return (
t.meta && (a.data = { meta: t.meta }),
e.patch(t, a),
(a = e.applyData(t, a)),
(a = { type: 'element', tagName: 'pre', properties: {}, children: [a] }),
e.patch(t, a),
a
);
}
function Yh(e, t) {
const n = { type: 'element', tagName: 'del', properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
function Qh(e, t) {
const n = { type: 'element', tagName: 'em', properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
function Bt(e) {
const t = [];
let n = -1,
r = 0,
i = 0;
for (; ++n < e.length; ) {
const a = e.charCodeAt(n);
let o = '';
if (a === 37 && Te(e.charCodeAt(n + 1)) && Te(e.charCodeAt(n + 2))) i = 2;
else if (a < 128)
/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a)) || (o = String.fromCharCode(a));
else if (a > 55295 && a < 57344) {
const l = e.charCodeAt(n + 1);
a < 56320 && l > 56319 && l < 57344 ? ((o = String.fromCharCode(a, l)), (i = 1)) : (o = '�');
} else o = String.fromCharCode(a);
o && (t.push(e.slice(r, n), encodeURIComponent(o)), (r = n + i + 1), (o = '')),
i && ((n += i), (i = 0));
}
return t.join('') + e.slice(r);
}
function ns(e, t) {
const n = String(t.identifier).toUpperCase(),
r = Bt(n.toLowerCase()),
i = e.footnoteOrder.indexOf(n);
let a;
i === -1
? (e.footnoteOrder.push(n), (e.footnoteCounts[n] = 1), (a = e.footnoteOrder.length))
: (e.footnoteCounts[n]++, (a = i + 1));
const o = e.footnoteCounts[n],
l = {
type: 'element',
tagName: 'a',
properties: {
href: '#' + e.clobberPrefix + 'fn-' + r,
id: e.clobberPrefix + 'fnref-' + r + (o > 1 ? '-' + o : ''),
dataFootnoteRef: !0,
ariaDescribedBy: ['footnote-label'],
},
children: [{ type: 'text', value: String(a) }],
};
e.patch(t, l);
const s = { type: 'element', tagName: 'sup', properties: {}, children: [l] };
return e.patch(t, s), e.applyData(t, s);
}
function Xh(e, t) {
const n = e.footnoteById;
let r = 1;
for (; r in n; ) r++;
const i = String(r);
return (
(n[i] = {
type: 'footnoteDefinition',
identifier: i,
children: [{ type: 'paragraph', children: t.children }],
position: t.position,
}),
ns(e, { type: 'footnoteReference', identifier: i, position: t.position })
);
}
function Jh(e, t) {
const n = { type: 'element', tagName: 'h' + t.depth, properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
function _h(e, t) {
if (e.dangerous) {
const n = { type: 'raw', value: t.value };
return e.patch(t, n), e.applyData(t, n);
}
return null;
}
function rs(e, t) {
const n = t.referenceType;
let r = ']';
if (
(n === 'collapsed' ? (r += '[]') : n === 'full' && (r += '[' + (t.label || t.identifier) + ']'),
t.type === 'imageReference')
)
return { type: 'text', value: '![' + t.alt + r };
const i = e.all(t),
a = i[0];
a && a.type === 'text' ? (a.value = '[' + a.value) : i.unshift({ type: 'text', value: '[' });
const o = i[i.length - 1];
return o && o.type === 'text' ? (o.value += r) : i.push({ type: 'text', value: r }), i;
}
function Zh(e, t) {
const n = e.definition(t.identifier);
if (!n) return rs(e, t);
const r = { src: Bt(n.url || ''), alt: t.alt };
n.title !== null && n.title !== void 0 && (r.title = n.title);
const i = { type: 'element', tagName: 'img', properties: r, children: [] };
return e.patch(t, i), e.applyData(t, i);
}
function ev(e, t) {
const n = { src: Bt(t.url) };
t.alt !== null && t.alt !== void 0 && (n.alt = t.alt),
t.title !== null && t.title !== void 0 && (n.title = t.title);
const r = { type: 'element', tagName: 'img', properties: n, children: [] };
return e.patch(t, r), e.applyData(t, r);
}
function tv(e, t) {
const n = { type: 'text', value: t.value.replace(/\r?\n|\r/g, ' ') };
e.patch(t, n);
const r = { type: 'element', tagName: 'code', properties: {}, children: [n] };
return e.patch(t, r), e.applyData(t, r);
}
function nv(e, t) {
const n = e.definition(t.identifier);
if (!n) return rs(e, t);
const r = { href: Bt(n.url || '') };
n.title !== null && n.title !== void 0 && (r.title = n.title);
const i = { type: 'element', tagName: 'a', properties: r, children: e.all(t) };
return e.patch(t, i), e.applyData(t, i);
}
function rv(e, t) {
const n = { href: Bt(t.url) };
t.title !== null && t.title !== void 0 && (n.title = t.title);
const r = { type: 'element', tagName: 'a', properties: n, children: e.all(t) };
return e.patch(t, r), e.applyData(t, r);
}
function iv(e, t, n) {
const r = e.all(t),
i = n ? av(n) : is(t),
a = {},
o = [];
if (typeof t.checked == 'boolean') {
const d = r[0];
let u;
d && d.type === 'element' && d.tagName === 'p'
? (u = d)
: ((u = { type: 'element', tagName: 'p', properties: {}, children: [] }), r.unshift(u)),
u.children.length > 0 && u.children.unshift({ type: 'text', value: ' ' }),
u.children.unshift({
type: 'element',
tagName: 'input',
properties: { type: 'checkbox', checked: t.checked, disabled: !0 },
children: [],
}),
(a.className = ['task-list-item']);
}
let l = -1;
for (; ++l < r.length; ) {
const d = r[l];
(i || l !== 0 || d.type !== 'element' || d.tagName !== 'p') &&
o.push({
type: 'text',
value: `
`,
}),
d.type === 'element' && d.tagName === 'p' && !i ? o.push(...d.children) : o.push(d);
}
const s = r[r.length - 1];
s &&
(i || s.type !== 'element' || s.tagName !== 'p') &&
o.push({
type: 'text',
value: `
`,
});
const c = { type: 'element', tagName: 'li', properties: a, children: o };
return e.patch(t, c), e.applyData(t, c);
}
function av(e) {
let t = !1;
if (e.type === 'list') {
t = e.spread || !1;
const n = e.children;
let r = -1;
for (; !t && ++r < n.length; ) t = is(n[r]);
}
return t;
}
function is(e) {
const t = e.spread;
return t ?? e.children.length > 1;
}
function ov(e, t) {
const n = {},
r = e.all(t);
let i = -1;
for (typeof t.start == 'number' && t.start !== 1 && (n.start = t.start); ++i < r.length; ) {
const o = r[i];
if (
o.type === 'element' &&
o.tagName === 'li' &&
o.properties &&
Array.isArray(o.properties.className) &&
o.properties.className.includes('task-list-item')
) {
n.className = ['contains-task-list'];
break;
}
}
const a = {
type: 'element',
tagName: t.ordered ? 'ol' : 'ul',
properties: n,
children: e.wrap(r, !0),
};
return e.patch(t, a), e.applyData(t, a);
}
function lv(e, t) {
const n = { type: 'element', tagName: 'p', properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
function sv(e, t) {
const n = { type: 'root', children: e.wrap(e.all(t)) };
return e.patch(t, n), e.applyData(t, n);
}
function uv(e, t) {
const n = { type: 'element', tagName: 'strong', properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
const Ti = as('start'),
Bi = as('end');
function cv(e) {
return { start: Ti(e), end: Bi(e) };
}
function as(e) {
return t;
function t(n) {
const r = (n && n.position && n.position[e]) || {};
return {
line: r.line || null,
column: r.column || null,
offset: r.offset > -1 ? r.offset : null,
};
}
}
function dv(e, t) {
const n = e.all(t),
r = n.shift(),
i = [];
if (r) {
const o = { type: 'element', tagName: 'thead', properties: {}, children: e.wrap([r], !0) };
e.patch(t.children[0], o), i.push(o);
}
if (n.length > 0) {
const o = { type: 'element', tagName: 'tbody', properties: {}, children: e.wrap(n, !0) },
l = Ti(t.children[1]),
s = Bi(t.children[t.children.length - 1]);
l.line && s.line && (o.position = { start: l, end: s }), i.push(o);
}
const a = { type: 'element', tagName: 'table', properties: {}, children: e.wrap(i, !0) };
return e.patch(t, a), e.applyData(t, a);
}
function pv(e, t, n) {
const r = n ? n.children : void 0,
a = (r ? r.indexOf(t) : 1) === 0 ? 'th' : 'td',
o = n && n.type === 'table' ? n.align : void 0,
l = o ? o.length : t.children.length;
let s = -1;
const c = [];
for (; ++s < l; ) {
const u = t.children[s],
f = {},
p = o ? o[s] : void 0;
p && (f.align = p);
let m = { type: 'element', tagName: a, properties: f, children: [] };
u && ((m.children = e.all(u)), e.patch(u, m), (m = e.applyData(t, m))), c.push(m);
}
const d = { type: 'element', tagName: 'tr', properties: {}, children: e.wrap(c, !0) };
return e.patch(t, d), e.applyData(t, d);
}
function fv(e, t) {
const n = { type: 'element', tagName: 'td', properties: {}, children: e.all(t) };
return e.patch(t, n), e.applyData(t, n);
}
const no = 9,
ro = 32;
function gv(e) {
const t = String(e),
n = /\r?\n|\r/g;
let r = n.exec(t),
i = 0;
const a = [];
for (; r; )
a.push(io(t.slice(i, r.index), i > 0, !0), r[0]), (i = r.index + r[0].length), (r = n.exec(t));
return a.push(io(t.slice(i), i > 0, !1)), a.join('');
}
function io(e, t, n) {
let r = 0,
i = e.length;
if (t) {
let a = e.codePointAt(r);
for (; a === no || a === ro; ) r++, (a = e.codePointAt(r));
}
if (n) {
let a = e.codePointAt(i - 1);
for (; a === no || a === ro; ) i--, (a = e.codePointAt(i - 1));
}
return i > r ? e.slice(r, i) : '';
}
function mv(e, t) {
const n = { type: 'text', value: gv(String(t.value)) };
return e.patch(t, n), e.applyData(t, n);
}
function hv(e, t) {
const n = { type: 'element', tagName: 'hr', properties: {}, children: [] };
return e.patch(t, n), e.applyData(t, n);
}
const vv = {
blockquote: qh,
break: Vh,
code: Kh,
delete: Yh,
emphasis: Qh,
footnoteReference: ns,
footnote: Xh,
heading: Jh,
html: _h,
imageReference: Zh,
image: ev,
inlineCode: tv,
linkReference: nv,
link: rv,
listItem: iv,
list: ov,
paragraph: lv,
root: sv,
strong: uv,
table: dv,
tableCell: fv,
tableRow: pv,
text: mv,
thematicBreak: hv,
toml: yn,
yaml: yn,
definition: yn,
footnoteDefinition: yn,
};
function yn() {
return null;
}
const os = function (e) {
if (e == null) return wv;
if (typeof e == 'string') return xv(e);
if (typeof e == 'object') return Array.isArray(e) ? bv(e) : yv(e);
if (typeof e == 'function') return tr(e);
throw new Error('Expected function, string, or object as test');
};
function bv(e) {
const t = [];
let n = -1;
for (; ++n < e.length; ) t[n] = os(e[n]);
return tr(r);
function r(...i) {
let a = -1;
for (; ++a < t.length; ) if (t[a].call(this, ...i)) return !0;
return !1;
}
}
function yv(e) {
return tr(t);
function t(n) {
let r;
for (r in e) if (n[r] !== e[r]) return !1;
return !0;
}
}
function xv(e) {
return tr(t);
function t(n) {
return n && n.type === e;
}
}
function tr(e) {
return t;
function t(n, ...r) {
return !!(n && typeof n == 'object' && 'type' in n && e.call(this, n, ...r));
}
}
function wv() {
return !0;
}
const Sv = !0,
ao = !1,
Cv = 'skip',
Dv = function (e, t, n, r) {
typeof t == 'function' && typeof n != 'function' && ((r = n), (n = t), (t = null));
const i = os(t),
a = r ? -1 : 1;
o(e, void 0, [])();
function o(l, s, c) {
const d = l && typeof l == 'object' ? l : {};
if (typeof d.type == 'string') {
const f =
typeof d.tagName == 'string' ? d.tagName : typeof d.name == 'string' ? d.name : void 0;
Object.defineProperty(u, 'name', {
value: 'node (' + (l.type + (f ? '<' + f + '>' : '')) + ')',
});
}
return u;
function u() {
let f = [],
p,
m,
h;
if ((!t || i(l, s, c[c.length - 1] || null)) && ((f = Iv(n(l, c))), f[0] === ao)) return f;
if (l.children && f[0] !== Cv)
for (
m = (r ? l.children.length : -1) + a, h = c.concat(l);
m > -1 && m < l.children.length;
) {
if (((p = o(l.children[m], m, h)()), p[0] === ao)) return p;
m = typeof p[1] == 'number' ? p[1] : m + a;
}
return f;
}
}
};
function Iv(e) {
return Array.isArray(e) ? e : typeof e == 'number' ? [Sv, e] : [e];
}
const Ri = function (e, t, n, r) {
typeof t == 'function' && typeof n != 'function' && ((r = n), (n = t), (t = null)),
Dv(e, t, i, r);
function i(a, o) {
const l = o[o.length - 1];
return n(a, l ? l.children.indexOf(a) : null, l);
}
};
function kv(e) {
return (
!e ||
!e.position ||
!e.position.start ||
!e.position.start.line ||
!e.position.start.column ||
!e.position.end ||
!e.position.end.line ||
!e.position.end.column
);
}
const oo = {}.hasOwnProperty;
function Ev(e) {
const t = Object.create(null);
if (!e || !e.type) throw new Error('mdast-util-definitions expected node');
return (
Ri(e, 'definition', (r) => {
const i = lo(r.identifier);
i && !oo.call(t, i) && (t[i] = r);
}),
n
);
function n(r) {
const i = lo(r);
return i && oo.call(t, i) ? t[i] : null;
}
}
function lo(e) {
return String(e || '').toUpperCase();
}
const Bn = {}.hasOwnProperty;
function Pv(e, t) {
const n = t || {},
r = n.allowDangerousHtml || !1,
i = {};
return (
(o.dangerous = r),
(o.clobberPrefix =
n.clobberPrefix === void 0 || n.clobberPrefix === null ? 'user-content-' : n.clobberPrefix),
(o.footnoteLabel = n.footnoteLabel || 'Footnotes'),
(o.footnoteLabelTagName = n.footnoteLabelTagName || 'h2'),
(o.footnoteLabelProperties = n.footnoteLabelProperties || { className: ['sr-only'] }),
(o.footnoteBackLabel = n.footnoteBackLabel || 'Back to content'),
(o.unknownHandler = n.unknownHandler),
(o.passThrough = n.passThrough),
(o.handlers = { ...vv, ...n.handlers }),
(o.definition = Ev(e)),
(o.footnoteById = i),
(o.footnoteOrder = []),
(o.footnoteCounts = {}),
(o.patch = Av),
(o.applyData = Nv),
(o.one = l),
(o.all = s),
(o.wrap = Tv),
(o.augment = a),
Ri(e, 'footnoteDefinition', (c) => {
const d = String(c.identifier).toUpperCase();
Bn.call(i, d) || (i[d] = c);
}),
o
);
function a(c, d) {
if (c && 'data' in c && c.data) {
const u = c.data;
u.hName &&
(d.type !== 'element' &&
(d = { type: 'element', tagName: '', properties: {}, children: [] }),
(d.tagName = u.hName)),
d.type === 'element' &&
u.hProperties &&
(d.properties = { ...d.properties, ...u.hProperties }),
'children' in d && d.children && u.hChildren && (d.children = u.hChildren);
}
if (c) {
const u = 'type' in c ? c : { position: c };
kv(u) || (d.position = { start: Ti(u), end: Bi(u) });
}
return d;
}
function o(c, d, u, f) {
return (
Array.isArray(u) && ((f = u), (u = {})),
a(c, { type: 'element', tagName: d, properties: u || {}, children: f || [] })
);
}
function l(c, d) {
return ls(o, c, d);
}
function s(c) {
return Fi(o, c);
}
}
function Av(e, t) {
e.position && (t.position = cv(e));
}
function Nv(e, t) {
let n = t;
if (e && e.data) {
const r = e.data.hName,
i = e.data.hChildren,
a = e.data.hProperties;
typeof r == 'string' &&
(n.type === 'element'
? (n.tagName = r)
: (n = { type: 'element', tagName: r, properties: {}, children: [] })),
n.type === 'element' && a && (n.properties = { ...n.properties, ...a }),
'children' in n && n.children && i !== null && i !== void 0 && (n.children = i);
}
return n;
}
function ls(e, t, n) {
const r = t && t.type;
if (!r) throw new Error('Expected node, got `' + t + '`');
return Bn.call(e.handlers, r)
? e.handlers[r](e, t, n)
: e.passThrough && e.passThrough.includes(r)
? 'children' in t
? { ...t, children: Fi(e, t) }
: t
: e.unknownHandler
? e.unknownHandler(e, t, n)
: Ov(e, t);
}
function Fi(e, t) {
const n = [];
if ('children' in t) {
const r = t.children;
let i = -1;
for (; ++i < r.length; ) {
const a = ls(e, r[i], t);
if (a) {
if (
i &&
r[i - 1].type === 'break' &&
(!Array.isArray(a) && a.type === 'text' && (a.value = a.value.replace(/^\s+/, '')),
!Array.isArray(a) && a.type === 'element')
) {
const o = a.children[0];
o && o.type === 'text' && (o.value = o.value.replace(/^\s+/, ''));
}
Array.isArray(a) ? n.push(...a) : n.push(a);
}
}
}
return n;
}
function Ov(e, t) {
const n = t.data || {},
r =
'value' in t && !(Bn.call(n, 'hProperties') || Bn.call(n, 'hChildren'))
? { type: 'text', value: t.value }
: { type: 'element', tagName: 'div', properties: {}, children: Fi(e, t) };
return e.patch(t, r), e.applyData(t, r);
}
function Tv(e, t) {
const n = [];
let r = -1;
for (
t &&
n.push({
type: 'text',
value: `
`,
});
++r < e.length;
)
r &&
n.push({
type: 'text',
value: `
`,
}),
n.push(e[r]);
return (
t &&
e.length > 0 &&
n.push({
type: 'text',
value: `
`,
}),
n
);
}
function Bv(e) {
const t = [];
let n = -1;
for (; ++n < e.footnoteOrder.length; ) {
const r = e.footnoteById[e.footnoteOrder[n]];
if (!r) continue;
const i = e.all(r),
a = String(r.identifier).toUpperCase(),
o = Bt(a.toLowerCase());
let l = 0;
const s = [];
for (; ++l <= e.footnoteCounts[a]; ) {
const u = {
type: 'element',
tagName: 'a',
properties: {
href: '#' + e.clobberPrefix + 'fnref-' + o + (l > 1 ? '-' + l : ''),
dataFootnoteBackref: !0,
className: ['data-footnote-backref'],
ariaLabel: e.footnoteBackLabel,
},
children: [{ type: 'text', value: '↩' }],
};
l > 1 &&
u.children.push({
type: 'element',
tagName: 'sup',
children: [{ type: 'text', value: String(l) }],
}),
s.length > 0 && s.push({ type: 'text', value: ' ' }),
s.push(u);
}
const c = i[i.length - 1];
if (c && c.type === 'element' && c.tagName === 'p') {
const u = c.children[c.children.length - 1];
u && u.type === 'text' ? (u.value += ' ') : c.children.push({ type: 'text', value: ' ' }),
c.children.push(...s);
} else i.push(...s);
const d = {
type: 'element',
tagName: 'li',
properties: { id: e.clobberPrefix + 'fn-' + o },
children: e.wrap(i, !0),
};
e.patch(r, d), t.push(d);
}
if (t.length !== 0)
return {
type: 'element',
tagName: 'section',
properties: { dataFootnotes: !0, className: ['footnotes'] },
children: [
{
type: 'element',
tagName: e.footnoteLabelTagName,
properties: {
...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),
id: 'footnote-label',
},
children: [{ type: 'text', value: e.footnoteLabel }],
},
{
type: 'text',
value: `
`,
},
{ type: 'element', tagName: 'ol', properties: {}, children: e.wrap(t, !0) },
{
type: 'text',
value: `
`,
},
],
};
}
function ss(e, t) {
const n = Pv(e, t),
r = n.one(e, null),
i = Bv(n);
return (
i &&
r.children.push(
{
type: 'text',
value: `
`,
},
i
),
Array.isArray(r) ? { type: 'root', children: r } : r
);
}
const Rv = function (e, t) {
return e && 'run' in e ? Lv(e, t) : Mv(e || t);
},
Fv = Rv;
function Lv(e, t) {
return (n, r, i) => {
e.run(ss(n, t), r, (a) => {
i(a);
});
};
}
function Mv(e) {
return (t) => ss(t, e);
}
class cn {
constructor(t, n, r) {
(this.property = t), (this.normal = n), r && (this.space = r);
}
}
cn.prototype.property = {};
cn.prototype.normal = {};
cn.prototype.space = null;
function us(e, t) {
const n = {},
r = {};
let i = -1;
for (; ++i < e.length; ) Object.assign(n, e[i].property), Object.assign(r, e[i].normal);
return new cn(n, r, t);
}
function Xr(e) {
return e.toLowerCase();
}
class Ue {
constructor(t, n) {
(this.property = t), (this.attribute = n);
}
}
Ue.prototype.space = null;
Ue.prototype.boolean = !1;
Ue.prototype.booleanish = !1;
Ue.prototype.overloadedBoolean = !1;
Ue.prototype.number = !1;
Ue.prototype.commaSeparated = !1;
Ue.prototype.spaceSeparated = !1;
Ue.prototype.commaOrSpaceSeparated = !1;
Ue.prototype.mustUseProperty = !1;
Ue.prototype.defined = !1;
let jv = 0;
const K = St(),
ge = St(),
cs = St(),
P = St(),
se = St(),
kt = St(),
Ne = St();
function St() {
return 2 ** ++jv;
}
const Jr = Object.freeze(
Object.defineProperty(
{
__proto__: null,
boolean: K,
booleanish: ge,
commaOrSpaceSeparated: Ne,
commaSeparated: kt,
number: P,
overloadedBoolean: cs,
spaceSeparated: se,
},
Symbol.toStringTag,
{ value: 'Module' }
)
),
Br = Object.keys(Jr);
class Li extends Ue {
constructor(t, n, r, i) {
let a = -1;
if ((super(t, n), so(this, 'space', i), typeof r == 'number'))
for (; ++a < Br.length; ) {
const o = Br[a];
so(this, Br[a], (r & Jr[o]) === Jr[o]);
}
}
}
Li.prototype.defined = !0;
function so(e, t, n) {
n && (e[t] = n);
}
const zv = {}.hasOwnProperty;
function Rt(e) {
const t = {},
n = {};
let r;
for (r in e.properties)
if (zv.call(e.properties, r)) {
const i = e.properties[r],
a = new Li(r, e.transform(e.attributes || {}, r), i, e.space);
e.mustUseProperty && e.mustUseProperty.includes(r) && (a.mustUseProperty = !0),
(t[r] = a),
(n[Xr(r)] = r),
(n[Xr(a.attribute)] = r);
}
return new cn(t, n, e.space);
}
const ds = Rt({
space: 'xlink',
transform(e, t) {
return 'xlink:' + t.slice(5).toLowerCase();
},
properties: {
xLinkActuate: null,
xLinkArcRole: null,
xLinkHref: null,
xLinkRole: null,
xLinkShow: null,
xLinkTitle: null,
xLinkType: null,
},
}),
ps = Rt({
space: 'xml',
transform(e, t) {
return 'xml:' + t.slice(3).toLowerCase();
},
properties: { xmlLang: null, xmlBase: null, xmlSpace: null },
});
function fs(e, t) {
return t in e ? e[t] : t;
}
function gs(e, t) {
return fs(e, t.toLowerCase());
}
const ms = Rt({
space: 'xmlns',
attributes: { xmlnsxlink: 'xmlns:xlink' },
transform: gs,
properties: { xmlns: null, xmlnsXLink: null },
}),
hs = Rt({
transform(e, t) {
return t === 'role' ? t : 'aria-' + t.slice(4).toLowerCase();
},
properties: {
ariaActiveDescendant: null,
ariaAtomic: ge,
ariaAutoComplete: null,
ariaBusy: ge,
ariaChecked: ge,
ariaColCount: P,
ariaColIndex: P,
ariaColSpan: P,
ariaControls: se,
ariaCurrent: null,
ariaDescribedBy: se,
ariaDetails: null,
ariaDisabled: ge,
ariaDropEffect: se,
ariaErrorMessage: null,
ariaExpanded: ge,
ariaFlowTo: se,
ariaGrabbed: ge,
ariaHasPopup: null,
ariaHidden: ge,
ariaInvalid: null,
ariaKeyShortcuts: null,
ariaLabel: null,
ariaLabelledBy: se,
ariaLevel: P,
ariaLive: null,
ariaModal: ge,
ariaMultiLine: ge,
ariaMultiSelectable: ge,
ariaOrientation: null,
ariaOwns: se,
ariaPlaceholder: null,
ariaPosInSet: P,
ariaPressed: ge,
ariaReadOnly: ge,
ariaRelevant: null,
ariaRequired: ge,
ariaRoleDescription: se,
ariaRowCount: P,
ariaRowIndex: P,
ariaRowSpan: P,
ariaSelected: ge,
ariaSetSize: P,
ariaSort: null,
ariaValueMax: P,
ariaValueMin: P,
ariaValueNow: P,
ariaValueText: null,
role: null,
},
}),
$v = Rt({
space: 'html',
attributes: {
acceptcharset: 'accept-charset',
classname: 'class',
htmlfor: 'for',
httpequiv: 'http-equiv',
},
transform: gs,
mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],
properties: {
abbr: null,
accept: kt,
acceptCharset: se,
accessKey: se,
action: null,
allow: null,
allowFullScreen: K,
allowPaymentRequest: K,
allowUserMedia: K,
alt: null,
as: null,
async: K,
autoCapitalize: null,
autoComplete: se,
autoFocus: K,
autoPlay: K,
capture: K,
charSet: null,
checked: K,
cite: null,
className: se,
cols: P,
colSpan: null,
content: null,
contentEditable: ge,
controls: K,
controlsList: se,
coords: P | kt,
crossOrigin: null,
data: null,
dateTime: null,
decoding: null,
default: K,
defer: K,
dir: null,
dirName: null,
disabled: K,
download: cs,
draggable: ge,
encType: null,
enterKeyHint: null,
form: null,
formAction: null,
formEncType: null,
formMethod: null,
formNoValidate: K,
formTarget: null,
headers: se,
height: P,
hidden: K,
high: P,
href: null,
hrefLang: null,
htmlFor: se,
httpEquiv: se,
id: null,
imageSizes: null,
imageSrcSet: null,
inputMode: null,
integrity: null,
is: null,
isMap: K,
itemId: null,
itemProp: se,
itemRef: se,
itemScope: K,
itemType: se,
kind: null,
label: null,
lang: null,
language: null,
list: null,
loading: null,
loop: K,
low: P,
manifest: null,
max: null,
maxLength: P,
media: null,
method: null,
min: null,
minLength: P,
multiple: K,
muted: K,
name: null,
nonce: null,
noModule: K,
noValidate: K,
onAbort: null,
onAfterPrint: null,
onAuxClick: null,
onBeforeMatch: null,
onBeforePrint: null,
onBeforeUnload: null,
onBlur: null,
onCancel: null,
onCanPlay: null,
onCanPlayThrough: null,
onChange: null,
onClick: null,
onClose: null,
onContextLost: null,
onContextMenu: null,
onContextRestored: null,
onCopy: null,
onCueChange: null,
onCut: null,
onDblClick: null,
onDrag: null,
onDragEnd: null,
onDragEnter: null,
onDragExit: null,
onDragLeave: null,
onDragOver: null,
onDragStart: null,
onDrop: null,
onDurationChange: null,
onEmptied: null,
onEnded: null,
onError: null,
onFocus: null,
onFormData: null,
onHashChange: null,
onInput: null,
onInvalid: null,
onKeyDown: null,
onKeyPress: null,
onKeyUp: null,
onLanguageChange: null,
onLoad: null,
onLoadedData: null,
onLoadedMetadata: null,
onLoadEnd: null,
onLoadStart: null,
onMessage: null,
onMessageError: null,
onMouseDown: null,
onMouseEnter: null,
onMouseLeave: null,
onMouseMove: null,
onMouseOut: null,
onMouseOver: null,
onMouseUp: null,
onOffline: null,
onOnline: null,
onPageHide: null,
onPageShow: null,
onPaste: null,
onPause: null,
onPlay: null,
onPlaying: null,
onPopState: null,
onProgress: null,
onRateChange: null,
onRejectionHandled: null,
onReset: null,
onResize: null,
onScroll: null,
onScrollEnd: null,
onSecurityPolicyViolation: null,
onSeeked: null,
onSeeking: null,
onSelect: null,
onSlotChange: null,
onStalled: null,
onStorage: null,
onSubmit: null,
onSuspend: null,
onTimeUpdate: null,
onToggle: null,
onUnhandledRejection: null,
onUnload: null,
onVolumeChange: null,
onWaiting: null,
onWheel: null,
open: K,
optimum: P,
pattern: null,
ping: se,
placeholder: null,
playsInline: K,
poster: null,
preload: null,
readOnly: K,
referrerPolicy: null,
rel: se,
required: K,
reversed: K,
rows: P,
rowSpan: P,
sandbox: se,
scope: null,
scoped: K,
seamless: K,
selected: K,
shape: null,
size: P,
sizes: null,
slot: null,
span: P,
spellCheck: ge,
src: null,
srcDoc: null,
srcLang: null,
srcSet: null,
start: P,
step: null,
style: null,
tabIndex: P,
target: null,
title: null,
translate: null,
type: null,
typeMustMatch: K,
useMap: null,
value: ge,
width: P,
wrap: null,
align: null,
aLink: null,
archive: se,
axis: null,
background: null,
bgColor: null,
border: P,
borderColor: null,
bottomMargin: P,
cellPadding: null,
cellSpacing: null,
char: null,
charOff: null,
classId: null,
clear: null,
code: null,
codeBase: null,
codeType: null,
color: null,
compact: K,
declare: K,
event: null,
face: null,
frame: null,
frameBorder: null,
hSpace: P,
leftMargin: P,
link: null,
longDesc: null,
lowSrc: null,
marginHeight: P,
marginWidth: P,
noResize: K,
noHref: K,
noShade: K,
noWrap: K,
object: null,
profile: null,
prompt: null,
rev: null,
rightMargin: P,
rules: null,
scheme: null,
scrolling: ge,
standby: null,
summary: null,
text: null,
topMargin: P,
valueType: null,
version: null,
vAlign: null,
vLink: null,
vSpace: P,
allowTransparency: null,
autoCorrect: null,
autoSave: null,
disablePictureInPicture: K,
disableRemotePlayback: K,
prefix: null,
property: null,
results: P,
security: null,
unselectable: null,
},
}),
Hv = Rt({
space: 'svg',
attributes: {
accentHeight: 'accent-height',
alignmentBaseline: 'alignment-baseline',
arabicForm: 'arabic-form',
baselineShift: 'baseline-shift',
capHeight: 'cap-height',
className: 'class',
clipPath: 'clip-path',
clipRule: 'clip-rule',
colorInterpolation: 'color-interpolation',
colorInterpolationFilters: 'color-interpolation-filters',
colorProfile: 'color-profile',
colorRendering: 'color-rendering',
crossOrigin: 'crossorigin',
dataType: 'datatype',
dominantBaseline: 'dominant-baseline',
enableBackground: 'enable-background',
fillOpacity: 'fill-opacity',
fillRule: 'fill-rule',
floodColor: 'flood-color',
floodOpacity: 'flood-opacity',
fontFamily: 'font-family',
fontSize: 'font-size',
fontSizeAdjust: 'font-size-adjust',
fontStretch: 'font-stretch',
fontStyle: 'font-style',
fontVariant: 'font-variant',
fontWeight: 'font-weight',
glyphName: 'glyph-name',
glyphOrientationHorizontal: 'glyph-orientation-horizontal',
glyphOrientationVertical: 'glyph-orientation-vertical',
hrefLang: 'hreflang',
horizAdvX: 'horiz-adv-x',
horizOriginX: 'horiz-origin-x',
horizOriginY: 'horiz-origin-y',
imageRendering: 'image-rendering',
letterSpacing: 'letter-spacing',
lightingColor: 'lighting-color',
markerEnd: 'marker-end',
markerMid: 'marker-mid',
markerStart: 'marker-start',
navDown: 'nav-down',
navDownLeft: 'nav-down-left',
navDownRight: 'nav-down-right',
navLeft: 'nav-left',
navNext: 'nav-next',
navPrev: 'nav-prev',
navRight: 'nav-right',
navUp: 'nav-up',
navUpLeft: 'nav-up-left',
navUpRight: 'nav-up-right',
onAbort: 'onabort',
onActivate: 'onactivate',
onAfterPrint: 'onafterprint',
onBeforePrint: 'onbeforeprint',
onBegin: 'onbegin',
onCancel: 'oncancel',
onCanPlay: 'oncanplay',
onCanPlayThrough: 'oncanplaythrough',
onChange: 'onchange',
onClick: 'onclick',
onClose: 'onclose',
onCopy: 'oncopy',
onCueChange: 'oncuechange',
onCut: 'oncut',
onDblClick: 'ondblclick',
onDrag: 'ondrag',
onDragEnd: 'ondragend',
onDragEnter: 'ondragenter',
onDragExit: 'ondragexit',
onDragLeave: 'ondragleave',
onDragOver: 'ondragover',
onDragStart: 'ondragstart',
onDrop: 'ondrop',
onDurationChange: 'ondurationchange',
onEmptied: 'onemptied',
onEnd: 'onend',
onEnded: 'onended',
onError: 'onerror',
onFocus: 'onfocus',
onFocusIn: 'onfocusin',
onFocusOut: 'onfocusout',
onHashChange: 'onhashchange',
onInput: 'oninput',
onInvalid: 'oninvalid',
onKeyDown: 'onkeydown',
onKeyPress: 'onkeypress',
onKeyUp: 'onkeyup',
onLoad: 'onload',
onLoadedData: 'onloadeddata',
onLoadedMetadata: 'onloadedmetadata',
onLoadStart: 'onloadstart',
onMessage: 'onmessage',
onMouseDown: 'onmousedown',
onMouseEnter: 'onmouseenter',
onMouseLeave: 'onmouseleave',
onMouseMove: 'onmousemove',
onMouseOut: 'onmouseout',
onMouseOver: 'onmouseover',
onMouseUp: 'onmouseup',
onMouseWheel: 'onmousewheel',
onOffline: 'onoffline',
onOnline: 'ononline',
onPageHide: 'onpagehide',
onPageShow: 'onpageshow',
onPaste: 'onpaste',
onPause: 'onpause',
onPlay: 'onplay',
onPlaying: 'onplaying',
onPopState: 'onpopstate',
onProgress: 'onprogress',
onRateChange: 'onratechange',
onRepeat: 'onrepeat',
onReset: 'onreset',
onResize: 'onresize',
onScroll: 'onscroll',
onSeeked: 'onseeked',
onSeeking: 'onseeking',
onSelect: 'onselect',
onShow: 'onshow',
onStalled: 'onstalled',
onStorage: 'onstorage',
onSubmit: 'onsubmit',
onSuspend: 'onsuspend',
onTimeUpdate: 'ontimeupdate',
onToggle: 'ontoggle',
onUnload: 'onunload',
onVolumeChange: 'onvolumechange',
onWaiting: 'onwaiting',
onZoom: 'onzoom',
overlinePosition: 'overline-position',
overlineThickness: 'overline-thickness',
paintOrder: 'paint-order',
panose1: 'panose-1',
pointerEvents: 'pointer-events',
referrerPolicy: 'referrerpolicy',
renderingIntent: 'rendering-intent',
shapeRendering: 'shape-rendering',
stopColor: 'stop-color',
stopOpacity: 'stop-opacity',
strikethroughPosition: 'strikethrough-position',
strikethroughThickness: 'strikethrough-thickness',
strokeDashArray: 'stroke-dasharray',
strokeDashOffset: 'stroke-dashoffset',
strokeLineCap: 'stroke-linecap',
strokeLineJoin: 'stroke-linejoin',
strokeMiterLimit: 'stroke-miterlimit',
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
tabIndex: 'tabindex',
textAnchor: 'text-anchor',
textDecoration: 'text-decoration',
textRendering: 'text-rendering',
typeOf: 'typeof',
underlinePosition: 'underline-position',
underlineThickness: 'underline-thickness',
unicodeBidi: 'unicode-bidi',
unicodeRange: 'unicode-range',
unitsPerEm: 'units-per-em',
vAlphabetic: 'v-alphabetic',
vHanging: 'v-hanging',
vIdeographic: 'v-ideographic',
vMathematical: 'v-mathematical',
vectorEffect: 'vector-effect',
vertAdvY: 'vert-adv-y',
vertOriginX: 'vert-origin-x',
vertOriginY: 'vert-origin-y',
wordSpacing: 'word-spacing',
writingMode: 'writing-mode',
xHeight: 'x-height',
playbackOrder: 'playbackorder',
timelineBegin: 'timelinebegin',
},
transform: fs,
properties: {
about: Ne,
accentHeight: P,
accumulate: null,
additive: null,
alignmentBaseline: null,
alphabetic: P,
amplitude: P,
arabicForm: null,
ascent: P,
attributeName: null,
attributeType: null,
azimuth: P,
bandwidth: null,
baselineShift: null,
baseFrequency: null,
baseProfile: null,
bbox: null,
begin: null,
bias: P,
by: null,
calcMode: null,
capHeight: P,
className: se,
clip: null,
clipPath: null,
clipPathUnits: null,
clipRule: null,
color: null,
colorInterpolation: null,
colorInterpolationFilters: null,
colorProfile: null,
colorRendering: null,
content: null,
contentScriptType: null,
contentStyleType: null,
crossOrigin: null,
cursor: null,
cx: null,
cy: null,
d: null,
dataType: null,
defaultAction: null,
descent: P,
diffuseConstant: P,
direction: null,
display: null,
dur: null,
divisor: P,
dominantBaseline: null,
download: K,
dx: null,
dy: null,
edgeMode: null,
editable: null,
elevation: P,
enableBackground: null,
end: null,
event: null,
exponent: P,
externalResourcesRequired: null,
fill: null,
fillOpacity: P,
fillRule: null,
filter: null,
filterRes: null,
filterUnits: null,
floodColor: null,
floodOpacity: null,
focusable: null,
focusHighlight: null,
fontFamily: null,
fontSize: null,
fontSizeAdjust: null,
fontStretch: null,
fontStyle: null,
fontVariant: null,
fontWeight: null,
format: null,
fr: null,
from: null,
fx: null,
fy: null,
g1: kt,
g2: kt,
glyphName: kt,
glyphOrientationHorizontal: null,
glyphOrientationVertical: null,
glyphRef: null,
gradientTransform: null,
gradientUnits: null,
handler: null,
hanging: P,
hatchContentUnits: null,
hatchUnits: null,
height: null,
href: null,
hrefLang: null,
horizAdvX: P,
horizOriginX: P,
horizOriginY: P,
id: null,
ideographic: P,
imageRendering: null,
initialVisibility: null,
in: null,
in2: null,
intercept: P,
k: P,
k1: P,
k2: P,
k3: P,
k4: P,
kernelMatrix: Ne,
kernelUnitLength: null,
keyPoints: null,
keySplines: null,
keyTimes: null,
kerning: null,
lang: null,
lengthAdjust: null,
letterSpacing: null,
lightingColor: null,
limitingConeAngle: P,
local: null,
markerEnd: null,
markerMid: null,
markerStart: null,
markerHeight: null,
markerUnits: null,
markerWidth: null,
mask: null,
maskContentUnits: null,
maskUnits: null,
mathematical: null,
max: null,
media: null,
mediaCharacterEncoding: null,
mediaContentEncodings: null,
mediaSize: P,
mediaTime: null,
method: null,
min: null,
mode: null,
name: null,
navDown: null,
navDownLeft: null,
navDownRight: null,
navLeft: null,
navNext: null,
navPrev: null,
navRight: null,
navUp: null,
navUpLeft: null,
navUpRight: null,
numOctaves: null,
observer: null,
offset: null,
onAbort: null,
onActivate: null,
onAfterPrint: null,
onBeforePrint: null,
onBegin: null,
onCancel: null,
onCanPlay: null,
onCanPlayThrough: null,
onChange: null,
onClick: null,
onClose: null,
onCopy: null,
onCueChange: null,
onCut: null,
onDblClick: null,
onDrag: null,
onDragEnd: null,
onDragEnter: null,
onDragExit: null,
onDragLeave: null,
onDragOver: null,
onDragStart: null,
onDrop: null,
onDurationChange: null,
onEmptied: null,
onEnd: null,
onEnded: null,
onError: null,
onFocus: null,
onFocusIn: null,
onFocusOut: null,
onHashChange: null,
onInput: null,
onInvalid: null,
onKeyDown: null,
onKeyPress: null,
onKeyUp: null,
onLoad: null,
onLoadedData: null,
onLoadedMetadata: null,
onLoadStart: null,
onMessage: null,
onMouseDown: null,
onMouseEnter: null,
onMouseLeave: null,
onMouseMove: null,
onMouseOut: null,
onMouseOver: null,
onMouseUp: null,
onMouseWheel: null,
onOffline: null,
onOnline: null,
onPageHide: null,
onPageShow: null,
onPaste: null,
onPause: null,
onPlay: null,
onPlaying: null,
onPopState: null,
onProgress: null,
onRateChange: null,
onRepeat: null,
onReset: null,
onResize: null,
onScroll: null,
onSeeked: null,
onSeeking: null,
onSelect: null,
onShow: null,
onStalled: null,
onStorage: null,
onSubmit: null,
onSuspend: null,
onTimeUpdate: null,
onToggle: null,
onUnload: null,
onVolumeChange: null,
onWaiting: null,
onZoom: null,
opacity: null,
operator: null,
order: null,
orient: null,
orientation: null,
origin: null,
overflow: null,
overlay: null,
overlinePosition: P,
overlineThickness: P,
paintOrder: null,
panose1: null,
path: null,
pathLength: P,
patternContentUnits: null,
patternTransform: null,
patternUnits: null,
phase: null,
ping: se,
pitch: null,
playbackOrder: null,
pointerEvents: null,
points: null,
pointsAtX: P,
pointsAtY: P,
pointsAtZ: P,
preserveAlpha: null,
preserveAspectRatio: null,
primitiveUnits: null,
propagate: null,
property: Ne,
r: null,
radius: null,
referrerPolicy: null,
refX: null,
refY: null,
rel: Ne,
rev: Ne,
renderingIntent: null,
repeatCount: null,
repeatDur: null,
requiredExtensions: Ne,
requiredFeatures: Ne,
requiredFonts: Ne,
requiredFormats: Ne,
resource: null,
restart: null,
result: null,
rotate: null,
rx: null,
ry: null,
scale: null,
seed: null,
shapeRendering: null,
side: null,
slope: null,
snapshotTime: null,
specularConstant: P,
specularExponent: P,
spreadMethod: null,
spacing: null,
startOffset: null,
stdDeviation: null,
stemh: null,
stemv: null,
stitchTiles: null,
stopColor: null,
stopOpacity: null,
strikethroughPosition: P,
strikethroughThickness: P,
string: null,
stroke: null,
strokeDashArray: Ne,
strokeDashOffset: null,
strokeLineCap: null,
strokeLineJoin: null,
strokeMiterLimit: P,
strokeOpacity: P,
strokeWidth: null,
style: null,
surfaceScale: P,
syncBehavior: null,
syncBehaviorDefault: null,
syncMaster: null,
syncTolerance: null,
syncToleranceDefault: null,
systemLanguage: Ne,
tabIndex: P,
tableValues: null,
target: null,
targetX: P,
targetY: P,
textAnchor: null,
textDecoration: null,
textRendering: null,
textLength: null,
timelineBegin: null,
title: null,
transformBehavior: null,
type: null,
typeOf: Ne,
to: null,
transform: null,
u1: null,
u2: null,
underlinePosition: P,
underlineThickness: P,
unicode: null,
unicodeBidi: null,
unicodeRange: null,
unitsPerEm: P,
values: null,
vAlphabetic: P,
vMathematical: P,
vectorEffect: null,
vHanging: P,
vIdeographic: P,
version: null,
vertAdvY: P,
vertOriginX: P,
vertOriginY: P,
viewBox: null,
viewTarget: null,
visibility: null,
width: null,
widths: null,
wordSpacing: null,
writingMode: null,
x: null,
x1: null,
x2: null,
xChannelSelector: null,
xHeight: P,
y: null,
y1: null,
y2: null,
yChannelSelector: null,
z: null,
zoomAndPan: null,
},
}),
Uv = /^data[-\w.:]+$/i,
uo = /-[a-z]/g,
Gv = /[A-Z]/g;
function Wv(e, t) {
const n = Xr(t);
let r = t,
i = Ue;
if (n in e.normal) return e.property[e.normal[n]];
if (n.length > 4 && n.slice(0, 4) === 'data' && Uv.test(t)) {
if (t.charAt(4) === '-') {
const a = t.slice(5).replace(uo, Vv);
r = 'data' + a.charAt(0).toUpperCase() + a.slice(1);
} else {
const a = t.slice(4);
if (!uo.test(a)) {
let o = a.replace(Gv, qv);
o.charAt(0) !== '-' && (o = '-' + o), (t = 'data' + o);
}
}
i = Li;
}
return new i(r, t);
}
function qv(e) {
return '-' + e.toLowerCase();
}
function Vv(e) {
return e.charAt(1).toUpperCase();
}
const co = {
classId: 'classID',
dataType: 'datatype',
itemId: 'itemID',
strokeDashArray: 'strokeDasharray',
strokeDashOffset: 'strokeDashoffset',
strokeLineCap: 'strokeLinecap',
strokeLineJoin: 'strokeLinejoin',
strokeMiterLimit: 'strokeMiterlimit',
typeOf: 'typeof',
xLinkActuate: 'xlinkActuate',
xLinkArcRole: 'xlinkArcrole',
xLinkHref: 'xlinkHref',
xLinkRole: 'xlinkRole',
xLinkShow: 'xlinkShow',
xLinkTitle: 'xlinkTitle',
xLinkType: 'xlinkType',
xmlnsXLink: 'xmlnsXlink',
},
Kv = us([ps, ds, ms, hs, $v], 'html'),
Yv = us([ps, ds, ms, hs, Hv], 'svg');
function Qv(e) {
if (e.allowedElements && e.disallowedElements)
throw new TypeError('Only one of `allowedElements` and `disallowedElements` should be defined');
if (e.allowedElements || e.disallowedElements || e.allowElement)
return (t) => {
Ri(t, 'element', (n, r, i) => {
const a = i;
let o;
if (
(e.allowedElements
? (o = !e.allowedElements.includes(n.tagName))
: e.disallowedElements && (o = e.disallowedElements.includes(n.tagName)),
!o && e.allowElement && typeof r == 'number' && (o = !e.allowElement(n, r, a)),
o && typeof r == 'number')
)
return (
e.unwrapDisallowed && n.children
? a.children.splice(r, 1, ...n.children)
: a.children.splice(r, 1),
r
);
});
};
}
var _r = {},
Xv = {
get exports() {
return _r;
},
set exports(e) {
_r = e;
},
},
ne = {};
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ var Mi = Symbol.for('react.element'),
ji = Symbol.for('react.portal'),
nr = Symbol.for('react.fragment'),
rr = Symbol.for('react.strict_mode'),
ir = Symbol.for('react.profiler'),
ar = Symbol.for('react.provider'),
or = Symbol.for('react.context'),
Jv = Symbol.for('react.server_context'),
lr = Symbol.for('react.forward_ref'),
sr = Symbol.for('react.suspense'),
ur = Symbol.for('react.suspense_list'),
cr = Symbol.for('react.memo'),
dr = Symbol.for('react.lazy'),
_v = Symbol.for('react.offscreen'),
vs;
vs = Symbol.for('react.module.reference');
function Ge(e) {
if (typeof e == 'object' && e !== null) {
var t = e.$$typeof;
switch (t) {
case Mi:
switch (((e = e.type), e)) {
case nr:
case ir:
case rr:
case sr:
case ur:
return e;
default:
switch (((e = e && e.$$typeof), e)) {
case Jv:
case or:
case lr:
case dr:
case cr:
case ar:
return e;
default:
return t;
}
}
case ji:
return t;
}
}
}
ne.ContextConsumer = or;
ne.ContextProvider = ar;
ne.Element = Mi;
ne.ForwardRef = lr;
ne.Fragment = nr;
ne.Lazy = dr;
ne.Memo = cr;
ne.Portal = ji;
ne.Profiler = ir;
ne.StrictMode = rr;
ne.Suspense = sr;
ne.SuspenseList = ur;
ne.isAsyncMode = function () {
return !1;
};
ne.isConcurrentMode = function () {
return !1;
};
ne.isContextConsumer = function (e) {
return Ge(e) === or;
};
ne.isContextProvider = function (e) {
return Ge(e) === ar;
};
ne.isElement = function (e) {
return typeof e == 'object' && e !== null && e.$$typeof === Mi;
};
ne.isForwardRef = function (e) {
return Ge(e) === lr;
};
ne.isFragment = function (e) {
return Ge(e) === nr;
};
ne.isLazy = function (e) {
return Ge(e) === dr;
};
ne.isMemo = function (e) {
return Ge(e) === cr;
};
ne.isPortal = function (e) {
return Ge(e) === ji;
};
ne.isProfiler = function (e) {
return Ge(e) === ir;
};
ne.isStrictMode = function (e) {
return Ge(e) === rr;
};
ne.isSuspense = function (e) {
return Ge(e) === sr;
};
ne.isSuspenseList = function (e) {
return Ge(e) === ur;
};
ne.isValidElementType = function (e) {
return (
typeof e == 'string' ||
typeof e == 'function' ||
e === nr ||
e === ir ||
e === rr ||
e === sr ||
e === ur ||
e === _v ||
(typeof e == 'object' &&
e !== null &&
(e.$$typeof === dr ||
e.$$typeof === cr ||
e.$$typeof === ar ||
e.$$typeof === or ||
e.$$typeof === lr ||
e.$$typeof === vs ||
e.getModuleId !== void 0))
);
};
ne.typeOf = Ge;
(function (e) {
e.exports = ne;
})(Xv);
const Zv = Cs(_r);
function eb(e) {
const t = e && typeof e == 'object' && e.type === 'text' ? e.value || '' : e;
return typeof t == 'string' && t.replace(/[ \t\n\f\r]/g, '') === '';
}
function tb(e) {
return e.join(' ').trim();
}
function nb(e, t) {
const n = t || {};
return (e[e.length - 1] === '' ? [...e, ''] : e)
.join((n.padRight ? ' ' : '') + ',' + (n.padLeft === !1 ? '' : ' '))
.trim();
}
var Rn = {},
rb = {
get exports() {
return Rn;
},
set exports(e) {
Rn = e;
},
},
po = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,
ib = /\n/g,
ab = /^\s*/,
ob = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,
lb = /^:\s*/,
sb = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,
ub = /^[;\s]*/,
cb = /^\s+|\s+$/g,
db = `
`,
fo = '/',
go = '*',
xt = '',
pb = 'comment',
fb = 'declaration',
gb = function (e, t) {
if (typeof e != 'string') throw new TypeError('First argument must be a string');
if (!e) return [];
t = t || {};
var n = 1,
r = 1;
function i(m) {
var h = m.match(ib);
h && (n += h.length);
var x = m.lastIndexOf(db);
r = ~x ? m.length - x : r + m.length;
}
function a() {
var m = { line: n, column: r };
return function (h) {
return (h.position = new o(m)), c(), h;
};
}
function o(m) {
(this.start = m), (this.end = { line: n, column: r }), (this.source = t.source);
}
o.prototype.content = e;
function l(m) {
var h = new Error(t.source + ':' + n + ':' + r + ': ' + m);
if (
((h.reason = m),
(h.filename = t.source),
(h.line = n),
(h.column = r),
(h.source = e),
!t.silent)
)
throw h;
}
function s(m) {
var h = m.exec(e);
if (h) {
var x = h[0];
return i(x), (e = e.slice(x.length)), h;
}
}
function c() {
s(ab);
}
function d(m) {
var h;
for (m = m || []; (h = u()); ) h !== !1 && m.push(h);
return m;
}
function u() {
var m = a();
if (!(fo != e.charAt(0) || go != e.charAt(1))) {
for (var h = 2; xt != e.charAt(h) && (go != e.charAt(h) || fo != e.charAt(h + 1)); ) ++h;
if (((h += 2), xt === e.charAt(h - 1))) return l('End of comment missing');
var x = e.slice(2, h - 2);
return (r += 2), i(x), (e = e.slice(h)), (r += 2), m({ type: pb, comment: x });
}
}
function f() {
var m = a(),
h = s(ob);
if (h) {
if ((u(), !s(lb))) return l("property missing ':'");
var x = s(sb),
b = m({
type: fb,
property: mo(h[0].replace(po, xt)),
value: x ? mo(x[0].replace(po, xt)) : xt,
});
return s(ub), b;
}
}
function p() {
var m = [];
d(m);
for (var h; (h = f()); ) h !== !1 && (m.push(h), d(m));
return m;
}
return c(), p();
};
function mo(e) {
return e ? e.replace(cb, xt) : xt;
}
var mb = gb;
function bs(e, t) {
var n = null;
if (!e || typeof e != 'string') return n;
for (var r, i = mb(e), a = typeof t == 'function', o, l, s = 0, c = i.length; s < c; s++)
(r = i[s]), (o = r.property), (l = r.value), a ? t(o, l, r) : l && (n || (n = {}), (n[o] = l));
return n;
}
rb.exports = bs;
Rn.default = bs;
const hb = Rn,
Zr = {}.hasOwnProperty,
vb = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr']);
function ys(e, t) {
const n = [];
let r = -1,
i;
for (; ++r < t.children.length; )
(i = t.children[r]),
i.type === 'element'
? n.push(bb(e, i, r, t))
: i.type === 'text'
? (t.type !== 'element' || !vb.has(t.tagName) || !eb(i)) && n.push(i.value)
: i.type === 'raw' && !e.options.skipHtml && n.push(i.value);
return n;
}
function bb(e, t, n, r) {
const i = e.options,
a = i.transformLinkUri === void 0 ? xg : i.transformLinkUri,
o = e.schema,
l = t.tagName,
s = {};
let c = o,
d;
if ((o.space === 'html' && l === 'svg' && ((c = Yv), (e.schema = c)), t.properties))
for (d in t.properties) Zr.call(t.properties, d) && xb(s, d, t.properties[d], e);
(l === 'ol' || l === 'ul') && e.listDepth++;
const u = ys(e, t);
(l === 'ol' || l === 'ul') && e.listDepth--, (e.schema = o);
const f = t.position || {
start: { line: null, column: null, offset: null },
end: { line: null, column: null, offset: null },
},
p = i.components && Zr.call(i.components, l) ? i.components[l] : l,
m = typeof p == 'string' || p === _.Fragment;
if (!Zv.isValidElementType(p))
throw new TypeError(`Component for name \`${l}\` not defined or is not renderable`);
if (
((s.key = n),
l === 'a' &&
i.linkTarget &&
(s.target =
typeof i.linkTarget == 'function'
? i.linkTarget(
String(s.href || ''),
t.children,
typeof s.title == 'string' ? s.title : null
)
: i.linkTarget),
l === 'a' &&
a &&
(s.href = a(String(s.href || ''), t.children, typeof s.title == 'string' ? s.title : null)),
!m && l === 'code' && r.type === 'element' && r.tagName !== 'pre' && (s.inline = !0),
!m &&
(l === 'h1' || l === 'h2' || l === 'h3' || l === 'h4' || l === 'h5' || l === 'h6') &&
(s.level = Number.parseInt(l.charAt(1), 10)),
l === 'img' &&
i.transformImageUri &&
(s.src = i.transformImageUri(
String(s.src || ''),
String(s.alt || ''),
typeof s.title == 'string' ? s.title : null
)),
!m && l === 'li' && r.type === 'element')
) {
const h = yb(t);
(s.checked = h && h.properties ? !!h.properties.checked : null),
(s.index = Rr(r, t)),
(s.ordered = r.tagName === 'ol');
}
return (
!m && (l === 'ol' || l === 'ul') && ((s.ordered = l === 'ol'), (s.depth = e.listDepth)),
(l === 'td' || l === 'th') &&
(s.align && (s.style || (s.style = {}), (s.style.textAlign = s.align), delete s.align),
m || (s.isHeader = l === 'th')),
!m && l === 'tr' && r.type === 'element' && (s.isHeader = r.tagName === 'thead'),
i.sourcePos && (s['data-sourcepos'] = Cb(f)),
!m && i.rawSourcePos && (s.sourcePosition = t.position),
!m && i.includeElementIndex && ((s.index = Rr(r, t)), (s.siblingCount = Rr(r))),
m || (s.node = t),
u.length > 0 ? _.createElement(p, s, u) : _.createElement(p, s)
);
}
function yb(e) {
let t = -1;
for (; ++t < e.children.length; ) {
const n = e.children[t];
if (n.type === 'element' && n.tagName === 'input') return n;
}
return null;
}
function Rr(e, t) {
let n = -1,
r = 0;
for (; ++n < e.children.length && e.children[n] !== t; ) e.children[n].type === 'element' && r++;
return r;
}
function xb(e, t, n, r) {
const i = Wv(r.schema, t);
let a = n;
a == null ||
a !== a ||
(Array.isArray(a) && (a = i.commaSeparated ? nb(a) : tb(a)),
i.property === 'style' && typeof a == 'string' && (a = wb(a)),
i.space && i.property
? (e[Zr.call(co, i.property) ? co[i.property] : i.property] = a)
: i.attribute && (e[i.attribute] = a));
}
function wb(e) {
const t = {};
try {
hb(e, n);
} catch {}
return t;
function n(r, i) {
const a = r.slice(0, 4) === '-ms-' ? `ms-${r.slice(4)}` : r;
t[a.replace(/-([a-z])/g, Sb)] = i;
}
}
function Sb(e, t) {
return t.toUpperCase();
}
function Cb(e) {
return [e.start.line, ':', e.start.column, '-', e.end.line, ':', e.end.column]
.map(String)
.join('');
}
const ho = {}.hasOwnProperty,
Db = 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md',
xn = {
plugins: { to: 'remarkPlugins', id: 'change-plugins-to-remarkplugins' },
renderers: { to: 'components', id: 'change-renderers-to-components' },
astPlugins: { id: 'remove-buggy-html-in-markdown-parser' },
allowDangerousHtml: { id: 'remove-buggy-html-in-markdown-parser' },
escapeHtml: { id: 'remove-buggy-html-in-markdown-parser' },
source: { to: 'children', id: 'change-source-to-children' },
allowNode: { to: 'allowElement', id: 'replace-allownode-allowedtypes-and-disallowedtypes' },
allowedTypes: {
to: 'allowedElements',
id: 'replace-allownode-allowedtypes-and-disallowedtypes',
},
disallowedTypes: {
to: 'disallowedElements',
id: 'replace-allownode-allowedtypes-and-disallowedtypes',
},
includeNodeIndex: {
to: 'includeElementIndex',
id: 'change-includenodeindex-to-includeelementindex',
},
};
function xs(e) {
for (const a in xn)
if (ho.call(xn, a) && ho.call(e, a)) {
const o = xn[a];
console.warn(
`[react-markdown] Warning: please ${
o.to ? `use \`${o.to}\` instead of` : 'remove'
} \`${a}\` (see <${Db}#${o.id}> for more info)`
),
delete xn[a];
}
const t = Fg()
.use(Wh)
.use(e.remarkPlugins || [])
.use(Fv, { ...e.remarkRehypeOptions, allowDangerousHtml: !0 })
.use(e.rehypePlugins || [])
.use(Qv, e),
n = new zl();
typeof e.children == 'string'
? (n.value = e.children)
: e.children !== void 0 &&
e.children !== null &&
console.warn(
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`
);
const r = t.runSync(t.parse(n), n);
if (r.type !== 'root') throw new TypeError('Expected a `root` node');
let i = _.createElement(_.Fragment, {}, ys({ options: e, schema: Kv, listDepth: 0 }, r));
return e.className && (i = _.createElement('div', { className: e.className }, i)), i;
}
xs.propTypes = {
children: W.string,
className: W.string,
allowElement: W.func,
allowedElements: W.arrayOf(W.string),
disallowedElements: W.arrayOf(W.string),
unwrapDisallowed: W.bool,
remarkPlugins: W.arrayOf(
W.oneOfType([
W.object,
W.func,
W.arrayOf(W.oneOfType([W.bool, W.string, W.object, W.func, W.arrayOf(W.any)])),
])
),
rehypePlugins: W.arrayOf(
W.oneOfType([
W.object,
W.func,
W.arrayOf(W.oneOfType([W.bool, W.string, W.object, W.func, W.arrayOf(W.any)])),
])
),
sourcePos: W.bool,
rawSourcePos: W.bool,
skipHtml: W.bool,
includeElementIndex: W.bool,
transformLinkUri: W.oneOfType([W.func, W.bool]),
linkTarget: W.oneOfType([W.func, W.string]),
transformImageUri: W.func,
components: W.object,
};
const Ib = () =>
new Promise((e) => {
chrome.storage.sync.get(
[
'rolesList',
'tokenLength',
'role',
'length',
'openAIkey',
'keyStatus',
'liStatus',
'isSubscription',
'params',
'license',
],
(t) => e(t)
);
});
let vo = '',
bo = 'Chat',
bt = 0;
const kb = () => Math.random().toString(36).slice(2, 6),
Eb = () => {
const [e, t] = N.useState(0),
[n, r] = N.useState(''),
[i, a] = N.useState(!1),
[o, l] = N.useState(''),
s = N.useRef(null),
[c, d] = N.useState([]),
[u, f] = N.useState(),
p = N.useRef(null),
[m, h] = N.useState({ bytes: 0, megaBytes: 0 }),
[x, b] = N.useState(!1),
[C, S] = N.useState(''),
D = (k) => {
const Q = JSON.stringify(k).length,
oe = Q / (1024 * 1024);
h({ bytes: Q, megaBytes: Number(oe.toFixed(2)) });
};
N.useEffect(() => {
chrome.storage.local.get(['qChats', 'token'], (k) => {
const v = k.qChats || [],
Q = k.token || '';
d(v), S(Q), f(v[0]), D(v);
});
}, []),
N.useEffect(() => {
var k;
f(c[e]), (k = s.current) == null || k.focus();
}, [e]),
N.useEffect(() => {
var k;
(p.current.scrollTop = p.current.scrollHeight), (k = s.current) == null || k.focus();
}, [u]);
const E = (k) => {
t(k), a(!1), r('');
},
w = (k) => {
k.stopPropagation(), a(() => !0), r(() => (u == null ? void 0 : u.title) || '');
},
O = (k) => {
k.stopPropagation();
const v = [...c];
(v[e].title = n), a(!1), r(''), d(v), chrome.storage.local.set({ qChats: v });
},
L = (k) => {
k.stopPropagation(), a(!1), r('');
},
F = (k) => {
k.stopPropagation();
const v = [...c];
v.splice(e, 1), t(() => 0), f(v[0]), d(() => v), chrome.storage.local.set({ qChats: v });
},
V = async (k) => {
var I, T, z;
if ((k.preventDefault(), !o)) return;
const v = { title: o.split(' ').slice(0, 6).join(' '), id: kb(), messages: [] };
let Q = '',
oe = '',
ee = 's';
const he = await Ib(),
{
rolesList: fe,
tokenLength: Le,
role: Se,
length: Ve,
openAIkey: et,
keyStatus: ft,
liStatus: tt,
isSubscription: Je,
params: nt,
license: rt,
} = he;
if (!tt || (!Je && (!et || !ft))) return;
(oe = Se), (ee = bt || Ve);
const Ke =
/^([\w\s.,`+:^;@<>=!\\|?\\'"()\\[\]{}$%&*-]+)(?:\/([\w\s]+))?(?:#([\w\s]+))?$/gi.exec(o);
if (Ke) {
const [, U, H, de] = Ke;
H && (oe = H), U && (Q = U), de && (ee = de);
}
if (oe) {
const U =
(fe == null
? void 0
: fe.filter((H) => H.name.toLowerCase() === oe.toLocaleLowerCase())) || [];
U.length > 0 &&
((vo = U[0].prompt), (bo = U[0].name), chrome.storage.sync.set({ role: U[0].id }));
}
if (ee) {
const U = parseInt(ee);
if (U) bt = U;
else {
const H = ee.toLowerCase(),
De =
Le[
H === 's' || H === 'small'
? 'small'
: H === 'm' || H === 'medium'
? 'medium'
: H === 'l' || H === 'long'
? 'long'
: H === 'll' || H === 'longer'
? 'longer'
: Ve
];
De && (bt = De);
}
}
const it = { user: Q + `[${bo}]`, ai: '' },
dn = `</s> Provide answer in no more than ${bt} tokens.`,
gt = [];
u == null ||
u.messages.forEach((U) => {
gt.push({ role: 'system', content: U.ai }), gt.push({ role: 'user', content: U.user });
}),
gt.push({ role: 'system', content: vo }),
gt.push({ role: 'user', content: Q + (bt ? dn : '') });
const pn = {
model: nt.gptModel || 'gpt-3.5-turbo',
messages: gt,
stream: !0,
...(bt && { max_tokens: bt }),
...(Je ? { license: rt, token: C } : {}),
},
_e = { ...(u || v) };
_e.messages.push(it);
const mt = _e.messages.length - 1;
l(''), f(() => _e);
let Ct = '';
try {
if (!Je) {
const H = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${et}` },
body: JSON.stringify(pn),
}),
de = (I = H == null ? void 0 : H.body) == null ? void 0 : I.getReader(),
De = new TextDecoder('utf-8');
for (;;) {
const { done: Pe, value: Ze } = (await (de == null ? void 0 : de.read())) || {};
if (Pe) break;
const Ae = De.decode(Ze),
le = Ae.split(`
`);
if (Ae.includes('error') && Ae.includes('message')) {
const Lt = JSON.parse(Ae).error.message;
(Ct += Lt),
f((at) => {
const fn = { ...at };
return (fn.messages[mt].ai += Lt), fn;
});
break;
}
const ht = le
.map((ue) => ue.replace(/^data: /, '').trim())
.filter((ue) => ue !== '' && ue !== '[DONE]')
.map((ue) => JSON.parse(ue));
for (const ue of ht) {
const at =
(z = (T = (ue == null ? void 0 : ue.choices)[0]) == null ? void 0 : T.delta) ==
null
? void 0
: z.content;
at &&
((Ct += at),
f((fn) => {
const zi = { ...fn };
return (zi.messages[mt].ai += at), zi;
}));
}
}
}
if (Je) {
const H = await fetch('https://api.quickyai.com/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(pn),
}),
de = H.headers.get('x-token');
de && chrome.storage.local.set({ token: de });
const Pe = H.body.getReader(),
Ze = new TextDecoder();
let Ae = !1;
for (; !Ae; ) {
const { value: le, done: ht } = await Pe.read();
Ae = ht;
const ue = Ze.decode(le);
(Ct += ue),
f((Lt) => {
const at = { ...Lt };
return (at.messages[mt].ai += ue), at;
});
}
}
_e.messages[mt].ai = Ct;
const U = c.length > 0 ? [...c] : [v];
(U[e] = u || { ..._e }), d(U), chrome.storage.local.set({ qChats: U });
} catch {
(_e.messages[mt].ai = 'Something went wrong'), f(_e);
}
},
A = (k) => {
k.key === 'Enter' && !k.shiftKey && (k.preventDefault(), V(k));
},
R = (k) => {
k.stopPropagation(), r(k.target.value);
},
Y = (k) => {
l(k.currentTarget.value);
},
q = (k) => {
const v = (k.match(/\n/g) || []).length;
return Math.min(v + 1, 5);
};
function $(k, v) {
const Q = document.createElement('a');
Q.setAttribute(
'href',
'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(v))
),
Q.setAttribute('download', k),
(Q.style.display = 'none'),
document.body.appendChild(Q),
Q.click(),
document.body.removeChild(Q);
}
const J = () => {
const k = c || [];
if (k.length < 1) return;
const v = new Date().toISOString().slice(0, 10);
$(`QuickyAI_Chats_${v}.json`, k);
},
ie = () => {
const k = document.createElement('input');
(k.type = 'file'),
(k.accept = 'application/json'),
(k.style.display = 'none'),
document.body.appendChild(k),
k.click(),
(k.onchange = () => {
const v = k.files;
if (v.length <= 0 || v[0].type !== 'application/json') return;
const Q = new FileReader();
Q.readAsText(v[0]),
(Q.onload = async (oe) => {
var fe;
if (!((fe = oe.target) != null && fe.result)) return;
const ee = JSON.parse(oe.target.result),
he = [...c, ...ee];
d(he), f(he[0]), D(he), chrome.storage.local.set({ qChats: he });
}),
document.body.removeChild(k);
});
},
ce = () => {
const k = [...c];
(k.length = 0),
t(() => 0),
d(() => k),
f(k[0]),
D(k),
chrome.storage.local.set({ qChats: k }),
b(!1);
},
me = () => {
b(!0);
},
y = (k) => {
k.stopPropagation(), b(!1);
},
pe = () => {
if ((t(() => 0), c.length < 1 || !c[0] || !u)) return;
const k = [...c];
k.unshift(void 0), d(k), f(void 0);
};
return g.jsxs(g.Fragment, {
children: [
g.jsx(yg, { isOpen: x, onDelete: ce, onClose: y }),
g.jsxs('div', {
className:
'w-full flex gap-2 overflow-hidden relative text-base h-[85vh] p-4 mt-4 max-w-[86rem] mx-auto',
children: [
g.jsxs('div', {
className: 'w-1/4 p-2 pb-12 bg-gray-700 rounded-lg text-white',
children: [
g.jsxs('div', {
className: 'flex justify-between items-center mb-4',
children: [
g.jsx('h1', {
className: 'text-2xl px-2 font-medium mb-0',
children: 'History',
}),
g.jsx('button', {
className: 'px-2 py-0.5 rounded bg-blue-500 hover:bg-blue-600 text-sm',
onClick: pe,
children: 'New chat',
}),
],
}),
g.jsx('ul', {
className: 'space-y-4 overflow-auto h-[92%] scrollbar list-none',
children: c.map((k, v) =>
g.jsxs(
'li',
{
className: `${
v === e ? 'bg-blue-100 text-gray-900' : ''
} p-2 rounded cursor-pointer`,
onClick: () => E(v),
children: [
g.jsxs('div', {
className: 'flex items-center justify-between',
children: [
i && v === e
? g.jsx('input', {
type: 'text',
className:
'border border-blue-500 rounded-md px-1 focus:outline-none',
value: n,
onChange: R,
autoFocus: !0,
})
: g.jsx('span', {
className:
'text-ellipsis overflow-hidden inline-block whitespace-nowrap w-[220px]',
children: k == null ? void 0 : k.title,
}),
v === e &&
g.jsxs('div', {
children: [
!i &&
g.jsx('button', {
className:
'text-blue-500 hover:text-blue-600 focus:outline-none mr-3',
onClick: w,
title: 'Edit title',
children: g.jsxs('svg', {
stroke: 'currentColor',
fill: 'none',
strokeWidth: '2',
viewBox: '0 0 24 24',
strokeLinecap: 'round',
strokeLinejoin: 'round',
className: 'h-4 w-4',
height: '1em',
width: '1em',
xmlns: 'http://www.w3.org/2000/svg',
children: [
g.jsx('path', { d: 'M12 20h9' }),
g.jsx('path', {
d: 'M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z',
}),
],
}),
}),
!i &&
g.jsx('button', {
className:
'text-red-400 hover:text-red-500 focus:outline-none',
onClick: F,
title: 'Delete chat',
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-4 h-4',
viewBox: '0 0 24 24',
children: g.jsxs('g', {
fill: 'currentColor',
children: [
g.jsx('path', {
d: 'M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877Z',
}),
g.jsx('path', {
fillRule: 'evenodd',
d: 'M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5c-.454.5-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886Zm-1.35-9.811c-.04-.434-.408-.75-.82-.707c-.413.043-.713.43-.672.864l.5 5.263c.04.434.408.75.82.707c.413-.043.713-.43.672-.864l-.5-5.263Zm4.329-.707c.412.043.713.43.671.864l-.5 5.263c-.04.434-.409.75-.82.707c-.413-.043-.713-.43-.672-.864l.5-5.263c.04-.434.409-.75.82-.707Z',
clipRule: 'evenodd',
}),
],
}),
}),
}),
i &&
g.jsxs(g.Fragment, {
children: [
g.jsx('button', {
className:
'text-blue-500 hover:text-blue-600 focus:outline-none mr-3',
onClick: O,
title: 'Save edit',
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: '1em',
height: '1em',
viewBox: '0 0 64 64',
children: g.jsx('path', {
fill: 'currentColor',
d: 'M56 2L18.8 42.9L8 34.7H2L18.8 62L62 2z',
}),
}),
}),
g.jsx('button', {
className:
'text-gray-600 hover:text-gray-700 focus:outline-none',
onClick: L,
title: 'Cancel edit',
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: '1em',
height: '1em',
viewBox: '0 0 15 15',
children: g.jsx('path', {
fill: 'currentColor',
d: 'M3.64 2.27L7.5 6.13l3.84-3.84A.92.92 0 0 1 12 2a1 1 0 0 1 1 1a.9.9 0 0 1-.27.66L8.84 7.5l3.89 3.89A.9.9 0 0 1 13 12a1 1 0 0 1-1 1a.92.92 0 0 1-.69-.27L7.5 8.87l-3.85 3.85A.92.92 0 0 1 3 13a1 1 0 0 1-1-1a.9.9 0 0 1 .27-.66L6.16 7.5L2.27 3.61A.9.9 0 0 1 2 3a1 1 0 0 1 1-1c.24.003.47.1.64.27Z',
}),
}),
}),
],
}),
],
}),
],
}),
g.jsxs('span', {
children: [
(k == null ? void 0 : k.messages.length) || 0,
' ',
(k == null ? void 0 : k.messages.length) === 1
? 'response'
: 'responses',
],
}),
],
},
v
)
),
}),
g.jsxs('div', {
className: 'text-sm rounded h-[8%] flex gap-2 justify-start items-center px-2',
children: [
g.jsxs('button', {
className:
'px-2 py-1 rounded bg-blue-500 hover:bg-blue-600 flex gap-1 items-center',
onClick: ie,
title: 'Import chats',
children: [
g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-4 h-4',
viewBox: '0 0 24 24',
children: g.jsx('path', {
fill: 'currentColor',
d: 'm14 12l-4-4v3H2v2h8v3m10 2V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v3h2V6h12v12H6v-3H4v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2Z',
}),
}),
g.jsx('span', { children: 'Import' }),
],
}),
g.jsxs('button', {
className:
'px-2 py-1 rounded bg-purple-500 hover:bg-purple-600 flex gap-1 items-center',
onClick: J,
title: 'Export chats',
children: [
g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-4 h-4',
viewBox: '0 0 24 24',
children: g.jsx('path', {
fill: 'currentColor',
d: 'm23 12l-4-4v3h-9v2h9v3M1 18V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3h-2V6H3v12h12v-3h2v3a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2Z',
}),
}),
g.jsx('span', { children: 'Export' }),
],
}),
g.jsx('button', {
title: 'Delete all chats',
className:
'px-2 py-1.5 rounded bg-red-500 hover:bg-red-600 flex gap-1 items-center',
onClick: me,
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-4 h-4',
viewBox: '0 0 24 24',
children: g.jsxs('g', {
fill: 'currentColor',
children: [
g.jsx('path', {
d: 'M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877Z',
}),
g.jsx('path', {
fillRule: 'evenodd',
d: 'M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5c-.454.5-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886Zm-1.35-9.811c-.04-.434-.408-.75-.82-.707c-.413.043-.713.43-.672.864l.5 5.263c.04.434.408.75.82.707c.413-.043.713-.43.672-.864l-.5-5.263Zm4.329-.707c.412.043.713.43.671.864l-.5 5.263c-.04.434-.409.75-.82.707c-.413-.043-.713-.43-.672-.864l.5-5.263c.04-.434.409-.75.82-.707Z',
clipRule: 'evenodd',
}),
],
}),
}),
}),
g.jsxs('div', {
className: 'justify-self-end whitespace-nowrap',
title: 'Size of the chats',
children: [
g.jsxs('span', {
className: 'text-gray-50',
children: [m.megaBytes, 'MB'],
}),
g.jsx('span', { className: 'px-0.5', children: '/' }),
g.jsx('span', { className: 'text-gray-400', children: '5MB' }),
],
}),
],
}),
],
}),
g.jsxs('div', {
className: 'w-3/4 pl-4 h-full relative rounded-lg',
children: [
g.jsx('h2', {
className: 'text-lg font-semibold mb-1',
children: u == null ? void 0 : u.title,
}),
g.jsxs('div', {
className: 'overflow-auto h-[85%] scrollbar pb-32',
ref: p,
children: [
u == null
? void 0
: u.messages.map((k, v) =>
g.jsxs(
'div',
{
className: 'flex flex-col gap-2',
children: [
g.jsxs('div', {
className: 'flex items-start gap-2 rounded bg-gray-100 p-3',
children: [
g.jsx('div', {
className:
'text-gray-700 rounded-full w-8 h-8 flex items-center justify-center border border-gray-300',
children: g.jsx('span', {
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-7 h-7',
viewBox: '0 0 24 24',
children: g.jsx('path', {
fill: 'currentColor',
d: 'M12 12q-1.65 0-2.825-1.175T8 8q0-1.65 1.175-2.825T12 4q1.65 0 2.825 1.175T16 8q0 1.65-1.175 2.825T12 12Zm-8 8v-2.8q0-.85.438-1.563T5.6 14.55q1.55-.775 3.15-1.163T12 13q1.65 0 3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2V20H4Z',
}),
}),
}),
}),
g.jsx('div', {
className: 'ml-2',
children: g.jsx('p', { children: k.user }),
}),
],
}),
g.jsxs('div', {
className: 'flex items-start gap-2 p-3',
children: [
g.jsx('div', {
className:
'rounded-full w-8 h-8 flex-shrink-0 select-none flex items-center justify-center p-1 border',
children: g.jsx('img', { src: '/icon-32.png', alt: 'AI' }),
}),
g.jsx('div', {
className: 'ml-2 w-full rounded',
children: g.jsx(xs, { children: k.ai }),
}),
],
}),
],
},
v
)
),
!u &&
g.jsxs('div', {
className: 'flex flex-col items-center gap-4 mt-32',
children: [
g.jsx('div', {
className: 'text-4xl text-gray-600 font-medium',
children: 'QuickyAI',
}),
g.jsx('div', {
className: 'text-center text-xl text-gray-500',
children: 'Start your new Chat now!',
}),
],
}),
],
}),
g.jsx('div', {
className: 'mt-4 h-[6%]',
children: g.jsxs('form', {
className: 'flex items-end gap-2 bottom-0 absolute w-full',
children: [
g.jsx('textarea', {
className:
'border border-gray-300 rounded-lg px-3 py-2 focus:outline-blue-400 max-h-64 text-base resize-none no-scrollbar w-[80%]',
placeholder: 'Enter your text',
onChange: Y,
rows: q(o),
ref: s,
onKeyDown: A,
value: o,
autoFocus: !0,
}),
g.jsx('button', {
className:
'bg-blue-400 hover:bg-blue-500 text-white px-6 py-2 rounded-lg w-[17%] flex justify-center items-center outline-none',
onClick: V,
type: 'submit',
children: g.jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
className: 'w-6 h-6',
viewBox: '0 0 24 24',
children: g.jsx('path', {
fill: 'currentColor',
d: 'm20.665 3.717l-17.73 6.837c-1.21.486-1.203 1.161-.222 1.462l4.552 1.42l10.532-6.645c.498-.303.953-.14.579.192l-8.533 7.701h-.002l.002.001l-.314 4.692c.46 0 .663-.211.921-.46l2.211-2.15l4.599 3.397c.848.467 1.457.227 1.668-.785l3.019-14.228c.309-1.239-.473-1.8-1.282-1.434z',
}),
}),
}),
],
}),
}),
],
}),
],
}),
],
});
},
Pb = [
{ name: 'rose', hex: '#ffeff3' },
{ name: 'blue', hex: '#e1efff' },
{ name: 'purple', hex: '#e5e0fd' },
{ name: 'lime', hex: '#c3ffc9' },
{ name: 'yellow', hex: '#fdf8b8' },
],
Ab = [
{ name: 'GPT-4', value: 'gpt-4' },
{ name: 'GPT-4 32K', value: 'gpt-4-32k' },
{ name: 'GPT-3.5', value: 'gpt-3.5-turbo' },
{ name: 'GPT-3.5 16K', value: 'gpt-3.5-turbo-16k' },
],
yo = {
completionTextSize: 17,
titleBg: '#ffeff3',
gptModel: 'gpt-3.5-turbo',
titleTextSize: 15,
hideRole: !1,
},
Nb = () => {
const [e, t] = N.useState(yo),
[n, r] = N.useState(!0);
N.useEffect(() => {
chrome.storage.sync.get(['params'], (u) => {
if (u.params) {
const {
completionTextSize: f,
titleBg: p,
gptModel: m,
titleTextSize: h,
hideRole: x,
} = u.params;
t(() => ({
completionTextSize: f,
titleBg: p,
gptModel: m,
titleTextSize: h,
hideRole: x,
})),
setTimeout(() => {
r(!0);
}, 1);
}
});
}, []),
N.useEffect(() => {
r(!1);
}, [e]);
const i = (u) => {
const f = +u.currentTarget.value;
t((p) => ({ ...p, completionTextSize: f }));
},
a = (u) => {
const f = +u.currentTarget.value;
t((p) => ({ ...p, titleTextSize: f }));
},
o = (u) => {
const f = u.target.value;
t((p) => ({ ...p, gptModel: f }));
},
l = (u) => {
const f = u.target.checked;
t((p) => ({ ...p, hideRole: f }));
},
s = (u) => {
t((f) => ({ ...f, titleBg: u }));
},
c = () => {
const { completionTextSize: u, titleBg: f, gptModel: p, titleTextSize: m, hideRole: h } = e;
chrome.storage.sync.get(['params'], (x) => {
const b = x.params,
C = { completionTextSize: u, titleBg: f, gptModel: p, titleTextSize: m, hideRole: h };
chrome.storage.sync.set({ params: { ...b, ...C } }), r(!0);
});
},
d = () => {
t(yo);
};
return g.jsxs('div', {
className: 'px-20 mx-auto pb-20 max-w-6xl relative',
children: [
g.jsx('h1', {
className: 'text-3xl font-semibold text-center font-sans mt-6',
children: 'Settings',
}),
g.jsxs('div', {
className: 'text-base mt-6 flex flex-col gap-6',
children: [
g.jsxs('div', {
className: 'flex items-center gap-4',
children: [
g.jsxs('div', {
className: 'font-medium',
children: [
g.jsx('span', { className: 'w-32 inline-block', children: 'GPT Model' }),
g.jsx('span', { children: ':' }),
],
}),
g.jsxs('div', {
className: 'relative',
children: [
g.jsx('select', {
id: 'model',
className:
'block appearance-none bg-gray-50 border border-gray-300 hover:border-gray-300 px-2 py-1 pr-8 rounded-md leading-normal focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-sm font-medium',
value: e.gptModel,
onChange: o,
children: Ab.map((u, f) =>
g.jsx('option', { value: u.value, children: u.name }, f)
),
}),
g.jsx('div', {
className:
'pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700',
children: g.jsx('svg', {
className: 'fill-current h-4 w-4',
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 20 20',
children: g.jsx('path', { d: 'M10 12l-6-6h12z' }),
}),
}),
],
}),
],
}),
g.jsxs('div', {
className: 'flex items-center gap-4',
children: [
g.jsxs('div', {
className: 'font-medium',
children: [
g.jsx('span', { className: 'w-32 inline-block', children: 'Result text size' }),
g.jsx('span', { children: ':' }),
],
}),
g.jsxs('div', {
className: 'flex gap-2 items-center',
children: [
g.jsx('input', {
type: 'number',
min: 5,
value: e.completionTextSize,
onChange: i,
className:
'block w-20 px-2 py-0.5 text-gray-900 border border-gray-300 rounded-md bg-gray-50 focus:ring-blue-500 focus:ring-2 outline-none ',
}),
' ',
g.jsx('span', { children: 'px' }),
],
}),
],
}),
g.jsxs('div', {
className: 'flex items-center gap-4',
children: [
g.jsxs('div', {
className: 'font-medium',
children: [
g.jsx('span', { className: 'w-32 inline-block', children: 'Title text size' }),
g.jsx('span', { children: ':' }),
],
}),
g.jsxs('div', {
className: 'flex gap-2 items-center',
children: [
g.jsx('input', {
type: 'number',
min: 5,
value: e.titleTextSize,
onChange: a,
className:
'block w-20 px-2 py-0.5 text-gray-900 border border-gray-300 rounded-md bg-gray-50 focus:ring-blue-500 focus:ring-2 outline-none ',
}),
' ',
g.jsx('span', { children: 'px' }),
],
}),
],
}),
g.jsxs('div', {
className: 'flex items-center gap-4',
children: [
g.jsxs('div', {
className: 'font-medium',
children: [
g.jsx('span', { className: 'w-32 inline-block', children: 'Hide prompt' }),
g.jsx('span', { children: ':' }),
],
}),
g.jsx('div', {
className: '-mb-2',
children: g.jsxs('label', {
className: 'relative inline-flex items-center cursor-pointer',
children: [
g.jsx('input', {
type: 'checkbox',
checked: e.hideRole,
onChange: l,
className: 'sr-only peer',
}),
g.jsx('div', {
className:
"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600",
}),
],
}),
}),
],
}),
g.jsxs('div', {
className: 'flex items-center gap-4',
children: [
g.jsxs('div', {
className: 'font-medium',
children: [
g.jsx('span', { className: 'w-32 inline-block', children: 'Theme color' }),
g.jsx('span', { children: ':' }),
],
}),
g.jsx('div', {
className: 'flex gap-2 items-center',
children: Pb.map((u) =>
g.jsx(
'button',
{
className: `px-3 py-1 rounded text-gray-700 font-medium mr-2 mb-2 text-ellipsis overflow-hidden w-16 h-6 flex justify-center items-center hover:outline outline-blue-400 ${
u.hex === e.titleBg ? 'outline outline-offset-2 outline-2' : ''
}`,
style: { backgroundColor: u.hex },
onClick: () => s(u.hex),
},
u.name
)
),
}),
],
}),
g.jsxs('div', {
className: 'flex items-center gap-4 font-normal mt-10',
children: [
g.jsx('button', {
className:
'bg-gray-400 hover:bg-gray-500 text-white py-2 px-4 rounded-md transition-colors duration-200',
onClick: d,
children: 'Restore default',
}),
g.jsx('button', {
className: `${
n ? 'bg-green-600 hover:bg-green-700' : 'bg-blue-600 hover:bg-blue-700'
} text-white py-2 px-4 rounded-md transition-colors duration-200`,
onClick: c,
children: n ? 'Saved' : 'Save settings',
}),
],
}),
],
}),
g.jsx('div', {
className: 'absolute right-6 top-20',
children: g.jsxs('div', {
className: 'bs-container w-[360px] h-40',
children: [
g.jsxs('div', {
className: 'bs-title-container',
style: { backgroundColor: e.titleBg },
children: [
g.jsxs('div', {
className: 'bs-controls',
children: [
g.jsx('div', { className: 'bs-red bs-circle', children: '×' }),
g.jsx('div', { className: 'bs-yellow bs-circle', children: '–' }),
g.jsx('div', { className: 'bs-green bs-circle', children: '+' }),
],
}),
g.jsxs('div', {
className: 'bs-title',
style: { fontSize: e.titleTextSize },
children: [
'Quicky AI',
' ',
g.jsx('span', {
className: 'bs-title-role',
style: { display: e.hideRole ? 'none' : 'inline' },
children: '(Explain)',
}),
],
}),
],
}),
g.jsx('div', {
className: 'bs-completion',
spellCheck: 'false',
'data-bs-text': 'Enter your text here',
style: { fontSize: e.completionTextSize },
children:
'A sample response text to check the size of it. A sample response text to check the size of it.',
}),
g.jsx('div', {
className: 'bs-copy-container',
children: g.jsx('div', {
className: 'bs-copy',
children: g.jsxs('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: '20',
height: '20',
viewBox: '0 0 24 24',
fill: 'none',
stroke: 'currentColor',
strokeWidth: '2',
strokeLinecap: 'round',
strokeLinejoin: 'round',
className: 'feather feather-copy',
children: [
g.jsx('rect', {
x: '9',
y: '9',
width: '13',
height: '13',
rx: '2',
ry: '2',
}),
g.jsx('path', {
d: 'M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1',
}),
],
}),
}),
}),
g.jsx('div', { className: 'bs-resizer' }),
],
}),
}),
],
});
};
function Ob() {
const [e, t] = N.useState('keys'),
r = new URLSearchParams(document.location.search).get('id');
N.useEffect(() => {
r === 'keys' && t('keys'),
r === 'prompts' && t('prompts'),
r === 'shortcuts' && t('shortcuts'),
r === 'guide' && t('guide'),
r === 'history' && t('history'),
r === 'settings' && t('settings');
}, []);
const i = (a) => {
t(a);
const o = new URL(window.location.href);
o.searchParams.set('id', a), window.history.pushState(null, '', o.toString());
};
return g.jsxs(g.Fragment, {
children: [
g.jsx(Is, { onClick: i, selectedTab: e }),
e === 'keys' && g.jsx(Ps, {}),
e === 'prompts' && g.jsx(mg, {}),
e === 'shortcuts' && g.jsx(vg, {}),
e === 'guide' && g.jsx(bg, {}),
e === 'history' && g.jsx(Eb, {}),
e === 'settings' && g.jsx(Nb, {}),
],
});
}
function Tb() {
const e = document.querySelector('#__root');
if (!e) throw new Error("Can't find Options root element");
Ds(e).render(g.jsx(Ob, {}));
}
Tb();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment