@ddict/popup 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/popup.es.js +1027 -1020
- package/dist/popup.umd.js +7 -7
- package/package.json +1 -1
package/dist/popup.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock as w, createElementBlock as $, createElementVNode as C, computed as S, unref as
|
|
1
|
+
import { openBlock as w, createElementBlock as $, createElementVNode as C, computed as S, unref as k, shallowRef as fn, watch as F, triggerRef as ut, onScopeDispose as tt, ref as E, onUnmounted as nt, inject as Ie, watchEffect as re, onMounted as xe, cloneVNode as Ot, h as Ee, Fragment as Z, defineComponent as ae, provide as ot, reactive as $t, nextTick as Q, toRaw as K, effectScope as Tt, markRaw as de, hasInjectionContext as pn, getCurrentInstance as It, isRef as Ce, isReactive as lt, toRef as Ge, getCurrentScope as Lt, toRefs as ct, mergeModels as vn, useModel as hn, createBlock as ee, withCtx as Pe, createVNode as H, renderList as se, normalizeClass as _e, toDisplayString as te, createCommentVNode as X, withModifiers as dt, createTextVNode as mn, withDirectives as Pt, vModelText as Vt, pushScopeId as gn, popScopeId as bn } from "vue";
|
|
2
2
|
const Cn = "data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%200%2096%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40.151%208.94498H35.7256V23.055H40.151C44.7473%2023.055%2047.826%2020.0825%2047.826%2015.9795C47.8267%2011.8093%2044.7678%208.94498%2040.151%208.94498ZM40.1312%2021.025H37.993V10.9974H40.1312C43.4217%2010.9974%2045.4972%2012.9846%2045.4972%2015.9795C45.4965%2018.9296%2043.4012%2021.025%2040.1312%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M54.5158%208.94498H50.0903V23.055H54.5158C59.1121%2023.055%2062.1908%2020.0825%2062.1908%2015.9795C62.1914%2011.8093%2059.1351%208.94498%2054.5158%208.94498ZM54.496%2021.025H52.3578V10.9974H54.496C57.789%2010.9974%2059.8619%2012.9846%2059.8619%2015.9795C59.8613%2018.9296%2057.766%2021.025%2054.496%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M66.7237%208.94498H64.4575V23.055H66.7237V8.94498Z'%20fill='%233B5695'/%3e%3cpath%20d='M76.4301%2010.7837C78.29%2010.7837%2079.7436%2011.6603%2080.7487%2013.2207L82.4589%2011.9591C81.2401%209.97057%2078.9957%208.70953%2076.409%208.70953C72.3898%208.64555%2068.9048%2011.9591%2068.9906%2016C68.9048%2020.0403%2072.3898%2023.3544%2076.409%2023.2905C79.0385%2023.2905%2081.2618%2022.0294%2082.4589%2020.0409L80.7487%2018.7793C79.7436%2020.3397%2078.29%2021.2163%2076.4301%2021.2163C73.544%2021.2163%2071.3418%2018.993%2071.3418%2016C71.3418%2013.007%2073.5433%2010.7837%2076.4301%2010.7837Z'%20fill='%233B5695'/%3e%3cpath%20d='M83.3135%208.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.66351%204.7121H4.604V15.4427L6.87208%2013.3839V6.79143H8.64559C11.4639%206.79143%2013.2835%208.47857%2013.2835%2011.0877C13.2835%2013.6916%2011.421%2015.4427%208.64559%2015.4427H4.604V17.5016H8.66351C12.7531%2017.5016%2015.6098%2014.8644%2015.6098%2011.0877C15.6104%207.27575%2012.8196%204.7121%208.66351%204.7121Z'%20fill='%233B5695'/%3e%3cpath%20d='M26.2425%209.25528H21.5502L20.7537%2014.293L21.4523%2014.3308L21.4069%2014.7294C21.3916%2014.8656%2021.3289%2015.0448%2021.112%2015.1734C21.1017%2015.9399%2021.0845%2017.0493%2020.9706%2018.1766H26.5937V19.8586H21.4677C22.4133%2022.9424%2024.1254%2024.9648%2026.5611%2025.8669L27.1536%2026.0864L26.6795%2026.5048C26.4875%2026.6737%2026.2182%2027.0141%2026.0896%2027.2489L25.9258%2027.5438L25.6155%2027.4152C23.167%2026.4095%2021.4223%2024.4926%2020.2905%2021.563C19.3602%2024.3365%2017.5797%2026.2553%2014.8592%2027.428L14.5438%2027.5617L14.3775%2027.2642C14.2764%2027.08%2014.0294%2026.7876%2013.8151%2026.5989L13.3564%2026.1951L13.9239%2025.9655C16.4555%2024.9392%2018.064%2023.1414%2018.8228%2020.4837C19.6647%2019.8381%2020.2099%2018.8221%2020.2169%2017.6801V4.53231C20.2169%202.58349%2018.6334%201%2016.6846%201H3.53487C1.58349%201%200%202.58349%200%204.53231V17.6795C0%2019.6283%201.58349%2021.2143%203.53487%2021.2143H8.25528V27.2431C8.25528%2029.3135%209.93986%2031%2012.0096%2031H26.2431C28.3161%2031%2029.9974%2029.3129%2029.9974%2027.2431V13.0096C29.9974%2010.9392%2028.3154%209.25528%2026.2425%209.25528ZM3.53487%2019.4517C2.55662%2019.4517%201.762%2018.6603%201.762%2017.6788V4.53231C1.762%203.55662%202.55598%202.762%203.53487%202.762H16.6839C17.6571%202.762%2018.4517%203.55598%2018.4517%204.53231V17.6795C18.4517%2017.778%2018.444%2017.8733%2018.4267%2017.9667C18.3941%2018.1811%2018.3231%2018.38%2018.215%2018.5592C17.9149%2019.0934%2017.3372%2019.4517%2016.6846%2019.4517H3.53487Z'%20fill='%233B5695'/%3e%3c/svg%3e", _n = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.5%203.25C5.25736%203.25%204.25%204.25736%204.25%205.5H3.5H2.75C2.75%203.42893%204.42893%201.75%206.5%201.75H17.5C17.9142%201.75%2018.25%202.08579%2018.25%202.5V15.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25H6.5C5.26293%2016.25%204.25%2017.2576%204.25%2018.5C4.25%2018.9142%203.91421%2019.25%203.5%2019.25C3.08579%2019.25%202.75%2018.9142%202.75%2018.5V5.5C2.75%205.49993%202.75%205.5%203.5%205.5C4.25%205.5%204.25%205.49993%204.25%205.5V15.5017C4.87779%2015.0296%205.65755%2014.75%206.5%2014.75H16.75V3.25H6.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.5%202.75C20.9142%202.75%2021.25%203.08579%2021.25%203.5V21.5C21.25%2021.9142%2020.9142%2022.25%2020.5%2022.25H6.5C4.42893%2022.25%202.75%2020.5711%202.75%2018.5C2.75%2016.4289%204.42893%2014.75%206.5%2014.75H17.4995C17.4996%2014.75%2017.5%2014.75%2017.5%2015.5C17.5%2016.25%2017.5001%2016.25%2017.5%2016.25H6.5C5.25736%2016.25%204.25%2017.2574%204.25%2018.5C4.25%2019.7426%205.25736%2020.75%206.5%2020.75H19.75V3.5C19.75%203.08579%2020.0858%202.75%2020.5%202.75ZM18.25%2015.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25V15.5L17.4995%2014.75C17.9137%2014.75%2018.25%2015.0858%2018.25%2015.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.25%2018.5C6.25%2018.0858%206.58579%2017.75%207%2017.75H17C17.4142%2017.75%2017.75%2018.0858%2017.75%2018.5C17.75%2018.9142%2017.4142%2019.25%2017%2019.25H7C6.58579%2019.25%206.25%2018.9142%206.25%2018.5Z'%20fill='%233B5695'/%3e%3c/svg%3e", xn = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.467%202.47236C2.75841%202.17799%203.23328%202.17559%203.52764%202.467L8.52765%207.41675C8.82201%207.70816%208.82441%208.18303%208.533%208.4774C8.24159%208.77176%207.76672%208.77416%207.47235%208.48275L2.47236%203.533C2.17799%203.24159%202.17559%202.76672%202.467%202.47236Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.533%2015.4724C8.82441%2015.7667%208.82201%2016.2416%208.52765%2016.533L3.52765%2021.4828C3.23328%2021.7742%202.75841%2021.7718%202.467%2021.4774C2.17559%2021.183%202.17799%2020.7082%202.47236%2020.4167L7.47235%2015.467C7.76672%2015.1756%208.24159%2015.178%208.533%2015.4724Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.52%2015.4697C15.8129%2015.1768%2016.2877%2015.1768%2016.5806%2015.4697L21.5304%2020.4194C21.8233%2020.7123%2021.8233%2021.1872%2021.5304%2021.4801C21.2375%2021.773%2020.7626%2021.773%2020.4697%2021.4801L15.52%2016.5303C15.2271%2016.2374%2015.2271%2015.7626%2015.52%2015.4697Z'%20fill='%233B5695'/%3e%3cpath%20d='M21.4801%202.46967C21.773%202.76256%2021.773%203.23744%2021.4801%203.53033L16.5303%208.48008C16.2374%208.77297%2015.7626%208.77297%2015.4697%208.48008C15.1768%208.18719%2015.1768%207.71231%2015.4697%207.41942L20.4194%202.46967C20.7123%202.17678%2021.1872%202.17678%2021.4801%202.46967Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.75%203C15.75%202.58579%2016.0858%202.25%2016.5%202.25H21C21.4142%202.25%2021.75%202.58579%2021.75%203V7.5C21.75%207.91421%2021.4142%208.25%2021%208.25C20.5858%208.25%2020.25%207.91421%2020.25%207.5V3.75H16.5C16.0858%203.75%2015.75%203.41421%2015.75%203Z'%20fill='%233B5695'/%3e%3cpath%20d='M21%2015.75C21.4142%2015.75%2021.75%2016.0858%2021.75%2016.5V21C21.75%2021.4142%2021.4142%2021.75%2021%2021.75H16.5C16.0858%2021.75%2015.75%2021.4142%2015.75%2021C15.75%2020.5858%2016.0858%2020.25%2016.5%2020.25H20.25V16.5C20.25%2016.0858%2020.5858%2015.75%2021%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M3%2015.75C3.41421%2015.75%203.75%2016.0858%203.75%2016.5V20.25H7.5C7.91421%2020.25%208.25%2020.5858%208.25%2021C8.25%2021.4142%207.91421%2021.75%207.5%2021.75H3C2.58579%2021.75%202.25%2021.4142%202.25%2021V16.5C2.25%2016.0858%202.58579%2015.75%203%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M2.25%203C2.25%202.58579%202.58579%202.25%203%202.25H7.5C7.91421%202.25%208.25%202.58579%208.25%203C8.25%203.41421%207.91421%203.75%207.5%203.75H3.75V7.5C3.75%207.91421%203.41421%208.25%203%208.25C2.58579%208.25%202.25%207.91421%202.25%207.5V3Z'%20fill='%233B5695'/%3e%3c/svg%3e", yn = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.12596%201.63869C9.46935%201.54364%209.83221%201.70329%209.99413%202.02068C10.3672%202.75191%2011.1261%203.25%2012%203.25C12.8739%203.25%2013.6328%202.75191%2014.0059%202.02068C14.1678%201.70329%2014.5307%201.54364%2014.874%201.63869C16.5585%202.10497%2018.0759%202.9704%2019.3184%204.12574C19.5611%204.35137%2019.6269%204.70948%2019.4804%205.00666C19.3331%205.30535%2019.25%205.6419%2019.25%206C19.25%207.24263%2020.2574%208.25%2021.5%208.25L21.5314%208.24977C21.8629%208.24504%2022.1583%208.45859%2022.2576%208.77495C22.5777%209.79397%2022.75%2010.8776%2022.75%2012C22.75%2012.7408%2022.6749%2013.4649%2022.5318%2014.1648C22.4548%2014.5411%2022.1059%2014.7985%2021.7237%2014.7609C21.6504%2014.7537%2021.5758%2014.75%2021.5%2014.75C20.2574%2014.75%2019.25%2015.7574%2019.25%2017C19.25%2017.5531%2019.4486%2018.0579%2019.7793%2018.4498C20.027%2018.7434%2020.0128%2019.1767%2019.7465%2019.4535C18.4777%2020.7719%2016.8745%2021.7678%2015.0721%2022.3044C14.6807%2022.4209%2014.2681%2022.2029%2014.1437%2021.814C13.8535%2020.906%2013.0024%2020.25%2012%2020.25C10.9976%2020.25%2010.1465%2020.906%209.85629%2021.814C9.73195%2022.2029%209.31927%2022.4209%208.92789%2022.3044C7.12545%2021.7678%205.52229%2020.7719%204.25353%2019.4535C3.98716%2019.1767%203.97299%2018.7434%204.22072%2018.4498C4.55139%2018.0579%204.75%2017.5531%204.75%2017C4.75%2015.7574%203.74264%2014.75%202.5%2014.75C2.42423%2014.75%202.34963%2014.7537%202.27634%2014.7609C1.89406%2014.7985%201.54519%2014.5411%201.46821%2014.1648C1.32505%2013.4649%201.25%2012.7408%201.25%2012C1.25%2010.8776%201.42227%209.79398%201.74236%208.77494C1.84173%208.45859%202.13705%208.24504%202.4686%208.24977L2.5%208.25C3.74264%208.25%204.75%207.24263%204.75%206C4.75%205.6419%204.66689%205.30535%204.51962%205.00666C4.3731%204.70948%204.43894%204.35137%204.68159%204.12574C5.92411%202.9704%207.44153%202.10497%209.12596%201.63869ZM6.08277%204.88991C6.19152%205.24123%206.25%205.61424%206.25%206C6.25%207.88945%204.85261%209.45253%203.03493%209.71213C2.84898%2010.4432%202.75%2011.2096%202.75%2012C2.75%2012.4294%202.77921%2012.8516%202.83567%2013.2648C4.74948%2013.4346%206.25%2015.0421%206.25%2017C6.25%2017.6669%206.0754%2018.2941%205.76971%2018.8372C6.62645%2019.6184%207.63002%2020.2404%208.73362%2020.657C9.37706%2019.5189%2010.598%2018.75%2012%2018.75C13.402%2018.75%2014.6229%2019.5189%2015.2664%2020.657C16.37%2020.2404%2017.3735%2019.6184%2018.2303%2018.8372C17.9246%2018.2941%2017.75%2017.6669%2017.75%2017C17.75%2015.0421%2019.2505%2013.4346%2021.1643%2013.2648C21.2208%2012.8516%2021.25%2012.4294%2021.25%2012C21.25%2011.2096%2021.151%2010.4432%2020.9651%209.71213C19.1474%209.45252%2017.75%207.88945%2017.75%206C17.75%205.61424%2017.8085%205.24123%2017.9172%204.88991C17.0618%204.1771%2016.0762%203.61614%2015.0018%203.24775C14.3184%204.15897%2013.2287%204.75%2012%204.75C10.7713%204.75%209.68158%204.15897%208.99819%203.24775C7.92382%203.61614%206.93823%204.1771%206.08277%204.88991Z'%20fill='%233B5695'/%3e%3cpath%20d='M7.75%2012C7.75%209.65278%209.65279%207.75%2012%207.75C14.3472%207.75%2016.25%209.65278%2016.25%2012C16.25%2014.3472%2014.3472%2016.25%2012%2016.25C9.65279%2016.25%207.75%2014.3472%207.75%2012ZM12%209.25C10.4812%209.25%209.25%2010.4812%209.25%2012C9.25%2013.5188%2010.4812%2014.75%2012%2014.75C13.5188%2014.75%2014.75%2013.5188%2014.75%2012C14.75%2010.4812%2013.5188%209.25%2012%209.25Z'%20fill='%233B5695'/%3e%3c/svg%3e", wn = { class: "flex justify-between" }, Sn = /* @__PURE__ */ C("div", { class: "flex flex-row" }, [
|
|
3
3
|
/* @__PURE__ */ C("img", {
|
|
4
4
|
src: Cn,
|
|
@@ -33,15 +33,15 @@ const Cn = "data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%20
|
|
|
33
33
|
C("div", En, [
|
|
34
34
|
C("button", {
|
|
35
35
|
class: "btn btn-ghost btn-circle",
|
|
36
|
-
onClick: l[0] || (l[0] = (
|
|
36
|
+
onClick: l[0] || (l[0] = (i) => t("reader"))
|
|
37
37
|
}, $n),
|
|
38
38
|
C("button", {
|
|
39
39
|
class: "btn btn-ghost btn-circle md:hidden",
|
|
40
|
-
onClick: l[1] || (l[1] = (
|
|
40
|
+
onClick: l[1] || (l[1] = (i) => t("fullScreen"))
|
|
41
41
|
}, In),
|
|
42
42
|
C("button", {
|
|
43
43
|
class: "btn btn-ghost btn-circle",
|
|
44
|
-
onClick: l[2] || (l[2] = (
|
|
44
|
+
onClick: l[2] || (l[2] = (i) => t("settings"))
|
|
45
45
|
}, Pn)
|
|
46
46
|
])
|
|
47
47
|
]));
|
|
@@ -50,22 +50,22 @@ const Cn = "data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%20
|
|
|
50
50
|
function ye(e, o, t) {
|
|
51
51
|
let n = t.initialDeps ?? [], l;
|
|
52
52
|
return () => {
|
|
53
|
-
var
|
|
53
|
+
var i, r, s, a;
|
|
54
54
|
let u;
|
|
55
|
-
t.key && ((
|
|
56
|
-
const
|
|
57
|
-
if (!(
|
|
55
|
+
t.key && ((i = t.debug) != null && i.call(t)) && (u = Date.now());
|
|
56
|
+
const c = e();
|
|
57
|
+
if (!(c.length !== n.length || c.some((_, v) => n[v] !== _)))
|
|
58
58
|
return l;
|
|
59
|
-
n =
|
|
59
|
+
n = c;
|
|
60
60
|
let m;
|
|
61
|
-
if (t.key && ((
|
|
62
|
-
const
|
|
63
|
-
for (
|
|
64
|
-
|
|
65
|
-
return
|
|
61
|
+
if (t.key && ((r = t.debug) != null && r.call(t)) && (m = Date.now()), l = o(...c), t.key && ((s = t.debug) != null && s.call(t))) {
|
|
62
|
+
const _ = Math.round((Date.now() - u) * 100) / 100, v = Math.round((Date.now() - m) * 100) / 100, h = v / 16, M = (N, T) => {
|
|
63
|
+
for (N = String(N); N.length < T; )
|
|
64
|
+
N = " " + N;
|
|
65
|
+
return N;
|
|
66
66
|
};
|
|
67
67
|
console.info(
|
|
68
|
-
`%c⏱ ${
|
|
68
|
+
`%c⏱ ${M(v, 5)} /${M(_, 5)} ms`,
|
|
69
69
|
`
|
|
70
70
|
font-size: .6rem;
|
|
71
71
|
font-weight: bold;
|
|
@@ -79,7 +79,7 @@ function ye(e, o, t) {
|
|
|
79
79
|
return (a = t == null ? void 0 : t.onChange) == null || a.call(t, l), l;
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function qe(e, o) {
|
|
83
83
|
if (e === void 0)
|
|
84
84
|
throw new Error("Unexpected undefined");
|
|
85
85
|
return e;
|
|
@@ -101,15 +101,15 @@ const kn = (e, o) => Math.abs(e - o) < 1, Mn = (e, o, t) => {
|
|
|
101
101
|
const n = e.targetWindow;
|
|
102
102
|
if (!n)
|
|
103
103
|
return;
|
|
104
|
-
const l = (
|
|
105
|
-
const { width: s, height: a } =
|
|
104
|
+
const l = (r) => {
|
|
105
|
+
const { width: s, height: a } = r;
|
|
106
106
|
o({ width: Math.round(s), height: Math.round(a) });
|
|
107
107
|
};
|
|
108
108
|
if (l(t.getBoundingClientRect()), !n.ResizeObserver)
|
|
109
109
|
return () => {
|
|
110
110
|
};
|
|
111
|
-
const
|
|
112
|
-
const s =
|
|
111
|
+
const i = new n.ResizeObserver((r) => {
|
|
112
|
+
const s = r[0];
|
|
113
113
|
if (s != null && s.borderBoxSize) {
|
|
114
114
|
const a = s.borderBoxSize[0];
|
|
115
115
|
if (a) {
|
|
@@ -119,10 +119,10 @@ const kn = (e, o) => Math.abs(e - o) < 1, Mn = (e, o, t) => {
|
|
|
119
119
|
}
|
|
120
120
|
l(t.getBoundingClientRect());
|
|
121
121
|
});
|
|
122
|
-
return
|
|
123
|
-
|
|
122
|
+
return i.observe(t, { box: "border-box" }), () => {
|
|
123
|
+
i.unobserve(t);
|
|
124
124
|
};
|
|
125
|
-
},
|
|
125
|
+
}, ft = {
|
|
126
126
|
passive: !0
|
|
127
127
|
}, Dn = typeof window > "u" ? !0 : "onscrollend" in window, Fn = (e, o) => {
|
|
128
128
|
const t = e.scrollElement;
|
|
@@ -132,17 +132,17 @@ const kn = (e, o) => Math.abs(e - o) < 1, Mn = (e, o, t) => {
|
|
|
132
132
|
if (!n)
|
|
133
133
|
return;
|
|
134
134
|
let l = 0;
|
|
135
|
-
const
|
|
135
|
+
const i = Dn ? () => {
|
|
136
136
|
} : Mn(
|
|
137
137
|
n,
|
|
138
138
|
() => {
|
|
139
139
|
o(l, !1);
|
|
140
140
|
},
|
|
141
141
|
e.options.isScrollingResetDelay
|
|
142
|
-
),
|
|
143
|
-
l = t[e.options.horizontal ? "scrollLeft" : "scrollTop"],
|
|
144
|
-
}, s =
|
|
145
|
-
return a(), t.addEventListener("scroll", s,
|
|
142
|
+
), r = (u) => () => {
|
|
143
|
+
l = t[e.options.horizontal ? "scrollLeft" : "scrollTop"], i(), o(l, u);
|
|
144
|
+
}, s = r(!0), a = r(!1);
|
|
145
|
+
return a(), t.addEventListener("scroll", s, ft), t.addEventListener("scrollend", a, ft), () => {
|
|
146
146
|
t.removeEventListener("scroll", s), t.removeEventListener("scrollend", a);
|
|
147
147
|
};
|
|
148
148
|
}, jn = (e, o, t) => {
|
|
@@ -160,10 +160,10 @@ const kn = (e, o) => Math.abs(e - o) < 1, Mn = (e, o, t) => {
|
|
|
160
160
|
adjustments: o = 0,
|
|
161
161
|
behavior: t
|
|
162
162
|
}, n) => {
|
|
163
|
-
var l,
|
|
164
|
-
const
|
|
165
|
-
(
|
|
166
|
-
[n.options.horizontal ? "left" : "top"]:
|
|
163
|
+
var l, i;
|
|
164
|
+
const r = e + o;
|
|
165
|
+
(i = (l = n.scrollElement) == null ? void 0 : l.scrollTo) == null || i.call(l, {
|
|
166
|
+
[n.options.horizontal ? "left" : "top"]: r,
|
|
167
167
|
behavior: t
|
|
168
168
|
});
|
|
169
169
|
};
|
|
@@ -172,8 +172,8 @@ class Hn {
|
|
|
172
172
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
173
173
|
let t = null;
|
|
174
174
|
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((l) => {
|
|
175
|
-
l.forEach((
|
|
176
|
-
this._measureElement(
|
|
175
|
+
l.forEach((i) => {
|
|
176
|
+
this._measureElement(i.target, i);
|
|
177
177
|
});
|
|
178
178
|
}));
|
|
179
179
|
return {
|
|
@@ -182,12 +182,12 @@ class Hn {
|
|
|
182
182
|
return (l = n()) == null ? void 0 : l.disconnect();
|
|
183
183
|
},
|
|
184
184
|
observe: (l) => {
|
|
185
|
-
var
|
|
186
|
-
return (
|
|
185
|
+
var i;
|
|
186
|
+
return (i = n()) == null ? void 0 : i.observe(l, { box: "border-box" });
|
|
187
187
|
},
|
|
188
188
|
unobserve: (l) => {
|
|
189
|
-
var
|
|
190
|
-
return (
|
|
189
|
+
var i;
|
|
190
|
+
return (i = n()) == null ? void 0 : i.unobserve(l);
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
})(), this.range = null, this.setOptions = (t) => {
|
|
@@ -218,12 +218,12 @@ class Hn {
|
|
|
218
218
|
...t
|
|
219
219
|
};
|
|
220
220
|
}, this.notify = (t, n) => {
|
|
221
|
-
var l,
|
|
222
|
-
const { startIndex:
|
|
221
|
+
var l, i;
|
|
222
|
+
const { startIndex: r, endIndex: s } = this.range ?? {
|
|
223
223
|
startIndex: void 0,
|
|
224
224
|
endIndex: void 0
|
|
225
225
|
}, a = this.calculateRange();
|
|
226
|
-
(t ||
|
|
226
|
+
(t || r !== (a == null ? void 0 : a.startIndex) || s !== (a == null ? void 0 : a.endIndex)) && ((i = (l = this.options).onChange) == null || i.call(l, this, n));
|
|
227
227
|
}, this.cleanup = () => {
|
|
228
228
|
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.observer.disconnect(), this.elementsCache.clear();
|
|
229
229
|
}, this._didMount = () => () => {
|
|
@@ -244,26 +244,26 @@ class Hn {
|
|
|
244
244
|
this.scrollRect = l, this.notify(!1, !1);
|
|
245
245
|
})
|
|
246
246
|
), this.unsubs.push(
|
|
247
|
-
this.options.observeElementOffset(this, (l,
|
|
248
|
-
this.scrollAdjustments = 0, this.scrollDirection =
|
|
249
|
-
const
|
|
250
|
-
this.isScrolling =
|
|
247
|
+
this.options.observeElementOffset(this, (l, i) => {
|
|
248
|
+
this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < l ? "forward" : "backward" : null, this.scrollOffset = l;
|
|
249
|
+
const r = this.isScrolling;
|
|
250
|
+
this.isScrolling = i, this.notify(r !== i, i);
|
|
251
251
|
})
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
255
|
-
const l = /* @__PURE__ */ new Map(),
|
|
256
|
-
for (let
|
|
257
|
-
const s = t[
|
|
255
|
+
const l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
256
|
+
for (let r = n - 1; r >= 0; r--) {
|
|
257
|
+
const s = t[r];
|
|
258
258
|
if (l.has(s.lane))
|
|
259
259
|
continue;
|
|
260
|
-
const a =
|
|
260
|
+
const a = i.get(
|
|
261
261
|
s.lane
|
|
262
262
|
);
|
|
263
|
-
if (a == null || s.end > a.end ?
|
|
263
|
+
if (a == null || s.end > a.end ? i.set(s.lane, s) : s.end < a.end && l.set(s.lane, !0), l.size === this.options.lanes)
|
|
264
264
|
break;
|
|
265
265
|
}
|
|
266
|
-
return
|
|
266
|
+
return i.size === this.options.lanes ? Array.from(i.values()).sort((r, s) => r.end === s.end ? r.index - s.index : r.end - s.end)[0] : void 0;
|
|
267
267
|
}, this.getMeasurementOptions = ye(
|
|
268
268
|
() => [
|
|
269
269
|
this.options.count,
|
|
@@ -272,53 +272,53 @@ class Hn {
|
|
|
272
272
|
this.options.getItemKey,
|
|
273
273
|
this.options.enabled
|
|
274
274
|
],
|
|
275
|
-
(t, n, l,
|
|
275
|
+
(t, n, l, i, r) => (this.pendingMeasuredCacheIndexes = [], {
|
|
276
276
|
count: t,
|
|
277
277
|
paddingStart: n,
|
|
278
278
|
scrollMargin: l,
|
|
279
|
-
getItemKey:
|
|
280
|
-
enabled:
|
|
279
|
+
getItemKey: i,
|
|
280
|
+
enabled: r
|
|
281
281
|
}),
|
|
282
282
|
{
|
|
283
283
|
key: !1
|
|
284
284
|
}
|
|
285
285
|
), this.getMeasurements = ye(
|
|
286
286
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
287
|
-
({ count: t, paddingStart: n, scrollMargin: l, getItemKey:
|
|
287
|
+
({ count: t, paddingStart: n, scrollMargin: l, getItemKey: i, enabled: r }, s) => {
|
|
288
288
|
var a;
|
|
289
|
-
if (!
|
|
289
|
+
if (!r)
|
|
290
290
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
291
291
|
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((p) => {
|
|
292
292
|
this.itemSizeCache.set(p.key, p.size);
|
|
293
293
|
}));
|
|
294
294
|
const u = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
295
295
|
this.pendingMeasuredCacheIndexes = [];
|
|
296
|
-
const
|
|
296
|
+
const c = this.measurementsCache.slice(0, u);
|
|
297
297
|
for (let p = u; p < t; p++) {
|
|
298
298
|
let m = (a = this.measurementsCache[p]) == null ? void 0 : a.measureElement;
|
|
299
299
|
m || (m = (D) => {
|
|
300
|
-
const
|
|
300
|
+
const x = i(p), L = this.elementsCache.get(x);
|
|
301
301
|
if (!D) {
|
|
302
|
-
L && (this.observer.unobserve(L), this.elementsCache.delete(
|
|
302
|
+
L && (this.observer.unobserve(L), this.elementsCache.delete(x));
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
L !== D && (L && this.observer.unobserve(L), this.observer.observe(D), this.elementsCache.set(
|
|
305
|
+
L !== D && (L && this.observer.unobserve(L), this.observer.observe(D), this.elementsCache.set(x, D)), D.isConnected && this.resizeItem(
|
|
306
306
|
p,
|
|
307
307
|
this.options.measureElement(D, void 0, this)
|
|
308
308
|
);
|
|
309
309
|
});
|
|
310
|
-
const
|
|
311
|
-
|
|
310
|
+
const _ = i(p), v = this.options.lanes === 1 ? c[p - 1] : this.getFurthestMeasurement(c, p), h = v ? v.end + this.options.gap : n + l, M = s.get(_), N = typeof M == "number" ? M : this.options.estimateSize(p), T = h + N, P = v ? v.lane : p % this.options.lanes;
|
|
311
|
+
c[p] = {
|
|
312
312
|
index: p,
|
|
313
313
|
start: h,
|
|
314
|
-
size:
|
|
314
|
+
size: N,
|
|
315
315
|
end: T,
|
|
316
|
-
key:
|
|
317
|
-
lane:
|
|
316
|
+
key: _,
|
|
317
|
+
lane: P,
|
|
318
318
|
measureElement: m
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
return this.measurementsCache =
|
|
321
|
+
return this.measurementsCache = c, c;
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
324
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
@@ -342,11 +342,11 @@ class Hn {
|
|
|
342
342
|
this.options.overscan,
|
|
343
343
|
this.options.count
|
|
344
344
|
],
|
|
345
|
-
(t, n, l,
|
|
345
|
+
(t, n, l, i) => n === null ? [] : t({
|
|
346
346
|
startIndex: n.startIndex,
|
|
347
347
|
endIndex: n.endIndex,
|
|
348
348
|
overscan: l,
|
|
349
|
-
count:
|
|
349
|
+
count: i
|
|
350
350
|
}),
|
|
351
351
|
{
|
|
352
352
|
key: process.env.NODE_ENV !== "production" && "getIndexes",
|
|
@@ -358,22 +358,22 @@ class Hn {
|
|
|
358
358
|
`Missing attribute name '${n}={index}' on measured element.`
|
|
359
359
|
), -1);
|
|
360
360
|
}, this._measureElement = (t, n) => {
|
|
361
|
-
const l = this.indexFromElement(t),
|
|
362
|
-
if (!
|
|
361
|
+
const l = this.indexFromElement(t), i = this.getMeasurements()[l];
|
|
362
|
+
if (!i || !t.isConnected) {
|
|
363
363
|
this.elementsCache.forEach((s, a) => {
|
|
364
364
|
s === t && (this.observer.unobserve(t), this.elementsCache.delete(a));
|
|
365
365
|
});
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
const
|
|
369
|
-
|
|
368
|
+
const r = this.elementsCache.get(i.key);
|
|
369
|
+
r !== t && (r && this.observer.unobserve(r), this.observer.observe(t), this.elementsCache.set(i.key, t)), this.resizeItem(l, this.options.measureElement(t, n, this));
|
|
370
370
|
}, this.resizeItem = (t, n) => {
|
|
371
371
|
const l = this.getMeasurements()[t];
|
|
372
372
|
if (!l)
|
|
373
373
|
return;
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
adjustments: this.scrollAdjustments +=
|
|
374
|
+
const i = this.itemSizeCache.get(l.key) ?? l.size, r = n - i;
|
|
375
|
+
r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(l, r, this) : l.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
|
|
376
|
+
adjustments: this.scrollAdjustments += r,
|
|
377
377
|
behavior: void 0
|
|
378
378
|
})), this.pendingMeasuredCacheIndexes.push(l.index), this.itemSizeCache = new Map(this.itemSizeCache.set(l.key, n)), this.notify(!0, !1));
|
|
379
379
|
}, this.measureElement = (t) => {
|
|
@@ -382,8 +382,8 @@ class Hn {
|
|
|
382
382
|
() => [this.getIndexes(), this.getMeasurements()],
|
|
383
383
|
(t, n) => {
|
|
384
384
|
const l = [];
|
|
385
|
-
for (let
|
|
386
|
-
const s = t[
|
|
385
|
+
for (let i = 0, r = t.length; i < r; i++) {
|
|
386
|
+
const s = t[i], a = n[s];
|
|
387
387
|
l.push(a);
|
|
388
388
|
}
|
|
389
389
|
return l;
|
|
@@ -395,32 +395,32 @@ class Hn {
|
|
|
395
395
|
), this.getVirtualItemForOffset = (t) => {
|
|
396
396
|
const n = this.getMeasurements();
|
|
397
397
|
if (n.length !== 0)
|
|
398
|
-
return
|
|
399
|
-
n[
|
|
398
|
+
return qe(
|
|
399
|
+
n[kt(
|
|
400
400
|
0,
|
|
401
401
|
n.length - 1,
|
|
402
|
-
(l) =>
|
|
402
|
+
(l) => qe(n[l]).start,
|
|
403
403
|
t
|
|
404
404
|
)]
|
|
405
405
|
);
|
|
406
406
|
}, this.getOffsetForAlignment = (t, n) => {
|
|
407
|
-
const l = this.getSize(),
|
|
408
|
-
n === "auto" && (t <=
|
|
409
|
-
const
|
|
407
|
+
const l = this.getSize(), i = this.getScrollOffset();
|
|
408
|
+
n === "auto" && (t <= i ? n = "start" : t >= i + l ? n = "end" : n = "start"), n === "start" ? t = t : n === "end" ? t = t - l : n === "center" && (t = t - l / 2);
|
|
409
|
+
const r = this.options.horizontal ? "scrollWidth" : "scrollHeight", a = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[r] : this.scrollElement[r] : 0) - l;
|
|
410
410
|
return Math.max(Math.min(a, t), 0);
|
|
411
411
|
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
412
412
|
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
413
413
|
const l = this.getMeasurements()[t];
|
|
414
414
|
if (!l)
|
|
415
415
|
return;
|
|
416
|
-
const
|
|
416
|
+
const i = this.getSize(), r = this.getScrollOffset();
|
|
417
417
|
if (n === "auto")
|
|
418
|
-
if (l.end >=
|
|
418
|
+
if (l.end >= r + i - this.options.scrollPaddingEnd)
|
|
419
419
|
n = "end";
|
|
420
|
-
else if (l.start <=
|
|
420
|
+
else if (l.start <= r + this.options.scrollPaddingStart)
|
|
421
421
|
n = "start";
|
|
422
422
|
else
|
|
423
|
-
return [
|
|
423
|
+
return [r, n];
|
|
424
424
|
const s = n === "end" ? l.end + this.options.scrollPaddingEnd : l.start - this.options.scrollPaddingStart;
|
|
425
425
|
return [this.getOffsetForAlignment(s, n), n];
|
|
426
426
|
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
|
|
@@ -436,14 +436,14 @@ class Hn {
|
|
|
436
436
|
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), l === "smooth" && this.isDynamicMode() && console.warn(
|
|
437
437
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
438
438
|
);
|
|
439
|
-
const
|
|
440
|
-
if (!
|
|
441
|
-
const [
|
|
442
|
-
this._scrollToOffset(
|
|
439
|
+
const i = this.getOffsetForIndex(t, n);
|
|
440
|
+
if (!i) return;
|
|
441
|
+
const [r, s] = i;
|
|
442
|
+
this._scrollToOffset(r, { adjustments: void 0, behavior: l }), l !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
443
443
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
444
444
|
this.options.getItemKey(t)
|
|
445
445
|
)) {
|
|
446
|
-
const [u] =
|
|
446
|
+
const [u] = qe(
|
|
447
447
|
this.getOffsetForIndex(t, s)
|
|
448
448
|
);
|
|
449
449
|
kn(u, this.getScrollOffset()) || this.scrollToIndex(t, { align: s, behavior: l });
|
|
@@ -462,7 +462,7 @@ class Hn {
|
|
|
462
462
|
const n = this.getMeasurements();
|
|
463
463
|
let l;
|
|
464
464
|
return n.length === 0 ? l = this.options.paddingStart : l = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
|
|
465
|
-
...n.slice(-this.options.lanes).map((
|
|
465
|
+
...n.slice(-this.options.lanes).map((i) => i.end)
|
|
466
466
|
), l - this.options.scrollMargin + this.options.paddingEnd;
|
|
467
467
|
}, this._scrollToOffset = (t, {
|
|
468
468
|
adjustments: n,
|
|
@@ -475,12 +475,12 @@ class Hn {
|
|
|
475
475
|
}, this.setOptions(o);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const kt = (e, o, t, n) => {
|
|
479
479
|
for (; e <= o; ) {
|
|
480
|
-
const l = (e + o) / 2 | 0,
|
|
481
|
-
if (
|
|
480
|
+
const l = (e + o) / 2 | 0, i = t(l);
|
|
481
|
+
if (i < n)
|
|
482
482
|
e = l + 1;
|
|
483
|
-
else if (
|
|
483
|
+
else if (i > n)
|
|
484
484
|
o = l - 1;
|
|
485
485
|
else
|
|
486
486
|
return l;
|
|
@@ -492,16 +492,16 @@ function zn({
|
|
|
492
492
|
outerSize: o,
|
|
493
493
|
scrollOffset: t
|
|
494
494
|
}) {
|
|
495
|
-
const n = e.length - 1,
|
|
496
|
-
let
|
|
497
|
-
for (;
|
|
498
|
-
|
|
499
|
-
return { startIndex:
|
|
495
|
+
const n = e.length - 1, i = kt(0, n, (s) => e[s].start, t);
|
|
496
|
+
let r = i;
|
|
497
|
+
for (; r < n && e[r].end < t + o; )
|
|
498
|
+
r++;
|
|
499
|
+
return { startIndex: i, endIndex: r };
|
|
500
500
|
}
|
|
501
501
|
function Un(e) {
|
|
502
|
-
const o = new Hn(
|
|
502
|
+
const o = new Hn(k(e)), t = fn(o), n = o._didMount();
|
|
503
503
|
return F(
|
|
504
|
-
() =>
|
|
504
|
+
() => k(e).getScrollElement(),
|
|
505
505
|
(l) => {
|
|
506
506
|
l && o._willUpdate();
|
|
507
507
|
},
|
|
@@ -509,20 +509,20 @@ function Un(e) {
|
|
|
509
509
|
immediate: !0
|
|
510
510
|
}
|
|
511
511
|
), F(
|
|
512
|
-
() =>
|
|
512
|
+
() => k(e),
|
|
513
513
|
(l) => {
|
|
514
514
|
o.setOptions({
|
|
515
515
|
...l,
|
|
516
|
-
onChange: (
|
|
516
|
+
onChange: (i, r) => {
|
|
517
517
|
var s;
|
|
518
|
-
|
|
518
|
+
ut(t), (s = l.onChange) == null || s.call(l, i, r);
|
|
519
519
|
}
|
|
520
|
-
}), o._willUpdate(),
|
|
520
|
+
}), o._willUpdate(), ut(t);
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
523
|
immediate: !0
|
|
524
524
|
}
|
|
525
|
-
),
|
|
525
|
+
), tt(n), t;
|
|
526
526
|
}
|
|
527
527
|
function Zn(e) {
|
|
528
528
|
return Un(
|
|
@@ -530,14 +530,14 @@ function Zn(e) {
|
|
|
530
530
|
observeElementRect: An,
|
|
531
531
|
observeElementOffset: Fn,
|
|
532
532
|
scrollToFn: Bn,
|
|
533
|
-
...
|
|
533
|
+
...k(e)
|
|
534
534
|
}))
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
537
|
function Wn(e, o, t) {
|
|
538
538
|
let n = E(t == null ? void 0 : t.value), l = S(() => e.value !== void 0);
|
|
539
|
-
return [S(() => l.value ? e.value : n.value), function(
|
|
540
|
-
return l.value || (n.value =
|
|
539
|
+
return [S(() => l.value ? e.value : n.value), function(i) {
|
|
540
|
+
return l.value || (n.value = i), o == null ? void 0 : o(i);
|
|
541
541
|
}];
|
|
542
542
|
}
|
|
543
543
|
function Gn(e) {
|
|
@@ -546,8 +546,8 @@ function Gn(e) {
|
|
|
546
546
|
}));
|
|
547
547
|
}
|
|
548
548
|
function Ae() {
|
|
549
|
-
let e = [], o = { addEventListener(t, n, l,
|
|
550
|
-
return t.addEventListener(n, l,
|
|
549
|
+
let e = [], o = { addEventListener(t, n, l, i) {
|
|
550
|
+
return t.addEventListener(n, l, i), o.add(() => t.removeEventListener(n, l, i));
|
|
551
551
|
}, requestAnimationFrame(...t) {
|
|
552
552
|
let n = requestAnimationFrame(...t);
|
|
553
553
|
o.add(() => cancelAnimationFrame(n));
|
|
@@ -566,9 +566,9 @@ function Ae() {
|
|
|
566
566
|
n.current = !1;
|
|
567
567
|
});
|
|
568
568
|
}, style(t, n, l) {
|
|
569
|
-
let
|
|
569
|
+
let i = t.style.getPropertyValue(n);
|
|
570
570
|
return Object.assign(t.style, { [n]: l }), this.add(() => {
|
|
571
|
-
Object.assign(t.style, { [n]:
|
|
571
|
+
Object.assign(t.style, { [n]: i });
|
|
572
572
|
});
|
|
573
573
|
}, group(t) {
|
|
574
574
|
let n = Ae();
|
|
@@ -585,7 +585,7 @@ function Ae() {
|
|
|
585
585
|
}
|
|
586
586
|
function qn() {
|
|
587
587
|
let e = Ae();
|
|
588
|
-
return
|
|
588
|
+
return nt(() => e.dispose()), e;
|
|
589
589
|
}
|
|
590
590
|
function Jn() {
|
|
591
591
|
let e = qn();
|
|
@@ -597,7 +597,7 @@ let Kn = Symbol("headlessui.useid"), Yn = 0;
|
|
|
597
597
|
function Le() {
|
|
598
598
|
return Ie(Kn, () => `${++Yn}`)();
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function V(e) {
|
|
601
601
|
var o;
|
|
602
602
|
if (e == null || e.value == null) return null;
|
|
603
603
|
let t = (o = e.value.$el) != null ? o : e.value;
|
|
@@ -611,10 +611,10 @@ function le(e, o, ...t) {
|
|
|
611
611
|
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map((l) => `"${l}"`).join(", ")}.`);
|
|
612
612
|
throw Error.captureStackTrace && Error.captureStackTrace(n, le), n;
|
|
613
613
|
}
|
|
614
|
-
var Qn = Object.defineProperty, Xn = (e, o, t) => o in e ? Qn(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t,
|
|
614
|
+
var Qn = Object.defineProperty, Xn = (e, o, t) => o in e ? Qn(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, pt = (e, o, t) => (Xn(e, typeof o != "symbol" ? o + "" : o, t), t);
|
|
615
615
|
let eo = class {
|
|
616
616
|
constructor() {
|
|
617
|
-
|
|
617
|
+
pt(this, "current", this.detect()), pt(this, "currentId", 0);
|
|
618
618
|
}
|
|
619
619
|
set(o) {
|
|
620
620
|
this.current !== o && (this.currentId = 0, this.current = o);
|
|
@@ -634,26 +634,26 @@ let eo = class {
|
|
|
634
634
|
detect() {
|
|
635
635
|
return typeof window > "u" || typeof document > "u" ? "server" : "client";
|
|
636
636
|
}
|
|
637
|
-
},
|
|
638
|
-
function
|
|
639
|
-
if (
|
|
637
|
+
}, st = new eo();
|
|
638
|
+
function it(e) {
|
|
639
|
+
if (st.isServer) return null;
|
|
640
640
|
if (e instanceof Node) return e.ownerDocument;
|
|
641
641
|
if (e != null && e.hasOwnProperty("value")) {
|
|
642
|
-
let o =
|
|
642
|
+
let o = V(e);
|
|
643
643
|
if (o) return o.ownerDocument;
|
|
644
644
|
}
|
|
645
645
|
return document;
|
|
646
646
|
}
|
|
647
|
-
let
|
|
648
|
-
var to = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(to || {}), no = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(no || {}), oo = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(oo || {}),
|
|
647
|
+
let vt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
648
|
+
var to = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(to || {}), no = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(no || {}), oo = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(oo || {}), Mt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Mt || {});
|
|
649
649
|
function lo(e, o = 0) {
|
|
650
650
|
var t;
|
|
651
|
-
return e === ((t =
|
|
652
|
-
return e.matches(
|
|
651
|
+
return e === ((t = it(e)) == null ? void 0 : t.body) ? !1 : le(o, { 0() {
|
|
652
|
+
return e.matches(vt);
|
|
653
653
|
}, 1() {
|
|
654
654
|
let n = e;
|
|
655
655
|
for (; n !== null; ) {
|
|
656
|
-
if (n.matches(
|
|
656
|
+
if (n.matches(vt)) return !0;
|
|
657
657
|
n = n.parentElement;
|
|
658
658
|
}
|
|
659
659
|
return !1;
|
|
@@ -665,147 +665,147 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
|
|
|
665
665
|
}, !0), document.addEventListener("click", (e) => {
|
|
666
666
|
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
667
667
|
}, !0));
|
|
668
|
-
function
|
|
668
|
+
function io(e, o = (t) => t) {
|
|
669
669
|
return e.slice().sort((t, n) => {
|
|
670
|
-
let l = o(t),
|
|
671
|
-
if (l === null ||
|
|
672
|
-
let
|
|
673
|
-
return
|
|
670
|
+
let l = o(t), i = o(n);
|
|
671
|
+
if (l === null || i === null) return 0;
|
|
672
|
+
let r = l.compareDocumentPosition(i);
|
|
673
|
+
return r & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : r & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
674
674
|
});
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function ro() {
|
|
677
677
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
678
678
|
}
|
|
679
679
|
function ao() {
|
|
680
680
|
return /Android/gi.test(window.navigator.userAgent);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
682
|
+
function Rt() {
|
|
683
|
+
return ro() || ao();
|
|
684
684
|
}
|
|
685
685
|
function Ve(e, o, t) {
|
|
686
|
-
|
|
686
|
+
st.isServer || re((n) => {
|
|
687
687
|
document.addEventListener(e, o, t), n(() => document.removeEventListener(e, o, t));
|
|
688
688
|
});
|
|
689
689
|
}
|
|
690
690
|
function uo(e, o, t) {
|
|
691
|
-
|
|
691
|
+
st.isServer || re((n) => {
|
|
692
692
|
window.addEventListener(e, o, t), n(() => window.removeEventListener(e, o, t));
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
695
|
function co(e, o, t = S(() => !0)) {
|
|
696
|
-
function n(
|
|
697
|
-
if (!t.value ||
|
|
698
|
-
let s = i
|
|
696
|
+
function n(i, r) {
|
|
697
|
+
if (!t.value || i.defaultPrevented) return;
|
|
698
|
+
let s = r(i);
|
|
699
699
|
if (s === null || !s.getRootNode().contains(s)) return;
|
|
700
|
-
let a = function u(
|
|
701
|
-
return typeof
|
|
700
|
+
let a = function u(c) {
|
|
701
|
+
return typeof c == "function" ? u(c()) : Array.isArray(c) || c instanceof Set ? c : [c];
|
|
702
702
|
}(e);
|
|
703
703
|
for (let u of a) {
|
|
704
704
|
if (u === null) continue;
|
|
705
|
-
let
|
|
706
|
-
if (
|
|
705
|
+
let c = u instanceof HTMLElement ? u : V(u);
|
|
706
|
+
if (c != null && c.contains(s) || i.composed && i.composedPath().includes(c)) return;
|
|
707
707
|
}
|
|
708
|
-
return !lo(s,
|
|
708
|
+
return !lo(s, Mt.Loose) && s.tabIndex !== -1 && i.preventDefault(), o(i, s);
|
|
709
709
|
}
|
|
710
710
|
let l = E(null);
|
|
711
|
-
Ve("pointerdown", (
|
|
712
|
-
var
|
|
713
|
-
t.value && (l.value = ((s = (
|
|
714
|
-
}, !0), Ve("mousedown", (
|
|
715
|
-
var
|
|
716
|
-
t.value && (l.value = ((s = (
|
|
717
|
-
}, !0), Ve("click", (
|
|
718
|
-
|
|
719
|
-
}, !0), Ve("touchend", (
|
|
720
|
-
}
|
|
721
|
-
function
|
|
711
|
+
Ve("pointerdown", (i) => {
|
|
712
|
+
var r, s;
|
|
713
|
+
t.value && (l.value = ((s = (r = i.composedPath) == null ? void 0 : r.call(i)) == null ? void 0 : s[0]) || i.target);
|
|
714
|
+
}, !0), Ve("mousedown", (i) => {
|
|
715
|
+
var r, s;
|
|
716
|
+
t.value && (l.value = ((s = (r = i.composedPath) == null ? void 0 : r.call(i)) == null ? void 0 : s[0]) || i.target);
|
|
717
|
+
}, !0), Ve("click", (i) => {
|
|
718
|
+
Rt() || l.value && (n(i, () => l.value), l.value = null);
|
|
719
|
+
}, !0), Ve("touchend", (i) => n(i, () => i.target instanceof HTMLElement ? i.target : null), !0), uo("blur", (i) => n(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
720
|
+
}
|
|
721
|
+
function ht(e, o) {
|
|
722
722
|
if (e) return e;
|
|
723
723
|
let t = o ?? "button";
|
|
724
724
|
if (typeof t == "string" && t.toLowerCase() === "button") return "button";
|
|
725
725
|
}
|
|
726
726
|
function fo(e, o) {
|
|
727
|
-
let t = E(
|
|
727
|
+
let t = E(ht(e.value.type, e.value.as));
|
|
728
728
|
return xe(() => {
|
|
729
|
-
t.value =
|
|
730
|
-
}),
|
|
729
|
+
t.value = ht(e.value.type, e.value.as);
|
|
730
|
+
}), re(() => {
|
|
731
731
|
var n;
|
|
732
|
-
t.value ||
|
|
732
|
+
t.value || V(o) && V(o) instanceof HTMLButtonElement && !((n = V(o)) != null && n.hasAttribute("type")) && (t.value = "button");
|
|
733
733
|
}), t;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function mt(e) {
|
|
736
736
|
return [e.screenX, e.screenY];
|
|
737
737
|
}
|
|
738
738
|
function po() {
|
|
739
739
|
let e = E([-1, -1]);
|
|
740
740
|
return { wasMoved(o) {
|
|
741
|
-
let t =
|
|
741
|
+
let t = mt(o);
|
|
742
742
|
return e.value[0] === t[0] && e.value[1] === t[1] ? !1 : (e.value = t, !0);
|
|
743
743
|
}, update(o) {
|
|
744
|
-
e.value =
|
|
744
|
+
e.value = mt(o);
|
|
745
745
|
} };
|
|
746
746
|
}
|
|
747
747
|
function vo({ container: e, accept: o, walk: t, enabled: n }) {
|
|
748
|
-
|
|
748
|
+
re(() => {
|
|
749
749
|
let l = e.value;
|
|
750
750
|
if (!l || n !== void 0 && !n.value) return;
|
|
751
|
-
let
|
|
752
|
-
if (!
|
|
753
|
-
let
|
|
751
|
+
let i = it(e);
|
|
752
|
+
if (!i) return;
|
|
753
|
+
let r = Object.assign((a) => o(a), { acceptNode: o }), s = i.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, r, !1);
|
|
754
754
|
for (; s.nextNode(); ) t(s.currentNode);
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
757
|
var Oe = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Oe || {}), ho = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(ho || {});
|
|
758
758
|
function pe({ visible: e = !0, features: o = 0, ourProps: t, theirProps: n, ...l }) {
|
|
759
|
-
var
|
|
760
|
-
let
|
|
761
|
-
if (e || o & 2 &&
|
|
759
|
+
var i;
|
|
760
|
+
let r = At(n, t), s = Object.assign(l, { props: r });
|
|
761
|
+
if (e || o & 2 && r.static) return Je(s);
|
|
762
762
|
if (o & 1) {
|
|
763
|
-
let a = (
|
|
763
|
+
let a = (i = r.unmount) == null || i ? 0 : 1;
|
|
764
764
|
return le(a, { 0() {
|
|
765
765
|
return null;
|
|
766
766
|
}, 1() {
|
|
767
|
-
return
|
|
767
|
+
return Je({ ...l, props: { ...r, hidden: !0, style: { display: "none" } } });
|
|
768
768
|
} });
|
|
769
769
|
}
|
|
770
|
-
return
|
|
770
|
+
return Je(s);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
var
|
|
774
|
-
let { as: s, ...a } = je(e, ["unmount", "static"]), u = (
|
|
772
|
+
function Je({ props: e, attrs: o, slots: t, slot: n, name: l }) {
|
|
773
|
+
var i, r;
|
|
774
|
+
let { as: s, ...a } = je(e, ["unmount", "static"]), u = (i = t.default) == null ? void 0 : i.call(t, n), c = {};
|
|
775
775
|
if (n) {
|
|
776
776
|
let p = !1, m = [];
|
|
777
|
-
for (let [
|
|
778
|
-
p && (
|
|
777
|
+
for (let [_, v] of Object.entries(n)) typeof v == "boolean" && (p = !0), v === !0 && m.push(_);
|
|
778
|
+
p && (c["data-headlessui-state"] = m.join(" "));
|
|
779
779
|
}
|
|
780
780
|
if (s === "template") {
|
|
781
|
-
if (u =
|
|
781
|
+
if (u = Nt(u ?? []), Object.keys(a).length > 0 || Object.keys(o).length > 0) {
|
|
782
782
|
let [p, ...m] = u ?? [];
|
|
783
|
-
if (!go(p) || m.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${l} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(a).concat(Object.keys(o)).map((h) => h.trim()).filter((h,
|
|
783
|
+
if (!go(p) || m.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${l} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(a).concat(Object.keys(o)).map((h) => h.trim()).filter((h, M, N) => N.indexOf(h) === M).sort((h, M) => h.localeCompare(M)).map((h) => ` - ${h}`).join(`
|
|
784
784
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((h) => ` - ${h}`).join(`
|
|
785
785
|
`)].join(`
|
|
786
786
|
`));
|
|
787
|
-
let
|
|
788
|
-
for (let h in
|
|
787
|
+
let _ = At((r = p.props) != null ? r : {}, a, c), v = Ot(p, _, !0);
|
|
788
|
+
for (let h in _) h.startsWith("on") && (v.props || (v.props = {}), v.props[h] = _[h]);
|
|
789
789
|
return v;
|
|
790
790
|
}
|
|
791
791
|
return Array.isArray(u) && u.length === 1 ? u[0] : u;
|
|
792
792
|
}
|
|
793
|
-
return Ee(s, Object.assign({}, a,
|
|
793
|
+
return Ee(s, Object.assign({}, a, c), { default: () => u });
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return e.flatMap((o) => o.type === Z ?
|
|
795
|
+
function Nt(e) {
|
|
796
|
+
return e.flatMap((o) => o.type === Z ? Nt(o.children) : [o]);
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function At(...e) {
|
|
799
799
|
if (e.length === 0) return {};
|
|
800
800
|
if (e.length === 1) return e[0];
|
|
801
801
|
let o = {}, t = {};
|
|
802
802
|
for (let n of e) for (let l in n) l.startsWith("on") && typeof n[l] == "function" ? (t[l] != null || (t[l] = []), t[l].push(n[l])) : o[l] = n[l];
|
|
803
803
|
if (o.disabled || o["aria-disabled"]) return Object.assign(o, Object.fromEntries(Object.keys(t).map((n) => [n, void 0])));
|
|
804
|
-
for (let n in t) Object.assign(o, { [n](l, ...
|
|
805
|
-
let
|
|
806
|
-
for (let s of
|
|
804
|
+
for (let n in t) Object.assign(o, { [n](l, ...i) {
|
|
805
|
+
let r = t[n];
|
|
806
|
+
for (let s of r) {
|
|
807
807
|
if (l instanceof Event && l.defaultPrevented) return;
|
|
808
|
-
s(l, ...
|
|
808
|
+
s(l, ...i);
|
|
809
809
|
}
|
|
810
810
|
} });
|
|
811
811
|
return o;
|
|
@@ -823,22 +823,22 @@ function je(e, o = []) {
|
|
|
823
823
|
function go(e) {
|
|
824
824
|
return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
|
|
825
825
|
}
|
|
826
|
-
var
|
|
826
|
+
var Dt = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Dt || {});
|
|
827
827
|
let bo = ae({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: o, attrs: t }) {
|
|
828
828
|
return () => {
|
|
829
829
|
var n;
|
|
830
|
-
let { features: l, ...
|
|
831
|
-
return pe({ ourProps:
|
|
830
|
+
let { features: l, ...i } = e, r = { "aria-hidden": (l & 2) === 2 ? !0 : (n = i["aria-hidden"]) != null ? n : void 0, hidden: (l & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(l & 4) === 4 && (l & 2) !== 2 && { display: "none" } } };
|
|
831
|
+
return pe({ ourProps: r, theirProps: i, slot: {}, attrs: t, slots: o, name: "Hidden" });
|
|
832
832
|
};
|
|
833
|
-
} }),
|
|
833
|
+
} }), Ft = Symbol("Context");
|
|
834
834
|
var $e = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))($e || {});
|
|
835
835
|
function Co() {
|
|
836
|
-
return Ie(
|
|
836
|
+
return Ie(Ft, null);
|
|
837
837
|
}
|
|
838
838
|
function _o(e) {
|
|
839
|
-
|
|
839
|
+
ot(Ft, e);
|
|
840
840
|
}
|
|
841
|
-
var W = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(W || {}),
|
|
841
|
+
var W = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(W || {}), jt = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(jt || {});
|
|
842
842
|
function xo(e) {
|
|
843
843
|
function o() {
|
|
844
844
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", o));
|
|
@@ -856,30 +856,30 @@ function yo(e) {
|
|
|
856
856
|
throw new Error("Unexpected object: " + e);
|
|
857
857
|
}
|
|
858
858
|
var z = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(z || {});
|
|
859
|
-
function
|
|
859
|
+
function gt(e, o) {
|
|
860
860
|
let t = o.resolveItems();
|
|
861
861
|
if (t.length <= 0) return null;
|
|
862
862
|
let n = o.resolveActiveIndex(), l = n ?? -1;
|
|
863
863
|
switch (e.focus) {
|
|
864
864
|
case 0: {
|
|
865
|
-
for (let
|
|
865
|
+
for (let i = 0; i < t.length; ++i) if (!o.resolveDisabled(t[i], i, t)) return i;
|
|
866
866
|
return n;
|
|
867
867
|
}
|
|
868
868
|
case 1: {
|
|
869
869
|
l === -1 && (l = t.length);
|
|
870
|
-
for (let
|
|
870
|
+
for (let i = l - 1; i >= 0; --i) if (!o.resolveDisabled(t[i], i, t)) return i;
|
|
871
871
|
return n;
|
|
872
872
|
}
|
|
873
873
|
case 2: {
|
|
874
|
-
for (let
|
|
874
|
+
for (let i = l + 1; i < t.length; ++i) if (!o.resolveDisabled(t[i], i, t)) return i;
|
|
875
875
|
return n;
|
|
876
876
|
}
|
|
877
877
|
case 3: {
|
|
878
|
-
for (let
|
|
878
|
+
for (let i = t.length - 1; i >= 0; --i) if (!o.resolveDisabled(t[i], i, t)) return i;
|
|
879
879
|
return n;
|
|
880
880
|
}
|
|
881
881
|
case 4: {
|
|
882
|
-
for (let
|
|
882
|
+
for (let i = 0; i < t.length; ++i) if (o.resolveId(t[i], i, t) === e.id) return i;
|
|
883
883
|
return n;
|
|
884
884
|
}
|
|
885
885
|
case 5:
|
|
@@ -888,285 +888,285 @@ function mt(e, o) {
|
|
|
888
888
|
yo(e);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
for (let [n, l] of Object.entries(e))
|
|
891
|
+
function Bt(e = {}, o = null, t = []) {
|
|
892
|
+
for (let [n, l] of Object.entries(e)) zt(t, Ht(o, n), l);
|
|
893
893
|
return t;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Ht(e, o) {
|
|
896
896
|
return e ? e + "[" + o + "]" : o;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
if (Array.isArray(t)) for (let [n, l] of t.entries())
|
|
900
|
-
else t instanceof Date ? e.push([o, t.toISOString()]) : typeof t == "boolean" ? e.push([o, t ? "1" : "0"]) : typeof t == "string" ? e.push([o, t]) : typeof t == "number" ? e.push([o, `${t}`]) : t == null ? e.push([o, ""]) :
|
|
898
|
+
function zt(e, o, t) {
|
|
899
|
+
if (Array.isArray(t)) for (let [n, l] of t.entries()) zt(e, Ht(o, n.toString()), l);
|
|
900
|
+
else t instanceof Date ? e.push([o, t.toISOString()]) : typeof t == "boolean" ? e.push([o, t ? "1" : "0"]) : typeof t == "string" ? e.push([o, t]) : typeof t == "number" ? e.push([o, `${t}`]) : t == null ? e.push([o, ""]) : Bt(t, o, e);
|
|
901
901
|
}
|
|
902
902
|
function wo(e, o) {
|
|
903
903
|
return e === o;
|
|
904
904
|
}
|
|
905
905
|
var So = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(So || {}), Eo = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(Eo || {}), Oo = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(Oo || {});
|
|
906
|
-
let
|
|
906
|
+
let Ut = Symbol("ComboboxContext");
|
|
907
907
|
function ve(e) {
|
|
908
|
-
let o = Ie(
|
|
908
|
+
let o = Ie(Ut, null);
|
|
909
909
|
if (o === null) {
|
|
910
910
|
let t = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
|
|
911
911
|
throw Error.captureStackTrace && Error.captureStackTrace(t, ve), t;
|
|
912
912
|
}
|
|
913
913
|
return o;
|
|
914
914
|
}
|
|
915
|
-
let
|
|
915
|
+
let Zt = Symbol("VirtualContext"), $o = ae({ name: "VirtualProvider", setup(e, { slots: o }) {
|
|
916
916
|
let t = ve("VirtualProvider"), n = S(() => {
|
|
917
|
-
let s =
|
|
917
|
+
let s = V(t.optionsRef);
|
|
918
918
|
if (!s) return { start: 0, end: 0 };
|
|
919
919
|
let a = window.getComputedStyle(s);
|
|
920
920
|
return { start: parseFloat(a.paddingBlockStart || a.paddingTop), end: parseFloat(a.paddingBlockEnd || a.paddingBottom) };
|
|
921
921
|
}), l = Zn(S(() => ({ scrollPaddingStart: n.value.start, scrollPaddingEnd: n.value.end, count: t.virtual.value.options.length, estimateSize() {
|
|
922
922
|
return 40;
|
|
923
923
|
}, getScrollElement() {
|
|
924
|
-
return
|
|
925
|
-
}, overscan: 12 }))),
|
|
924
|
+
return V(t.optionsRef);
|
|
925
|
+
}, overscan: 12 }))), i = S(() => {
|
|
926
926
|
var s;
|
|
927
927
|
return (s = t.virtual.value) == null ? void 0 : s.options;
|
|
928
|
-
}),
|
|
929
|
-
return F([
|
|
930
|
-
|
|
931
|
-
}),
|
|
928
|
+
}), r = E(0);
|
|
929
|
+
return F([i], () => {
|
|
930
|
+
r.value += 1;
|
|
931
|
+
}), ot(Zt, t.virtual.value ? l : null), () => [Ee("div", { style: { position: "relative", width: "100%", height: `${l.value.getTotalSize()}px` }, ref: (s) => {
|
|
932
932
|
if (s) {
|
|
933
933
|
if (typeof process < "u" && process.env.JEST_WORKER_ID !== void 0 || t.activationTrigger.value === 0) return;
|
|
934
934
|
t.activeOptionIndex.value !== null && t.virtual.value.options.length > t.activeOptionIndex.value && l.value.scrollToIndex(t.activeOptionIndex.value);
|
|
935
935
|
}
|
|
936
|
-
} }, l.value.getVirtualItems().map((s) =>
|
|
936
|
+
} }, l.value.getVirtualItems().map((s) => Ot(o.default({ option: t.virtual.value.options[s.index], open: t.comboboxState.value === 0 })[0], { key: `${r.value}-${s.index}`, "data-index": s.index, "aria-setsize": t.virtual.value.options.length, "aria-posinset": s.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${s.start}px)`, overflowAnchor: "none" } })))];
|
|
937
937
|
} }), To = ae({ name: "Combobox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], nullable: !0, default: null }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, nullable: { type: Boolean, default: !1 }, multiple: { type: [Boolean], default: !1 }, immediate: { type: [Boolean], default: !1 }, virtual: { type: Object, default: null } }, inheritAttrs: !1, setup(e, { slots: o, attrs: t, emit: n }) {
|
|
938
|
-
let l = E(1),
|
|
939
|
-
function v(
|
|
940
|
-
let
|
|
941
|
-
return
|
|
938
|
+
let l = E(1), i = E(null), r = E(null), s = E(null), a = E(null), u = E({ static: !1, hold: !1 }), c = E([]), p = E(null), m = E(2), _ = E(!1);
|
|
939
|
+
function v(d = (f) => f) {
|
|
940
|
+
let f = p.value !== null ? c.value[p.value] : null, y = d(c.value.slice()), O = y.length > 0 && y[0].dataRef.order.value !== null ? y.sort((A, G) => A.dataRef.order.value - G.dataRef.order.value) : io(y, (A) => V(A.dataRef.domRef)), R = f ? O.indexOf(f) : null;
|
|
941
|
+
return R === -1 && (R = null), { options: O, activeOptionIndex: R };
|
|
942
942
|
}
|
|
943
|
-
let h = S(() => e.multiple ? 1 : 0),
|
|
944
|
-
function L(
|
|
943
|
+
let h = S(() => e.multiple ? 1 : 0), M = S(() => e.nullable), [N, T] = Wn(S(() => e.modelValue), (d) => n("update:modelValue", d), S(() => e.defaultValue)), P = S(() => N.value === void 0 ? le(h.value, { 1: [], 0: void 0 }) : N.value), D = null, x = null;
|
|
944
|
+
function L(d) {
|
|
945
945
|
return le(h.value, { 0() {
|
|
946
|
-
return T == null ? void 0 : T(
|
|
946
|
+
return T == null ? void 0 : T(d);
|
|
947
947
|
}, 1: () => {
|
|
948
|
-
let
|
|
949
|
-
return O === -1 ?
|
|
948
|
+
let f = K(g.value.value).slice(), y = K(d), O = f.findIndex((R) => g.compare(y, K(R)));
|
|
949
|
+
return O === -1 ? f.push(y) : f.splice(O, 1), T == null ? void 0 : T(f);
|
|
950
950
|
} });
|
|
951
951
|
}
|
|
952
952
|
let b = S(() => {
|
|
953
953
|
});
|
|
954
|
-
F([b], ([
|
|
955
|
-
if (g.virtual.value &&
|
|
956
|
-
let y =
|
|
954
|
+
F([b], ([d], [f]) => {
|
|
955
|
+
if (g.virtual.value && d && f && p.value !== null) {
|
|
956
|
+
let y = d.indexOf(f[p.value]);
|
|
957
957
|
y !== -1 ? p.value = y : p.value = null;
|
|
958
958
|
}
|
|
959
959
|
});
|
|
960
|
-
let g = { comboboxState: l, value:
|
|
960
|
+
let g = { comboboxState: l, value: P, mode: h, compare(d, f) {
|
|
961
961
|
if (typeof e.by == "string") {
|
|
962
962
|
let y = e.by;
|
|
963
|
-
return (
|
|
963
|
+
return (d == null ? void 0 : d[y]) === (f == null ? void 0 : f[y]);
|
|
964
964
|
}
|
|
965
|
-
return e.by === null ? wo(
|
|
966
|
-
}, calculateIndex(
|
|
967
|
-
return g.virtual.value ? e.by === null ? g.virtual.value.options.indexOf(
|
|
968
|
-
}, defaultValue: S(() => e.defaultValue), nullable:
|
|
969
|
-
T(
|
|
965
|
+
return e.by === null ? wo(d, f) : e.by(d, f);
|
|
966
|
+
}, calculateIndex(d) {
|
|
967
|
+
return g.virtual.value ? e.by === null ? g.virtual.value.options.indexOf(d) : g.virtual.value.options.findIndex((f) => g.compare(f, d)) : c.value.findIndex((f) => g.compare(f.dataRef.value, d));
|
|
968
|
+
}, defaultValue: S(() => e.defaultValue), nullable: M, immediate: S(() => !1), virtual: S(() => null), inputRef: r, labelRef: i, buttonRef: s, optionsRef: a, disabled: S(() => e.disabled), options: c, change(d) {
|
|
969
|
+
T(d);
|
|
970
970
|
}, activeOptionIndex: S(() => {
|
|
971
|
-
if (
|
|
971
|
+
if (_.value && p.value === null && (g.virtual.value ? g.virtual.value.options.length > 0 : c.value.length > 0)) {
|
|
972
972
|
if (g.virtual.value) {
|
|
973
|
-
let
|
|
973
|
+
let f = g.virtual.value.options.findIndex((y) => {
|
|
974
974
|
var O;
|
|
975
975
|
return !((O = g.virtual.value) != null && O.disabled(y));
|
|
976
976
|
});
|
|
977
|
-
if (
|
|
977
|
+
if (f !== -1) return f;
|
|
978
978
|
}
|
|
979
|
-
let
|
|
980
|
-
if (
|
|
979
|
+
let d = c.value.findIndex((f) => !f.dataRef.disabled);
|
|
980
|
+
if (d !== -1) return d;
|
|
981
981
|
}
|
|
982
982
|
return p.value;
|
|
983
983
|
}), activationTrigger: m, optionsPropsRef: u, closeCombobox() {
|
|
984
|
-
|
|
984
|
+
_.value = !1, !e.disabled && l.value !== 1 && (l.value = 1, p.value = null);
|
|
985
985
|
}, openCombobox() {
|
|
986
|
-
if (
|
|
986
|
+
if (_.value = !0, !e.disabled && l.value !== 0) {
|
|
987
987
|
if (g.value.value) {
|
|
988
|
-
let
|
|
989
|
-
|
|
988
|
+
let d = g.calculateIndex(g.value.value);
|
|
989
|
+
d !== -1 && (p.value = d);
|
|
990
990
|
}
|
|
991
991
|
l.value = 0;
|
|
992
992
|
}
|
|
993
|
-
}, setActivationTrigger(
|
|
994
|
-
m.value =
|
|
995
|
-
}, goToOption(
|
|
996
|
-
|
|
993
|
+
}, setActivationTrigger(d) {
|
|
994
|
+
m.value = d;
|
|
995
|
+
}, goToOption(d, f, y) {
|
|
996
|
+
_.value = !1, D !== null && cancelAnimationFrame(D), D = requestAnimationFrame(() => {
|
|
997
997
|
if (e.disabled || a.value && !u.value.static && l.value === 1) return;
|
|
998
998
|
if (g.virtual.value) {
|
|
999
|
-
p.value =
|
|
1000
|
-
var
|
|
1001
|
-
return (G = (
|
|
999
|
+
p.value = d === z.Specific ? f : gt({ focus: d }, { resolveItems: () => g.virtual.value.options, resolveActiveIndex: () => {
|
|
1000
|
+
var A, G;
|
|
1001
|
+
return (G = (A = g.activeOptionIndex.value) != null ? A : g.virtual.value.options.findIndex((q) => {
|
|
1002
1002
|
var j;
|
|
1003
1003
|
return !((j = g.virtual.value) != null && j.disabled(q));
|
|
1004
1004
|
})) != null ? G : null;
|
|
1005
|
-
}, resolveDisabled: (
|
|
1005
|
+
}, resolveDisabled: (A) => g.virtual.value.disabled(A), resolveId() {
|
|
1006
1006
|
throw new Error("Function not implemented.");
|
|
1007
1007
|
} }), m.value = y ?? 2;
|
|
1008
1008
|
return;
|
|
1009
1009
|
}
|
|
1010
1010
|
let O = v();
|
|
1011
1011
|
if (O.activeOptionIndex === null) {
|
|
1012
|
-
let
|
|
1013
|
-
|
|
1012
|
+
let A = O.options.findIndex((G) => !G.dataRef.disabled);
|
|
1013
|
+
A !== -1 && (O.activeOptionIndex = A);
|
|
1014
1014
|
}
|
|
1015
|
-
let
|
|
1016
|
-
p.value =
|
|
1015
|
+
let R = d === z.Specific ? f : gt({ focus: d }, { resolveItems: () => O.options, resolveActiveIndex: () => O.activeOptionIndex, resolveId: (A) => A.id, resolveDisabled: (A) => A.dataRef.disabled });
|
|
1016
|
+
p.value = R, m.value = y ?? 2, c.value = O.options;
|
|
1017
1017
|
});
|
|
1018
|
-
}, selectOption(
|
|
1019
|
-
let
|
|
1020
|
-
if (!
|
|
1021
|
-
let { dataRef: y } =
|
|
1018
|
+
}, selectOption(d) {
|
|
1019
|
+
let f = c.value.find((O) => O.id === d);
|
|
1020
|
+
if (!f) return;
|
|
1021
|
+
let { dataRef: y } = f;
|
|
1022
1022
|
L(y.value);
|
|
1023
1023
|
}, selectActiveOption() {
|
|
1024
1024
|
if (g.activeOptionIndex.value !== null) {
|
|
1025
1025
|
if (g.virtual.value) L(g.virtual.value.options[g.activeOptionIndex.value]);
|
|
1026
1026
|
else {
|
|
1027
|
-
let { dataRef:
|
|
1028
|
-
L(
|
|
1027
|
+
let { dataRef: d } = c.value[g.activeOptionIndex.value];
|
|
1028
|
+
L(d.value);
|
|
1029
1029
|
}
|
|
1030
1030
|
g.goToOption(z.Specific, g.activeOptionIndex.value);
|
|
1031
1031
|
}
|
|
1032
|
-
}, registerOption(
|
|
1033
|
-
let y =
|
|
1032
|
+
}, registerOption(d, f) {
|
|
1033
|
+
let y = $t({ id: d, dataRef: f });
|
|
1034
1034
|
if (g.virtual.value) {
|
|
1035
|
-
|
|
1035
|
+
c.value.push(y);
|
|
1036
1036
|
return;
|
|
1037
1037
|
}
|
|
1038
|
-
|
|
1039
|
-
let O = v((
|
|
1040
|
-
p.value === null && g.isSelected(
|
|
1041
|
-
let
|
|
1042
|
-
|
|
1038
|
+
x && cancelAnimationFrame(x);
|
|
1039
|
+
let O = v((R) => (R.push(y), R));
|
|
1040
|
+
p.value === null && g.isSelected(f.value.value) && (O.activeOptionIndex = O.options.indexOf(y)), c.value = O.options, p.value = O.activeOptionIndex, m.value = 2, O.options.some((R) => !V(R.dataRef.domRef)) && (x = requestAnimationFrame(() => {
|
|
1041
|
+
let R = v();
|
|
1042
|
+
c.value = R.options, p.value = R.activeOptionIndex;
|
|
1043
1043
|
}));
|
|
1044
|
-
}, unregisterOption(
|
|
1045
|
-
if (D !== null && cancelAnimationFrame(D),
|
|
1046
|
-
|
|
1044
|
+
}, unregisterOption(d, f) {
|
|
1045
|
+
if (D !== null && cancelAnimationFrame(D), f && (_.value = !0), g.virtual.value) {
|
|
1046
|
+
c.value = c.value.filter((O) => O.id !== d);
|
|
1047
1047
|
return;
|
|
1048
1048
|
}
|
|
1049
1049
|
let y = v((O) => {
|
|
1050
|
-
let
|
|
1051
|
-
return
|
|
1050
|
+
let R = O.findIndex((A) => A.id === d);
|
|
1051
|
+
return R !== -1 && O.splice(R, 1), O;
|
|
1052
1052
|
});
|
|
1053
|
-
|
|
1054
|
-
}, isSelected(
|
|
1055
|
-
return le(h.value, { 0: () => g.compare(K(g.value.value), K(
|
|
1056
|
-
}, isActive(
|
|
1057
|
-
return p.value === g.calculateIndex(
|
|
1053
|
+
c.value = y.options, p.value = y.activeOptionIndex, m.value = 2;
|
|
1054
|
+
}, isSelected(d) {
|
|
1055
|
+
return le(h.value, { 0: () => g.compare(K(g.value.value), K(d)), 1: () => K(g.value.value).some((f) => g.compare(K(f), K(d))) });
|
|
1056
|
+
}, isActive(d) {
|
|
1057
|
+
return p.value === g.calculateIndex(d);
|
|
1058
1058
|
} };
|
|
1059
|
-
co([
|
|
1059
|
+
co([r, s, a], () => g.closeCombobox(), S(() => l.value === 0)), ot(Ut, g), _o(S(() => le(l.value, { 0: $e.Open, 1: $e.Closed })));
|
|
1060
1060
|
let I = S(() => {
|
|
1061
|
-
var
|
|
1062
|
-
return (
|
|
1061
|
+
var d;
|
|
1062
|
+
return (d = V(r)) == null ? void 0 : d.closest("form");
|
|
1063
1063
|
});
|
|
1064
1064
|
return xe(() => {
|
|
1065
1065
|
F([I], () => {
|
|
1066
1066
|
if (!I.value || e.defaultValue === void 0) return;
|
|
1067
|
-
function
|
|
1067
|
+
function d() {
|
|
1068
1068
|
g.change(e.defaultValue);
|
|
1069
1069
|
}
|
|
1070
|
-
return I.value.addEventListener("reset",
|
|
1071
|
-
var
|
|
1072
|
-
(
|
|
1070
|
+
return I.value.addEventListener("reset", d), () => {
|
|
1071
|
+
var f;
|
|
1072
|
+
(f = I.value) == null || f.removeEventListener("reset", d);
|
|
1073
1073
|
};
|
|
1074
1074
|
}, { immediate: !0 });
|
|
1075
1075
|
}), () => {
|
|
1076
|
-
var
|
|
1077
|
-
let { name: O, disabled:
|
|
1078
|
-
return Ee(Z, [...O != null &&
|
|
1076
|
+
var d, f, y;
|
|
1077
|
+
let { name: O, disabled: R, form: A, ...G } = e, q = { open: l.value === 0, disabled: R, activeIndex: g.activeOptionIndex.value, activeOption: g.activeOptionIndex.value === null ? null : g.virtual.value ? g.virtual.value.options[(d = g.activeOptionIndex.value) != null ? d : 0] : (y = (f = g.options.value[g.activeOptionIndex.value]) == null ? void 0 : f.dataRef.value) != null ? y : null, value: P.value };
|
|
1078
|
+
return Ee(Z, [...O != null && P.value != null ? Bt({ [O]: P.value }).map(([j, dn]) => Ee(bo, mo({ features: Dt.Hidden, key: j, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: A, disabled: R, name: j, value: dn }))) : [], pe({ theirProps: { ...t, ...je(G, ["by", "defaultValue", "immediate", "modelValue", "multiple", "nullable", "onUpdate:modelValue", "virtual"]) }, ourProps: {}, slot: q, slots: o, attrs: t, name: "Combobox" })]);
|
|
1079
1079
|
};
|
|
1080
1080
|
} });
|
|
1081
1081
|
ae({ name: "ComboboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(e, { attrs: o, slots: t }) {
|
|
1082
1082
|
var n;
|
|
1083
|
-
let l = (n = e.id) != null ? n : `headlessui-combobox-label-${Le()}`,
|
|
1084
|
-
function
|
|
1083
|
+
let l = (n = e.id) != null ? n : `headlessui-combobox-label-${Le()}`, i = ve("ComboboxLabel");
|
|
1084
|
+
function r() {
|
|
1085
1085
|
var s;
|
|
1086
|
-
(s =
|
|
1086
|
+
(s = V(i.inputRef)) == null || s.focus({ preventScroll: !0 });
|
|
1087
1087
|
}
|
|
1088
1088
|
return () => {
|
|
1089
|
-
let s = { open:
|
|
1089
|
+
let s = { open: i.comboboxState.value === 0, disabled: i.disabled.value }, { ...a } = e, u = { id: l, ref: i.labelRef, onClick: r };
|
|
1090
1090
|
return pe({ ourProps: u, theirProps: a, slot: s, attrs: o, slots: t, name: "ComboboxLabel" });
|
|
1091
1091
|
};
|
|
1092
1092
|
} });
|
|
1093
1093
|
let Io = ae({ name: "ComboboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(e, { attrs: o, slots: t, expose: n }) {
|
|
1094
1094
|
var l;
|
|
1095
|
-
let
|
|
1096
|
-
n({ el:
|
|
1097
|
-
function s(
|
|
1098
|
-
|
|
1095
|
+
let i = (l = e.id) != null ? l : `headlessui-combobox-button-${Le()}`, r = ve("ComboboxButton");
|
|
1096
|
+
n({ el: r.buttonRef, $el: r.buttonRef });
|
|
1097
|
+
function s(c) {
|
|
1098
|
+
r.disabled.value || (r.comboboxState.value === 0 ? r.closeCombobox() : (c.preventDefault(), r.openCombobox()), Q(() => {
|
|
1099
1099
|
var p;
|
|
1100
|
-
return (p =
|
|
1100
|
+
return (p = V(r.inputRef)) == null ? void 0 : p.focus({ preventScroll: !0 });
|
|
1101
1101
|
}));
|
|
1102
1102
|
}
|
|
1103
|
-
function a(
|
|
1104
|
-
switch (
|
|
1103
|
+
function a(c) {
|
|
1104
|
+
switch (c.key) {
|
|
1105
1105
|
case W.ArrowDown:
|
|
1106
|
-
|
|
1106
|
+
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && r.openCombobox(), Q(() => {
|
|
1107
1107
|
var p;
|
|
1108
|
-
return (p =
|
|
1108
|
+
return (p = r.inputRef.value) == null ? void 0 : p.focus({ preventScroll: !0 });
|
|
1109
1109
|
});
|
|
1110
1110
|
return;
|
|
1111
1111
|
case W.ArrowUp:
|
|
1112
|
-
|
|
1113
|
-
|
|
1112
|
+
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && (r.openCombobox(), Q(() => {
|
|
1113
|
+
r.value.value || r.goToOption(z.Last);
|
|
1114
1114
|
})), Q(() => {
|
|
1115
1115
|
var p;
|
|
1116
|
-
return (p =
|
|
1116
|
+
return (p = r.inputRef.value) == null ? void 0 : p.focus({ preventScroll: !0 });
|
|
1117
1117
|
});
|
|
1118
1118
|
return;
|
|
1119
1119
|
case W.Escape:
|
|
1120
|
-
if (
|
|
1121
|
-
|
|
1120
|
+
if (r.comboboxState.value !== 0) return;
|
|
1121
|
+
c.preventDefault(), r.optionsRef.value && !r.optionsPropsRef.value.static && c.stopPropagation(), r.closeCombobox(), Q(() => {
|
|
1122
1122
|
var p;
|
|
1123
|
-
return (p =
|
|
1123
|
+
return (p = r.inputRef.value) == null ? void 0 : p.focus({ preventScroll: !0 });
|
|
1124
1124
|
});
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
let u = fo(S(() => ({ as: e.as, type: o.type })),
|
|
1128
|
+
let u = fo(S(() => ({ as: e.as, type: o.type })), r.buttonRef);
|
|
1129
1129
|
return () => {
|
|
1130
|
-
var
|
|
1131
|
-
let m = { open:
|
|
1132
|
-
return pe({ ourProps: v, theirProps:
|
|
1130
|
+
var c, p;
|
|
1131
|
+
let m = { open: r.comboboxState.value === 0, disabled: r.disabled.value, value: r.value.value }, { ..._ } = e, v = { ref: r.buttonRef, id: i, type: u.value, tabindex: "-1", "aria-haspopup": "listbox", "aria-controls": (c = V(r.optionsRef)) == null ? void 0 : c.id, "aria-expanded": r.comboboxState.value === 0, "aria-labelledby": r.labelRef.value ? [(p = V(r.labelRef)) == null ? void 0 : p.id, i].join(" ") : void 0, disabled: r.disabled.value === !0 ? !0 : void 0, onKeydown: a, onClick: s };
|
|
1132
|
+
return pe({ ourProps: v, theirProps: _, slot: m, attrs: o, slots: t, name: "ComboboxButton" });
|
|
1133
1133
|
};
|
|
1134
1134
|
} }), Lo = ae({ name: "ComboboxInput", props: { as: { type: [Object, String], default: "input" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, displayValue: { type: Function }, defaultValue: { type: String, default: void 0 }, id: { type: String, default: null } }, emits: { change: (e) => !0 }, setup(e, { emit: o, attrs: t, slots: n, expose: l }) {
|
|
1135
|
-
var
|
|
1136
|
-
let
|
|
1135
|
+
var i;
|
|
1136
|
+
let r = (i = e.id) != null ? i : `headlessui-combobox-input-${Le()}`, s = ve("ComboboxInput"), a = S(() => it(V(s.inputRef))), u = { value: !1 };
|
|
1137
1137
|
l({ el: s.inputRef, $el: s.inputRef });
|
|
1138
|
-
function
|
|
1138
|
+
function c() {
|
|
1139
1139
|
s.change(null);
|
|
1140
|
-
let
|
|
1141
|
-
|
|
1140
|
+
let x = V(s.optionsRef);
|
|
1141
|
+
x && (x.scrollTop = 0), s.goToOption(z.Nothing);
|
|
1142
1142
|
}
|
|
1143
1143
|
let p = S(() => {
|
|
1144
|
-
var
|
|
1144
|
+
var x;
|
|
1145
1145
|
let L = s.value.value;
|
|
1146
|
-
return
|
|
1146
|
+
return V(s.inputRef) ? typeof e.displayValue < "u" && L !== void 0 ? (x = e.displayValue(L)) != null ? x : "" : typeof L == "string" ? L : "" : "";
|
|
1147
1147
|
});
|
|
1148
1148
|
xe(() => {
|
|
1149
|
-
F([p, s.comboboxState, a], ([
|
|
1149
|
+
F([p, s.comboboxState, a], ([x, L], [b, g]) => {
|
|
1150
1150
|
if (u.value) return;
|
|
1151
|
-
let I =
|
|
1152
|
-
I && ((g === 0 && L === 1 ||
|
|
1153
|
-
var
|
|
1154
|
-
if (u.value || !I || ((
|
|
1155
|
-
let { selectionStart:
|
|
1156
|
-
Math.abs((y ?? 0) - (
|
|
1151
|
+
let I = V(s.inputRef);
|
|
1152
|
+
I && ((g === 0 && L === 1 || x !== b) && (I.value = x), requestAnimationFrame(() => {
|
|
1153
|
+
var d;
|
|
1154
|
+
if (u.value || !I || ((d = a.value) == null ? void 0 : d.activeElement) !== I) return;
|
|
1155
|
+
let { selectionStart: f, selectionEnd: y } = I;
|
|
1156
|
+
Math.abs((y ?? 0) - (f ?? 0)) === 0 && f === 0 && I.setSelectionRange(I.value.length, I.value.length);
|
|
1157
1157
|
}));
|
|
1158
|
-
}, { immediate: !0 }), F([s.comboboxState], ([
|
|
1159
|
-
if (
|
|
1158
|
+
}, { immediate: !0 }), F([s.comboboxState], ([x], [L]) => {
|
|
1159
|
+
if (x === 0 && L === 1) {
|
|
1160
1160
|
if (u.value) return;
|
|
1161
|
-
let b =
|
|
1161
|
+
let b = V(s.inputRef);
|
|
1162
1162
|
if (!b) return;
|
|
1163
|
-
let g = b.value, { selectionStart: I, selectionEnd:
|
|
1164
|
-
b.value = "", b.value = g,
|
|
1163
|
+
let g = b.value, { selectionStart: I, selectionEnd: d, selectionDirection: f } = b;
|
|
1164
|
+
b.value = "", b.value = g, f !== null ? b.setSelectionRange(I, d, f) : b.setSelectionRange(I, d);
|
|
1165
1165
|
}
|
|
1166
1166
|
});
|
|
1167
1167
|
});
|
|
1168
1168
|
let m = E(!1);
|
|
1169
|
-
function
|
|
1169
|
+
function _() {
|
|
1170
1170
|
m.value = !0;
|
|
1171
1171
|
}
|
|
1172
1172
|
function v() {
|
|
@@ -1175,39 +1175,39 @@ let Io = ae({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1175
1175
|
});
|
|
1176
1176
|
}
|
|
1177
1177
|
let h = Jn();
|
|
1178
|
-
function
|
|
1178
|
+
function M(x) {
|
|
1179
1179
|
switch (u.value = !0, h(() => {
|
|
1180
1180
|
u.value = !1;
|
|
1181
|
-
}),
|
|
1181
|
+
}), x.key) {
|
|
1182
1182
|
case W.Enter:
|
|
1183
1183
|
if (u.value = !1, s.comboboxState.value !== 0 || m.value) return;
|
|
1184
|
-
if (
|
|
1184
|
+
if (x.preventDefault(), x.stopPropagation(), s.activeOptionIndex.value === null) {
|
|
1185
1185
|
s.closeCombobox();
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
1188
1188
|
s.selectActiveOption(), s.mode.value === 0 && s.closeCombobox();
|
|
1189
1189
|
break;
|
|
1190
1190
|
case W.ArrowDown:
|
|
1191
|
-
return u.value = !1,
|
|
1191
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), le(s.comboboxState.value, { 0: () => s.goToOption(z.Next), 1: () => s.openCombobox() });
|
|
1192
1192
|
case W.ArrowUp:
|
|
1193
|
-
return u.value = !1,
|
|
1193
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), le(s.comboboxState.value, { 0: () => s.goToOption(z.Previous), 1: () => {
|
|
1194
1194
|
s.openCombobox(), Q(() => {
|
|
1195
1195
|
s.value.value || s.goToOption(z.Last);
|
|
1196
1196
|
});
|
|
1197
1197
|
} });
|
|
1198
1198
|
case W.Home:
|
|
1199
|
-
if (
|
|
1200
|
-
return u.value = !1,
|
|
1199
|
+
if (x.shiftKey) break;
|
|
1200
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), s.goToOption(z.First);
|
|
1201
1201
|
case W.PageUp:
|
|
1202
|
-
return u.value = !1,
|
|
1202
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), s.goToOption(z.First);
|
|
1203
1203
|
case W.End:
|
|
1204
|
-
if (
|
|
1205
|
-
return u.value = !1,
|
|
1204
|
+
if (x.shiftKey) break;
|
|
1205
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), s.goToOption(z.Last);
|
|
1206
1206
|
case W.PageDown:
|
|
1207
|
-
return u.value = !1,
|
|
1207
|
+
return u.value = !1, x.preventDefault(), x.stopPropagation(), s.goToOption(z.Last);
|
|
1208
1208
|
case W.Escape:
|
|
1209
1209
|
if (u.value = !1, s.comboboxState.value !== 0) return;
|
|
1210
|
-
|
|
1210
|
+
x.preventDefault(), s.optionsRef.value && !s.optionsPropsRef.value.static && x.stopPropagation(), s.nullable.value && s.mode.value === 0 && s.value.value === null && c(), s.closeCombobox();
|
|
1211
1211
|
break;
|
|
1212
1212
|
case W.Tab:
|
|
1213
1213
|
if (u.value = !1, s.comboboxState.value !== 0) return;
|
|
@@ -1215,39 +1215,39 @@ let Io = ae({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1215
1215
|
break;
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
o("change",
|
|
1218
|
+
function N(x) {
|
|
1219
|
+
o("change", x), s.nullable.value && s.mode.value === 0 && x.target.value === "" && c(), s.openCombobox();
|
|
1220
1220
|
}
|
|
1221
|
-
function T(
|
|
1221
|
+
function T(x) {
|
|
1222
1222
|
var L, b, g;
|
|
1223
|
-
let I = (L =
|
|
1224
|
-
if (u.value = !1, !((b =
|
|
1223
|
+
let I = (L = x.relatedTarget) != null ? L : ce.find((d) => d !== x.currentTarget);
|
|
1224
|
+
if (u.value = !1, !((b = V(s.optionsRef)) != null && b.contains(I)) && !((g = V(s.buttonRef)) != null && g.contains(I)) && s.comboboxState.value === 0) return x.preventDefault(), s.mode.value === 0 && (s.nullable.value && s.value.value === null ? c() : s.activationTrigger.value !== 1 && s.selectActiveOption()), s.closeCombobox();
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function P(x) {
|
|
1227
1227
|
var L, b, g;
|
|
1228
|
-
let I = (L =
|
|
1229
|
-
(b =
|
|
1228
|
+
let I = (L = x.relatedTarget) != null ? L : ce.find((d) => d !== x.currentTarget);
|
|
1229
|
+
(b = V(s.buttonRef)) != null && b.contains(I) || (g = V(s.optionsRef)) != null && g.contains(I) || s.disabled.value || s.immediate.value && s.comboboxState.value !== 0 && (s.openCombobox(), Ae().nextFrame(() => {
|
|
1230
1230
|
s.setActivationTrigger(1);
|
|
1231
1231
|
}));
|
|
1232
1232
|
}
|
|
1233
1233
|
let D = S(() => {
|
|
1234
|
-
var
|
|
1235
|
-
return (g = (b = (L = e.defaultValue) != null ? L : s.defaultValue.value !== void 0 ? (
|
|
1234
|
+
var x, L, b, g;
|
|
1235
|
+
return (g = (b = (L = e.defaultValue) != null ? L : s.defaultValue.value !== void 0 ? (x = e.displayValue) == null ? void 0 : x.call(e, s.defaultValue.value) : null) != null ? b : s.defaultValue.value) != null ? g : "";
|
|
1236
1236
|
});
|
|
1237
1237
|
return () => {
|
|
1238
|
-
var
|
|
1239
|
-
let y = { open: s.comboboxState.value === 0 }, { displayValue: O, onChange:
|
|
1240
|
-
return pe({ ourProps: G, theirProps:
|
|
1238
|
+
var x, L, b, g, I, d, f;
|
|
1239
|
+
let y = { open: s.comboboxState.value === 0 }, { displayValue: O, onChange: R, ...A } = e, G = { "aria-controls": (x = s.optionsRef.value) == null ? void 0 : x.id, "aria-expanded": s.comboboxState.value === 0, "aria-activedescendant": s.activeOptionIndex.value === null ? void 0 : s.virtual.value ? (L = s.options.value.find((q) => !s.virtual.value.disabled(q.dataRef.value) && s.compare(q.dataRef.value, s.virtual.value.options[s.activeOptionIndex.value]))) == null ? void 0 : L.id : (b = s.options.value[s.activeOptionIndex.value]) == null ? void 0 : b.id, "aria-labelledby": (d = (g = V(s.labelRef)) == null ? void 0 : g.id) != null ? d : (I = V(s.buttonRef)) == null ? void 0 : I.id, "aria-autocomplete": "list", id: r, onCompositionstart: _, onCompositionend: v, onKeydown: M, onInput: N, onFocus: P, onBlur: T, role: "combobox", type: (f = t.type) != null ? f : "text", tabIndex: 0, ref: s.inputRef, defaultValue: D.value, disabled: s.disabled.value === !0 ? !0 : void 0 };
|
|
1240
|
+
return pe({ ourProps: G, theirProps: A, slot: y, attrs: t, slots: n, features: Oe.RenderStrategy | Oe.Static, name: "ComboboxInput" });
|
|
1241
1241
|
};
|
|
1242
1242
|
} }), Po = ae({ name: "ComboboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, hold: { type: [Boolean], default: !1 } }, setup(e, { attrs: o, slots: t, expose: n }) {
|
|
1243
|
-
let l = ve("ComboboxOptions"),
|
|
1244
|
-
n({ el: l.optionsRef, $el: l.optionsRef }),
|
|
1243
|
+
let l = ve("ComboboxOptions"), i = `headlessui-combobox-options-${Le()}`;
|
|
1244
|
+
n({ el: l.optionsRef, $el: l.optionsRef }), re(() => {
|
|
1245
1245
|
l.optionsPropsRef.value.static = e.static;
|
|
1246
|
-
}),
|
|
1246
|
+
}), re(() => {
|
|
1247
1247
|
l.optionsPropsRef.value.hold = e.hold;
|
|
1248
1248
|
});
|
|
1249
|
-
let
|
|
1250
|
-
vo({ container: S(() =>
|
|
1249
|
+
let r = Co(), s = S(() => r !== null ? (r.value & $e.Open) === $e.Open : l.comboboxState.value === 0);
|
|
1250
|
+
vo({ container: S(() => V(l.optionsRef)), enabled: S(() => l.comboboxState.value === 0), accept(u) {
|
|
1251
1251
|
return u.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : u.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1252
1252
|
}, walk(u) {
|
|
1253
1253
|
u.setAttribute("role", "none");
|
|
@@ -1256,55 +1256,55 @@ let Io = ae({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1256
1256
|
u.preventDefault();
|
|
1257
1257
|
}
|
|
1258
1258
|
return () => {
|
|
1259
|
-
var u,
|
|
1260
|
-
let m = { open: l.comboboxState.value === 0 },
|
|
1261
|
-
return pe({ ourProps:
|
|
1259
|
+
var u, c, p;
|
|
1260
|
+
let m = { open: l.comboboxState.value === 0 }, _ = { "aria-labelledby": (p = (u = V(l.labelRef)) == null ? void 0 : u.id) != null ? p : (c = V(l.buttonRef)) == null ? void 0 : c.id, id: i, ref: l.optionsRef, role: "listbox", "aria-multiselectable": l.mode.value === 1 ? !0 : void 0, onMousedown: a }, v = je(e, ["hold"]);
|
|
1261
|
+
return pe({ ourProps: _, theirProps: v, slot: m, attrs: o, slots: l.virtual.value && l.comboboxState.value === 0 ? { ...t, default: () => [Ee($o, {}, t.default)] } : t, features: Oe.RenderStrategy | Oe.Static, visible: s.value, name: "ComboboxOptions" });
|
|
1262
1262
|
};
|
|
1263
1263
|
} }), Vo = ae({ name: "ComboboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, order: { type: [Number], default: null } }, setup(e, { slots: o, attrs: t, expose: n }) {
|
|
1264
|
-
let l = ve("ComboboxOption"),
|
|
1265
|
-
n({ el:
|
|
1264
|
+
let l = ve("ComboboxOption"), i = `headlessui-combobox-option-${Le()}`, r = E(null), s = S(() => e.disabled);
|
|
1265
|
+
n({ el: r, $el: r });
|
|
1266
1266
|
let a = S(() => {
|
|
1267
1267
|
var T;
|
|
1268
|
-
return l.virtual.value ? l.activeOptionIndex.value === l.calculateIndex(e.value) : l.activeOptionIndex.value === null ? !1 : ((T = l.options.value[l.activeOptionIndex.value]) == null ? void 0 : T.id) ===
|
|
1269
|
-
}), u = S(() => l.isSelected(e.value)),
|
|
1270
|
-
xe(() => l.registerOption(
|
|
1271
|
-
let T =
|
|
1272
|
-
T && (
|
|
1273
|
-
}),
|
|
1268
|
+
return l.virtual.value ? l.activeOptionIndex.value === l.calculateIndex(e.value) : l.activeOptionIndex.value === null ? !1 : ((T = l.options.value[l.activeOptionIndex.value]) == null ? void 0 : T.id) === i;
|
|
1269
|
+
}), u = S(() => l.isSelected(e.value)), c = Ie(Zt, null), p = S(() => ({ disabled: e.disabled, value: e.value, domRef: r, order: S(() => e.order) }));
|
|
1270
|
+
xe(() => l.registerOption(i, p)), nt(() => l.unregisterOption(i, a.value)), re(() => {
|
|
1271
|
+
let T = V(r);
|
|
1272
|
+
T && (c == null || c.value.measureElement(T));
|
|
1273
|
+
}), re(() => {
|
|
1274
1274
|
l.comboboxState.value === 0 && a.value && (l.virtual.value || l.activationTrigger.value !== 0 && Q(() => {
|
|
1275
|
-
var T,
|
|
1276
|
-
return (
|
|
1275
|
+
var T, P;
|
|
1276
|
+
return (P = (T = V(r)) == null ? void 0 : T.scrollIntoView) == null ? void 0 : P.call(T, { block: "nearest" });
|
|
1277
1277
|
}));
|
|
1278
1278
|
});
|
|
1279
1279
|
function m(T) {
|
|
1280
|
-
T.preventDefault(), T.button ===
|
|
1281
|
-
var
|
|
1282
|
-
return (
|
|
1280
|
+
T.preventDefault(), T.button === jt.Left && (s.value || (l.selectOption(i), Rt() || requestAnimationFrame(() => {
|
|
1281
|
+
var P;
|
|
1282
|
+
return (P = V(l.inputRef)) == null ? void 0 : P.focus({ preventScroll: !0 });
|
|
1283
1283
|
}), l.mode.value === 0 && l.closeCombobox()));
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function _() {
|
|
1286
1286
|
var T;
|
|
1287
1287
|
if (e.disabled || (T = l.virtual.value) != null && T.disabled(e.value)) return l.goToOption(z.Nothing);
|
|
1288
|
-
let
|
|
1289
|
-
l.goToOption(z.Specific,
|
|
1288
|
+
let P = l.calculateIndex(e.value);
|
|
1289
|
+
l.goToOption(z.Specific, P);
|
|
1290
1290
|
}
|
|
1291
1291
|
let v = po();
|
|
1292
1292
|
function h(T) {
|
|
1293
1293
|
v.update(T);
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1296
|
-
var
|
|
1297
|
-
if (!v.wasMoved(T) || e.disabled || (
|
|
1295
|
+
function M(T) {
|
|
1296
|
+
var P;
|
|
1297
|
+
if (!v.wasMoved(T) || e.disabled || (P = l.virtual.value) != null && P.disabled(e.value) || a.value) return;
|
|
1298
1298
|
let D = l.calculateIndex(e.value);
|
|
1299
1299
|
l.goToOption(z.Specific, D, 0);
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1302
|
-
var
|
|
1303
|
-
v.wasMoved(T) && (e.disabled || (
|
|
1301
|
+
function N(T) {
|
|
1302
|
+
var P;
|
|
1303
|
+
v.wasMoved(T) && (e.disabled || (P = l.virtual.value) != null && P.disabled(e.value) || a.value && (l.optionsPropsRef.value.hold || l.goToOption(z.Nothing)));
|
|
1304
1304
|
}
|
|
1305
1305
|
return () => {
|
|
1306
|
-
let { disabled: T } = e,
|
|
1307
|
-
return pe({ ourProps: D, theirProps:
|
|
1306
|
+
let { disabled: T } = e, P = { active: a.value, selected: u.value, disabled: T }, D = { id: i, ref: r, role: "option", tabIndex: T === !0 ? void 0 : -1, "aria-disabled": T === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onMousedown: m, onFocus: _, onPointerenter: h, onMouseenter: h, onPointermove: M, onMousemove: M, onPointerleave: N, onMouseleave: N }, x = je(e, ["order", "value"]);
|
|
1307
|
+
return pe({ ourProps: D, theirProps: x, slot: P, attrs: t, slots: o, name: "ComboboxOption" });
|
|
1308
1308
|
};
|
|
1309
1309
|
} });
|
|
1310
1310
|
function ko(e, o) {
|
|
@@ -1352,174 +1352,73 @@ function Ro(e, o) {
|
|
|
1352
1352
|
})
|
|
1353
1353
|
]);
|
|
1354
1354
|
}
|
|
1355
|
-
const gt = {
|
|
1356
|
-
__name: "Select",
|
|
1357
|
-
props: /* @__PURE__ */ pn({
|
|
1358
|
-
languages: {
|
|
1359
|
-
type: Object,
|
|
1360
|
-
required: !0
|
|
1361
|
-
}
|
|
1362
|
-
}, {
|
|
1363
|
-
modelValue: {},
|
|
1364
|
-
modelModifiers: {}
|
|
1365
|
-
}),
|
|
1366
|
-
emits: ["update:modelValue"],
|
|
1367
|
-
setup(e) {
|
|
1368
|
-
const o = e, t = vn(e, "modelValue"), n = E(""), l = E(null), r = S(() => Object.entries(o.languages).filter(
|
|
1369
|
-
([, s]) => s.toLowerCase().includes(n.value.toLowerCase())
|
|
1370
|
-
)), i = (s) => {
|
|
1371
|
-
s.target.value = "", n.value = "", l.value && l.value.$el.click();
|
|
1372
|
-
};
|
|
1373
|
-
return (s, a) => (w(), ee(M(To), {
|
|
1374
|
-
modelValue: t.value,
|
|
1375
|
-
"onUpdate:modelValue": a[3] || (a[3] = (u) => t.value = u),
|
|
1376
|
-
as: "div",
|
|
1377
|
-
class: "relative mt-1"
|
|
1378
|
-
}, {
|
|
1379
|
-
default: Pe(() => [
|
|
1380
|
-
H(M(Lo), {
|
|
1381
|
-
class: "w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",
|
|
1382
|
-
onChange: a[0] || (a[0] = (u) => n.value = u.target.value),
|
|
1383
|
-
displayValue: (u) => e.languages[u],
|
|
1384
|
-
onFocus: a[1] || (a[1] = (u) => i(u))
|
|
1385
|
-
}, null, 8, ["displayValue"]),
|
|
1386
|
-
H(M(Io), {
|
|
1387
|
-
ref_key: "btnSelect",
|
|
1388
|
-
ref: l,
|
|
1389
|
-
class: "absolute inset-y-0 right-0 flex items-center pr-2"
|
|
1390
|
-
}, {
|
|
1391
|
-
default: Pe(() => [
|
|
1392
|
-
H(M(Mo), {
|
|
1393
|
-
class: "h-5 w-5 text-gray-400",
|
|
1394
|
-
"aria-hidden": "true",
|
|
1395
|
-
onClick: a[2] || (a[2] = (u) => i(u))
|
|
1396
|
-
})
|
|
1397
|
-
]),
|
|
1398
|
-
_: 1
|
|
1399
|
-
}, 512),
|
|
1400
|
-
H(M(Po), { class: "absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50" }, {
|
|
1401
|
-
default: Pe(() => [
|
|
1402
|
-
(w(!0), $(Z, null, se(r.value, ([u, f]) => (w(), ee(M(Vo), {
|
|
1403
|
-
key: u,
|
|
1404
|
-
value: u
|
|
1405
|
-
}, {
|
|
1406
|
-
default: Pe(({ active: p, selected: m }) => [
|
|
1407
|
-
C("li", {
|
|
1408
|
-
class: Ce([
|
|
1409
|
-
"relative cursor-default select-none py-2 pl-3 pr-9",
|
|
1410
|
-
p ? "bg-[#3B5695] text-white" : "text-textCustom"
|
|
1411
|
-
])
|
|
1412
|
-
}, [
|
|
1413
|
-
C("span", {
|
|
1414
|
-
class: Ce(["block truncate", m && "font-semibold"])
|
|
1415
|
-
}, te(f), 3)
|
|
1416
|
-
], 2)
|
|
1417
|
-
]),
|
|
1418
|
-
_: 2
|
|
1419
|
-
}, 1032, ["value"]))), 128))
|
|
1420
|
-
]),
|
|
1421
|
-
_: 1
|
|
1422
|
-
})
|
|
1423
|
-
]),
|
|
1424
|
-
_: 1
|
|
1425
|
-
}, 8, ["modelValue"]));
|
|
1426
|
-
}
|
|
1427
|
-
}, Zt = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e", No = { key: 0 }, Ao = /* @__PURE__ */ C("img", {
|
|
1428
|
-
src: Zt,
|
|
1429
|
-
alt: "swap",
|
|
1430
|
-
class: "w-4"
|
|
1431
|
-
}, null, -1), Do = [
|
|
1432
|
-
Ao
|
|
1433
|
-
], Fo = /* @__PURE__ */ C("img", {
|
|
1434
|
-
src: Zt,
|
|
1435
|
-
alt: "swap",
|
|
1436
|
-
class: "w-4"
|
|
1437
|
-
}, null, -1), jo = [
|
|
1438
|
-
Fo
|
|
1439
|
-
], Bo = {
|
|
1440
|
-
__name: "SwapBtn",
|
|
1441
|
-
props: {
|
|
1442
|
-
isBidirect: {
|
|
1443
|
-
type: Boolean,
|
|
1444
|
-
default: !1
|
|
1445
|
-
}
|
|
1446
|
-
},
|
|
1447
|
-
emits: ["swap"],
|
|
1448
|
-
setup(e, { emit: o }) {
|
|
1449
|
-
const t = o;
|
|
1450
|
-
return (n, l) => e.isBidirect ? (w(), $("button", {
|
|
1451
|
-
key: 1,
|
|
1452
|
-
onClick: l[0] || (l[0] = (r) => t("swap"))
|
|
1453
|
-
}, jo)) : (w(), $("button", No, Do));
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
1355
|
var Wt = !1;
|
|
1457
1356
|
function ke(e, o, t) {
|
|
1458
1357
|
return Array.isArray(e) ? (e.length = Math.max(e.length, o), e.splice(o, 1, t), t) : (e[o] = t, t);
|
|
1459
1358
|
}
|
|
1460
|
-
function
|
|
1359
|
+
function Ke(e, o) {
|
|
1461
1360
|
if (Array.isArray(e)) {
|
|
1462
1361
|
e.splice(o, 1);
|
|
1463
1362
|
return;
|
|
1464
1363
|
}
|
|
1465
1364
|
delete e[o];
|
|
1466
1365
|
}
|
|
1467
|
-
function
|
|
1366
|
+
function No() {
|
|
1468
1367
|
return Gt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1469
1368
|
}
|
|
1470
1369
|
function Gt() {
|
|
1471
1370
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
1472
1371
|
}
|
|
1473
|
-
const
|
|
1474
|
-
let me,
|
|
1475
|
-
function
|
|
1372
|
+
const Ao = typeof Proxy == "function", Do = "devtools-plugin:setup", Fo = "plugin:settings:set";
|
|
1373
|
+
let me, Ye;
|
|
1374
|
+
function jo() {
|
|
1476
1375
|
var e;
|
|
1477
|
-
return me !== void 0 || (typeof window < "u" && window.performance ? (me = !0,
|
|
1376
|
+
return me !== void 0 || (typeof window < "u" && window.performance ? (me = !0, Ye = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (me = !0, Ye = globalThis.perf_hooks.performance) : me = !1), me;
|
|
1478
1377
|
}
|
|
1479
|
-
function
|
|
1480
|
-
return
|
|
1378
|
+
function Bo() {
|
|
1379
|
+
return jo() ? Ye.now() : Date.now();
|
|
1481
1380
|
}
|
|
1482
|
-
class
|
|
1381
|
+
class Ho {
|
|
1483
1382
|
constructor(o, t) {
|
|
1484
1383
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = o, this.hook = t;
|
|
1485
1384
|
const n = {};
|
|
1486
1385
|
if (o.settings)
|
|
1487
|
-
for (const
|
|
1488
|
-
const s = o.settings[
|
|
1489
|
-
n[
|
|
1386
|
+
for (const r in o.settings) {
|
|
1387
|
+
const s = o.settings[r];
|
|
1388
|
+
n[r] = s.defaultValue;
|
|
1490
1389
|
}
|
|
1491
1390
|
const l = `__vue-devtools-plugin-settings__${o.id}`;
|
|
1492
|
-
let
|
|
1391
|
+
let i = Object.assign({}, n);
|
|
1493
1392
|
try {
|
|
1494
|
-
const
|
|
1495
|
-
Object.assign(
|
|
1393
|
+
const r = localStorage.getItem(l), s = JSON.parse(r);
|
|
1394
|
+
Object.assign(i, s);
|
|
1496
1395
|
} catch {
|
|
1497
1396
|
}
|
|
1498
1397
|
this.fallbacks = {
|
|
1499
1398
|
getSettings() {
|
|
1500
|
-
return
|
|
1399
|
+
return i;
|
|
1501
1400
|
},
|
|
1502
|
-
setSettings(
|
|
1401
|
+
setSettings(r) {
|
|
1503
1402
|
try {
|
|
1504
|
-
localStorage.setItem(l, JSON.stringify(
|
|
1403
|
+
localStorage.setItem(l, JSON.stringify(r));
|
|
1505
1404
|
} catch {
|
|
1506
1405
|
}
|
|
1507
|
-
|
|
1406
|
+
i = r;
|
|
1508
1407
|
},
|
|
1509
1408
|
now() {
|
|
1510
|
-
return
|
|
1409
|
+
return Bo();
|
|
1511
1410
|
}
|
|
1512
|
-
}, t && t.on(
|
|
1513
|
-
|
|
1411
|
+
}, t && t.on(Fo, (r, s) => {
|
|
1412
|
+
r === this.plugin.id && this.fallbacks.setSettings(s);
|
|
1514
1413
|
}), this.proxiedOn = new Proxy({}, {
|
|
1515
|
-
get: (
|
|
1414
|
+
get: (r, s) => this.target ? this.target.on[s] : (...a) => {
|
|
1516
1415
|
this.onQueue.push({
|
|
1517
1416
|
method: s,
|
|
1518
1417
|
args: a
|
|
1519
1418
|
});
|
|
1520
1419
|
}
|
|
1521
1420
|
}), this.proxiedTarget = new Proxy({}, {
|
|
1522
|
-
get: (
|
|
1421
|
+
get: (r, s) => this.target ? this.target[s] : s === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(s) ? (...a) => (this.targetQueue.push({
|
|
1523
1422
|
method: s,
|
|
1524
1423
|
args: a,
|
|
1525
1424
|
resolve: () => {
|
|
@@ -1542,16 +1441,16 @@ class qo {
|
|
|
1542
1441
|
}
|
|
1543
1442
|
}
|
|
1544
1443
|
function qt(e, o) {
|
|
1545
|
-
const t = e, n = Gt(), l =
|
|
1546
|
-
if (l && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !
|
|
1547
|
-
l.emit(
|
|
1444
|
+
const t = e, n = Gt(), l = No(), i = Ao && t.enableEarlyProxy;
|
|
1445
|
+
if (l && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !i))
|
|
1446
|
+
l.emit(Do, e, o);
|
|
1548
1447
|
else {
|
|
1549
|
-
const
|
|
1448
|
+
const r = i ? new Ho(t, l) : null;
|
|
1550
1449
|
(n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1551
1450
|
pluginDescriptor: t,
|
|
1552
1451
|
setupFn: o,
|
|
1553
|
-
proxy:
|
|
1554
|
-
}),
|
|
1452
|
+
proxy: r
|
|
1453
|
+
}), r && o(r.proxiedTarget);
|
|
1555
1454
|
}
|
|
1556
1455
|
}
|
|
1557
1456
|
/*!
|
|
@@ -1572,7 +1471,7 @@ var ne;
|
|
|
1572
1471
|
e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
|
|
1573
1472
|
})(ne || (ne = {}));
|
|
1574
1473
|
const Be = typeof window < "u", Se = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && Be, bt = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
|
|
1575
|
-
function
|
|
1474
|
+
function zo(e, { autoBom: o = !1 } = {}) {
|
|
1576
1475
|
return o && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
|
|
1577
1476
|
}
|
|
1578
1477
|
function rt(e, o, t) {
|
|
@@ -1602,16 +1501,16 @@ function Me(e) {
|
|
|
1602
1501
|
}
|
|
1603
1502
|
const Re = typeof navigator == "object" ? navigator : { userAgent: "" }, Yt = /Macintosh/.test(Re.userAgent) && /AppleWebKit/.test(Re.userAgent) && !/Safari/.test(Re.userAgent), Qt = Be ? (
|
|
1604
1503
|
// Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
|
|
1605
|
-
typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !Yt ?
|
|
1504
|
+
typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !Yt ? Uo : (
|
|
1606
1505
|
// Use msSaveOrOpenBlob as a second approach
|
|
1607
|
-
"msSaveOrOpenBlob" in Re ?
|
|
1506
|
+
"msSaveOrOpenBlob" in Re ? Zo : (
|
|
1608
1507
|
// Fallback to using FileReader and a popup
|
|
1609
|
-
|
|
1508
|
+
Wo
|
|
1610
1509
|
)
|
|
1611
1510
|
)
|
|
1612
1511
|
) : () => {
|
|
1613
1512
|
};
|
|
1614
|
-
function
|
|
1513
|
+
function Uo(e, o = "download", t) {
|
|
1615
1514
|
const n = document.createElement("a");
|
|
1616
1515
|
n.download = o, n.rel = "noopener", typeof e == "string" ? (n.href = e, n.origin !== location.origin ? Kt(n.href) ? rt(e, o, t) : (n.target = "_blank", Me(n)) : Me(n)) : (n.href = URL.createObjectURL(e), setTimeout(function() {
|
|
1617
1516
|
URL.revokeObjectURL(n.href);
|
|
@@ -1619,7 +1518,7 @@ function Ko(e, o = "download", t) {
|
|
|
1619
1518
|
Me(n);
|
|
1620
1519
|
}, 0));
|
|
1621
1520
|
}
|
|
1622
|
-
function
|
|
1521
|
+
function Zo(e, o = "download", t) {
|
|
1623
1522
|
if (typeof e == "string")
|
|
1624
1523
|
if (Kt(e))
|
|
1625
1524
|
rt(e, o, t);
|
|
@@ -1630,19 +1529,19 @@ function Yo(e, o = "download", t) {
|
|
|
1630
1529
|
});
|
|
1631
1530
|
}
|
|
1632
1531
|
else
|
|
1633
|
-
navigator.msSaveOrOpenBlob(
|
|
1532
|
+
navigator.msSaveOrOpenBlob(zo(e, t), o);
|
|
1634
1533
|
}
|
|
1635
|
-
function
|
|
1534
|
+
function Wo(e, o, t, n) {
|
|
1636
1535
|
if (n = n || open("", "_blank"), n && (n.document.title = n.document.body.innerText = "downloading..."), typeof e == "string")
|
|
1637
1536
|
return rt(e, o, t);
|
|
1638
|
-
const l = e.type === "application/octet-stream",
|
|
1639
|
-
if ((
|
|
1537
|
+
const l = e.type === "application/octet-stream", i = /constructor/i.test(String(bt.HTMLElement)) || "safari" in bt, r = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
1538
|
+
if ((r || l && i || Yt) && typeof FileReader < "u") {
|
|
1640
1539
|
const s = new FileReader();
|
|
1641
1540
|
s.onloadend = function() {
|
|
1642
1541
|
let a = s.result;
|
|
1643
1542
|
if (typeof a != "string")
|
|
1644
1543
|
throw n = null, new Error("Wrong reader.result type");
|
|
1645
|
-
a =
|
|
1544
|
+
a = r ? a : a.replace(/^data:[^;]*;/, "data:attachment/file;"), n ? n.location.href = a : location.assign(a), n = null;
|
|
1646
1545
|
}, s.readAsDataURL(e);
|
|
1647
1546
|
} else {
|
|
1648
1547
|
const s = URL.createObjectURL(e);
|
|
@@ -1655,7 +1554,7 @@ function B(e, o) {
|
|
|
1655
1554
|
const t = "🍍 " + e;
|
|
1656
1555
|
typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, o) : o === "error" ? console.error(t) : o === "warn" ? console.warn(t) : console.log(t);
|
|
1657
1556
|
}
|
|
1658
|
-
function
|
|
1557
|
+
function at(e) {
|
|
1659
1558
|
return "_a" in e && "install" in e;
|
|
1660
1559
|
}
|
|
1661
1560
|
function Xt() {
|
|
@@ -1665,7 +1564,7 @@ function Xt() {
|
|
|
1665
1564
|
function en(e) {
|
|
1666
1565
|
return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (B('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
|
|
1667
1566
|
}
|
|
1668
|
-
async function
|
|
1567
|
+
async function Go(e) {
|
|
1669
1568
|
if (!Xt())
|
|
1670
1569
|
try {
|
|
1671
1570
|
await navigator.clipboard.writeText(JSON.stringify(e.state.value)), B("Global state copied to clipboard.");
|
|
@@ -1675,7 +1574,7 @@ async function Xo(e) {
|
|
|
1675
1574
|
B("Failed to serialize the state. Check the console for more details.", "error"), console.error(o);
|
|
1676
1575
|
}
|
|
1677
1576
|
}
|
|
1678
|
-
async function
|
|
1577
|
+
async function qo(e) {
|
|
1679
1578
|
if (!Xt())
|
|
1680
1579
|
try {
|
|
1681
1580
|
tn(e, JSON.parse(await navigator.clipboard.readText())), B("Global state pasted from clipboard.");
|
|
@@ -1685,7 +1584,7 @@ async function el(e) {
|
|
|
1685
1584
|
B("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(o);
|
|
1686
1585
|
}
|
|
1687
1586
|
}
|
|
1688
|
-
async function
|
|
1587
|
+
async function Jo(e) {
|
|
1689
1588
|
try {
|
|
1690
1589
|
Qt(new Blob([JSON.stringify(e.state.value)], {
|
|
1691
1590
|
type: "text/plain;charset=utf-8"
|
|
@@ -1695,7 +1594,7 @@ async function tl(e) {
|
|
|
1695
1594
|
}
|
|
1696
1595
|
}
|
|
1697
1596
|
let oe;
|
|
1698
|
-
function
|
|
1597
|
+
function Ko() {
|
|
1699
1598
|
oe || (oe = document.createElement("input"), oe.type = "file", oe.accept = ".json");
|
|
1700
1599
|
function e() {
|
|
1701
1600
|
return new Promise((o, t) => {
|
|
@@ -1710,9 +1609,9 @@ function nl() {
|
|
|
1710
1609
|
}
|
|
1711
1610
|
return e;
|
|
1712
1611
|
}
|
|
1713
|
-
async function
|
|
1612
|
+
async function Yo(e) {
|
|
1714
1613
|
try {
|
|
1715
|
-
const t = await
|
|
1614
|
+
const t = await Ko()();
|
|
1716
1615
|
if (!t)
|
|
1717
1616
|
return;
|
|
1718
1617
|
const { text: n, file: l } = t;
|
|
@@ -1734,31 +1633,31 @@ function Y(e) {
|
|
|
1734
1633
|
}
|
|
1735
1634
|
};
|
|
1736
1635
|
}
|
|
1737
|
-
const nn = "🍍 Pinia (root)",
|
|
1738
|
-
function
|
|
1739
|
-
return
|
|
1740
|
-
id:
|
|
1636
|
+
const nn = "🍍 Pinia (root)", Qe = "_root";
|
|
1637
|
+
function Qo(e) {
|
|
1638
|
+
return at(e) ? {
|
|
1639
|
+
id: Qe,
|
|
1741
1640
|
label: nn
|
|
1742
1641
|
} : {
|
|
1743
1642
|
id: e.$id,
|
|
1744
1643
|
label: e.$id
|
|
1745
1644
|
};
|
|
1746
1645
|
}
|
|
1747
|
-
function
|
|
1748
|
-
if (
|
|
1646
|
+
function Xo(e) {
|
|
1647
|
+
if (at(e)) {
|
|
1749
1648
|
const t = Array.from(e._s.keys()), n = e._s;
|
|
1750
1649
|
return {
|
|
1751
|
-
state: t.map((
|
|
1650
|
+
state: t.map((i) => ({
|
|
1752
1651
|
editable: !0,
|
|
1753
|
-
key:
|
|
1754
|
-
value: e.state.value[
|
|
1652
|
+
key: i,
|
|
1653
|
+
value: e.state.value[i]
|
|
1755
1654
|
})),
|
|
1756
|
-
getters: t.filter((
|
|
1757
|
-
const
|
|
1655
|
+
getters: t.filter((i) => n.get(i)._getters).map((i) => {
|
|
1656
|
+
const r = n.get(i);
|
|
1758
1657
|
return {
|
|
1759
1658
|
editable: !1,
|
|
1760
|
-
key:
|
|
1761
|
-
value:
|
|
1659
|
+
key: i,
|
|
1660
|
+
value: r._getters.reduce((s, a) => (s[a] = r[a], s), {})
|
|
1762
1661
|
};
|
|
1763
1662
|
})
|
|
1764
1663
|
};
|
|
@@ -1780,7 +1679,7 @@ function sl(e) {
|
|
|
1780
1679
|
value: e[t]
|
|
1781
1680
|
}))), o;
|
|
1782
1681
|
}
|
|
1783
|
-
function
|
|
1682
|
+
function el(e) {
|
|
1784
1683
|
return e ? Array.isArray(e) ? e.reduce((o, t) => (o.keys.push(t.key), o.operations.push(t.type), o.oldValue[t.key] = t.oldValue, o.newValue[t.key] = t.newValue, o), {
|
|
1785
1684
|
oldValue: {},
|
|
1786
1685
|
keys: [],
|
|
@@ -1793,7 +1692,7 @@ function rl(e) {
|
|
|
1793
1692
|
newValue: e.newValue
|
|
1794
1693
|
} : {};
|
|
1795
1694
|
}
|
|
1796
|
-
function
|
|
1695
|
+
function tl(e) {
|
|
1797
1696
|
switch (e) {
|
|
1798
1697
|
case ne.direct:
|
|
1799
1698
|
return "mutation";
|
|
@@ -1806,8 +1705,8 @@ function il(e) {
|
|
|
1806
1705
|
}
|
|
1807
1706
|
}
|
|
1808
1707
|
let be = !0;
|
|
1809
|
-
const Ne = [], ue = "pinia:mutations", U = "pinia", { assign:
|
|
1810
|
-
function
|
|
1708
|
+
const Ne = [], ue = "pinia:mutations", U = "pinia", { assign: nl } = Object, De = (e) => "🍍 " + e;
|
|
1709
|
+
function ol(e, o) {
|
|
1811
1710
|
qt({
|
|
1812
1711
|
id: "dev.esm.pinia",
|
|
1813
1712
|
label: "Pinia 🍍",
|
|
@@ -1830,28 +1729,28 @@ function ul(e, o) {
|
|
|
1830
1729
|
{
|
|
1831
1730
|
icon: "content_copy",
|
|
1832
1731
|
action: () => {
|
|
1833
|
-
|
|
1732
|
+
Go(o);
|
|
1834
1733
|
},
|
|
1835
1734
|
tooltip: "Serialize and copy the state"
|
|
1836
1735
|
},
|
|
1837
1736
|
{
|
|
1838
1737
|
icon: "content_paste",
|
|
1839
1738
|
action: async () => {
|
|
1840
|
-
await
|
|
1739
|
+
await qo(o), t.sendInspectorTree(U), t.sendInspectorState(U);
|
|
1841
1740
|
},
|
|
1842
1741
|
tooltip: "Replace the state with the content of your clipboard"
|
|
1843
1742
|
},
|
|
1844
1743
|
{
|
|
1845
1744
|
icon: "save",
|
|
1846
1745
|
action: () => {
|
|
1847
|
-
|
|
1746
|
+
Jo(o);
|
|
1848
1747
|
},
|
|
1849
1748
|
tooltip: "Save the state as a JSON file"
|
|
1850
1749
|
},
|
|
1851
1750
|
{
|
|
1852
1751
|
icon: "folder_open",
|
|
1853
1752
|
action: async () => {
|
|
1854
|
-
await
|
|
1753
|
+
await Yo(o), t.sendInspectorTree(U), t.sendInspectorState(U);
|
|
1855
1754
|
},
|
|
1856
1755
|
tooltip: "Import the state from a JSON file"
|
|
1857
1756
|
}
|
|
@@ -1867,10 +1766,10 @@ function ul(e, o) {
|
|
|
1867
1766
|
}
|
|
1868
1767
|
]
|
|
1869
1768
|
}), t.on.inspectComponent((n, l) => {
|
|
1870
|
-
const
|
|
1871
|
-
if (
|
|
1872
|
-
const
|
|
1873
|
-
Object.values(
|
|
1769
|
+
const i = n.componentInstance && n.componentInstance.proxy;
|
|
1770
|
+
if (i && i._pStores) {
|
|
1771
|
+
const r = n.componentInstance.proxy._pStores;
|
|
1772
|
+
Object.values(r).forEach((s) => {
|
|
1874
1773
|
n.instanceData.state.push({
|
|
1875
1774
|
type: De(s.$id),
|
|
1876
1775
|
key: "state",
|
|
@@ -1897,8 +1796,8 @@ function ul(e, o) {
|
|
|
1897
1796
|
value: s._getters.reduce((a, u) => {
|
|
1898
1797
|
try {
|
|
1899
1798
|
a[u] = s[u];
|
|
1900
|
-
} catch (
|
|
1901
|
-
a[u] =
|
|
1799
|
+
} catch (c) {
|
|
1800
|
+
a[u] = c;
|
|
1902
1801
|
}
|
|
1903
1802
|
return a;
|
|
1904
1803
|
}, {})
|
|
@@ -1908,39 +1807,39 @@ function ul(e, o) {
|
|
|
1908
1807
|
}), t.on.getInspectorTree((n) => {
|
|
1909
1808
|
if (n.app === e && n.inspectorId === U) {
|
|
1910
1809
|
let l = [o];
|
|
1911
|
-
l = l.concat(Array.from(o._s.values())), n.rootNodes = (n.filter ? l.filter((
|
|
1810
|
+
l = l.concat(Array.from(o._s.values())), n.rootNodes = (n.filter ? l.filter((i) => "$id" in i ? i.$id.toLowerCase().includes(n.filter.toLowerCase()) : nn.toLowerCase().includes(n.filter.toLowerCase())) : l).map(Qo);
|
|
1912
1811
|
}
|
|
1913
1812
|
}), t.on.getInspectorState((n) => {
|
|
1914
1813
|
if (n.app === e && n.inspectorId === U) {
|
|
1915
|
-
const l = n.nodeId ===
|
|
1814
|
+
const l = n.nodeId === Qe ? o : o._s.get(n.nodeId);
|
|
1916
1815
|
if (!l)
|
|
1917
1816
|
return;
|
|
1918
|
-
l && (n.state =
|
|
1817
|
+
l && (n.state = Xo(l));
|
|
1919
1818
|
}
|
|
1920
1819
|
}), t.on.editInspectorState((n, l) => {
|
|
1921
1820
|
if (n.app === e && n.inspectorId === U) {
|
|
1922
|
-
const
|
|
1923
|
-
if (!
|
|
1821
|
+
const i = n.nodeId === Qe ? o : o._s.get(n.nodeId);
|
|
1822
|
+
if (!i)
|
|
1924
1823
|
return B(`store "${n.nodeId}" not found`, "error");
|
|
1925
|
-
const { path:
|
|
1926
|
-
|
|
1824
|
+
const { path: r } = n;
|
|
1825
|
+
at(i) ? r.unshift("state") : (r.length !== 1 || !i._customProperties.has(r[0]) || r[0] in i.$state) && r.unshift("$state"), be = !1, n.set(i, r, n.state.value), be = !0;
|
|
1927
1826
|
}
|
|
1928
1827
|
}), t.on.editComponentState((n) => {
|
|
1929
1828
|
if (n.type.startsWith("🍍")) {
|
|
1930
|
-
const l = n.type.replace(/^🍍\s*/, ""),
|
|
1931
|
-
if (!
|
|
1829
|
+
const l = n.type.replace(/^🍍\s*/, ""), i = o._s.get(l);
|
|
1830
|
+
if (!i)
|
|
1932
1831
|
return B(`store "${l}" not found`, "error");
|
|
1933
|
-
const { path:
|
|
1934
|
-
if (
|
|
1832
|
+
const { path: r } = n;
|
|
1833
|
+
if (r[0] !== "state")
|
|
1935
1834
|
return B(`Invalid path for store "${l}":
|
|
1936
|
-
${
|
|
1835
|
+
${r}
|
|
1937
1836
|
Only state can be modified.`);
|
|
1938
|
-
|
|
1837
|
+
r[0] = "$state", be = !1, n.set(i, r, n.state.value), be = !0;
|
|
1939
1838
|
}
|
|
1940
1839
|
});
|
|
1941
1840
|
});
|
|
1942
1841
|
}
|
|
1943
|
-
function
|
|
1842
|
+
function ll(e, o) {
|
|
1944
1843
|
Ne.includes(De(o.$id)) || Ne.push(De(o.$id)), qt({
|
|
1945
1844
|
id: "dev.esm.pinia",
|
|
1946
1845
|
label: "Pinia 🍍",
|
|
@@ -1963,8 +1862,8 @@ function cl(e, o) {
|
|
|
1963
1862
|
}
|
|
1964
1863
|
}, (t) => {
|
|
1965
1864
|
const n = typeof t.now == "function" ? t.now.bind(t) : Date.now;
|
|
1966
|
-
o.$onAction(({ after:
|
|
1967
|
-
const
|
|
1865
|
+
o.$onAction(({ after: r, onError: s, name: a, args: u }) => {
|
|
1866
|
+
const c = on++;
|
|
1968
1867
|
t.addTimelineEvent({
|
|
1969
1868
|
layerId: ue,
|
|
1970
1869
|
event: {
|
|
@@ -1976,10 +1875,10 @@ function cl(e, o) {
|
|
|
1976
1875
|
action: Y(a),
|
|
1977
1876
|
args: u
|
|
1978
1877
|
},
|
|
1979
|
-
groupId:
|
|
1878
|
+
groupId: c
|
|
1980
1879
|
}
|
|
1981
|
-
}),
|
|
1982
|
-
|
|
1880
|
+
}), r((p) => {
|
|
1881
|
+
ie = void 0, t.addTimelineEvent({
|
|
1983
1882
|
layerId: ue,
|
|
1984
1883
|
event: {
|
|
1985
1884
|
time: n(),
|
|
@@ -1991,11 +1890,11 @@ function cl(e, o) {
|
|
|
1991
1890
|
args: u,
|
|
1992
1891
|
result: p
|
|
1993
1892
|
},
|
|
1994
|
-
groupId:
|
|
1893
|
+
groupId: c
|
|
1995
1894
|
}
|
|
1996
1895
|
});
|
|
1997
1896
|
}), s((p) => {
|
|
1998
|
-
|
|
1897
|
+
ie = void 0, t.addTimelineEvent({
|
|
1999
1898
|
layerId: ue,
|
|
2000
1899
|
event: {
|
|
2001
1900
|
time: n(),
|
|
@@ -2008,41 +1907,41 @@ function cl(e, o) {
|
|
|
2008
1907
|
args: u,
|
|
2009
1908
|
error: p
|
|
2010
1909
|
},
|
|
2011
|
-
groupId:
|
|
1910
|
+
groupId: c
|
|
2012
1911
|
}
|
|
2013
1912
|
});
|
|
2014
1913
|
});
|
|
2015
|
-
}, !0), o._customProperties.forEach((
|
|
2016
|
-
F(() =>
|
|
1914
|
+
}, !0), o._customProperties.forEach((r) => {
|
|
1915
|
+
F(() => k(o[r]), (s, a) => {
|
|
2017
1916
|
t.notifyComponentUpdate(), t.sendInspectorState(U), be && t.addTimelineEvent({
|
|
2018
1917
|
layerId: ue,
|
|
2019
1918
|
event: {
|
|
2020
1919
|
time: n(),
|
|
2021
1920
|
title: "Change",
|
|
2022
|
-
subtitle:
|
|
1921
|
+
subtitle: r,
|
|
2023
1922
|
data: {
|
|
2024
1923
|
newValue: s,
|
|
2025
1924
|
oldValue: a
|
|
2026
1925
|
},
|
|
2027
|
-
groupId:
|
|
1926
|
+
groupId: ie
|
|
2028
1927
|
}
|
|
2029
1928
|
});
|
|
2030
1929
|
}, { deep: !0 });
|
|
2031
|
-
}), o.$subscribe(({ events:
|
|
1930
|
+
}), o.$subscribe(({ events: r, type: s }, a) => {
|
|
2032
1931
|
if (t.notifyComponentUpdate(), t.sendInspectorState(U), !be)
|
|
2033
1932
|
return;
|
|
2034
1933
|
const u = {
|
|
2035
1934
|
time: n(),
|
|
2036
|
-
title:
|
|
2037
|
-
data:
|
|
2038
|
-
groupId:
|
|
1935
|
+
title: tl(s),
|
|
1936
|
+
data: nl({ store: Y(o.$id) }, el(r)),
|
|
1937
|
+
groupId: ie
|
|
2039
1938
|
};
|
|
2040
|
-
s === ne.patchFunction ? u.subtitle = "⤵️" : s === ne.patchObject ? u.subtitle = "🧩" :
|
|
1939
|
+
s === ne.patchFunction ? u.subtitle = "⤵️" : s === ne.patchObject ? u.subtitle = "🧩" : r && !Array.isArray(r) && (u.subtitle = r.type), r && (u.data["rawEvent(s)"] = {
|
|
2041
1940
|
_custom: {
|
|
2042
1941
|
display: "DebuggerEvent",
|
|
2043
1942
|
type: "object",
|
|
2044
1943
|
tooltip: "raw DebuggerEvent[]",
|
|
2045
|
-
value:
|
|
1944
|
+
value: r
|
|
2046
1945
|
}
|
|
2047
1946
|
}), t.addTimelineEvent({
|
|
2048
1947
|
layerId: ue,
|
|
@@ -2050,8 +1949,8 @@ function cl(e, o) {
|
|
|
2050
1949
|
});
|
|
2051
1950
|
}, { detached: !0, flush: "sync" });
|
|
2052
1951
|
const l = o._hotUpdate;
|
|
2053
|
-
o._hotUpdate = de((
|
|
2054
|
-
l(
|
|
1952
|
+
o._hotUpdate = de((r) => {
|
|
1953
|
+
l(r), t.addTimelineEvent({
|
|
2055
1954
|
layerId: ue,
|
|
2056
1955
|
event: {
|
|
2057
1956
|
time: n(),
|
|
@@ -2064,52 +1963,52 @@ function cl(e, o) {
|
|
|
2064
1963
|
}
|
|
2065
1964
|
}), t.notifyComponentUpdate(), t.sendInspectorTree(U), t.sendInspectorState(U);
|
|
2066
1965
|
});
|
|
2067
|
-
const { $dispose:
|
|
1966
|
+
const { $dispose: i } = o;
|
|
2068
1967
|
o.$dispose = () => {
|
|
2069
|
-
|
|
1968
|
+
i(), t.notifyComponentUpdate(), t.sendInspectorTree(U), t.sendInspectorState(U), t.getSettings().logStoreChanges && B(`Disposed "${o.$id}" store 🗑`);
|
|
2070
1969
|
}, t.notifyComponentUpdate(), t.sendInspectorTree(U), t.sendInspectorState(U), t.getSettings().logStoreChanges && B(`"${o.$id}" store installed 🆕`);
|
|
2071
1970
|
});
|
|
2072
1971
|
}
|
|
2073
|
-
let on = 0,
|
|
1972
|
+
let on = 0, ie;
|
|
2074
1973
|
function Ct(e, o, t) {
|
|
2075
|
-
const n = o.reduce((l,
|
|
1974
|
+
const n = o.reduce((l, i) => (l[i] = K(e)[i], l), {});
|
|
2076
1975
|
for (const l in n)
|
|
2077
1976
|
e[l] = function() {
|
|
2078
|
-
const
|
|
1977
|
+
const i = on, r = t ? new Proxy(e, {
|
|
2079
1978
|
get(...a) {
|
|
2080
|
-
return
|
|
1979
|
+
return ie = i, Reflect.get(...a);
|
|
2081
1980
|
},
|
|
2082
1981
|
set(...a) {
|
|
2083
|
-
return
|
|
1982
|
+
return ie = i, Reflect.set(...a);
|
|
2084
1983
|
}
|
|
2085
1984
|
}) : e;
|
|
2086
|
-
|
|
2087
|
-
const s = n[l].apply(
|
|
2088
|
-
return
|
|
1985
|
+
ie = i;
|
|
1986
|
+
const s = n[l].apply(r, arguments);
|
|
1987
|
+
return ie = void 0, s;
|
|
2089
1988
|
};
|
|
2090
1989
|
}
|
|
2091
|
-
function
|
|
1990
|
+
function sl({ app: e, store: o, options: t }) {
|
|
2092
1991
|
if (o.$id.startsWith("__hot:"))
|
|
2093
1992
|
return;
|
|
2094
1993
|
o._isOptionsAPI = !!t.state, Ct(o, Object.keys(t.actions), o._isOptionsAPI);
|
|
2095
1994
|
const n = o._hotUpdate;
|
|
2096
1995
|
K(o)._hotUpdate = function(l) {
|
|
2097
1996
|
n.apply(this, arguments), Ct(o, Object.keys(l._hmrPayload.actions), !!o._isOptionsAPI);
|
|
2098
|
-
},
|
|
1997
|
+
}, ll(
|
|
2099
1998
|
e,
|
|
2100
1999
|
// FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
|
|
2101
2000
|
o
|
|
2102
2001
|
);
|
|
2103
2002
|
}
|
|
2104
|
-
function
|
|
2105
|
-
const e =
|
|
2003
|
+
function il() {
|
|
2004
|
+
const e = Tt(!0), o = e.run(() => E({}));
|
|
2106
2005
|
let t = [], n = [];
|
|
2107
2006
|
const l = de({
|
|
2108
|
-
install(
|
|
2109
|
-
Te(l), l._a =
|
|
2007
|
+
install(i) {
|
|
2008
|
+
Te(l), l._a = i, i.provide(Jt, l), i.config.globalProperties.$pinia = l, Se && ol(i, l), n.forEach((r) => t.push(r)), n = [];
|
|
2110
2009
|
},
|
|
2111
|
-
use(
|
|
2112
|
-
return !this._a && !Wt ? n.push(
|
|
2010
|
+
use(i) {
|
|
2011
|
+
return !this._a && !Wt ? n.push(i) : t.push(i), this;
|
|
2113
2012
|
},
|
|
2114
2013
|
_p: t,
|
|
2115
2014
|
// it's actually undefined here
|
|
@@ -2119,7 +2018,7 @@ function fl() {
|
|
|
2119
2018
|
_s: /* @__PURE__ */ new Map(),
|
|
2120
2019
|
state: o
|
|
2121
2020
|
});
|
|
2122
|
-
return Se && typeof Proxy < "u" && l.use(
|
|
2021
|
+
return Se && typeof Proxy < "u" && l.use(sl), l;
|
|
2123
2022
|
}
|
|
2124
2023
|
function ln(e, o) {
|
|
2125
2024
|
for (const t in o) {
|
|
@@ -2127,7 +2026,7 @@ function ln(e, o) {
|
|
|
2127
2026
|
if (!(t in e))
|
|
2128
2027
|
continue;
|
|
2129
2028
|
const l = e[t];
|
|
2130
|
-
fe(l) && fe(n) && !
|
|
2029
|
+
fe(l) && fe(n) && !Ce(n) && !lt(n) ? e[t] = ln(l, n) : e[t] = n;
|
|
2131
2030
|
}
|
|
2132
2031
|
return e;
|
|
2133
2032
|
}
|
|
@@ -2136,57 +2035,57 @@ const sn = () => {
|
|
|
2136
2035
|
function _t(e, o, t, n = sn) {
|
|
2137
2036
|
e.push(o);
|
|
2138
2037
|
const l = () => {
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2038
|
+
const i = e.indexOf(o);
|
|
2039
|
+
i > -1 && (e.splice(i, 1), n());
|
|
2141
2040
|
};
|
|
2142
|
-
return !t &&
|
|
2041
|
+
return !t && Lt() && tt(l), l;
|
|
2143
2042
|
}
|
|
2144
2043
|
function ge(e, ...o) {
|
|
2145
2044
|
e.slice().forEach((t) => {
|
|
2146
2045
|
t(...o);
|
|
2147
2046
|
});
|
|
2148
2047
|
}
|
|
2149
|
-
const
|
|
2150
|
-
function
|
|
2048
|
+
const rl = (e) => e();
|
|
2049
|
+
function Xe(e, o) {
|
|
2151
2050
|
e instanceof Map && o instanceof Map && o.forEach((t, n) => e.set(n, t)), e instanceof Set && o instanceof Set && o.forEach(e.add, e);
|
|
2152
2051
|
for (const t in o) {
|
|
2153
2052
|
if (!o.hasOwnProperty(t))
|
|
2154
2053
|
continue;
|
|
2155
2054
|
const n = o[t], l = e[t];
|
|
2156
|
-
fe(l) && fe(n) && e.hasOwnProperty(t) && !
|
|
2055
|
+
fe(l) && fe(n) && e.hasOwnProperty(t) && !Ce(n) && !lt(n) ? e[t] = Xe(l, n) : e[t] = n;
|
|
2157
2056
|
}
|
|
2158
2057
|
return e;
|
|
2159
2058
|
}
|
|
2160
|
-
const
|
|
2059
|
+
const al = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
2161
2060
|
/* istanbul ignore next */
|
|
2162
2061
|
Symbol()
|
|
2163
2062
|
);
|
|
2164
|
-
function
|
|
2165
|
-
return !fe(e) || !e.hasOwnProperty(
|
|
2063
|
+
function ul(e) {
|
|
2064
|
+
return !fe(e) || !e.hasOwnProperty(al);
|
|
2166
2065
|
}
|
|
2167
2066
|
const { assign: J } = Object;
|
|
2168
2067
|
function xt(e) {
|
|
2169
|
-
return !!(
|
|
2068
|
+
return !!(Ce(e) && e.effect);
|
|
2170
2069
|
}
|
|
2171
2070
|
function yt(e, o, t, n) {
|
|
2172
|
-
const { state: l, actions:
|
|
2071
|
+
const { state: l, actions: i, getters: r } = o, s = t.state.value[e];
|
|
2173
2072
|
let a;
|
|
2174
2073
|
function u() {
|
|
2175
2074
|
!s && (process.env.NODE_ENV === "production" || !n) && (t.state.value[e] = l ? l() : {});
|
|
2176
|
-
const
|
|
2075
|
+
const c = process.env.NODE_ENV !== "production" && n ? (
|
|
2177
2076
|
// use ref() to unwrap refs inside state TODO: check if this is still necessary
|
|
2178
|
-
|
|
2179
|
-
) :
|
|
2180
|
-
return J(
|
|
2077
|
+
ct(E(l ? l() : {}).value)
|
|
2078
|
+
) : ct(t.state.value[e]);
|
|
2079
|
+
return J(c, i, Object.keys(r || {}).reduce((p, m) => (process.env.NODE_ENV !== "production" && m in c && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${e}".`), p[m] = de(S(() => {
|
|
2181
2080
|
Te(t);
|
|
2182
|
-
const
|
|
2183
|
-
return
|
|
2081
|
+
const _ = t._s.get(e);
|
|
2082
|
+
return r[m].call(_, _);
|
|
2184
2083
|
})), p), {}));
|
|
2185
2084
|
}
|
|
2186
|
-
return a =
|
|
2085
|
+
return a = et(e, u, o, t, n, !0), a;
|
|
2187
2086
|
}
|
|
2188
|
-
function
|
|
2189
|
-
let
|
|
2087
|
+
function et(e, o, t = {}, n, l, i) {
|
|
2088
|
+
let r;
|
|
2190
2089
|
const s = J({ actions: {} }, t);
|
|
2191
2090
|
if (process.env.NODE_ENV !== "production" && !n._e.active)
|
|
2192
2091
|
throw new Error("Pinia destroyed");
|
|
@@ -2194,33 +2093,33 @@ function Xe(e, o, t = {}, n, l, r) {
|
|
|
2194
2093
|
deep: !0
|
|
2195
2094
|
// flush: 'post',
|
|
2196
2095
|
};
|
|
2197
|
-
process.env.NODE_ENV !== "production" && !Wt && (a.onTrigger = (
|
|
2198
|
-
u ?
|
|
2096
|
+
process.env.NODE_ENV !== "production" && !Wt && (a.onTrigger = (d) => {
|
|
2097
|
+
u ? _ = d : u == !1 && !b._hotUpdating && (Array.isArray(_) ? _.push(d) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
|
|
2199
2098
|
});
|
|
2200
|
-
let u,
|
|
2099
|
+
let u, c, p = [], m = [], _;
|
|
2201
2100
|
const v = n.state.value[e];
|
|
2202
|
-
!
|
|
2101
|
+
!i && !v && (process.env.NODE_ENV === "production" || !l) && (n.state.value[e] = {});
|
|
2203
2102
|
const h = E({});
|
|
2204
|
-
let
|
|
2205
|
-
function
|
|
2206
|
-
let
|
|
2207
|
-
u =
|
|
2103
|
+
let M;
|
|
2104
|
+
function N(d) {
|
|
2105
|
+
let f;
|
|
2106
|
+
u = c = !1, process.env.NODE_ENV !== "production" && (_ = []), typeof d == "function" ? (d(n.state.value[e]), f = {
|
|
2208
2107
|
type: ne.patchFunction,
|
|
2209
2108
|
storeId: e,
|
|
2210
|
-
events:
|
|
2211
|
-
}) : (
|
|
2109
|
+
events: _
|
|
2110
|
+
}) : (Xe(n.state.value[e], d), f = {
|
|
2212
2111
|
type: ne.patchObject,
|
|
2213
|
-
payload:
|
|
2112
|
+
payload: d,
|
|
2214
2113
|
storeId: e,
|
|
2215
|
-
events:
|
|
2114
|
+
events: _
|
|
2216
2115
|
});
|
|
2217
|
-
const y =
|
|
2116
|
+
const y = M = Symbol();
|
|
2218
2117
|
Q().then(() => {
|
|
2219
|
-
|
|
2220
|
-
}),
|
|
2118
|
+
M === y && (u = !0);
|
|
2119
|
+
}), c = !0, ge(p, f, n.state.value[e]);
|
|
2221
2120
|
}
|
|
2222
|
-
const T =
|
|
2223
|
-
const { state:
|
|
2121
|
+
const T = i ? function() {
|
|
2122
|
+
const { state: f } = t, y = f ? f() : {};
|
|
2224
2123
|
this.$patch((O) => {
|
|
2225
2124
|
J(O, y);
|
|
2226
2125
|
});
|
|
@@ -2230,36 +2129,36 @@ function Xe(e, o, t = {}, n, l, r) {
|
|
|
2230
2129
|
throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
|
|
2231
2130
|
} : sn
|
|
2232
2131
|
);
|
|
2233
|
-
function
|
|
2234
|
-
|
|
2132
|
+
function P() {
|
|
2133
|
+
r.stop(), p = [], m = [], n._s.delete(e);
|
|
2235
2134
|
}
|
|
2236
|
-
function D(
|
|
2135
|
+
function D(d, f) {
|
|
2237
2136
|
return function() {
|
|
2238
2137
|
Te(n);
|
|
2239
|
-
const y = Array.from(arguments), O = [],
|
|
2240
|
-
function
|
|
2138
|
+
const y = Array.from(arguments), O = [], R = [];
|
|
2139
|
+
function A(j) {
|
|
2241
2140
|
O.push(j);
|
|
2242
2141
|
}
|
|
2243
2142
|
function G(j) {
|
|
2244
|
-
|
|
2143
|
+
R.push(j);
|
|
2245
2144
|
}
|
|
2246
2145
|
ge(m, {
|
|
2247
2146
|
args: y,
|
|
2248
|
-
name:
|
|
2147
|
+
name: d,
|
|
2249
2148
|
store: b,
|
|
2250
|
-
after:
|
|
2149
|
+
after: A,
|
|
2251
2150
|
onError: G
|
|
2252
2151
|
});
|
|
2253
2152
|
let q;
|
|
2254
2153
|
try {
|
|
2255
|
-
q =
|
|
2154
|
+
q = f.apply(this && this.$id === e ? this : b, y);
|
|
2256
2155
|
} catch (j) {
|
|
2257
|
-
throw ge(
|
|
2156
|
+
throw ge(R, j), j;
|
|
2258
2157
|
}
|
|
2259
|
-
return q instanceof Promise ? q.then((j) => (ge(O, j), j)).catch((j) => (ge(
|
|
2158
|
+
return q instanceof Promise ? q.then((j) => (ge(O, j), j)).catch((j) => (ge(R, j), Promise.reject(j))) : (ge(O, q), q);
|
|
2260
2159
|
};
|
|
2261
2160
|
}
|
|
2262
|
-
const
|
|
2161
|
+
const x = /* @__PURE__ */ de({
|
|
2263
2162
|
actions: {},
|
|
2264
2163
|
getters: {},
|
|
2265
2164
|
state: [],
|
|
@@ -2269,22 +2168,22 @@ function Xe(e, o, t = {}, n, l, r) {
|
|
|
2269
2168
|
// _s: scope,
|
|
2270
2169
|
$id: e,
|
|
2271
2170
|
$onAction: _t.bind(null, m),
|
|
2272
|
-
$patch:
|
|
2171
|
+
$patch: N,
|
|
2273
2172
|
$reset: T,
|
|
2274
|
-
$subscribe(
|
|
2275
|
-
const y = _t(p,
|
|
2276
|
-
(
|
|
2173
|
+
$subscribe(d, f = {}) {
|
|
2174
|
+
const y = _t(p, d, f.detached, () => O()), O = r.run(() => F(() => n.state.value[e], (R) => {
|
|
2175
|
+
(f.flush === "sync" ? c : u) && d({
|
|
2277
2176
|
storeId: e,
|
|
2278
2177
|
type: ne.direct,
|
|
2279
|
-
events:
|
|
2280
|
-
},
|
|
2281
|
-
}, J({}, a,
|
|
2178
|
+
events: _
|
|
2179
|
+
}, R);
|
|
2180
|
+
}, J({}, a, f)));
|
|
2282
2181
|
return y;
|
|
2283
2182
|
},
|
|
2284
|
-
$dispose:
|
|
2285
|
-
}, b =
|
|
2183
|
+
$dispose: P
|
|
2184
|
+
}, b = $t(process.env.NODE_ENV !== "production" || Se ? J(
|
|
2286
2185
|
{
|
|
2287
|
-
_hmrPayload:
|
|
2186
|
+
_hmrPayload: x,
|
|
2288
2187
|
_customProperties: de(/* @__PURE__ */ new Set())
|
|
2289
2188
|
// devtools custom properties
|
|
2290
2189
|
},
|
|
@@ -2293,79 +2192,79 @@ function Xe(e, o, t = {}, n, l, r) {
|
|
|
2293
2192
|
// setupStore
|
|
2294
2193
|
) : L);
|
|
2295
2194
|
n._s.set(e, b);
|
|
2296
|
-
const I = (n._a && n._a.runWithContext ||
|
|
2297
|
-
for (const
|
|
2298
|
-
const
|
|
2299
|
-
if (
|
|
2300
|
-
process.env.NODE_ENV !== "production" && l ? ke(h.value,
|
|
2301
|
-
else if (typeof
|
|
2302
|
-
const y = process.env.NODE_ENV !== "production" && l ?
|
|
2303
|
-
I[
|
|
2304
|
-
} else process.env.NODE_ENV !== "production" && xt(
|
|
2195
|
+
const I = (n._a && n._a.runWithContext || rl)(() => n._e.run(() => (r = Tt()).run(o)));
|
|
2196
|
+
for (const d in I) {
|
|
2197
|
+
const f = I[d];
|
|
2198
|
+
if (Ce(f) && !xt(f) || lt(f))
|
|
2199
|
+
process.env.NODE_ENV !== "production" && l ? ke(h.value, d, Ge(I, d)) : i || (v && ul(f) && (Ce(f) ? f.value = v[d] : Xe(f, v[d])), n.state.value[e][d] = f), process.env.NODE_ENV !== "production" && x.state.push(d);
|
|
2200
|
+
else if (typeof f == "function") {
|
|
2201
|
+
const y = process.env.NODE_ENV !== "production" && l ? f : D(d, f);
|
|
2202
|
+
I[d] = y, process.env.NODE_ENV !== "production" && (x.actions[d] = f), s.actions[d] = f;
|
|
2203
|
+
} else process.env.NODE_ENV !== "production" && xt(f) && (x.getters[d] = i ? (
|
|
2305
2204
|
// @ts-expect-error
|
|
2306
|
-
t.getters[
|
|
2307
|
-
) :
|
|
2308
|
-
(I._getters = de([]))).push(
|
|
2205
|
+
t.getters[d]
|
|
2206
|
+
) : f, Be && (I._getters || // @ts-expect-error: same
|
|
2207
|
+
(I._getters = de([]))).push(d));
|
|
2309
2208
|
}
|
|
2310
2209
|
if (J(b, I), J(K(b), I), Object.defineProperty(b, "$state", {
|
|
2311
2210
|
get: () => process.env.NODE_ENV !== "production" && l ? h.value : n.state.value[e],
|
|
2312
|
-
set: (
|
|
2211
|
+
set: (d) => {
|
|
2313
2212
|
if (process.env.NODE_ENV !== "production" && l)
|
|
2314
2213
|
throw new Error("cannot set hotState");
|
|
2315
|
-
|
|
2316
|
-
J(
|
|
2214
|
+
N((f) => {
|
|
2215
|
+
J(f, d);
|
|
2317
2216
|
});
|
|
2318
2217
|
}
|
|
2319
|
-
}), process.env.NODE_ENV !== "production" && (b._hotUpdate = de((
|
|
2320
|
-
b._hotUpdating = !0,
|
|
2321
|
-
if (
|
|
2322
|
-
const y =
|
|
2323
|
-
typeof y == "object" && fe(y) && fe(O) ? ln(y, O) :
|
|
2218
|
+
}), process.env.NODE_ENV !== "production" && (b._hotUpdate = de((d) => {
|
|
2219
|
+
b._hotUpdating = !0, d._hmrPayload.state.forEach((f) => {
|
|
2220
|
+
if (f in b.$state) {
|
|
2221
|
+
const y = d.$state[f], O = b.$state[f];
|
|
2222
|
+
typeof y == "object" && fe(y) && fe(O) ? ln(y, O) : d.$state[f] = O;
|
|
2324
2223
|
}
|
|
2325
|
-
ke(b,
|
|
2326
|
-
}), Object.keys(b.$state).forEach((
|
|
2327
|
-
|
|
2328
|
-
}), u = !1,
|
|
2224
|
+
ke(b, f, Ge(d.$state, f));
|
|
2225
|
+
}), Object.keys(b.$state).forEach((f) => {
|
|
2226
|
+
f in d.$state || Ke(b, f);
|
|
2227
|
+
}), u = !1, c = !1, n.state.value[e] = Ge(d._hmrPayload, "hotState"), c = !0, Q().then(() => {
|
|
2329
2228
|
u = !0;
|
|
2330
2229
|
});
|
|
2331
|
-
for (const
|
|
2332
|
-
const y =
|
|
2333
|
-
ke(b,
|
|
2230
|
+
for (const f in d._hmrPayload.actions) {
|
|
2231
|
+
const y = d[f];
|
|
2232
|
+
ke(b, f, D(f, y));
|
|
2334
2233
|
}
|
|
2335
|
-
for (const
|
|
2336
|
-
const y =
|
|
2234
|
+
for (const f in d._hmrPayload.getters) {
|
|
2235
|
+
const y = d._hmrPayload.getters[f], O = i ? (
|
|
2337
2236
|
// special handling of options api
|
|
2338
2237
|
S(() => (Te(n), y.call(b, b)))
|
|
2339
2238
|
) : y;
|
|
2340
|
-
ke(b,
|
|
2239
|
+
ke(b, f, O);
|
|
2341
2240
|
}
|
|
2342
|
-
Object.keys(b._hmrPayload.getters).forEach((
|
|
2343
|
-
|
|
2344
|
-
}), Object.keys(b._hmrPayload.actions).forEach((
|
|
2345
|
-
|
|
2346
|
-
}), b._hmrPayload =
|
|
2241
|
+
Object.keys(b._hmrPayload.getters).forEach((f) => {
|
|
2242
|
+
f in d._hmrPayload.getters || Ke(b, f);
|
|
2243
|
+
}), Object.keys(b._hmrPayload.actions).forEach((f) => {
|
|
2244
|
+
f in d._hmrPayload.actions || Ke(b, f);
|
|
2245
|
+
}), b._hmrPayload = d._hmrPayload, b._getters = d._getters, b._hotUpdating = !1;
|
|
2347
2246
|
})), Se) {
|
|
2348
|
-
const
|
|
2247
|
+
const d = {
|
|
2349
2248
|
writable: !0,
|
|
2350
2249
|
configurable: !0,
|
|
2351
2250
|
// avoid warning on devtools trying to display this property
|
|
2352
2251
|
enumerable: !1
|
|
2353
2252
|
};
|
|
2354
|
-
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((
|
|
2355
|
-
Object.defineProperty(b,
|
|
2253
|
+
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((f) => {
|
|
2254
|
+
Object.defineProperty(b, f, J({ value: b[f] }, d));
|
|
2356
2255
|
});
|
|
2357
2256
|
}
|
|
2358
|
-
return n._p.forEach((
|
|
2257
|
+
return n._p.forEach((d) => {
|
|
2359
2258
|
if (Se) {
|
|
2360
|
-
const
|
|
2259
|
+
const f = r.run(() => d({
|
|
2361
2260
|
store: b,
|
|
2362
2261
|
app: n._a,
|
|
2363
2262
|
pinia: n,
|
|
2364
2263
|
options: s
|
|
2365
2264
|
}));
|
|
2366
|
-
Object.keys(
|
|
2265
|
+
Object.keys(f || {}).forEach((y) => b._customProperties.add(y)), J(b, f);
|
|
2367
2266
|
} else
|
|
2368
|
-
J(b,
|
|
2267
|
+
J(b, r.run(() => d({
|
|
2369
2268
|
store: b,
|
|
2370
2269
|
app: n._a,
|
|
2371
2270
|
pinia: n,
|
|
@@ -2373,50 +2272,155 @@ function Xe(e, o, t = {}, n, l, r) {
|
|
|
2373
2272
|
})));
|
|
2374
2273
|
}), process.env.NODE_ENV !== "production" && b.$state && typeof b.$state == "object" && typeof b.$state.constructor == "function" && !b.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
2375
2274
|
state: () => new MyClass()
|
|
2376
|
-
Found in store "${b.$id}".`), v &&
|
|
2275
|
+
Found in store "${b.$id}".`), v && i && t.hydrate && t.hydrate(b.$state, v), u = !0, c = !0, b;
|
|
2377
2276
|
}
|
|
2378
2277
|
function He(e, o, t) {
|
|
2379
2278
|
let n, l;
|
|
2380
|
-
const
|
|
2279
|
+
const i = typeof o == "function";
|
|
2381
2280
|
if (typeof e == "string")
|
|
2382
|
-
n = e, l =
|
|
2281
|
+
n = e, l = i ? t : o;
|
|
2383
2282
|
else if (l = e, n = e.id, process.env.NODE_ENV !== "production" && typeof n != "string")
|
|
2384
2283
|
throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
|
|
2385
|
-
function
|
|
2386
|
-
const u =
|
|
2284
|
+
function r(s, a) {
|
|
2285
|
+
const u = pn();
|
|
2387
2286
|
if (s = // in test mode, ignore the argument provided as we can always retrieve a
|
|
2388
2287
|
// pinia instance with getActivePinia()
|
|
2389
2288
|
(process.env.NODE_ENV === "test" && we && we._testing ? null : s) || (u ? Ie(Jt, null) : null), s && Te(s), process.env.NODE_ENV !== "production" && !we)
|
|
2390
2289
|
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
2391
2290
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
2392
2291
|
This will fail in production.`);
|
|
2393
|
-
s = we, s._s.has(n) || (
|
|
2394
|
-
const
|
|
2292
|
+
s = we, s._s.has(n) || (i ? et(n, o, l, s) : yt(n, l, s), process.env.NODE_ENV !== "production" && (r._pinia = s));
|
|
2293
|
+
const c = s._s.get(n);
|
|
2395
2294
|
if (process.env.NODE_ENV !== "production" && a) {
|
|
2396
|
-
const p = "__hot:" + n, m =
|
|
2295
|
+
const p = "__hot:" + n, m = i ? et(p, o, l, s, !0) : yt(p, J({}, l), s, !0);
|
|
2397
2296
|
a._hotUpdate(m), delete s.state.value[p], s._s.delete(p);
|
|
2398
2297
|
}
|
|
2399
2298
|
if (process.env.NODE_ENV !== "production" && Be) {
|
|
2400
|
-
const p =
|
|
2299
|
+
const p = It();
|
|
2401
2300
|
if (p && p.proxy && // avoid adding stores that are just built for hot module replacement
|
|
2402
2301
|
!a) {
|
|
2403
|
-
const m = p.proxy,
|
|
2404
|
-
|
|
2302
|
+
const m = p.proxy, _ = "_pStores" in m ? m._pStores : m._pStores = {};
|
|
2303
|
+
_[n] = c;
|
|
2405
2304
|
}
|
|
2406
2305
|
}
|
|
2407
|
-
return
|
|
2306
|
+
return c;
|
|
2408
2307
|
}
|
|
2409
|
-
return
|
|
2308
|
+
return r.$id = n, r;
|
|
2410
2309
|
}
|
|
2411
|
-
const ze = He("
|
|
2310
|
+
const ze = He("loader", () => ({ loading: E(!1) })), wt = {
|
|
2311
|
+
__name: "Select",
|
|
2312
|
+
props: /* @__PURE__ */ vn({
|
|
2313
|
+
languages: {
|
|
2314
|
+
type: Object,
|
|
2315
|
+
required: !0
|
|
2316
|
+
}
|
|
2317
|
+
}, {
|
|
2318
|
+
modelValue: {},
|
|
2319
|
+
modelModifiers: {}
|
|
2320
|
+
}),
|
|
2321
|
+
emits: ["update:modelValue"],
|
|
2322
|
+
setup(e) {
|
|
2323
|
+
const o = ze(), t = e, n = hn(e, "modelValue"), l = E(""), i = E(null), r = S(() => Object.entries(t.languages).filter(
|
|
2324
|
+
([, a]) => a.toLowerCase().includes(l.value.toLowerCase())
|
|
2325
|
+
)), s = (a) => {
|
|
2326
|
+
a.target.value = "", l.value = "", i.value && i.value.$el.click();
|
|
2327
|
+
};
|
|
2328
|
+
return (a, u) => (w(), ee(k(To), {
|
|
2329
|
+
modelValue: n.value,
|
|
2330
|
+
"onUpdate:modelValue": u[3] || (u[3] = (c) => n.value = c),
|
|
2331
|
+
disabled: k(o).loading,
|
|
2332
|
+
as: "div",
|
|
2333
|
+
class: "relative mt-1"
|
|
2334
|
+
}, {
|
|
2335
|
+
default: Pe(() => [
|
|
2336
|
+
H(k(Lo), {
|
|
2337
|
+
class: "w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",
|
|
2338
|
+
onChange: u[0] || (u[0] = (c) => l.value = c.target.value),
|
|
2339
|
+
displayValue: (c) => e.languages[c],
|
|
2340
|
+
onFocus: u[1] || (u[1] = (c) => s(c))
|
|
2341
|
+
}, null, 8, ["displayValue"]),
|
|
2342
|
+
H(k(Io), {
|
|
2343
|
+
ref_key: "btnSelect",
|
|
2344
|
+
ref: i,
|
|
2345
|
+
class: "absolute inset-y-0 right-0 flex items-center pr-2"
|
|
2346
|
+
}, {
|
|
2347
|
+
default: Pe(() => [
|
|
2348
|
+
H(k(Mo), {
|
|
2349
|
+
class: "h-5 w-5 text-gray-400",
|
|
2350
|
+
"aria-hidden": "true",
|
|
2351
|
+
onClick: u[2] || (u[2] = (c) => s(c))
|
|
2352
|
+
})
|
|
2353
|
+
]),
|
|
2354
|
+
_: 1
|
|
2355
|
+
}, 512),
|
|
2356
|
+
H(k(Po), { class: "absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50" }, {
|
|
2357
|
+
default: Pe(() => [
|
|
2358
|
+
(w(!0), $(Z, null, se(r.value, ([c, p]) => (w(), ee(k(Vo), {
|
|
2359
|
+
key: c,
|
|
2360
|
+
value: c
|
|
2361
|
+
}, {
|
|
2362
|
+
default: Pe(({ active: m, selected: _ }) => [
|
|
2363
|
+
C("li", {
|
|
2364
|
+
class: _e([
|
|
2365
|
+
"relative cursor-default select-none py-2 pl-3 pr-9",
|
|
2366
|
+
m ? "bg-[#3B5695] text-white" : "text-textCustom"
|
|
2367
|
+
])
|
|
2368
|
+
}, [
|
|
2369
|
+
C("span", {
|
|
2370
|
+
class: _e(["block truncate", _ && "font-semibold"])
|
|
2371
|
+
}, te(p), 3)
|
|
2372
|
+
], 2)
|
|
2373
|
+
]),
|
|
2374
|
+
_: 2
|
|
2375
|
+
}, 1032, ["value"]))), 128))
|
|
2376
|
+
]),
|
|
2377
|
+
_: 1
|
|
2378
|
+
})
|
|
2379
|
+
]),
|
|
2380
|
+
_: 1
|
|
2381
|
+
}, 8, ["modelValue", "disabled"]));
|
|
2382
|
+
}
|
|
2383
|
+
}, rn = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e", cl = ["disabled"], dl = /* @__PURE__ */ C("img", {
|
|
2384
|
+
src: rn,
|
|
2385
|
+
alt: "swap",
|
|
2386
|
+
class: "w-4"
|
|
2387
|
+
}, null, -1), fl = [
|
|
2388
|
+
dl
|
|
2389
|
+
], pl = ["disabled"], vl = /* @__PURE__ */ C("img", {
|
|
2390
|
+
src: rn,
|
|
2391
|
+
alt: "swap",
|
|
2392
|
+
class: "w-4"
|
|
2393
|
+
}, null, -1), hl = [
|
|
2394
|
+
vl
|
|
2395
|
+
], ml = {
|
|
2396
|
+
__name: "SwapBtn",
|
|
2397
|
+
props: {
|
|
2398
|
+
isBidirect: {
|
|
2399
|
+
type: Boolean,
|
|
2400
|
+
default: !1
|
|
2401
|
+
}
|
|
2402
|
+
},
|
|
2403
|
+
emits: ["swap"],
|
|
2404
|
+
setup(e, { emit: o }) {
|
|
2405
|
+
const t = ze(), n = o;
|
|
2406
|
+
return (l, i) => e.isBidirect ? (w(), $("button", {
|
|
2407
|
+
key: 1,
|
|
2408
|
+
onClick: i[0] || (i[0] = (r) => n("swap")),
|
|
2409
|
+
disabled: k(t).loading
|
|
2410
|
+
}, hl, 8, pl)) : (w(), $("button", {
|
|
2411
|
+
key: 0,
|
|
2412
|
+
disabled: k(t).loading
|
|
2413
|
+
}, fl, 8, cl));
|
|
2414
|
+
}
|
|
2415
|
+
}, Ue = He("language", () => {
|
|
2412
2416
|
const e = E("auto"), o = E("en"), t = E({
|
|
2413
2417
|
src: [],
|
|
2414
2418
|
target: []
|
|
2415
2419
|
}), n = S(() => t.value.src[e.value]), l = S(() => t.value.target[o.value]);
|
|
2416
|
-
function
|
|
2420
|
+
function i(a, u) {
|
|
2417
2421
|
e.value = a == null ? void 0 : a.src, o.value = a == null ? void 0 : a.target, t.value = u;
|
|
2418
2422
|
}
|
|
2419
|
-
function
|
|
2423
|
+
function r() {
|
|
2420
2424
|
if (!t.value.src[o.value] || !t.value.target[e.value]) return;
|
|
2421
2425
|
const a = e.value;
|
|
2422
2426
|
e.value = o.value, o.value = a;
|
|
@@ -2424,50 +2428,50 @@ const ze = He("language", () => {
|
|
|
2424
2428
|
function s(a) {
|
|
2425
2429
|
return t.value.src[a] || t.value.target[a];
|
|
2426
2430
|
}
|
|
2427
|
-
return { languages: t, src: e, target: o, srcLabel: n, targetLabel: l, init:
|
|
2428
|
-
}),
|
|
2431
|
+
return { languages: t, src: e, target: o, srcLabel: n, targetLabel: l, init: i, swap: r, getLabel: s };
|
|
2432
|
+
}), gl = {
|
|
2429
2433
|
key: 0,
|
|
2430
2434
|
class: "flex"
|
|
2431
|
-
},
|
|
2435
|
+
}, bl = {
|
|
2432
2436
|
__name: "Selects",
|
|
2433
2437
|
setup(e) {
|
|
2434
|
-
const o =
|
|
2438
|
+
const o = Ue();
|
|
2435
2439
|
function t() {
|
|
2436
2440
|
o.swap();
|
|
2437
2441
|
}
|
|
2438
|
-
return (n, l) =>
|
|
2439
|
-
H(
|
|
2440
|
-
modelValue:
|
|
2441
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
2442
|
-
languages:
|
|
2442
|
+
return (n, l) => k(o).languages ? (w(), $("div", gl, [
|
|
2443
|
+
H(wt, {
|
|
2444
|
+
modelValue: k(o).src,
|
|
2445
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => k(o).src = i),
|
|
2446
|
+
languages: k(o).languages.src,
|
|
2443
2447
|
class: "grow"
|
|
2444
2448
|
}, null, 8, ["modelValue", "languages"]),
|
|
2445
|
-
H(
|
|
2446
|
-
isBidirect:
|
|
2449
|
+
H(ml, {
|
|
2450
|
+
isBidirect: k(o).src !== "auto",
|
|
2447
2451
|
class: "grow-0 mx-3",
|
|
2448
2452
|
onSwap: t
|
|
2449
2453
|
}, null, 8, ["isBidirect"]),
|
|
2450
|
-
H(
|
|
2451
|
-
modelValue:
|
|
2452
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
2453
|
-
languages:
|
|
2454
|
+
H(wt, {
|
|
2455
|
+
modelValue: k(o).target,
|
|
2456
|
+
"onUpdate:modelValue": l[1] || (l[1] = (i) => k(o).target = i),
|
|
2457
|
+
languages: k(o).languages.target,
|
|
2454
2458
|
class: "grow"
|
|
2455
2459
|
}, null, 8, ["modelValue", "languages"])
|
|
2456
2460
|
])) : X("", !0);
|
|
2457
2461
|
}
|
|
2458
|
-
},
|
|
2462
|
+
}, Cl = {
|
|
2459
2463
|
INPUT_MAX_LENGTH: 5e3,
|
|
2460
2464
|
INPUT_DEBOUNCE: 500
|
|
2461
|
-
},
|
|
2465
|
+
}, Ze = (e, o) => {
|
|
2462
2466
|
const t = e.__vccOpts || e;
|
|
2463
2467
|
for (const [n, l] of o)
|
|
2464
2468
|
t[n] = l;
|
|
2465
2469
|
return t;
|
|
2466
|
-
},
|
|
2467
|
-
function
|
|
2468
|
-
return w(), $("span",
|
|
2470
|
+
}, _l = {}, xl = { class: "mr-2 loading loading-dots loading-xs" };
|
|
2471
|
+
function yl(e, o) {
|
|
2472
|
+
return w(), $("span", xl);
|
|
2469
2473
|
}
|
|
2470
|
-
const
|
|
2474
|
+
const wl = /* @__PURE__ */ Ze(_l, [["render", yl]]), Sl = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%204.66667H3.51125C3.82693%204.6667%204.13239%204.55473%204.37325%204.35067L6.83392%202.26667C6.99592%202.12953%207.19374%202.04156%207.40407%202.01312C7.61441%201.98468%207.82849%202.01696%208.02109%202.10615C8.21369%202.19534%208.37678%202.33772%208.49114%202.51652C8.60551%202.69532%208.66638%202.90309%208.66659%203.11534V12.8847C8.66649%2013.097%208.60565%2013.305%208.49125%2013.4839C8.37685%2013.6628%208.21367%2013.8053%208.02094%2013.8945C7.82822%2013.9837%207.614%2014.0159%207.40356%2013.9874C7.19312%2013.9588%206.99523%2013.8707%206.83325%2013.7333L4.37325%2011.6487C4.13229%2011.4449%203.82685%2011.3331%203.51125%2011.3333H2.33325C2.06804%2011.3333%201.81368%2011.228%201.62615%2011.0404C1.43861%2010.8529%201.33325%2010.5986%201.33325%2010.3333V5.66667C1.33325%205.40145%201.43861%205.1471%201.62615%204.95956C1.81368%204.77203%202.06804%204.66667%202.33325%204.66667ZM11.1779%2011.18C11.5969%2010.763%2011.9294%2010.2674%2012.1562%209.72156C12.3831%209.17572%2012.4999%208.59044%2012.4999%207.99934C12.4999%207.40823%2012.3831%206.82295%2012.1562%206.27711C11.9294%205.73127%2011.5969%205.23564%2011.1779%204.81867C11.1317%204.77098%2011.0765%204.73297%2011.0155%204.70686C10.9544%204.68075%2010.8888%204.66705%2010.8224%204.66657C10.756%204.66609%2010.6902%204.67883%2010.6288%204.70406C10.5674%204.72929%2010.5116%204.76649%2010.4647%204.8135C10.4179%204.86051%2010.3808%204.91639%2010.3558%204.97787C10.3307%205.03935%2010.3181%205.10521%2010.3188%205.17159C10.3195%205.23798%2010.3334%205.30357%2010.3597%205.36453C10.3859%205.42549%2010.4241%205.48061%2010.4719%205.52667C10.7977%205.85079%2011.0562%206.23609%2011.2326%206.66043C11.409%207.08477%2011.4998%207.53979%2011.4998%207.99934C11.4998%208.45888%2011.409%208.9139%2011.2326%209.33824C11.0562%209.76258%2010.7977%2010.1479%2010.4719%2010.472C10.4241%2010.5181%2010.3859%2010.5732%2010.3597%2010.6341C10.3334%2010.6951%2010.3195%2010.7607%2010.3188%2010.8271C10.3181%2010.8935%2010.3307%2010.9593%2010.3558%2011.0208C10.3808%2011.0823%2010.4179%2011.1382%2010.4647%2011.1852C10.5116%2011.2322%2010.5674%2011.2694%2010.6288%2011.2946C10.6902%2011.3198%2010.756%2011.3326%2010.8224%2011.3321C10.8888%2011.3316%2010.9544%2011.3179%2011.0155%2011.2918C11.0765%2011.2657%2011.1317%2011.2277%2011.1779%2011.18ZM12.7113%2013.2127C12.6123%2013.2126%2012.5157%2013.1832%2012.4335%2013.1281C12.3513%2013.0731%2012.2873%2012.9949%2012.2495%2012.9035C12.2118%2012.8121%2012.202%2012.7115%2012.2214%2012.6146C12.2408%2012.5176%2012.2886%2012.4285%2012.3586%2012.3587C12.9317%2011.7866%2013.3865%2011.1071%2013.6967%2010.359C14.0069%209.61101%2014.1666%208.80915%2014.1666%207.99934C14.1666%207.18952%2014.0069%206.38766%2013.6967%205.63963C13.3865%204.8916%2012.9317%204.2121%2012.3586%203.64C12.3122%203.59351%2012.2754%203.53834%2012.2503%203.47764C12.2252%203.41693%2012.2124%203.35188%2012.2124%203.2862C12.2125%203.22052%2012.2255%203.15549%2012.2507%203.09483C12.2759%203.03417%2012.3128%202.97907%2012.3593%202.93267C12.4057%202.88627%2012.4609%202.84948%2012.5216%202.8244C12.5823%202.79932%2012.6474%202.78645%2012.7131%202.78651C12.7787%202.78657%2012.8438%202.79957%2012.9044%202.82476C12.9651%202.84995%2013.0202%202.88685%2013.0666%202.93334C13.7327%203.59825%2014.2612%204.38801%2014.6218%205.25741C14.9824%206.12681%2015.168%207.05879%2015.168%208C15.168%208.94122%2014.9824%209.87319%2014.6218%2010.7426C14.2612%2011.612%2013.7327%2012.4018%2013.0666%2013.0667C13.02%2013.1134%2012.9646%2013.1504%2012.9036%2013.1756C12.8426%2013.2007%2012.7772%2013.2129%2012.7113%2013.2127Z'%20fill='%233B5695'/%3e%3c/svg%3e", El = "data:image/svg+xml,%3csvg%20class='swap-on%20fill-current%20h-4%20w-4'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill-rule='evenodd'%20d='M4.5%207.5a3%203%200%200%201%203-3h9a3%203%200%200%201%203%203v9a3%203%200%200%201-3%203h-9a3%203%200%200%201-3-3v-9Z'%20clip-rule='evenodd'%20fill='%238595BE'/%3e%3c/svg%3e", an = He("tts", () => {
|
|
2471
2475
|
const e = E({
|
|
2472
2476
|
src: null,
|
|
2473
2477
|
target: null
|
|
@@ -2491,17 +2495,17 @@ const yl = /* @__PURE__ */ Ue(Cl, [["render", xl]]), wl = "data:image/svg+xml,%3
|
|
|
2491
2495
|
get: t,
|
|
2492
2496
|
reset: n
|
|
2493
2497
|
};
|
|
2494
|
-
}),
|
|
2495
|
-
src: wl,
|
|
2496
|
-
alt: "Play"
|
|
2497
|
-
}, null, -1), Ol = [
|
|
2498
|
-
El
|
|
2499
|
-
], $l = /* @__PURE__ */ C("img", {
|
|
2498
|
+
}), Ol = /* @__PURE__ */ C("img", {
|
|
2500
2499
|
src: Sl,
|
|
2500
|
+
alt: "Play"
|
|
2501
|
+
}, null, -1), $l = [
|
|
2502
|
+
Ol
|
|
2503
|
+
], Tl = /* @__PURE__ */ C("img", {
|
|
2504
|
+
src: El,
|
|
2501
2505
|
alt: "Stop"
|
|
2502
|
-
}, null, -1),
|
|
2503
|
-
|
|
2504
|
-
],
|
|
2506
|
+
}, null, -1), Il = [
|
|
2507
|
+
Tl
|
|
2508
|
+
], Ll = {
|
|
2505
2509
|
__name: "SpeakBtn",
|
|
2506
2510
|
props: {
|
|
2507
2511
|
type: {
|
|
@@ -2511,82 +2515,82 @@ const yl = /* @__PURE__ */ Ue(Cl, [["render", xl]]), wl = "data:image/svg+xml,%3
|
|
|
2511
2515
|
},
|
|
2512
2516
|
emits: ["loadTTS"],
|
|
2513
2517
|
setup(e, { emit: o }) {
|
|
2514
|
-
const t =
|
|
2518
|
+
const t = an(), n = e, l = o, i = S(() => t.tts[n.type]), r = E(!1), s = new Audio();
|
|
2515
2519
|
F(
|
|
2516
|
-
|
|
2520
|
+
i,
|
|
2517
2521
|
() => {
|
|
2518
|
-
if (!
|
|
2519
|
-
|
|
2522
|
+
if (!i.value) {
|
|
2523
|
+
r.value = !1;
|
|
2520
2524
|
return;
|
|
2521
2525
|
}
|
|
2522
2526
|
u();
|
|
2523
2527
|
},
|
|
2524
2528
|
{ immediate: !0 }
|
|
2525
|
-
),
|
|
2526
|
-
|
|
2529
|
+
), nt(() => {
|
|
2530
|
+
c(), s.src = "";
|
|
2527
2531
|
});
|
|
2528
2532
|
function a() {
|
|
2529
|
-
if (
|
|
2533
|
+
if (i.value) {
|
|
2530
2534
|
u();
|
|
2531
2535
|
return;
|
|
2532
2536
|
}
|
|
2533
|
-
|
|
2537
|
+
r.value = !0, l("loadTTS");
|
|
2534
2538
|
}
|
|
2535
2539
|
function u() {
|
|
2536
|
-
|
|
2537
|
-
|
|
2540
|
+
i.value && (s.src = i.value, r.value = !0, s.play().catch(() => {
|
|
2541
|
+
r.value = !1;
|
|
2538
2542
|
}));
|
|
2539
2543
|
}
|
|
2540
|
-
function
|
|
2541
|
-
s.pause(), s.currentTime = 0,
|
|
2544
|
+
function c() {
|
|
2545
|
+
s.pause(), s.currentTime = 0, r.value = !1;
|
|
2542
2546
|
}
|
|
2543
2547
|
return s.onended = () => {
|
|
2544
|
-
|
|
2545
|
-
}, (p, m) =>
|
|
2548
|
+
r.value = !1;
|
|
2549
|
+
}, (p, m) => r.value ? (w(), $("button", {
|
|
2546
2550
|
key: 1,
|
|
2547
2551
|
class: "btn btn-xs btn-ghost btn-circle",
|
|
2548
|
-
onClick:
|
|
2549
|
-
},
|
|
2552
|
+
onClick: dt(c, ["prevent"])
|
|
2553
|
+
}, Il)) : (w(), $("button", {
|
|
2550
2554
|
key: 0,
|
|
2551
2555
|
class: "btn btn-xs btn-ghost btn-circle",
|
|
2552
|
-
onClick:
|
|
2553
|
-
},
|
|
2556
|
+
onClick: dt(a, ["prevent"])
|
|
2557
|
+
}, $l));
|
|
2554
2558
|
}
|
|
2555
|
-
},
|
|
2556
|
-
src:
|
|
2559
|
+
}, Pl = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.19102%203.19102C3.44571%202.93633%203.85864%202.93633%204.11333%203.19102L12.809%2011.8867C13.0637%2012.1414%2013.0637%2012.5543%2012.809%2012.809C12.5543%2013.0637%2012.1414%2013.0637%2011.8867%2012.809L3.19102%204.11333C2.93633%203.85864%202.93633%203.44571%203.19102%203.19102Z'%20fill='%231A1F2A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.809%203.19102C13.0637%203.44571%2013.0637%203.85864%2012.809%204.11333L4.11333%2012.809C3.85864%2013.0637%203.44571%2013.0637%203.19102%2012.809C2.93633%2012.5543%202.93633%2012.1414%203.19102%2011.8867L11.8867%203.19102C12.1414%202.93633%2012.5543%202.93633%2012.809%203.19102Z'%20fill='%231A1F2A'/%3e%3c/svg%3e", Vl = {}, kl = { class: "btn btn-xs btn-circle btn-ghost" }, Ml = /* @__PURE__ */ C("img", {
|
|
2560
|
+
src: Pl,
|
|
2557
2561
|
alt: "Clear",
|
|
2558
2562
|
class: "w-4"
|
|
2559
|
-
}, null, -1),
|
|
2560
|
-
|
|
2563
|
+
}, null, -1), Rl = [
|
|
2564
|
+
Ml
|
|
2561
2565
|
];
|
|
2562
|
-
function
|
|
2563
|
-
return w(), $("button",
|
|
2566
|
+
function Nl(e, o) {
|
|
2567
|
+
return w(), $("button", kl, Rl);
|
|
2564
2568
|
}
|
|
2565
|
-
const
|
|
2569
|
+
const Al = /* @__PURE__ */ Ze(Vl, [["render", Nl]]), Dl = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.47207%201.31905C7.57125%201.12371%207.77589%201%208.00001%201C8.22413%201%208.42877%201.12367%208.52795%201.31905L10.3721%204.95175L14.4959%205.53427C14.7177%205.5656%2014.9019%205.7166%2014.9712%205.9238C15.0404%206.13101%2014.9827%206.35843%2014.8222%206.51049L11.8382%209.33816L12.5427%2013.3309C12.5806%2013.5456%2012.4897%2013.7626%2012.3084%2013.8906C12.1272%2014.0187%2011.8868%2014.0356%2011.6884%2013.9342L8.00004%2012.0491L4.31158%2013.9343C4.11323%2014.0356%203.87286%2014.0187%203.69157%2013.8907C3.51028%2013.7627%203.4195%2013.5457%203.45736%2013.3309L4.1618%209.33819L1.17781%206.51052C1.01735%206.35846%200.959571%206.13101%201.02884%205.92383C1.09807%205.71663%201.28232%205.56563%201.50409%205.53431L5.62787%204.95178L7.47207%201.31905Z'%20fill='%23FFC857'/%3e%3c/svg%3e", Fl = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9491%205.89315C14.8278%205.53128%2014.5111%205.27252%2014.1226%205.21783L10.5264%204.7114L8.91813%201.55315C8.74435%201.21195%208.39257%201%207.99998%201C7.60739%201%207.25557%201.21195%207.08183%201.55315L5.47358%204.7114L1.8774%205.21783C1.48888%205.27252%201.17219%205.53128%201.05086%205.89315C0.929554%206.25501%201.02881%206.64477%201.30993%206.91038L3.91217%209.36871L3.29786%2012.8399C3.2315%2013.215%203.38755%2013.5868%203.7052%2013.8105C3.88128%2013.9344%204.08938%2014%204.30704%2014C4.47232%2014%204.63705%2013.9606%204.78341%2013.886L7.99995%2012.2471L11.2165%2013.886C11.3628%2013.9606%2011.5276%2014%2011.6929%2014C11.9106%2014%2012.1187%2013.9345%2012.2948%2013.8105C12.6124%2013.5868%2012.7685%2013.215%2012.7021%2012.84L12.0878%209.36871L14.6901%206.91035C14.9712%206.64477%2015.0704%206.25498%2014.9491%205.89315ZM14.0266%206.25082L11.2455%208.87813C11.1335%208.98392%2011.0824%209.13637%2011.1089%209.28575L11.7654%2012.9956C11.7701%2013.0226%2011.759%2013.0493%2011.7362%2013.0653C11.7202%2013.0766%2011.7038%2013.079%2011.6929%2013.079C11.6809%2013.079%2011.6694%2013.0762%2011.6587%2013.0708L8.22108%2011.3192C8.15189%2011.284%208.07593%2011.2663%207.99998%2011.2663C7.92402%2011.2663%207.84807%2011.284%207.77882%2011.3193L4.34118%2013.0708C4.33052%2013.0763%204.31904%2013.079%204.30701%2013.079C4.29611%2013.079%204.27969%2013.0767%204.26373%2013.0654C4.24092%2013.0494%204.22975%2013.0226%204.2345%2012.9957L4.89104%209.28584C4.91747%209.13646%204.86637%208.98401%204.75439%208.87822L1.97327%206.25091C1.95308%206.23184%201.94595%206.20383%201.95466%206.17786C1.9634%206.15185%201.98612%206.13326%202.01405%206.12933L5.85743%205.58807C6.0122%205.56626%206.14599%205.47208%206.21521%205.33616L7.93404%201.9608C7.94653%201.9363%207.97178%201.92107%207.99998%201.92107C8.02818%201.92107%208.05343%201.9363%208.06591%201.9608L9.78468%205.33607C9.85391%205.47199%209.9877%205.5662%2010.1425%205.58799L13.9859%206.12924C14.0138%206.1332%2014.0365%206.15176%2014.0452%206.17777C14.0539%206.20374%2014.0468%206.23175%2014.0266%206.25082Z'%20fill='%231A1F2A'/%3e%3c/svg%3e", jl = { class: "btn btn-xs btn-circle btn-ghost" }, Bl = {
|
|
2566
2570
|
key: 0,
|
|
2567
|
-
src:
|
|
2571
|
+
src: Dl,
|
|
2568
2572
|
alt: "Clear",
|
|
2569
2573
|
class: "w-4"
|
|
2570
|
-
},
|
|
2574
|
+
}, Hl = {
|
|
2571
2575
|
key: 1,
|
|
2572
|
-
src:
|
|
2576
|
+
src: Fl,
|
|
2573
2577
|
alt: "Clear",
|
|
2574
2578
|
class: "w-4"
|
|
2575
|
-
},
|
|
2579
|
+
}, zl = {
|
|
2576
2580
|
__name: "FavoriteBtn",
|
|
2577
2581
|
props: {
|
|
2578
2582
|
isFilled: Boolean
|
|
2579
2583
|
},
|
|
2580
2584
|
setup(e) {
|
|
2581
2585
|
const o = e;
|
|
2582
|
-
return (t, n) => (w(), $("button",
|
|
2583
|
-
o.isFilled ? (w(), $("img",
|
|
2586
|
+
return (t, n) => (w(), $("button", jl, [
|
|
2587
|
+
o.isFilled ? (w(), $("img", Bl)) : (w(), $("img", Hl))
|
|
2584
2588
|
]));
|
|
2585
2589
|
}
|
|
2586
|
-
},
|
|
2590
|
+
}, Ul = { class: "flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center" }, Zl = { class: "text-sm text-gray-600" }, Wl = {
|
|
2587
2591
|
key: 0,
|
|
2588
2592
|
class: "italic"
|
|
2589
|
-
},
|
|
2593
|
+
}, Gl = /* @__PURE__ */ C("div", { class: "flex-grow" }, null, -1), un = {
|
|
2590
2594
|
__name: "TranslationBtnGroup",
|
|
2591
2595
|
props: {
|
|
2592
2596
|
loading: {
|
|
@@ -2630,26 +2634,26 @@ const Nl = /* @__PURE__ */ Ue(Pl, [["render", Rl]]), Al = "data:image/svg+xml,%3
|
|
|
2630
2634
|
emits: ["clear", "favorite", "loadTTS"],
|
|
2631
2635
|
setup(e, { emit: o }) {
|
|
2632
2636
|
const t = e, n = o;
|
|
2633
|
-
return (l,
|
|
2634
|
-
t.src ? (w(), ee(
|
|
2637
|
+
return (l, i) => (w(), $("div", Ul, [
|
|
2638
|
+
t.src ? (w(), ee(Ll, {
|
|
2635
2639
|
key: 0,
|
|
2636
2640
|
type: t.type,
|
|
2637
|
-
onLoadTTS:
|
|
2641
|
+
onLoadTTS: i[0] || (i[0] = (r) => n("loadTTS"))
|
|
2638
2642
|
}, null, 8, ["type"])) : X("", !0),
|
|
2639
|
-
C("div",
|
|
2643
|
+
C("div", Zl, [
|
|
2640
2644
|
mn(te(e.srcLabel) + " ", 1),
|
|
2641
|
-
e.phonetic ? (w(), $("span",
|
|
2645
|
+
e.phonetic ? (w(), $("span", Wl, "- [" + te(t.phonetic) + "]", 1)) : X("", !0)
|
|
2642
2646
|
]),
|
|
2643
|
-
|
|
2644
|
-
t.loading ? (w(), ee(
|
|
2645
|
-
t.src && t.isClearBtn ? (w(), ee(
|
|
2647
|
+
Gl,
|
|
2648
|
+
t.loading ? (w(), ee(wl, { key: 1 })) : X("", !0),
|
|
2649
|
+
t.src && t.isClearBtn ? (w(), ee(Al, {
|
|
2646
2650
|
key: 2,
|
|
2647
|
-
onClick:
|
|
2651
|
+
onClick: i[1] || (i[1] = (r) => n("clear"))
|
|
2648
2652
|
})) : X("", !0),
|
|
2649
|
-
t.src && t.isFavoriteBtn ? (w(), ee(
|
|
2653
|
+
t.src && t.isFavoriteBtn ? (w(), ee(zl, {
|
|
2650
2654
|
key: 3,
|
|
2651
2655
|
isFilled: t.isFavorite,
|
|
2652
|
-
onClick:
|
|
2656
|
+
onClick: i[2] || (i[2] = (r) => n("favorite"))
|
|
2653
2657
|
}, null, 8, ["isFilled"])) : X("", !0)
|
|
2654
2658
|
]));
|
|
2655
2659
|
}
|
|
@@ -2657,18 +2661,18 @@ const Nl = /* @__PURE__ */ Ue(Pl, [["render", Rl]]), Al = "data:image/svg+xml,%3
|
|
|
2657
2661
|
const e = E(null), o = E(null), t = E(null), n = E({
|
|
2658
2662
|
src: null,
|
|
2659
2663
|
target: null
|
|
2660
|
-
}), l = E(null),
|
|
2664
|
+
}), l = E(null), i = E([]), r = E([]), s = E([]), a = E([]), u = E({
|
|
2661
2665
|
src: null,
|
|
2662
2666
|
target: null
|
|
2663
|
-
}),
|
|
2664
|
-
function
|
|
2665
|
-
e.value = h.src, o.value = h.target, t.value = h.text, n.value = h.phonetic, l.value = h.result,
|
|
2667
|
+
}), c = Ue(), p = S(() => c.getLabel(e.value)), m = S(() => c.getLabel(o.value));
|
|
2668
|
+
function _(h) {
|
|
2669
|
+
e.value = h.src, o.value = h.target, t.value = h.text, n.value = h.phonetic, l.value = h.result, i.value = h.dictionary, r.value = h.definitions, s.value = h.synonyms, a.value = h.examples, u.value = h.tts;
|
|
2666
2670
|
}
|
|
2667
2671
|
function v() {
|
|
2668
2672
|
e.value = null, o.value = null, t.value = null, n.value = {
|
|
2669
2673
|
src: null,
|
|
2670
2674
|
target: null
|
|
2671
|
-
}, l.value = null,
|
|
2675
|
+
}, l.value = null, i.value = [], r.value = [], s.value = [], a.value = [], u.value = {
|
|
2672
2676
|
src: null,
|
|
2673
2677
|
target: null
|
|
2674
2678
|
};
|
|
@@ -2681,114 +2685,114 @@ const Nl = /* @__PURE__ */ Ue(Pl, [["render", Rl]]), Al = "data:image/svg+xml,%3
|
|
|
2681
2685
|
phonetic: n,
|
|
2682
2686
|
text: t,
|
|
2683
2687
|
result: l,
|
|
2684
|
-
dictionary:
|
|
2685
|
-
definitions:
|
|
2688
|
+
dictionary: i,
|
|
2689
|
+
definitions: r,
|
|
2686
2690
|
synonyms: s,
|
|
2687
2691
|
examples: a,
|
|
2688
2692
|
tts: u,
|
|
2689
|
-
init:
|
|
2693
|
+
init: _,
|
|
2690
2694
|
reset: v
|
|
2691
2695
|
};
|
|
2692
2696
|
});
|
|
2693
|
-
function
|
|
2694
|
-
return
|
|
2697
|
+
function ql(e) {
|
|
2698
|
+
return Lt() ? (tt(e), !0) : !1;
|
|
2695
2699
|
}
|
|
2696
2700
|
function Fe(e) {
|
|
2697
|
-
return typeof e == "function" ? e() :
|
|
2701
|
+
return typeof e == "function" ? e() : k(e);
|
|
2698
2702
|
}
|
|
2699
|
-
const
|
|
2703
|
+
const Jl = typeof window < "u" && typeof document < "u";
|
|
2700
2704
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
2701
|
-
const
|
|
2705
|
+
const St = () => {
|
|
2702
2706
|
};
|
|
2703
|
-
function
|
|
2707
|
+
function Kl(e, o) {
|
|
2704
2708
|
function t(...n) {
|
|
2705
|
-
return new Promise((l,
|
|
2706
|
-
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(l).catch(
|
|
2709
|
+
return new Promise((l, i) => {
|
|
2710
|
+
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(l).catch(i);
|
|
2707
2711
|
});
|
|
2708
2712
|
}
|
|
2709
2713
|
return t;
|
|
2710
2714
|
}
|
|
2711
|
-
function
|
|
2712
|
-
let t, n, l =
|
|
2713
|
-
const
|
|
2714
|
-
clearTimeout(s), l(), l =
|
|
2715
|
+
function Yl(e, o = {}) {
|
|
2716
|
+
let t, n, l = St;
|
|
2717
|
+
const i = (s) => {
|
|
2718
|
+
clearTimeout(s), l(), l = St;
|
|
2715
2719
|
};
|
|
2716
2720
|
return (s) => {
|
|
2717
2721
|
const a = Fe(e), u = Fe(o.maxWait);
|
|
2718
|
-
return t &&
|
|
2719
|
-
l = o.rejectOnCancel ? p :
|
|
2720
|
-
t &&
|
|
2722
|
+
return t && i(t), a <= 0 || u !== void 0 && u <= 0 ? (n && (i(n), n = null), Promise.resolve(s())) : new Promise((c, p) => {
|
|
2723
|
+
l = o.rejectOnCancel ? p : c, u && !n && (n = setTimeout(() => {
|
|
2724
|
+
t && i(t), n = null, c(s());
|
|
2721
2725
|
}, u)), t = setTimeout(() => {
|
|
2722
|
-
n &&
|
|
2726
|
+
n && i(n), n = null, c(s());
|
|
2723
2727
|
}, a);
|
|
2724
2728
|
});
|
|
2725
2729
|
};
|
|
2726
2730
|
}
|
|
2727
|
-
function
|
|
2728
|
-
return
|
|
2729
|
-
|
|
2731
|
+
function Ql(e, o = 200, t = {}) {
|
|
2732
|
+
return Kl(
|
|
2733
|
+
Yl(o, t),
|
|
2730
2734
|
e
|
|
2731
2735
|
);
|
|
2732
2736
|
}
|
|
2733
|
-
function
|
|
2737
|
+
function Et(e) {
|
|
2734
2738
|
var o;
|
|
2735
2739
|
const t = Fe(e);
|
|
2736
2740
|
return (o = t == null ? void 0 : t.$el) != null ? o : t;
|
|
2737
2741
|
}
|
|
2738
|
-
const
|
|
2739
|
-
function
|
|
2740
|
-
const e = E(!1), o =
|
|
2742
|
+
const Xl = Jl ? window : void 0;
|
|
2743
|
+
function es() {
|
|
2744
|
+
const e = E(!1), o = It();
|
|
2741
2745
|
return o && xe(() => {
|
|
2742
2746
|
e.value = !0;
|
|
2743
2747
|
}, o), e;
|
|
2744
2748
|
}
|
|
2745
|
-
function
|
|
2746
|
-
const o =
|
|
2749
|
+
function ts(e) {
|
|
2750
|
+
const o = es();
|
|
2747
2751
|
return S(() => (o.value, !!e()));
|
|
2748
2752
|
}
|
|
2749
|
-
function
|
|
2750
|
-
const { window: n =
|
|
2751
|
-
let
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
-
}, a = S(() => Array.isArray(e) ? e.map((p) =>
|
|
2753
|
+
function ns(e, o, t = {}) {
|
|
2754
|
+
const { window: n = Xl, ...l } = t;
|
|
2755
|
+
let i;
|
|
2756
|
+
const r = ts(() => n && "ResizeObserver" in n), s = () => {
|
|
2757
|
+
i && (i.disconnect(), i = void 0);
|
|
2758
|
+
}, a = S(() => Array.isArray(e) ? e.map((p) => Et(p)) : [Et(e)]), u = F(
|
|
2755
2759
|
a,
|
|
2756
2760
|
(p) => {
|
|
2757
|
-
if (s(),
|
|
2758
|
-
|
|
2761
|
+
if (s(), r.value && n) {
|
|
2762
|
+
i = new ResizeObserver(o);
|
|
2759
2763
|
for (const m of p)
|
|
2760
|
-
m &&
|
|
2764
|
+
m && i.observe(m, l);
|
|
2761
2765
|
}
|
|
2762
2766
|
},
|
|
2763
2767
|
{ immediate: !0, flush: "post" }
|
|
2764
|
-
),
|
|
2768
|
+
), c = () => {
|
|
2765
2769
|
s(), u();
|
|
2766
2770
|
};
|
|
2767
|
-
return
|
|
2768
|
-
isSupported:
|
|
2769
|
-
stop:
|
|
2771
|
+
return ql(c), {
|
|
2772
|
+
isSupported: r,
|
|
2773
|
+
stop: c
|
|
2770
2774
|
};
|
|
2771
2775
|
}
|
|
2772
|
-
function
|
|
2776
|
+
function cn(e) {
|
|
2773
2777
|
var o;
|
|
2774
|
-
const t = E(e == null ? void 0 : e.element), n = E(e == null ? void 0 : e.input), l = (o = e == null ? void 0 : e.styleProp) != null ? o : "height",
|
|
2775
|
-
function
|
|
2778
|
+
const t = E(e == null ? void 0 : e.element), n = E(e == null ? void 0 : e.input), l = (o = e == null ? void 0 : e.styleProp) != null ? o : "height", i = E(1);
|
|
2779
|
+
function r() {
|
|
2776
2780
|
var s;
|
|
2777
2781
|
if (!t.value)
|
|
2778
2782
|
return;
|
|
2779
2783
|
let a = "";
|
|
2780
|
-
t.value.style[l] = "1px",
|
|
2784
|
+
t.value.style[l] = "1px", i.value = (s = t.value) == null ? void 0 : s.scrollHeight, e != null && e.styleTarget ? Fe(e.styleTarget).style[l] = `${i.value}px` : a = `${i.value}px`, t.value.style[l] = a;
|
|
2781
2785
|
}
|
|
2782
|
-
return F([n, t], () => Q(
|
|
2786
|
+
return F([n, t], () => Q(r), { immediate: !0 }), F(i, () => {
|
|
2783
2787
|
var s;
|
|
2784
2788
|
return (s = e == null ? void 0 : e.onResize) == null ? void 0 : s.call(e);
|
|
2785
|
-
}),
|
|
2789
|
+
}), ns(t, () => r()), e != null && e.watch && F(e.watch, r, { immediate: !0, deep: !0 }), {
|
|
2786
2790
|
textarea: t,
|
|
2787
2791
|
input: n,
|
|
2788
|
-
triggerResize:
|
|
2792
|
+
triggerResize: r
|
|
2789
2793
|
};
|
|
2790
2794
|
}
|
|
2791
|
-
const
|
|
2795
|
+
const os = {
|
|
2792
2796
|
__name: "TranslationInput",
|
|
2793
2797
|
props: {
|
|
2794
2798
|
text: {
|
|
@@ -2798,52 +2802,52 @@ const ns = {
|
|
|
2798
2802
|
},
|
|
2799
2803
|
emits: ["change", "clear", "loadTTS"],
|
|
2800
2804
|
setup(e, { emit: o }) {
|
|
2801
|
-
const t = he(), n = e, l = E(""),
|
|
2805
|
+
const t = he(), n = e, l = E(""), i = S(() => t.src), r = S(() => t.srcLabel), s = S(() => {
|
|
2802
2806
|
var v;
|
|
2803
2807
|
return (v = t.phonetic) == null ? void 0 : v.src;
|
|
2804
|
-
}), { textarea: a } =
|
|
2808
|
+
}), { textarea: a } = cn({ input: l, styleProp: "minHeight" }), u = o, c = Ql(() => {
|
|
2805
2809
|
u("change", l.value);
|
|
2806
|
-
},
|
|
2810
|
+
}, Cl.INPUT_DEBOUNCE);
|
|
2807
2811
|
function p() {
|
|
2808
2812
|
if (!l.value) {
|
|
2809
2813
|
m();
|
|
2810
2814
|
return;
|
|
2811
2815
|
}
|
|
2812
|
-
|
|
2816
|
+
c();
|
|
2813
2817
|
}
|
|
2814
2818
|
function m() {
|
|
2815
2819
|
u("clear"), l.value = "", a.value.focus();
|
|
2816
2820
|
}
|
|
2817
|
-
async function
|
|
2821
|
+
async function _() {
|
|
2818
2822
|
await Q(), a.value.select();
|
|
2819
2823
|
}
|
|
2820
2824
|
return F(
|
|
2821
2825
|
() => n.text,
|
|
2822
2826
|
(v) => {
|
|
2823
|
-
l.value !== v &&
|
|
2827
|
+
l.value !== v && _(), l.value = v;
|
|
2824
2828
|
}
|
|
2825
2829
|
), (v, h) => (w(), $(Z, null, [
|
|
2826
|
-
H(
|
|
2827
|
-
src:
|
|
2828
|
-
srcLabel:
|
|
2830
|
+
H(un, {
|
|
2831
|
+
src: i.value,
|
|
2832
|
+
srcLabel: r.value,
|
|
2829
2833
|
type: "src",
|
|
2830
2834
|
phonetic: s.value,
|
|
2831
2835
|
isClearBtn: !0,
|
|
2832
2836
|
onClear: m,
|
|
2833
|
-
onLoadTTS: h[0] || (h[0] = (
|
|
2837
|
+
onLoadTTS: h[0] || (h[0] = (M) => u("loadTTS"))
|
|
2834
2838
|
}, null, 8, ["src", "srcLabel", "phonetic"]),
|
|
2835
|
-
|
|
2839
|
+
Pt(C("textarea", {
|
|
2836
2840
|
ref_key: "textarea",
|
|
2837
2841
|
ref: a,
|
|
2838
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
2842
|
+
"onUpdate:modelValue": h[1] || (h[1] = (M) => l.value = M),
|
|
2839
2843
|
class: "w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",
|
|
2840
2844
|
autofocus: "",
|
|
2841
2845
|
rows: "2",
|
|
2842
2846
|
onInput: p,
|
|
2843
|
-
onFocus:
|
|
2847
|
+
onFocus: _
|
|
2844
2848
|
}, null, 544), [
|
|
2845
2849
|
[
|
|
2846
|
-
|
|
2850
|
+
Vt,
|
|
2847
2851
|
l.value,
|
|
2848
2852
|
void 0,
|
|
2849
2853
|
{ trim: !0 }
|
|
@@ -2851,22 +2855,22 @@ const ns = {
|
|
|
2851
2855
|
])
|
|
2852
2856
|
], 64));
|
|
2853
2857
|
}
|
|
2854
|
-
},
|
|
2858
|
+
}, ls = /* @__PURE__ */ Ze(os, [["__scopeId", "data-v-90bf3e0d"]]), ss = (e) => (gn("data-v-4b9f4a7b"), e = e(), bn(), e), is = { class: "flex flex-col" }, rs = /* @__PURE__ */ ss(() => /* @__PURE__ */ C("div", { class: "w-full flex align-item-center justify-end mt-2" }, null, -1)), as = {
|
|
2855
2859
|
__name: "TranslationResult",
|
|
2856
2860
|
props: {
|
|
2857
2861
|
isFavoriteFeatureEnabled: Boolean
|
|
2858
2862
|
},
|
|
2859
2863
|
emits: ["loadTTS"],
|
|
2860
2864
|
setup(e, { emit: o }) {
|
|
2861
|
-
const t = he(), n = E(!1), l = S(() => t.result),
|
|
2862
|
-
var
|
|
2863
|
-
return (
|
|
2864
|
-
}), a = e, u =
|
|
2865
|
-
return (
|
|
2866
|
-
H(
|
|
2867
|
-
loading:
|
|
2868
|
-
src:
|
|
2869
|
-
srcLabel:
|
|
2865
|
+
const t = he(), n = E(!1), l = S(() => t.result), i = S(() => t.target), r = S(() => t.targetLabel), s = S(() => {
|
|
2866
|
+
var _;
|
|
2867
|
+
return (_ = t.phonetic) == null ? void 0 : _.target;
|
|
2868
|
+
}), a = e, u = ze(), { textarea: c, input: p } = cn({ input: l, styleProp: "minHeight" }), m = o;
|
|
2869
|
+
return (_, v) => (w(), $(Z, null, [
|
|
2870
|
+
H(un, {
|
|
2871
|
+
loading: k(u).loading,
|
|
2872
|
+
src: i.value,
|
|
2873
|
+
srcLabel: r.value,
|
|
2870
2874
|
type: "target",
|
|
2871
2875
|
isFavoriteBtn: a.isFavoriteFeatureEnabled,
|
|
2872
2876
|
isFavorite: n.value,
|
|
@@ -2874,75 +2878,75 @@ const ns = {
|
|
|
2874
2878
|
onFavorite: v[0] || (v[0] = (h) => n.value = !n.value),
|
|
2875
2879
|
onLoadTTS: v[1] || (v[1] = (h) => m("loadTTS"))
|
|
2876
2880
|
}, null, 8, ["loading", "src", "srcLabel", "isFavoriteBtn", "isFavorite", "phonetic"]),
|
|
2877
|
-
C("div",
|
|
2878
|
-
|
|
2881
|
+
C("div", is, [
|
|
2882
|
+
Pt(C("textarea", {
|
|
2879
2883
|
ref_key: "textarea",
|
|
2880
|
-
ref:
|
|
2881
|
-
"onUpdate:modelValue": v[2] || (v[2] = (h) =>
|
|
2884
|
+
ref: c,
|
|
2885
|
+
"onUpdate:modelValue": v[2] || (v[2] = (h) => Ce(p) ? p.value = h : null),
|
|
2882
2886
|
class: "w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",
|
|
2883
2887
|
readonly: "",
|
|
2884
2888
|
rows: "2",
|
|
2885
2889
|
spellcheck: "false"
|
|
2886
2890
|
}, null, 512), [
|
|
2887
|
-
[
|
|
2891
|
+
[Vt, k(p)]
|
|
2888
2892
|
]),
|
|
2889
2893
|
rs
|
|
2890
2894
|
])
|
|
2891
2895
|
], 64));
|
|
2892
2896
|
}
|
|
2893
|
-
},
|
|
2897
|
+
}, us = /* @__PURE__ */ Ze(as, [["__scopeId", "data-v-4b9f4a7b"]]), cs = { class: "btn btn-sm btn-circle btn-ghost" }, We = {
|
|
2894
2898
|
__name: "ToggleBtn",
|
|
2895
2899
|
props: {
|
|
2896
2900
|
isExpanded: Boolean
|
|
2897
2901
|
},
|
|
2898
2902
|
setup(e) {
|
|
2899
2903
|
const o = e;
|
|
2900
|
-
return (t, n) => (w(), $("button",
|
|
2901
|
-
o.isExpanded ? (w(), ee(
|
|
2904
|
+
return (t, n) => (w(), $("button", cs, [
|
|
2905
|
+
o.isExpanded ? (w(), ee(k(Ro), {
|
|
2902
2906
|
key: 0,
|
|
2903
2907
|
class: "w-7 text-gray-400"
|
|
2904
|
-
})) : (w(), ee(
|
|
2908
|
+
})) : (w(), ee(k(ko), {
|
|
2905
2909
|
key: 1,
|
|
2906
2910
|
class: "w-7 text-gray-400"
|
|
2907
2911
|
}))
|
|
2908
2912
|
]));
|
|
2909
2913
|
}
|
|
2910
|
-
},
|
|
2914
|
+
}, ds = { class: "card border bg-white rounded-lg" }, fs = { class: "card-body px-4 py-2 gap-0" }, ps = { class: "flex justify-between items-center" }, vs = /* @__PURE__ */ C("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Translations", -1), hs = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, ms = { class: "list-none list-inside" }, gs = ["onClick"], bs = { class: "text-base font-normal text-gray-800 leading-4" }, Cs = {
|
|
2911
2915
|
__name: "Dictionary",
|
|
2912
2916
|
emits: ["translate"],
|
|
2913
2917
|
setup(e, { emit: o }) {
|
|
2914
|
-
const t = E(!0), n = he(), l =
|
|
2918
|
+
const t = E(!0), n = he(), l = Ue(), i = S(() => n.dictionary), r = o, s = () => {
|
|
2915
2919
|
t.value = !t.value;
|
|
2916
2920
|
}, a = (u) => {
|
|
2917
|
-
|
|
2921
|
+
r("translate", u, n.target, n.src), l.src = n.target, l.target = n.src, window.scrollTo(0, 0);
|
|
2918
2922
|
};
|
|
2919
|
-
return (u,
|
|
2920
|
-
C("div",
|
|
2921
|
-
C("div",
|
|
2922
|
-
|
|
2923
|
-
H(
|
|
2923
|
+
return (u, c) => (w(), $("div", ds, [
|
|
2924
|
+
C("div", fs, [
|
|
2925
|
+
C("div", ps, [
|
|
2926
|
+
vs,
|
|
2927
|
+
H(We, {
|
|
2924
2928
|
isExpanded: t.value,
|
|
2925
2929
|
onClick: s
|
|
2926
2930
|
}, null, 8, ["isExpanded"])
|
|
2927
2931
|
]),
|
|
2928
2932
|
C("div", {
|
|
2929
|
-
class:
|
|
2933
|
+
class: _e(["overflow-hidden transition-all duration-300 ease-in-out", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
2930
2934
|
}, [
|
|
2931
2935
|
C("ul", null, [
|
|
2932
|
-
(w(!0), $(Z, null, se(
|
|
2936
|
+
(w(!0), $(Z, null, se(i.value, (p, m) => (w(), $("li", {
|
|
2933
2937
|
key: `${p.pos}-${m}`,
|
|
2934
2938
|
class: "mb-2"
|
|
2935
2939
|
}, [
|
|
2936
|
-
C("h5",
|
|
2937
|
-
C("ul",
|
|
2938
|
-
(w(!0), $(Z, null, se(p.items, (
|
|
2939
|
-
key: `${
|
|
2940
|
+
C("h5", hs, te(p.pos), 1),
|
|
2941
|
+
C("ul", ms, [
|
|
2942
|
+
(w(!0), $(Z, null, se(p.items, (_, v) => (w(), $("li", {
|
|
2943
|
+
key: `${_.word}-${v}`
|
|
2940
2944
|
}, [
|
|
2941
2945
|
C("span", {
|
|
2942
2946
|
class: "p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",
|
|
2943
|
-
onClick: (h) => a(
|
|
2944
|
-
}, te(
|
|
2945
|
-
C("small",
|
|
2947
|
+
onClick: (h) => a(_.word)
|
|
2948
|
+
}, te(_.word), 9, gs),
|
|
2949
|
+
C("small", bs, " - " + te(_.reverse_translation.join(", ")), 1)
|
|
2946
2950
|
]))), 128))
|
|
2947
2951
|
])
|
|
2948
2952
|
]))), 128))
|
|
@@ -2951,41 +2955,41 @@ const ns = {
|
|
|
2951
2955
|
])
|
|
2952
2956
|
]));
|
|
2953
2957
|
}
|
|
2954
|
-
},
|
|
2958
|
+
}, _s = { class: "card border bg-white rounded-lg" }, xs = { class: "card-body px-4 py-2 gap-0" }, ys = { class: "flex justify-between items-center" }, ws = /* @__PURE__ */ C("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Definitions", -1), Ss = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, Es = { class: "text-base text-textCustom list-decimal list-outside ml-5" }, Os = /* @__PURE__ */ C("br", null, null, -1), $s = {
|
|
2955
2959
|
key: 0,
|
|
2956
2960
|
class: "italic"
|
|
2957
|
-
},
|
|
2961
|
+
}, Ts = {
|
|
2958
2962
|
__name: "Definition",
|
|
2959
2963
|
setup(e) {
|
|
2960
2964
|
const o = E(!0), t = he(), n = S(() => t.definitions), l = () => {
|
|
2961
2965
|
o.value = !o.value;
|
|
2962
2966
|
};
|
|
2963
|
-
return (
|
|
2964
|
-
C("div",
|
|
2965
|
-
C("div",
|
|
2966
|
-
|
|
2967
|
-
H(
|
|
2967
|
+
return (i, r) => (w(), $("div", _s, [
|
|
2968
|
+
C("div", xs, [
|
|
2969
|
+
C("div", ys, [
|
|
2970
|
+
ws,
|
|
2971
|
+
H(We, {
|
|
2968
2972
|
isExpanded: o.value,
|
|
2969
2973
|
onClick: l
|
|
2970
2974
|
}, null, 8, ["isExpanded"])
|
|
2971
2975
|
]),
|
|
2972
2976
|
C("div", {
|
|
2973
|
-
class:
|
|
2977
|
+
class: _e(["overflow-hidden transition-all duration-300 ease-in-out", o.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
2974
2978
|
}, [
|
|
2975
2979
|
C("ul", null, [
|
|
2976
2980
|
(w(!0), $(Z, null, se(n.value, (s, a) => (w(), $("li", {
|
|
2977
2981
|
key: `${s.pos}-${a}`,
|
|
2978
2982
|
class: "mb-2"
|
|
2979
2983
|
}, [
|
|
2980
|
-
C("h5",
|
|
2981
|
-
C("ul",
|
|
2982
|
-
(w(!0), $(Z, null, se(s.items, (u,
|
|
2983
|
-
key: `${u.gloss}-${
|
|
2984
|
+
C("h5", Ss, te(s.pos), 1),
|
|
2985
|
+
C("ul", Es, [
|
|
2986
|
+
(w(!0), $(Z, null, se(s.items, (u, c) => (w(), $("li", {
|
|
2987
|
+
key: `${u.gloss}-${c}`,
|
|
2984
2988
|
class: "mb-1"
|
|
2985
2989
|
}, [
|
|
2986
2990
|
C("span", null, te(u.gloss), 1),
|
|
2987
|
-
|
|
2988
|
-
u.example ? (w(), $("small",
|
|
2991
|
+
Os,
|
|
2992
|
+
u.example ? (w(), $("small", $s, '"' + te(u.example) + '"', 1)) : X("", !0)
|
|
2989
2993
|
]))), 128))
|
|
2990
2994
|
])
|
|
2991
2995
|
]))), 128))
|
|
@@ -2994,72 +2998,72 @@ const ns = {
|
|
|
2994
2998
|
])
|
|
2995
2999
|
]));
|
|
2996
3000
|
}
|
|
2997
|
-
},
|
|
3001
|
+
}, Is = { class: "card border bg-white rounded-lg" }, Ls = { class: "card-body px-4 py-2 gap-0" }, Ps = { class: "flex justify-between items-center" }, Vs = /* @__PURE__ */ C("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Examples", -1), ks = { class: "text-textCustom list-decimal list-outside ml-7 mt-2" }, Ms = ["innerHTML"], Rs = {
|
|
2998
3002
|
__name: "Example",
|
|
2999
3003
|
setup(e) {
|
|
3000
3004
|
const o = E(!0), t = he(), n = S(() => t.examples), l = () => {
|
|
3001
3005
|
o.value = !o.value;
|
|
3002
3006
|
};
|
|
3003
|
-
return (
|
|
3004
|
-
C("div",
|
|
3005
|
-
C("div",
|
|
3006
|
-
|
|
3007
|
-
H(
|
|
3007
|
+
return (i, r) => (w(), $("div", Is, [
|
|
3008
|
+
C("div", Ls, [
|
|
3009
|
+
C("div", Ps, [
|
|
3010
|
+
Vs,
|
|
3011
|
+
H(We, {
|
|
3008
3012
|
isExpanded: o.value,
|
|
3009
3013
|
onClick: l
|
|
3010
3014
|
}, null, 8, ["isExpanded"])
|
|
3011
3015
|
]),
|
|
3012
3016
|
C("div", {
|
|
3013
|
-
class:
|
|
3017
|
+
class: _e(["overflow-hidden transition-all duration-300 ease-in-out", o.value ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3014
3018
|
}, [
|
|
3015
|
-
C("ul",
|
|
3019
|
+
C("ul", ks, [
|
|
3016
3020
|
(w(!0), $(Z, null, se(n.value, (s, a) => (w(), $("li", {
|
|
3017
3021
|
key: `${s.definition_id}-${a}`,
|
|
3018
3022
|
innerHTML: s
|
|
3019
|
-
}, null, 8,
|
|
3023
|
+
}, null, 8, Ms))), 128))
|
|
3020
3024
|
])
|
|
3021
3025
|
], 2)
|
|
3022
3026
|
])
|
|
3023
3027
|
]));
|
|
3024
3028
|
}
|
|
3025
|
-
},
|
|
3029
|
+
}, Ns = { class: "card border bg-white rounded-lg" }, As = { class: "card-body px-4 py-2 gap-0" }, Ds = { class: "flex justify-between items-center" }, Fs = /* @__PURE__ */ C("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Synonyms", -1), js = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, Bs = { class: "list-none list-inside" }, Hs = { class: "flex flex-wrap" }, zs = ["onClick"], Us = {
|
|
3026
3030
|
__name: "Synonyms",
|
|
3027
3031
|
emits: ["translate"],
|
|
3028
3032
|
setup(e, { emit: o }) {
|
|
3029
|
-
const t = E(!0), n = he(), l = S(() => n.synonyms),
|
|
3033
|
+
const t = E(!0), n = he(), l = S(() => n.synonyms), i = o, r = () => {
|
|
3030
3034
|
t.value = !t.value;
|
|
3031
3035
|
}, s = (a) => {
|
|
3032
|
-
|
|
3036
|
+
i("translate", a), window.scrollTo(0, 0);
|
|
3033
3037
|
};
|
|
3034
|
-
return (a, u) => (w(), $("div",
|
|
3035
|
-
C("div",
|
|
3036
|
-
C("div",
|
|
3037
|
-
|
|
3038
|
-
H(
|
|
3038
|
+
return (a, u) => (w(), $("div", Ns, [
|
|
3039
|
+
C("div", As, [
|
|
3040
|
+
C("div", Ds, [
|
|
3041
|
+
Fs,
|
|
3042
|
+
H(We, {
|
|
3039
3043
|
isExpanded: t.value,
|
|
3040
|
-
onClick:
|
|
3044
|
+
onClick: r
|
|
3041
3045
|
}, null, 8, ["isExpanded"])
|
|
3042
3046
|
]),
|
|
3043
3047
|
C("div", {
|
|
3044
|
-
class:
|
|
3048
|
+
class: _e(["overflow-hidden transition-all duration-300 ease-in-out", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3045
3049
|
}, [
|
|
3046
3050
|
C("ul", null, [
|
|
3047
|
-
(w(!0), $(Z, null, se(l.value, (
|
|
3048
|
-
key: `${
|
|
3051
|
+
(w(!0), $(Z, null, se(l.value, (c, p) => (w(), $("li", {
|
|
3052
|
+
key: `${c.pos}-${p}`,
|
|
3049
3053
|
class: "mb-2"
|
|
3050
3054
|
}, [
|
|
3051
|
-
C("h5",
|
|
3052
|
-
C("ul",
|
|
3053
|
-
(w(!0), $(Z, null, se(
|
|
3054
|
-
key: `${m.word}-${
|
|
3055
|
+
C("h5", js, te(c.pos), 1),
|
|
3056
|
+
C("ul", Bs, [
|
|
3057
|
+
(w(!0), $(Z, null, se(c.items, (m, _) => (w(), $("li", {
|
|
3058
|
+
key: `${m.word}-${_}`,
|
|
3055
3059
|
class: "mb-2"
|
|
3056
3060
|
}, [
|
|
3057
|
-
C("div",
|
|
3061
|
+
C("div", Hs, [
|
|
3058
3062
|
(w(!0), $(Z, null, se(m.synonym, (v, h) => (w(), $("span", {
|
|
3059
3063
|
key: `${v}-${h}`,
|
|
3060
3064
|
class: "p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",
|
|
3061
|
-
onClick: (
|
|
3062
|
-
}, te(v), 9,
|
|
3065
|
+
onClick: (M) => s(v)
|
|
3066
|
+
}, te(v), 9, zs))), 128))
|
|
3063
3067
|
])
|
|
3064
3068
|
]))), 128))
|
|
3065
3069
|
])
|
|
@@ -3069,13 +3073,13 @@ const ns = {
|
|
|
3069
3073
|
])
|
|
3070
3074
|
]));
|
|
3071
3075
|
}
|
|
3072
|
-
},
|
|
3076
|
+
}, Zs = { class: "bg-white min-h-screen flex flex-col" }, Ws = { class: "py-2 px-5 shadow-lg" }, Gs = { class: "px-5 flex-grow" }, qs = { class: "flex flex-col lg:flex-row lg:gap-2" }, Js = { class: "w-full lg:w-[calc(50%-1rem)] my-2" }, Ks = /* @__PURE__ */ C("div", { class: "w-6 h-4 mx-auto hidden lg:block" }, null, -1), Ys = { class: "w-full lg:w-[calc(50%-1rem)] my-2" }, Qs = { class: "grid grid-cols-1 lg:grid-cols-3 gap-4" }, Xs = {
|
|
3073
3077
|
key: 0,
|
|
3074
3078
|
class: "w-full my-4"
|
|
3075
|
-
},
|
|
3079
|
+
}, e2 = {
|
|
3076
3080
|
key: 1,
|
|
3077
3081
|
class: "text-textCustom italic font-medium"
|
|
3078
|
-
},
|
|
3082
|
+
}, o2 = {
|
|
3079
3083
|
__name: "Popup",
|
|
3080
3084
|
props: {
|
|
3081
3085
|
opt: {
|
|
@@ -3101,11 +3105,11 @@ const ns = {
|
|
|
3101
3105
|
},
|
|
3102
3106
|
emits: ["opt", "translate", "reader", "settings", "fullscreen", "loadTTS"],
|
|
3103
3107
|
setup(e, { emit: o }) {
|
|
3104
|
-
const t =
|
|
3108
|
+
const t = il(), n = he(t), l = an(t), i = Ue(t), r = ze(t), s = e, a = o, u = E("");
|
|
3105
3109
|
F(
|
|
3106
3110
|
() => s.translation,
|
|
3107
3111
|
(v) => {
|
|
3108
|
-
|
|
3112
|
+
v && (r.loading = !1, u.value = v.text, n.init(v), l.reset());
|
|
3109
3113
|
},
|
|
3110
3114
|
{ immediate: !0 }
|
|
3111
3115
|
), F(
|
|
@@ -3119,76 +3123,79 @@ const ns = {
|
|
|
3119
3123
|
},
|
|
3120
3124
|
{ immediate: !0 }
|
|
3121
3125
|
), F([() => s.opt, () => s.languages], ([v, h]) => {
|
|
3122
|
-
|
|
3123
|
-
}), F([() =>
|
|
3124
|
-
a("opt", { src: v, target: h }),
|
|
3126
|
+
i.init(v, h);
|
|
3127
|
+
}), F([() => i.src, () => i.target], ([v, h]) => {
|
|
3128
|
+
a("opt", { src: v, target: h }), _(u.value);
|
|
3125
3129
|
}), xe(() => {
|
|
3126
|
-
|
|
3130
|
+
i.init(s.opt, s.languages);
|
|
3127
3131
|
});
|
|
3128
|
-
function
|
|
3132
|
+
function c() {
|
|
3129
3133
|
u.value = "", n.reset();
|
|
3130
3134
|
}
|
|
3131
3135
|
function p(v) {
|
|
3132
|
-
|
|
3136
|
+
_(v);
|
|
3133
3137
|
}
|
|
3134
3138
|
function m(v) {
|
|
3135
3139
|
const h = v === "src" ? n.text : n.result;
|
|
3136
3140
|
a("loadTTS", { type: v, data: h });
|
|
3137
3141
|
}
|
|
3138
|
-
function
|
|
3139
|
-
v && (u.value = v,
|
|
3142
|
+
function _(v, h = i.src, M = i.target) {
|
|
3143
|
+
v && (u.value = v, r.loading = !0, a("translate", {
|
|
3140
3144
|
src: h,
|
|
3141
|
-
target:
|
|
3145
|
+
target: M,
|
|
3142
3146
|
text: v
|
|
3143
3147
|
}));
|
|
3144
3148
|
}
|
|
3145
|
-
return (v, h) =>
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3149
|
+
return (v, h) => {
|
|
3150
|
+
var M, N, T;
|
|
3151
|
+
return w(), $("div", Zs, [
|
|
3152
|
+
C("div", Ws, [
|
|
3153
|
+
H(Vn, {
|
|
3154
|
+
onReader: h[0] || (h[0] = (P) => a("reader")),
|
|
3155
|
+
onSettings: h[1] || (h[1] = (P) => a("settings")),
|
|
3156
|
+
onFullScreen: h[2] || (h[2] = (P) => a("fullscreen"))
|
|
3157
|
+
})
|
|
3158
|
+
]),
|
|
3155
3159
|
C("div", Gs, [
|
|
3160
|
+
H(bl, { class: "my-4" }),
|
|
3156
3161
|
C("div", qs, [
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3162
|
+
C("div", Js, [
|
|
3163
|
+
H(ls, {
|
|
3164
|
+
text: u.value,
|
|
3165
|
+
onChange: p,
|
|
3166
|
+
onClear: c,
|
|
3167
|
+
onLoadTTS: h[3] || (h[3] = (P) => m("src"))
|
|
3168
|
+
}, null, 8, ["text"])
|
|
3169
|
+
]),
|
|
3170
|
+
Ks,
|
|
3171
|
+
C("div", Ys, [
|
|
3172
|
+
H(us, {
|
|
3173
|
+
isFavoriteFeatureEnabled: e.isFavoriteFeatureEnabled,
|
|
3174
|
+
onLoadTTS: h[4] || (h[4] = (P) => m("target"))
|
|
3175
|
+
}, null, 8, ["isFavoriteFeatureEnabled"])
|
|
3176
|
+
])
|
|
3163
3177
|
]),
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
]),
|
|
3184
|
-
M(n).examples.length ? (w(), $("div", Qs, [
|
|
3185
|
-
H(Ms)
|
|
3186
|
-
])) : X("", !0)
|
|
3187
|
-
], 64)) : (w(), $("span", Xs, "Service unavailable"))
|
|
3188
|
-
])
|
|
3189
|
-
]));
|
|
3178
|
+
s.translation ? (w(), $(Z, { key: 0 }, [
|
|
3179
|
+
C("div", Qs, [
|
|
3180
|
+
(M = k(n).dictionary) != null && M.length ? (w(), ee(Cs, {
|
|
3181
|
+
key: 0,
|
|
3182
|
+
onTranslate: _
|
|
3183
|
+
})) : X("", !0),
|
|
3184
|
+
(N = k(n).definitions) != null && N.length ? (w(), ee(Ts, { key: 1 })) : X("", !0),
|
|
3185
|
+
(T = k(n).synonyms) != null && T.length ? (w(), ee(Us, {
|
|
3186
|
+
key: 2,
|
|
3187
|
+
onTranslate: _
|
|
3188
|
+
})) : X("", !0)
|
|
3189
|
+
]),
|
|
3190
|
+
k(n).examples.length ? (w(), $("div", Xs, [
|
|
3191
|
+
H(Rs)
|
|
3192
|
+
])) : X("", !0)
|
|
3193
|
+
], 64)) : (w(), $("span", e2, "Service unavailable"))
|
|
3194
|
+
])
|
|
3195
|
+
]);
|
|
3196
|
+
};
|
|
3190
3197
|
}
|
|
3191
3198
|
};
|
|
3192
3199
|
export {
|
|
3193
|
-
|
|
3200
|
+
o2 as default
|
|
3194
3201
|
};
|