PageSourceSearch

https://edusources.nl/assets/BundleCardContent-ByT6cllr.js

js edusources.nl collected 2026-10-02 07:51:05 UTC 7,114 bytes, 156 lines download raw bytes

1;
2{
3  try {
4    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f2f91390-4bea-4e62-961a-8d7877bb33f8", e._sentryDebugIdIdentifier = "sentry-dbid-f2f91390-4bea-4e62-961a-8d7877bb33f8");
6  } catch (e) {
7  }
8}
9;
10import { a as getBundleTitle, b as getBundleDescription, m as getBundleImageUrl } from "./index-qVJxi8tm.js";
11import { k as fetchMaterialCountFromSearchUrl } from "./service-CtKQEcII.js";
12import { k as ref, p as watch, d as defineComponent, u as useI18n, l as computed, r as resolveComponent, o as openBlock, c as createElementBlock, h as createBaseVNode, f as unref, g as createBlock, b as createVNode, w as withCtx, m as mergeProps, t as toDisplayString, x as createCommentVNode, _ as _export_sfc } from "./index-jnpBjG05.js";
13function useBundleMaterialCount(bundle) {
14  const materialCount = ref(null);
15  const loadMaterialCount = async () => {
16    if (bundle.type === "dynamic" && bundle.search_url) {
17      try {
18        materialCount.value = await fetchMaterialCountFromSearchUrl(bundle.search_url);
19      } catch {
20        materialCount.value = 0;
21      }
22    }
23  };
24  watch(() => bundle.search_url, () => {
25    loadMaterialCount();
26  }, { immediate: true });
27  return { materialCount };
28}
29const _hoisted_1 = { class: "card-content" };
30const _hoisted_2 = { class: "image_wrapper" };
31const _hoisted_3 = ["src", "alt"];
32const _hoisted_4 = { class: "content-area" };
33const _hoisted_5 = { class: "truncate2" };
34const _hoisted_6 = { class: "collection-type" };
35const _hoisted_7 = {
36  key: 0,
37  class: "ml-2"
38};
39const _hoisted_8 = {
40  key: 1,
41  class: "ml-2"
42};
43const _hoisted_9 = { key: 0 };
44const _sfc_main = /* @__PURE__ */ defineComponent({
45  __name: "BundleCardContent",
46  props: {
47    bundle: {},
48    bustCache: { type: Boolean, default: false }
49  },
50  setup(__props) {
51    const { t } = useI18n({ inheritLocale: true, useScope: "local" });
52    const props = __props;
53    const showTooltip = ref(false);
54    const imageError = ref(false);
55    const title = computed(() => getBundleTitle(props.bundle));
56    const description = computed(() => getBundleDescription(props.bundle));
57    const { materialCount } = useBundleMaterialCount(props.bundle);
58    const handleImageError = () => {
59      imageError.value = true;
60    };
61    const onHover = (event) => {
62      const target = event.target;
63      showTooltip.value = target.scrollHeight > target.clientHeight;
64    };
65    return (_ctx, _cache) => {
66      const _component_v_img = resolveComponent("v-img");
67      const _component_v_card_title = resolveComponent("v-card-title");
68      const _component_v_tooltip = resolveComponent("v-tooltip");
69      const _component_v_card_text = resolveComponent("v-card-text");
70      const _component_v_progress_circular = resolveComponent("v-progress-circular");
71      return openBlock(), createElementBlock("div", _hoisted_1, [
72        createBaseVNode("div", _hoisted_2, [
73          _ctx.bundle.has_image && !imageError.value ? (openBlock(), createElementBlock("img", {
74            key: _ctx.bustCache ? `${_ctx.bundle.id}-${_ctx.bundle.has_image}-${Date.now()}` : void 0,
75            src: unref(getBundleImageUrl)(_ctx.bundle),
76            alt: title.value,
77            onError: handleImageError
78          }, null, 40, _hoisted_3)) : (openBlock(), createBlock(_component_v_img, {
79            key: 1,
80            src: "/src/assets/placeholder-no-border.svg",
81            width: 140,
82            height: 140
83          }))
84        ]),
85        createBaseVNode("div", _hoisted_4, [
86          createVNode(_component_v_tooltip, {
87            text: title.value,
88            disabled: !showTooltip.value,
89            location: "top"
90          }, {
91            activator: withCtx(({ props: p }) => [
92              createVNode(_component_v_card_title, mergeProps(p, { class: "pt-4 title-text" }), {
93                default: withCtx(() => [
94                  createBaseVNode("div", {
95                    class: "truncate3",
96                    onMouseover: _cache[0] || (_cache[0] = ($event) => onHover($event))
97                  }, toDisplayString(title.value), 33)
98                ]),
99                _: 2
100              }, 1040)
101            ]),
102            _: 1
103          }, 8, ["text", "disabled"]),
104          description.value ? (openBlock(), createBlock(_component_v_card_text, { key: 0 }, {
105            default: withCtx(() => [
106              createBaseVNode("div", _hoisted_5, toDisplayString(description.value), 1)
107            ]),
108            _: 1
109          })) : createCommentVNode("", true),
110          createVNode(_component_v_card_text, { class: "collection-info" }, {
111            default: withCtx(() => [
112              createBaseVNode("span", _hoisted_6, toDisplayString(unref(t)("collection", { type: unref(t)(_ctx.bundle.type) })), 1),
113              _ctx.bundle.type === "static" ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(_ctx.bundle.material_ids?.length || 0) + " " + toDisplayString(unref(t)("learning-materials")), 1)) : _ctx.bundle.type === "dynamic" && _ctx.bundle.search_url ? (openBlock(), createElementBlock("span", _hoisted_8, [
114                unref(materialCount) !== null ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(materialCount)) + " " + toDisplayString(unref(t)("learning-materials")), 1)) : (openBlock(), createBlock(_component_v_progress_circular, {
115                  key: 1,
116                  indeterminate: "",
117                  size: "16",
118                  width: "2",
119                  color: "green"
120                }))
121              ])) : createCommentVNode("", true)
122            ]),
123            _: 1
124          })
125        ])
126      ]);
127    };
128  }
129});
130function block0(Component) {
131  const _Component = Component;
132  _Component.__i18n = _Component.__i18n || [];
133  _Component.__i18n.push({
134    "locale": "",
135    "resource": {
136      "en-US": {
137        "learning-materials": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "materials" } },
138        "collection": { "t": 0, "b": { "t": 2, "i": [{ "t": 4, "k": "type" }, { "t": 3, "v": " collection" }] } },
139        "static": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "Static" } },
140        "dynamic": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "Dynamic" } }
141      },
142      "nl-NL": {
143        "learning-materials": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "leermaterialen" } },
144        "collection": { "t": 0, "b": { "t": 2, "i": [{ "t": 4, "k": "type" }, { "t": 3, "v": " collectie" }] } },
145        "static": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "Statische" } },
146        "dynamic": { "t": 0, "b": { "t": 2, "i": [{ "t": 3 }], "s": "Dynamische" } }
147      }
148    }
149  });
150}
151if (typeof block0 === "function") block0(_sfc_main);
152const BundleCardContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-26cbc3a4"]]);
153export {
154  BundleCardContent as B
155};
156//# sourceMappingURL=BundleCardContent-ByT6cllr.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.