@kaifronsdal/transcript-viewer
Version:
A web-based viewer for AI conversation transcripts with rollback support
102 lines (99 loc) • 3.44 kB
JavaScript
import { w as push, O as head, G as unsubscribe_stores, y as pop, F as store_get, J as getContext, I as escape_html } from './index-C8Be6c37.js';
import './client-DoQtN8lG.js';
import { t as transcriptViewSettings } from './stores-BsrhgqVf.js';
import '@sveltejs/kit/internal';
import './exports-Cv9LZeD1.js';
import './index2-CdK9_MHr.js';
const getStores = () => {
const stores$1 = getContext("__svelte__");
return {
/** @type {typeof page} */
page: {
subscribe: stores$1.page.subscribe
},
/** @type {typeof navigating} */
navigating: {
subscribe: stores$1.navigating.subscribe
},
/** @type {typeof updated} */
updated: stores$1.updated
};
};
const page = {
subscribe(fn) {
const store = getStores().page;
return store.subscribe(fn);
}
};
function _page($$payload, $$props) {
push();
var $$store_subs;
function parsePathParams() {
const path = store_get($$store_subs ??= {}, "$page", page).params.path;
if (!path) {
return { directoryPath: "", transcriptId: "" };
}
let pathParts;
if (Array.isArray(path)) {
pathParts = path;
} else if (typeof path === "string") {
pathParts = path.split("/").filter((segment) => segment.length > 0);
} else {
console.error("Unexpected path type:", typeof path, path);
return { directoryPath: "", transcriptId: "" };
}
if (pathParts.length === 0) {
return { directoryPath: "", transcriptId: "" };
}
const lastSegment = pathParts[pathParts.length - 1];
let transcriptId2;
try {
transcriptId2 = decodeURIComponent(lastSegment);
} catch (err) {
console.error("Error decoding transcript ID:", err);
transcriptId2 = lastSegment;
}
let directoryPath2 = "";
if (pathParts.length > 1) {
const directorySegments = pathParts.slice(0, -1);
try {
directoryPath2 = directorySegments.map((part) => decodeURIComponent(part)).join("/");
} catch (err) {
console.error("Error decoding directory path:", err);
directoryPath2 = directorySegments.join("/");
}
}
return { directoryPath: directoryPath2, transcriptId: transcriptId2 };
}
const { directoryPath, transcriptId } = parsePathParams();
let loading = true;
let error = null;
let pageTitle = "Loading Transcript - AWT Viewer";
(() => {
console.log("🔄 [DEBUG] Computing conversationColumns...");
console.log("📊 [DEBUG] Loading state:", loading);
console.log("❌ [DEBUG] Error state:", error);
console.log("📊 [DEBUG] Transcript available:", false);
console.log("⚙️ [DEBUG] View settings available:", !!transcriptViewSettings?.value);
{
console.log("⏳ [DEBUG] Still loading, returning empty array");
return [];
}
})();
head($$payload, ($$payload2) => {
$$payload2.title = `<title>${escape_html(pageTitle)}</title>`;
});
{
$$payload.out += "<!--[-->";
$$payload.out += `<div class="min-h-[50vh] flex items-center justify-center"><div class="text-center"><div class="loading loading-spinner loading-lg"></div> <p class="mt-4 text-base-content/70">Loading transcript...</p></div></div>`;
}
$$payload.out += `<!--]--> `;
{
$$payload.out += "<!--[!-->";
}
$$payload.out += `<!--]-->`;
if ($$store_subs) unsubscribe_stores($$store_subs);
pop();
}
export { _page as default };
//# sourceMappingURL=_page.svelte-CTG22FHe.js.map