@columnus/shared 0.1.51 → 0.1.54
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/apiProfile.js +1 -1
- package/dist/apiProfile.js.map +1 -1
- package/dist/betterAuthSession.d.ts +3 -1
- package/dist/betterAuthSession.js +10 -4
- package/dist/betterAuthSession.js.map +1 -1
- package/dist/bffProtocol.js +1 -1
- package/dist/bffProtocol.js.map +1 -1
- package/dist/ciPreviewEnv.js.map +1 -1
- package/dist/clipboardTransfer.js +121 -148
- package/dist/clipboardTransfer.js.map +1 -1
- package/dist/csv.js +121 -148
- package/dist/csv.js.map +1 -1
- package/dist/displayLabel.js +1 -1
- package/dist/displayLabel.js.map +1 -1
- package/dist/importMatch.js +121 -148
- package/dist/importMatch.js.map +1 -1
- package/dist/index.js +143 -153
- package/dist/index.js.map +1 -1
- package/dist/previewDeployName.d.ts +6 -0
- package/dist/previewDeployName.js +12 -1
- package/dist/previewDeployName.js.map +1 -1
- package/dist/queryMerge.js +1 -1
- package/dist/queryMerge.js.map +1 -1
- package/dist/queryPlan.js +1 -1
- package/dist/queryPlan.js.map +1 -1
- package/dist/queryStudio.js +1 -1
- package/dist/queryStudio.js.map +1 -1
- package/dist/queryTypes.js +1 -1
- package/dist/queryTypes.js.map +1 -1
- package/dist/recordTableColumns.js +1 -1
- package/dist/recordTableColumns.js.map +1 -1
- package/dist/recordTablePreload.js +1 -1
- package/dist/recordTablePreload.js.map +1 -1
- package/dist/refDisplayRequests.js +121 -148
- package/dist/refDisplayRequests.js.map +1 -1
- package/dist/richDoc.js +1 -1
- package/dist/richDoc.js.map +1 -1
- package/dist/schemaTypes.js +1 -1
- package/dist/schemaTypes.js.map +1 -1
- package/dist/share.js +1 -1
- package/dist/share.js.map +1 -1
- package/dist/shareApiBridge.js +1 -1
- package/dist/shareApiBridge.js.map +1 -1
- package/dist/shareProposal.js +1 -1
- package/dist/shareProposal.js.map +1 -1
- package/dist/spaceBundle.js +1 -1
- package/dist/spaceBundle.js.map +1 -1
- package/dist/storageFieldValues.js +1 -1
- package/dist/storageFieldValues.js.map +1 -1
- package/package.json +2 -2
package/dist/ciPreviewEnv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/previewDeployName.ts","../src/ciPreviewEnv.ts"],"names":[],"mappings":";AAOO,SAAS,sBAAA,CAAuB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAoB;AAC1F,EAAA,MAAM,GAAA,GAAM,GAAA,CAAI,YAAA,IAAgB,GAAA,CAAI,WAAA;AACpC,EAAA,IAAI,CAAC,KAAK,OAAO,IAAA;AACjB,EAAA,MAAM,IAAA,GAAO,GAAA,CAAI,OAAA,CAAQ,cAAA,EAAgB,EAAE,EAAE,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,IAAK,EAAA;AAC9D,EAAA,OAAO,IAAA,IAAQ,IAAA;AACjB;AAYA,IAAM,mBAAA,GAAsB,sBAAA;AAC5B,IAAM,kBAAA,GAAqB,sCAAA;AAGpB,SAAS,kBAAA,CAAmB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAoB;AACtF,EAAA,MAAM,IAAA,GAAO,uBAAuB,GAAG,CAAA;AACvC,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,QAAA,GAAW,kBAAA,CAAmB,IAAA,CAAK,IAAI,IAAI,CAAC,CAAA;AAClD,IAAA,IAAI,UAAU,OAAO,QAAA;AAAA,EACvB;AAEA,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,cAAA,IAAkB,GAAA,CAAI,UAAA;AACzC,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,MAAM,aAAa,mBAAA,CAAoB,IAAA,CAAK,qBAAqB,MAAM,CAAC,IAAI,CAAC,CAAA;AAC7E,IAAA,IAAI,YAAY,OAAO,UAAA;AAAA,EACzB;AAEA,EAAA,OAAO,IAAA;AACT;AA2BA,SAAS,qBAAqB,MAAA,E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E,EAAA,EAAI,KAAA,EAAO,OAAA,EAAQ;AAAA,EAC9B;AACF;AAEO,SAAS,mBAAmB,GAAA,EAAqB;AACtD,EAAA,OAAO,GAAA,CAAI,IAAA,EAAK,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AACtC;AAGO,SAAS,wBAAA,CAAyB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAyB;AACjG,EAAA,OAAO,IAAI,oBAAA,EAAsB,IAAA,MAAU,GAAA,CAAI,qBAAA,EAAuB,MAAK,IAAK,MAAA;AAClF","file":"ciPreviewEnv.js","sourcesContent":["/**\n * Sanitized Convex preview deployment name for CI / Coolify preview builds.\n * \"/\" breaks preview/<name> lookups in Convex deployment references.\n *\n * Coolify preview env vars: COOLIFY_BRANCH, COOLIFY_IS_PREVIEW, COOLIFY_FQDN,\n * COOLIFY_URL (BuildKit build secrets).\n */\nexport function coolifyHostnameFromEnv(env: NodeJS.ProcessEnv = process.env): string | null {\n const raw = env.COOLIFY_FQDN ?? env.COOLIFY_URL;\n if (!raw) return null;\n const host = raw.replace(/^https?:\\/\\//, \"\").split(\"/\")[0] ?? \"\";\n return host || null;\n}\n\n/** True when Coolify (or CI_PREVIEW) indicates a PR preview Docker build. */\nexport function isCiPreviewBuild(env: NodeJS.ProcessEnv = process.env): boolean {\n if (env.CI_PREVIEW === \"true\" || env.COOLIFY_IS_PREVIEW === \"true\") {\n return true;\n }\n const host = coolifyHostnameFromEnv(env);\n // preview-<pr>, manage-preview-<pr>, deploy-preview-<pr>\n return Boolean(host && /^(?:manage-|deploy-)?preview-\\d+\\./.test(host));\n}\n\nconst PULL_HEAD_BRANCH_RE = /^pull\\/(\\d+)\\/head$/i;\nconst PREVIEW_HOST_PR_RE = /^(?:manage-|deploy-)?preview-(\\d+)\\./;\n\n/** PR id from `preview-<n>.<domain>` / `manage-preview-<n>` hostname or `pull/<n>/head` branch. */\nexport function resolvePreviewPrId(env: NodeJS.ProcessEnv = process.env): string | null {\n const host = coolifyHostnameFromEnv(env);\n if (host) {\n const fromHost = PREVIEW_HOST_PR_RE.exec(host)?.[1];\n if (fromHost) return fromHost;\n }\n\n const branch = env.COOLIFY_BRANCH ?? env.GIT_BRANCH;\n if (branch) {\n const fromBranch = PULL_HEAD_BRANCH_RE.exec(stripQualifiedBranch(branch))?.[1];\n if (fromBranch) return fromBranch;\n }\n\n return null;\n}\n\n/**\n * Resolve the git branch used for Convex `--preview-name`.\n * Coolify often sets COOLIFY_BRANCH to `pull/<n>/head` at runtime (see coollabsio/coolify#9572).\n */\nexport function resolvePreviewBranch(env: NodeJS.ProcessEnv = process.env): string | null {\n if (env.GITHUB_HEAD_REF) return stripQualifiedBranch(env.GITHUB_HEAD_REF);\n\n const branch = env.COOLIFY_BRANCH ?? env.GIT_BRANCH;\n const prId = resolvePreviewPrId(env);\n if (!branch) {\n return prId ? `preview-${prId}` : null;\n }\n\n const stripped = stripQualifiedBranch(branch);\n if (PULL_HEAD_BRANCH_RE.test(stripped)) {\n if (prId) return `preview-${prId}`;\n }\n // Coolify PR apps often leave COOLIFY_BRANCH=main while FQDN is *-preview-<n>.\n if ((stripped === \"main\" || stripped === \"master\") && prId) {\n return `preview-${prId}`;\n }\n return stripped;\n}\n\n/** Strip Coolify/Convex qualified suffixes (e.g. `pull-48-head:pr-48-coolify`). */\nfunction stripQualifiedBranch(branch: string): string {\n const colon = branch.indexOf(\":\");\n return colon > 0 ? branch.slice(0, colon) : branch;\n}\n\nexport function sanitizePreviewDeployName(branch: string): string {\n return stripQualifiedBranch(branch).replace(/\\//g, \"-\");\n}\n\n/** Normalize a preview name from Convex env before `convex deploy --preview-name`. */\nexport function normalizePreviewDeployName(name: string): string {\n return sanitizePreviewDeployName(name.trim());\n}\n\nexport function ciPreviewDeployName(env: NodeJS.ProcessEnv = process.env): string | null {\n if (!isCiPreviewBuild(env)) return null;\n\n const branch = resolvePreviewBranch(env);\n if (!branch) return null;\n return sanitizePreviewDeployName(branch);\n}\n\n/** Stale failures from broken preview deploy before the bridge was live. */\nexport const STALE_ENDPOINT_DEPLOY_ERROR =\n /^deploy endpoint returned (?:200(?: OK)?|500(?: Internal Server Error)?)$/;\n\nexport function isStaleEndpointDeployError(error: string | undefined): boolean {\n return error != null && STALE_ENDPOINT_DEPLOY_ERROR.test(error);\n}\n\n/** Infra failures from a prior broken deploy that a fresh save can retry. */\nexport function isRecoverableDeployError(error: string | undefined): boolean {\n if (error == null) return false;\n if (isStaleEndpointDeployError(error)) return true;\n if (error.includes(\"502 Bad Gateway\")) return true;\n if (error.includes(\"deploy endpoint unreachable\")) return true;\n if (error.includes(\"deploy endpoint timed out\")) return true;\n return (\n error.includes(\"convex/bin/main.js\") ||\n error.includes(\"convex CLI (bin/main.js\") ||\n error.includes(\"convex CLI not available\")\n );\n}\n","import { resolvePreviewPrId } from \"./previewDeployName.ts\";\n\nconst GIT_SHA_RE = /^[0-9a-fA-F]{7,40}$/;\n\n/** Parse and validate a git commit SHA (7–40 hex chars). */\nexport function parseGitSha(raw: string | undefined, label = \"commit\"): string {\n const commit = (raw ?? \"\").trim();\n if (!commit || commit === \"unknown\" || !GIT_SHA_RE.test(commit)) {\n throw new Error(`${label} must be a git SHA (7–40 hex chars); got '${raw ?? \"\"}'`);\n }\n return commit;\n}\n\nexport function defaultProdDeployUrl(domain = \"columnus.app\"): string {\n return `https://deploy.${domain}/ops/v1/deploy-initial`;\n}\n\nfunction hostnameOf(url: string): string | null {\n try {\n const withScheme = /:\\/\\//.test(url) ? url : `http://${url}`;\n return new URL(withScheme).hostname;\n } catch {\n return null;\n }\n}\n\n/** True for local defaults that should not beat Coolify preview deploy URLs. */\nexport function isLoopbackDeployServiceUrl(url: string): boolean {\n const host = hostnameOf(url);\n return host === \"127.0.0.1\" || host === \"localhost\" || host === \"::1\";\n}\n\n/** Production shared deploy host (`deploy.columnus.app`), any path. */\nexport function isProdDeployServiceUrl(url: string, domain = \"columnus.app\"): boolean {\n return hostnameOf(url) === `deploy.${domain}`;\n}\n\n/**\n * When on a PR preview host, return the per-PR deploy-service URL unless env already\n * points at a non-production executor (deploy-preview or Coolify internal).\n *\n * Coolify often copies production `STUDIO_DEPLOY_URL=https://deploy.columnus.app/deploy`\n * onto preview apps — that must not win over `deploy-preview-<pr>`.\n */\nexport function derivePreviewStudioDeployUrl(\n env: NodeJS.ProcessEnv = process.env,\n domain = \"columnus.app\",\n): string | null {\n const prId = resolvePreviewPrId(env);\n if (!prId) return null;\n\n for (const key of [\"COLUMNUS_DEPLOY_SERVICE_URL\", \"STUDIO_DEPLOY_URL\"] as const) {\n const current = env[key]?.trim();\n if (!current) continue;\n if (isLoopbackDeployServiceUrl(current) || isProdDeployServiceUrl(current, domain)) {\n continue;\n }\n // Explicit non-prod URL (deploy-preview / Coolify internal) — leave alone.\n return null;\n }\n\n return `https://deploy-preview-${prId}.${domain}/ops/v1/deploy-initial`;\n}\n\nconst LOCAL_DEPLOY_SERVICE_DEFAULT = \"http://127.0.0.1:8787\";\n\n/**\n * Runtime deploy-service URL for Web BFF / container entrypoint.\n *\n * Prefer preview-derived `deploy-preview-<pr>`, else non-loopback `COLUMNUS_DEPLOY_SERVICE_URL`,\n * else `STUDIO_DEPLOY_URL`, else loopback COLUMNUS, else local default.\n *\n * Callers that need an origin (no path) should normalize with deploy-service helpers.\n */\nexport function resolveRuntimeDeployServiceUrl(\n env: NodeJS.ProcessEnv = process.env,\n domain = \"columnus.app\",\n): string {\n const derived = derivePreviewStudioDeployUrl(env, domain);\n if (derived) return derived;\n\n const columnus = env.COLUMNUS_DEPLOY_SERVICE_URL?.trim();\n const studio = env.STUDIO_DEPLOY_URL?.trim();\n if (columnus && !isLoopbackDeployServiceUrl(columnus)) return columnus;\n if (studio) return studio;\n if (columnus) return columnus;\n return LOCAL_DEPLOY_SERVICE_DEFAULT;\n}\n\n/** Coolify internal URL for columnus-deploy preview container (build-time manifest sync). */\nexport function derivePreviewDeployBuildUrl(env: NodeJS.ProcessEnv = process.env): string | null {\n const prId = resolvePreviewPrId(env);\n if (!prId) return null;\n\n let uuid = env.COLUMNUS_DEPLOY_RESOURCE_UUID?.trim() ?? \"\";\n uuid = uuid.replace(/^https?:\\/\\//, \"\");\n uuid = uuid.split(\"/\")[0] ?? \"\";\n uuid = uuid.split(\"-pr-\")[0] ?? uuid;\n uuid = uuid.split(\":\")[0] ?? uuid;\n if (!uuid) return null;\n\n const port = env.COLUMNUS_DEPLOY_PREVIEW_PORT?.trim() || \"3000\";\n return `http://${uuid}-pr-${prId}:${port}/ops/v1/deploy-initial`;\n}\n\nexport type ResolveSyncDeployUrlResult =\n | { ok: true; url: string; derivedMessage?: string }\n | { ok: false; message: string };\n\n/** URL for `sync-manifest-deploy` during Docker/CI builds. */\nexport function resolveSyncDeployUrl(\n env: NodeJS.ProcessEnv,\n studioDeployUrl: string,\n isPreviewBuild: boolean,\n): ResolveSyncDeployUrlResult {\n const explicit = env.STUDIO_DEPLOY_BUILD_URL?.trim();\n if (explicit) {\n return { ok: true, url: explicit };\n }\n\n if (env.CI_PREVIEW === \"true\") {\n return { ok: true, url: \"http://127.0.0.1:8787/ops/v1/deploy-initial\" };\n }\n\n if (isPreviewBuild) {\n const derived = derivePreviewDeployBuildUrl(env);\n if (derived) {\n return {\n ok: true,\n url: derived,\n derivedMessage: `derived STUDIO_DEPLOY_BUILD_URL=${derived} (from COLUMNUS_DEPLOY_RESOURCE_UUID + PR id)`,\n };\n }\n return {\n ok: false,\n message:\n \"Set COLUMNUS_DEPLOY_RESOURCE_UUID on columnus-web preview (columnus-deploy Coolify resource UUID) or STUDIO_DEPLOY_BUILD_URL explicitly. See plans/done/021-preview-deploy-service.md\",\n };\n }\n\n return { ok: true, url: studioDeployUrl };\n}\n\nexport type PreviewSourceCommitResult =\n | { ok: true; commit: string; required: boolean }\n | { ok: false; message: string };\n\n/** Validates SOURCE_COMMIT for Coolify preview builds (skipped when CI_PREVIEW=true). */\nexport function validatePreviewSourceCommit(\n env: NodeJS.ProcessEnv = process.env,\n): PreviewSourceCommitResult {\n if (env.CI_PREVIEW === \"true\") {\n return { ok: true, commit: env.SOURCE_COMMIT?.trim() ?? \"\", required: false };\n }\n\n const raw = env.SOURCE_COMMIT ?? \"\";\n try {\n const commit = parseGitSha(raw, \"SOURCE_COMMIT\");\n return { ok: true, commit, required: true };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (!raw.trim() || raw.trim() === \"unknown\") {\n return {\n ok: false,\n message: `SOURCE_COMMIT is required for Coolify preview builds (got '${raw}'). Enable Advanced → Include Source Commit in Build on both columnus-web and columnus-deploy.`,\n };\n }\n return { ok: false, message };\n }\n}\n\nexport function normalizeConvexUrl(url: string): string {\n return url.trim().replace(/\\/+$/, \"\");\n}\n\n/** DOCS_SEED_SYNC_EMAIL with PLAYWRIGHT_TEST_EMAIL fallback (Coolify / entrypoint). */\nexport function docsSeedSyncEmailFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n return env.DOCS_SEED_SYNC_EMAIL?.trim() || env.PLAYWRIGHT_TEST_EMAIL?.trim() || undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/previewDeployName.ts","../src/ciPreviewEnv.ts"],"names":[],"mappings":";AAOO,SAAS,sBAAA,CAAuB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAoB;AAC1F,EAAA,MAAM,GAAA,GAAM,GAAA,CAAI,YAAA,IAAgB,GAAA,CAAI,WAAA;AACpC,EAAA,IAAI,CAAC,KAAK,OAAO,IAAA;AACjB,EAAA,MAAM,IAAA,GAAO,GAAA,CAAI,OAAA,CAAQ,cAAA,EAAgB,EAAE,EAAE,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,IAAK,EAAA;AAC9D,EAAA,OAAO,IAAA,IAAQ,IAAA;AACjB;AA+BA,IAAM,mBAAA,GAAsB,sBAAA;AAC5B,IAAM,kBAAA,GAAqB,sCAAA;AAGpB,SAAS,kBAAA,CAAmB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAoB;AACtF,EAAA,MAAM,IA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,MAAM,MAAA,GAAS,WAAA,CAAY,GAAA,EAAK,eAAe,CAAA;AAC/C,IAAA,OAAO,EAAE,EAAA,EAAI,IAAA,EAAM,MAAA,EAAQ,UAAU,IAAA,EAAK;AAAA,EAC5C,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,IAAA,IAAI,CAAC,GAAA,CAAI,IAAA,MAAU,GAAA,CAAI,IAAA,OAAW,SAAA,EAAW;AAC3C,MAAA,OAAO;AAAA,QACL,EAAA,EAAI,KAAA;AAAA,QACJ,OAAA,EAAS,8DAA8D,GAAG,CAAA,mGAAA;AAAA,OAC5E;AAAA,IACF;AACA,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,OAAA,EAAQ;AAAA,EAC9B;AACF;AAEO,SAAS,mBAAmB,GAAA,EAAqB;AACtD,EAAA,OAAO,GAAA,CAAI,IAAA,EAAK,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AACtC;AAGO,SAAS,wBAAA,CAAyB,GAAA,GAAyB,OAAA,CAAQ,GAAA,EAAyB;AACjG,EAAA,OAAO,IAAI,oBAAA,EAAsB,IAAA,MAAU,GAAA,CAAI,qBAAA,EAAuB,MAAK,IAAK,MAAA;AAClF","file":"ciPreviewEnv.js","sourcesContent":["/**\n * Sanitized Convex preview deployment name for CI / Coolify preview builds.\n * \"/\" breaks preview/<name> lookups in Convex deployment references.\n *\n * Coolify preview env vars: COOLIFY_BRANCH, COOLIFY_IS_PREVIEW, COOLIFY_FQDN,\n * COOLIFY_URL (BuildKit build secrets).\n */\nexport function coolifyHostnameFromEnv(env: NodeJS.ProcessEnv = process.env): string | null {\n const raw = env.COOLIFY_FQDN ?? env.COOLIFY_URL;\n if (!raw) return null;\n const host = raw.replace(/^https?:\\/\\//, \"\").split(\"/\")[0] ?? \"\";\n return host || null;\n}\n\n/**\n * Browser origin Better Auth expects on server-side OTP probes.\n * Preview configure sets SITE_URL to `https://<coolify-host>`; Origin must match.\n * Coolify often injects `COOLIFY_URL=http://…` — do not use that scheme.\n */\nexport function resolveTrustedAuthOrigin(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const explicit = env.COLUMNUS_AUTH_ORIGIN?.trim();\n if (explicit) return explicit.replace(/\\/$/, \"\");\n\n const host = coolifyHostnameFromEnv(env);\n if (host) return `https://${host}`;\n\n const siteUrl = env.SITE_URL?.trim();\n if (siteUrl && !/\\.convex\\.site(?:\\/|$)/i.test(siteUrl)) {\n return siteUrl.replace(/\\/$/, \"\");\n }\n return undefined;\n}\n\n/** True when Coolify (or CI_PREVIEW) indicates a PR preview Docker build. */\nexport function isCiPreviewBuild(env: NodeJS.ProcessEnv = process.env): boolean {\n if (env.CI_PREVIEW === \"true\" || env.COOLIFY_IS_PREVIEW === \"true\") {\n return true;\n }\n const host = coolifyHostnameFromEnv(env);\n // preview-<pr>, manage-preview-<pr>, deploy-preview-<pr>\n return Boolean(host && /^(?:manage-|deploy-)?preview-\\d+\\./.test(host));\n}\n\nconst PULL_HEAD_BRANCH_RE = /^pull\\/(\\d+)\\/head$/i;\nconst PREVIEW_HOST_PR_RE = /^(?:manage-|deploy-)?preview-(\\d+)\\./;\n\n/** PR id from `preview-<n>.<domain>` / `manage-preview-<n>` hostname or `pull/<n>/head` branch. */\nexport function resolvePreviewPrId(env: NodeJS.ProcessEnv = process.env): string | null {\n const host = coolifyHostnameFromEnv(env);\n if (host) {\n const fromHost = PREVIEW_HOST_PR_RE.exec(host)?.[1];\n if (fromHost) return fromHost;\n }\n\n const branch = env.COOLIFY_BRANCH ?? env.GIT_BRANCH;\n if (branch) {\n const fromBranch = PULL_HEAD_BRANCH_RE.exec(stripQualifiedBranch(branch))?.[1];\n if (fromBranch) return fromBranch;\n }\n\n return null;\n}\n\n/**\n * Resolve the git branch used for Convex `--preview-name`.\n * Coolify often sets COOLIFY_BRANCH to `pull/<n>/head` at runtime (see coollabsio/coolify#9572).\n */\nexport function resolvePreviewBranch(env: NodeJS.ProcessEnv = process.env): string | null {\n if (env.GITHUB_HEAD_REF) return stripQualifiedBranch(env.GITHUB_HEAD_REF);\n\n const branch = env.COOLIFY_BRANCH ?? env.GIT_BRANCH;\n const prId = resolvePreviewPrId(env);\n if (!branch) {\n return prId ? `preview-${prId}` : null;\n }\n\n const stripped = stripQualifiedBranch(branch);\n if (PULL_HEAD_BRANCH_RE.test(stripped)) {\n if (prId) return `preview-${prId}`;\n }\n // Coolify PR apps often leave COOLIFY_BRANCH=main while FQDN is *-preview-<n>.\n if ((stripped === \"main\" || stripped === \"master\") && prId) {\n return `preview-${prId}`;\n }\n return stripped;\n}\n\n/** Strip Coolify/Convex qualified suffixes (e.g. `pull-48-head:pr-48-coolify`). */\nfunction stripQualifiedBranch(branch: string): string {\n const colon = branch.indexOf(\":\");\n return colon > 0 ? branch.slice(0, colon) : branch;\n}\n\nexport function sanitizePreviewDeployName(branch: string): string {\n return stripQualifiedBranch(branch).replace(/\\//g, \"-\");\n}\n\n/** Normalize a preview name from Convex env before `convex deploy --preview-name`. */\nexport function normalizePreviewDeployName(name: string): string {\n return sanitizePreviewDeployName(name.trim());\n}\n\nexport function ciPreviewDeployName(env: NodeJS.ProcessEnv = process.env): string | null {\n if (!isCiPreviewBuild(env)) return null;\n\n const branch = resolvePreviewBranch(env);\n if (!branch) return null;\n return sanitizePreviewDeployName(branch);\n}\n\n/** Stale failures from broken preview deploy before the bridge was live. */\nexport const STALE_ENDPOINT_DEPLOY_ERROR =\n /^deploy endpoint returned (?:200(?: OK)?|500(?: Internal Server Error)?)$/;\n\nexport function isStaleEndpointDeployError(error: string | undefined): boolean {\n return error != null && STALE_ENDPOINT_DEPLOY_ERROR.test(error);\n}\n\n/** Infra failures from a prior broken deploy that a fresh save can retry. */\nexport function isRecoverableDeployError(error: string | undefined): boolean {\n if (error == null) return false;\n if (isStaleEndpointDeployError(error)) return true;\n if (error.includes(\"502 Bad Gateway\")) return true;\n if (error.includes(\"deploy endpoint unreachable\")) return true;\n if (error.includes(\"deploy endpoint timed out\")) return true;\n return (\n error.includes(\"convex/bin/main.js\") ||\n error.includes(\"convex CLI (bin/main.js\") ||\n error.includes(\"convex CLI not available\")\n );\n}\n","import { resolvePreviewPrId } from \"./previewDeployName.ts\";\n\nconst GIT_SHA_RE = /^[0-9a-fA-F]{7,40}$/;\n\n/** Parse and validate a git commit SHA (7–40 hex chars). */\nexport function parseGitSha(raw: string | undefined, label = \"commit\"): string {\n const commit = (raw ?? \"\").trim();\n if (!commit || commit === \"unknown\" || !GIT_SHA_RE.test(commit)) {\n throw new Error(`${label} must be a git SHA (7–40 hex chars); got '${raw ?? \"\"}'`);\n }\n return commit;\n}\n\nexport function defaultProdDeployUrl(domain = \"columnus.app\"): string {\n return `https://deploy.${domain}/ops/v1/deploy-initial`;\n}\n\nfunction hostnameOf(url: string): string | null {\n try {\n const withScheme = /:\\/\\//.test(url) ? url : `http://${url}`;\n return new URL(withScheme).hostname;\n } catch {\n return null;\n }\n}\n\n/** True for local defaults that should not beat Coolify preview deploy URLs. */\nexport function isLoopbackDeployServiceUrl(url: string): boolean {\n const host = hostnameOf(url);\n return host === \"127.0.0.1\" || host === \"localhost\" || host === \"::1\";\n}\n\n/** Production shared deploy host (`deploy.columnus.app`), any path. */\nexport function isProdDeployServiceUrl(url: string, domain = \"columnus.app\"): boolean {\n return hostnameOf(url) === `deploy.${domain}`;\n}\n\n/**\n * When on a PR preview host, return the per-PR deploy-service URL unless env already\n * points at a non-production executor (deploy-preview or Coolify internal).\n *\n * Coolify often copies production `STUDIO_DEPLOY_URL=https://deploy.columnus.app/deploy`\n * onto preview apps — that must not win over `deploy-preview-<pr>`.\n */\nexport function derivePreviewStudioDeployUrl(\n env: NodeJS.ProcessEnv = process.env,\n domain = \"columnus.app\",\n): string | null {\n const prId = resolvePreviewPrId(env);\n if (!prId) return null;\n\n for (const key of [\"COLUMNUS_DEPLOY_SERVICE_URL\", \"STUDIO_DEPLOY_URL\"] as const) {\n const current = env[key]?.trim();\n if (!current) continue;\n if (isLoopbackDeployServiceUrl(current) || isProdDeployServiceUrl(current, domain)) {\n continue;\n }\n // Explicit non-prod URL (deploy-preview / Coolify internal) — leave alone.\n return null;\n }\n\n return `https://deploy-preview-${prId}.${domain}/ops/v1/deploy-initial`;\n}\n\nconst LOCAL_DEPLOY_SERVICE_DEFAULT = \"http://127.0.0.1:8787\";\n\n/**\n * Runtime deploy-service URL for Web BFF / container entrypoint.\n *\n * Prefer preview-derived `deploy-preview-<pr>`, else non-loopback `COLUMNUS_DEPLOY_SERVICE_URL`,\n * else `STUDIO_DEPLOY_URL`, else loopback COLUMNUS, else local default.\n *\n * Callers that need an origin (no path) should normalize with deploy-service helpers.\n */\nexport function resolveRuntimeDeployServiceUrl(\n env: NodeJS.ProcessEnv = process.env,\n domain = \"columnus.app\",\n): string {\n const derived = derivePreviewStudioDeployUrl(env, domain);\n if (derived) return derived;\n\n const columnus = env.COLUMNUS_DEPLOY_SERVICE_URL?.trim();\n const studio = env.STUDIO_DEPLOY_URL?.trim();\n if (columnus && !isLoopbackDeployServiceUrl(columnus)) return columnus;\n if (studio) return studio;\n if (columnus) return columnus;\n return LOCAL_DEPLOY_SERVICE_DEFAULT;\n}\n\n/** Coolify internal URL for columnus-deploy preview container (build-time manifest sync). */\nexport function derivePreviewDeployBuildUrl(env: NodeJS.ProcessEnv = process.env): string | null {\n const prId = resolvePreviewPrId(env);\n if (!prId) return null;\n\n let uuid = env.COLUMNUS_DEPLOY_RESOURCE_UUID?.trim() ?? \"\";\n uuid = uuid.replace(/^https?:\\/\\//, \"\");\n uuid = uuid.split(\"/\")[0] ?? \"\";\n uuid = uuid.split(\"-pr-\")[0] ?? uuid;\n uuid = uuid.split(\":\")[0] ?? uuid;\n if (!uuid) return null;\n\n const port = env.COLUMNUS_DEPLOY_PREVIEW_PORT?.trim() || \"3000\";\n return `http://${uuid}-pr-${prId}:${port}/ops/v1/deploy-initial`;\n}\n\nexport type ResolveSyncDeployUrlResult =\n | { ok: true; url: string; derivedMessage?: string }\n | { ok: false; message: string };\n\n/** URL for `sync-manifest-deploy` during Docker/CI builds. */\nexport function resolveSyncDeployUrl(\n env: NodeJS.ProcessEnv,\n studioDeployUrl: string,\n isPreviewBuild: boolean,\n): ResolveSyncDeployUrlResult {\n const explicit = env.STUDIO_DEPLOY_BUILD_URL?.trim();\n if (explicit) {\n return { ok: true, url: explicit };\n }\n\n if (env.CI_PREVIEW === \"true\") {\n return { ok: true, url: \"http://127.0.0.1:8787/ops/v1/deploy-initial\" };\n }\n\n if (isPreviewBuild) {\n const derived = derivePreviewDeployBuildUrl(env);\n if (derived) {\n return {\n ok: true,\n url: derived,\n derivedMessage: `derived STUDIO_DEPLOY_BUILD_URL=${derived} (from COLUMNUS_DEPLOY_RESOURCE_UUID + PR id)`,\n };\n }\n return {\n ok: false,\n message:\n \"Set COLUMNUS_DEPLOY_RESOURCE_UUID on columnus-web preview (columnus-deploy Coolify resource UUID) or STUDIO_DEPLOY_BUILD_URL explicitly. See plans/done/021-preview-deploy-service.md\",\n };\n }\n\n return { ok: true, url: studioDeployUrl };\n}\n\nexport type PreviewSourceCommitResult =\n | { ok: true; commit: string; required: boolean }\n | { ok: false; message: string };\n\n/** Validates SOURCE_COMMIT for Coolify preview builds (skipped when CI_PREVIEW=true). */\nexport function validatePreviewSourceCommit(\n env: NodeJS.ProcessEnv = process.env,\n): PreviewSourceCommitResult {\n if (env.CI_PREVIEW === \"true\") {\n return { ok: true, commit: env.SOURCE_COMMIT?.trim() ?? \"\", required: false };\n }\n\n const raw = env.SOURCE_COMMIT ?? \"\";\n try {\n const commit = parseGitSha(raw, \"SOURCE_COMMIT\");\n return { ok: true, commit, required: true };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (!raw.trim() || raw.trim() === \"unknown\") {\n return {\n ok: false,\n message: `SOURCE_COMMIT is required for Coolify preview builds (got '${raw}'). Enable Advanced → Include Source Commit in Build on both columnus-web and columnus-deploy.`,\n };\n }\n return { ok: false, message };\n }\n}\n\nexport function normalizeConvexUrl(url: string): string {\n return url.trim().replace(/\\/+$/, \"\");\n}\n\n/** DOCS_SEED_SYNC_EMAIL with PLAYWRIGHT_TEST_EMAIL fallback (Coolify / entrypoint). */\nexport function docsSeedSyncEmailFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n return env.DOCS_SEED_SYNC_EMAIL?.trim() || env.PLAYWRIGHT_TEST_EMAIL?.trim() || undefined;\n}\n"]}
|
|
@@ -35,7 +35,7 @@ var require_papaparse_min = __commonJS({
|
|
|
35
35
|
"function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
|
|
36
36
|
})(exports, function r() {
|
|
37
37
|
var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
|
|
38
|
-
var
|
|
38
|
+
var s = !n.document && !!n.postMessage, a = n.IS_PAPA_WORKER || false, o = {}, h = 0, w = {};
|
|
39
39
|
function P(e) {
|
|
40
40
|
return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
|
|
41
41
|
}
|
|
@@ -50,25 +50,25 @@ var require_papaparse_min = __commonJS({
|
|
|
50
50
|
let e3 = this._config.newline;
|
|
51
51
|
e3 || (r2 = this._config.quoteChar || '"', e3 = this._handle.guessLineEndings(t, r2)), t = [...t.split(e3).slice(i2)].join(e3);
|
|
52
52
|
}
|
|
53
|
-
this.isFirstChunk &&
|
|
53
|
+
this.isFirstChunk && U(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t)) && (t = r2), this.isFirstChunk = false, this._halted = false;
|
|
54
54
|
var i2 = this._partialLine + t, r2 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
|
|
55
55
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
56
56
|
t = r2.meta.cursor, i2 = (this._finished || (this._partialLine = i2.substring(t - this._baseIndex), this._baseIndex = t), r2 && r2.data && (this._rowCount += r2.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
|
|
57
|
-
if (a) n.postMessage({ results: r2, workerId:
|
|
58
|
-
else if (
|
|
57
|
+
if (a) n.postMessage({ results: r2, workerId: w.WORKER_ID, finished: i2 });
|
|
58
|
+
else if (U(this._config.chunk) && !e2) {
|
|
59
59
|
if (this._config.chunk(r2, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
|
|
60
60
|
this._completeResults = r2 = void 0;
|
|
61
61
|
}
|
|
62
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !
|
|
62
|
+
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !U(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
|
|
63
63
|
}
|
|
64
64
|
this._halted = true;
|
|
65
65
|
}, this._sendError = function(e2) {
|
|
66
|
-
|
|
66
|
+
U(this._config.error) ? this._config.error(e2) : a && this._config.error && n.postMessage({ workerId: w.WORKER_ID, error: e2, finished: false });
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function d(e) {
|
|
70
70
|
var r2;
|
|
71
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
71
|
+
(e = e || {}).chunkSize || (e.chunkSize = w.RemoteChunkSize), u.call(this, e), this._nextChunk = s ? function() {
|
|
72
72
|
this._readChunk(), this._chunkLoaded();
|
|
73
73
|
} : function() {
|
|
74
74
|
this._readChunk();
|
|
@@ -77,7 +77,7 @@ var require_papaparse_min = __commonJS({
|
|
|
77
77
|
}, this._readChunk = function() {
|
|
78
78
|
if (this._finished) this._chunkLoaded();
|
|
79
79
|
else {
|
|
80
|
-
if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s || (r2.onload =
|
|
80
|
+
if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s || (r2.onload = m(this._chunkLoaded, this), r2.onerror = m(this._chunkError, this)), r2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s), this._config.downloadRequestHeaders) {
|
|
81
81
|
var e2, t = this._config.downloadRequestHeaders;
|
|
82
82
|
for (e2 in t) r2.setRequestHeader(e2, t[e2]);
|
|
83
83
|
}
|
|
@@ -98,10 +98,10 @@ var require_papaparse_min = __commonJS({
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
function l(e) {
|
|
101
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
101
|
+
(e = e || {}).chunkSize || (e.chunkSize = w.LocalChunkSize), u.call(this, e);
|
|
102
102
|
var i2, r2, n2 = "undefined" != typeof FileReader;
|
|
103
103
|
this.stream = function(e2) {
|
|
104
|
-
this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload =
|
|
104
|
+
this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = m(this._chunkLoaded, this), i2.onerror = m(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
|
|
105
105
|
}, this._nextChunk = function() {
|
|
106
106
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
107
107
|
}, this._readChunk = function() {
|
|
@@ -113,7 +113,7 @@ var require_papaparse_min = __commonJS({
|
|
|
113
113
|
this._sendError(i2.error);
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function f(e) {
|
|
117
117
|
var i2;
|
|
118
118
|
u.call(this, e = e || {}), this.stream = function(e2) {
|
|
119
119
|
return i2 = e2, this._nextChunk();
|
|
@@ -122,7 +122,7 @@ var require_papaparse_min = __commonJS({
|
|
|
122
122
|
if (!this._finished) return e2 = this._config.chunkSize, i2 = e2 ? (t = i2.substring(0, e2), i2.substring(e2)) : (t = i2, ""), this._finished = !i2, this.parseChunk(t);
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function c(e) {
|
|
126
126
|
u.call(this, e = e || {});
|
|
127
127
|
var t = [], i2 = true, r2 = false;
|
|
128
128
|
this.pause = function() {
|
|
@@ -135,34 +135,34 @@ var require_papaparse_min = __commonJS({
|
|
|
135
135
|
r2 && 1 === t.length && (this._finished = true);
|
|
136
136
|
}, this._nextChunk = function() {
|
|
137
137
|
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : i2 = true;
|
|
138
|
-
}, this._streamData =
|
|
138
|
+
}, this._streamData = m(function(e2) {
|
|
139
139
|
try {
|
|
140
140
|
t.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), i2 && (i2 = false, this._checkIsFinished(), this.parseChunk(t.shift()));
|
|
141
141
|
} catch (e3) {
|
|
142
142
|
this._streamError(e3);
|
|
143
143
|
}
|
|
144
|
-
}, this), this._streamError =
|
|
144
|
+
}, this), this._streamError = m(function(e2) {
|
|
145
145
|
this._streamCleanUp(), this._sendError(e2);
|
|
146
|
-
}, this), this._streamEnd =
|
|
146
|
+
}, this), this._streamEnd = m(function() {
|
|
147
147
|
this._streamCleanUp(), r2 = true, this._streamData("");
|
|
148
|
-
}, this), this._streamCleanUp =
|
|
148
|
+
}, this), this._streamCleanUp = m(function() {
|
|
149
149
|
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
150
150
|
}, this);
|
|
151
151
|
}
|
|
152
152
|
function i(m2) {
|
|
153
|
-
var n2, s2, a2, t, o2 = Math.pow(2, 53), h2 = -o2, u2 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d2 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i2 = this, r2 = 0,
|
|
154
|
-
function
|
|
153
|
+
var n2, s2, a2, t, o2 = Math.pow(2, 53), h2 = -o2, u2 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d2 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i2 = this, r2 = 0, l2 = 0, f2 = false, e = false, c2 = [], p2 = { data: [], errors: [], meta: {} };
|
|
154
|
+
function y(e2) {
|
|
155
155
|
return "greedy" === m2.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
if (p2 && a2 && (k("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" +
|
|
159
|
-
return !
|
|
160
|
-
})),
|
|
157
|
+
function _2() {
|
|
158
|
+
if (p2 && a2 && (k("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + w.DefaultDelimiter + "'"), a2 = false), m2.skipEmptyLines && (p2.data = p2.data.filter(function(e3) {
|
|
159
|
+
return !y(e3);
|
|
160
|
+
})), g2()) {
|
|
161
161
|
let t3 = function(e3, t4) {
|
|
162
|
-
e3 = P(e3),
|
|
162
|
+
e3 = P(e3), U(m2.transformHeader) && (e3 = m2.transformHeader(e3, t4)), c2.push(e3);
|
|
163
163
|
};
|
|
164
164
|
if (p2) if (Array.isArray(p2.data[0])) {
|
|
165
|
-
for (var e2 = 0;
|
|
165
|
+
for (var e2 = 0; g2() && e2 < p2.data.length; e2++) p2.data[e2].forEach(t3);
|
|
166
166
|
p2.data.splice(0, 1);
|
|
167
167
|
} else p2.data.forEach(t3);
|
|
168
168
|
}
|
|
@@ -176,124 +176,124 @@ var require_papaparse_min = __commonJS({
|
|
|
176
176
|
})(t4) ? parseFloat(t4) : d2.test(t4) ? new Date(t4) : "" === t4 ? null : t4) : t4)(n3 = m2.header ? r4 >= c2.length ? "__parsed_extra" : c2[r4] : n3, s3 = m2.transform ? m2.transform(s3, n3) : s3);
|
|
177
177
|
"__parsed_extra" === n3 ? (i4[n3] = i4[n3] || [], i4[n3].push(s3)) : i4[n3] = s3;
|
|
178
178
|
}
|
|
179
|
-
return m2.header && (r4 > c2.length ? k("FieldMismatch", "TooManyFields", "Too many fields: expected " + c2.length + " fields but parsed " + r4,
|
|
179
|
+
return m2.header && (r4 > c2.length ? k("FieldMismatch", "TooManyFields", "Too many fields: expected " + c2.length + " fields but parsed " + r4, l2 + t3) : r4 < c2.length && k("FieldMismatch", "TooFewFields", "Too few fields: expected " + c2.length + " fields but parsed " + r4, l2 + t3)), i4;
|
|
180
180
|
}
|
|
181
181
|
var r3;
|
|
182
|
-
p2 && (m2.header || m2.dynamicTyping || m2.transform) && (r3 = 1, !p2.data.length || Array.isArray(p2.data[0]) ? (p2.data = p2.data.map(i3), r3 = p2.data.length) : p2.data = i3(p2.data, 0), m2.header && p2.meta && (p2.meta.fields = c2),
|
|
182
|
+
p2 && (m2.header || m2.dynamicTyping || m2.transform) && (r3 = 1, !p2.data.length || Array.isArray(p2.data[0]) ? (p2.data = p2.data.map(i3), r3 = p2.data.length) : p2.data = i3(p2.data, 0), m2.header && p2.meta && (p2.meta.fields = c2), l2 += r3);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function g2() {
|
|
185
185
|
return m2.header && 0 === c2.length;
|
|
186
186
|
}
|
|
187
187
|
function k(e2, t2, i3, r3) {
|
|
188
188
|
e2 = { type: e2, code: t2, message: i3 };
|
|
189
189
|
void 0 !== r3 && (e2.row = r3), p2.errors.push(e2);
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
p2 = e2,
|
|
191
|
+
U(m2.step) && (t = m2.step, m2.step = function(e2) {
|
|
192
|
+
p2 = e2, g2() ? _2() : (_2(), 0 !== p2.data.length && (r2 += e2.data.length, m2.preview && r2 > m2.preview ? s2.abort() : (p2.data = p2.data[0], t(p2, i2))));
|
|
193
193
|
}), this.parse = function(e2, t2, i3) {
|
|
194
|
-
var r3 = m2.quoteChar || '"', r3 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r3)), a2 = false, m2.delimiter ?
|
|
194
|
+
var r3 = m2.quoteChar || '"', r3 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r3)), a2 = false, m2.delimiter ? U(m2.delimiter) && (m2.delimiter = m2.delimiter(e2), p2.meta.delimiter = m2.delimiter) : ((r3 = ((e3, t3, i4, r4, n3) => {
|
|
195
195
|
var s3, a3, o3, h3;
|
|
196
|
-
n3 = n3 || [",", " ", "|", ";",
|
|
196
|
+
n3 = n3 || [",", " ", "|", ";", w.RECORD_SEP, w.UNIT_SEP];
|
|
197
197
|
for (var u3 = 0; u3 < n3.length; u3++) {
|
|
198
|
-
for (var d3,
|
|
199
|
-
0 <
|
|
198
|
+
for (var d3, l3 = n3[u3], f3 = 0, c3 = 0, p3 = 0, _3 = (o3 = void 0, new E({ comments: r4, delimiter: l3, newline: t3, preview: 10 }).parse(e3)), g3 = 0; g3 < _3.data.length; g3++) i4 && y(_3.data[g3]) ? p3++ : (d3 = _3.data[g3].length, c3 += d3, void 0 === o3 ? o3 = d3 : 0 < d3 && (f3 += Math.abs(d3 - o3), o3 = d3));
|
|
199
|
+
0 < _3.data.length && (c3 /= _3.data.length - p3), 1.99 < c3 && (void 0 === a3 || f3 < a3 || f3 === a3 && h3 < c3) && (a3 = f3, s3 = l3, h3 = c3);
|
|
200
200
|
}
|
|
201
201
|
return { successful: !!(m2.delimiter = s3), bestDelimiter: s3 };
|
|
202
|
-
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r3.bestDelimiter : (a2 = true, m2.delimiter =
|
|
203
|
-
return m2.preview && m2.header && r3.preview++, n2 = e2, s2 = new E(r3), p2 = s2.parse(n2, t2, i3),
|
|
202
|
+
})(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r3.bestDelimiter : (a2 = true, m2.delimiter = w.DefaultDelimiter), p2.meta.delimiter = m2.delimiter), b(m2));
|
|
203
|
+
return m2.preview && m2.header && r3.preview++, n2 = e2, s2 = new E(r3), p2 = s2.parse(n2, t2, i3), _2(), f2 ? { meta: { paused: true } } : p2 || { meta: { paused: false } };
|
|
204
204
|
}, this.paused = function() {
|
|
205
|
-
return
|
|
205
|
+
return f2;
|
|
206
206
|
}, this.pause = function() {
|
|
207
|
-
|
|
207
|
+
f2 = true, s2.abort(), n2 = U(m2.chunk) ? "" : n2.substring(s2.getCharIndex());
|
|
208
208
|
}, this.resume = function() {
|
|
209
|
-
i2.streamer._halted ? (
|
|
209
|
+
i2.streamer._halted ? (f2 = false, i2.streamer.parseChunk(n2, true)) : setTimeout(i2.resume, 3);
|
|
210
210
|
}, this.aborted = function() {
|
|
211
211
|
return e;
|
|
212
212
|
}, this.abort = function() {
|
|
213
|
-
e = true, s2.abort(), p2.meta.aborted = true,
|
|
213
|
+
e = true, s2.abort(), p2.meta.aborted = true, U(m2.complete) && m2.complete(p2), n2 = "";
|
|
214
214
|
}, this.guessLineEndings = function(e2, t2) {
|
|
215
215
|
e2 = e2.substring(0, 1048576);
|
|
216
|
-
var t2 = new RegExp(
|
|
216
|
+
var t2 = new RegExp(q(t2) + "([^]*?)" + q(t2), "gm"), i3 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i3[0].length;
|
|
217
217
|
if (1 === i3.length || e2) return "\n";
|
|
218
218
|
for (var r3 = 0, n3 = 0; n3 < i3.length; n3++) "\n" === i3[n3][0] && r3++;
|
|
219
219
|
return r3 >= i3.length / 2 ? "\r\n" : "\r";
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function q(e) {
|
|
223
223
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
224
224
|
}
|
|
225
225
|
function E(C) {
|
|
226
|
-
var S = (C = C || {}).delimiter, O = C.newline, x = C.comments, I = C.step, A = C.preview, T = C.fastMode, D = null, L = false, F = null == C.quoteChar ? '"' : C.quoteChar,
|
|
227
|
-
if (void 0 !== C.escapeChar && (
|
|
228
|
-
true === x ? x = "#" : ("string" != typeof x || -1 <
|
|
229
|
-
var
|
|
226
|
+
var S = (C = C || {}).delimiter, O = C.newline, x = C.comments, I = C.step, A = C.preview, T = C.fastMode, D = null, L = false, F = null == C.quoteChar ? '"' : C.quoteChar, z = F;
|
|
227
|
+
if (void 0 !== C.escapeChar && (z = C.escapeChar), ("string" != typeof S || -1 < w.BAD_DELIMITERS.indexOf(S)) && (S = ","), x === S) throw new Error("Comment character same as delimiter");
|
|
228
|
+
true === x ? x = "#" : ("string" != typeof x || -1 < w.BAD_DELIMITERS.indexOf(x)) && (x = false), "\n" !== O && "\r" !== O && "\r\n" !== O && (O = "\n");
|
|
229
|
+
var M = 0, j = false;
|
|
230
230
|
this.parse = function(i2, t, r2) {
|
|
231
231
|
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
232
|
-
var n2 = i2.length, e = S.length, s2 = O.length, a2 = x.length, o2 =
|
|
233
|
-
if (!i2) return
|
|
232
|
+
var n2 = i2.length, e = S.length, s2 = O.length, a2 = x.length, o2 = U(I), h2 = [], u2 = [], d2 = [], l2 = M = 0;
|
|
233
|
+
if (!i2) return v();
|
|
234
234
|
if (T || false !== T && -1 === i2.indexOf(F)) {
|
|
235
|
-
for (var
|
|
236
|
-
if (d2 =
|
|
237
|
-
else if (r2) return
|
|
235
|
+
for (var f2 = i2.split(O), c2 = 0; c2 < f2.length; c2++) {
|
|
236
|
+
if (d2 = f2[c2], M += d2.length, c2 !== f2.length - 1) M += O.length;
|
|
237
|
+
else if (r2) return v();
|
|
238
238
|
if (!x || d2.substring(0, a2) !== x) {
|
|
239
239
|
if (o2) {
|
|
240
|
-
if (h2 = [], k(d2.split(S)), R(),
|
|
240
|
+
if (h2 = [], k(d2.split(S)), R(), j) return v();
|
|
241
241
|
} else k(d2.split(S));
|
|
242
|
-
if (A && A <= c2) return h2 = h2.slice(0, A),
|
|
242
|
+
if (A && A <= c2) return h2 = h2.slice(0, A), v(true);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
return
|
|
245
|
+
return v();
|
|
246
246
|
}
|
|
247
|
-
for (var p2 = i2.indexOf(S,
|
|
248
|
-
if (-1 === (m2 = i2.indexOf(F, m2 + 1))) return r2 || u2.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h2.length, index:
|
|
249
|
-
if (m2 === n2 - 1) return E2(i2.substring(
|
|
250
|
-
if (F ===
|
|
251
|
-
else if (F ===
|
|
247
|
+
for (var p2 = i2.indexOf(S, M), _2 = i2.indexOf(O, M), g2 = new RegExp(q(z) + q(F), "g"), m2 = i2.indexOf(F, M); ; ) if (i2[M] === F) for (m2 = M, M++; ; ) {
|
|
248
|
+
if (-1 === (m2 = i2.indexOf(F, m2 + 1))) return r2 || u2.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h2.length, index: M }), E2();
|
|
249
|
+
if (m2 === n2 - 1) return E2(i2.substring(M, m2).replace(g2, F));
|
|
250
|
+
if (F === z && i2[m2 + 1] === z) m2++;
|
|
251
|
+
else if (F === z || 0 === m2 || i2[m2 - 1] !== z) {
|
|
252
252
|
-1 !== p2 && p2 < m2 + 1 && (p2 = i2.indexOf(S, m2 + 1));
|
|
253
|
-
var
|
|
254
|
-
if (i2.substr(m2 + 1 +
|
|
255
|
-
d2.push(i2.substring(
|
|
253
|
+
var y = w2(-1 === (_2 = -1 !== _2 && _2 < m2 + 1 ? i2.indexOf(O, m2 + 1) : _2) ? p2 : Math.min(p2, _2));
|
|
254
|
+
if (i2.substr(m2 + 1 + y, e) === S) {
|
|
255
|
+
d2.push(i2.substring(M, m2).replace(g2, F)), i2[M = m2 + 1 + y + e] !== F && (m2 = i2.indexOf(F, M)), p2 = i2.indexOf(S, M), _2 = i2.indexOf(O, M);
|
|
256
256
|
break;
|
|
257
257
|
}
|
|
258
|
-
|
|
259
|
-
if (i2.substring(m2 + 1 +
|
|
260
|
-
if (d2.push(i2.substring(
|
|
261
|
-
if (A && h2.length >= A) return
|
|
258
|
+
y = w2(_2);
|
|
259
|
+
if (i2.substring(m2 + 1 + y, m2 + 1 + y + s2) === O) {
|
|
260
|
+
if (d2.push(i2.substring(M, m2).replace(g2, F)), b2(m2 + 1 + y + s2), p2 = i2.indexOf(S, M), m2 = i2.indexOf(F, M), o2 && (R(), j)) return v();
|
|
261
|
+
if (A && h2.length >= A) return v(true);
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
|
-
u2.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h2.length, index:
|
|
264
|
+
u2.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h2.length, index: M }), m2++;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
else if (x && 0 === d2.length && i2.substring(
|
|
268
|
-
if (-1 ===
|
|
269
|
-
|
|
270
|
-
} else if (-1 !== p2 && (p2 <
|
|
267
|
+
else if (x && 0 === d2.length && i2.substring(M, M + a2) === x) {
|
|
268
|
+
if (-1 === _2) return v();
|
|
269
|
+
M = _2 + s2, _2 = i2.indexOf(O, M), p2 = i2.indexOf(S, M);
|
|
270
|
+
} else if (-1 !== p2 && (p2 < _2 || -1 === _2)) d2.push(i2.substring(M, p2)), M = p2 + e, p2 = i2.indexOf(S, M);
|
|
271
271
|
else {
|
|
272
|
-
if (-1 ===
|
|
273
|
-
if (d2.push(i2.substring(
|
|
274
|
-
if (A && h2.length >= A) return
|
|
272
|
+
if (-1 === _2) break;
|
|
273
|
+
if (d2.push(i2.substring(M, _2)), b2(_2 + s2), o2 && (R(), j)) return v();
|
|
274
|
+
if (A && h2.length >= A) return v(true);
|
|
275
275
|
}
|
|
276
276
|
return E2();
|
|
277
277
|
function k(e2) {
|
|
278
|
-
h2.push(e2),
|
|
278
|
+
h2.push(e2), l2 = M;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function w2(e2) {
|
|
281
281
|
var t2 = 0;
|
|
282
282
|
return t2 = -1 !== e2 && (e2 = i2.substring(m2 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
283
283
|
}
|
|
284
284
|
function E2(e2) {
|
|
285
|
-
return r2 || (void 0 === e2 && (e2 = i2.substring(
|
|
285
|
+
return r2 || (void 0 === e2 && (e2 = i2.substring(M)), d2.push(e2), M = n2, k(d2), o2 && R()), v();
|
|
286
286
|
}
|
|
287
287
|
function b2(e2) {
|
|
288
|
-
|
|
288
|
+
M = e2, k(d2), d2 = [], _2 = i2.indexOf(O, M);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function v(e2) {
|
|
291
291
|
if (C.header && !t && h2.length && !L) {
|
|
292
292
|
var s3 = h2[0], a3 = /* @__PURE__ */ Object.create(null), o3 = new Set(s3);
|
|
293
293
|
let n3 = false;
|
|
294
294
|
for (let r3 = 0; r3 < s3.length; r3++) {
|
|
295
295
|
let i3 = P(s3[r3]);
|
|
296
|
-
if (a3[i3 =
|
|
296
|
+
if (a3[i3 = U(C.transformHeader) ? C.transformHeader(i3, r3) : i3]) {
|
|
297
297
|
let e3, t2 = a3[i3];
|
|
298
298
|
for (; e3 = i3 + "_" + t2, t2++, o3.has(e3); ) ;
|
|
299
299
|
o3.add(e3), s3[r3] = e3, a3[i3]++, n3 = true, (D = null === D ? {} : D)[e3] = i3;
|
|
@@ -302,36 +302,36 @@ var require_papaparse_min = __commonJS({
|
|
|
302
302
|
}
|
|
303
303
|
n3 && console.warn("Duplicate headers found and renamed."), L = true;
|
|
304
304
|
}
|
|
305
|
-
return { data: h2, errors: u2, meta: { delimiter: S, linebreak: O, aborted:
|
|
305
|
+
return { data: h2, errors: u2, meta: { delimiter: S, linebreak: O, aborted: j, truncated: !!e2, cursor: l2 + (t || 0), renamedHeaders: D } };
|
|
306
306
|
}
|
|
307
307
|
function R() {
|
|
308
|
-
I(
|
|
308
|
+
I(v()), h2 = [], u2 = [];
|
|
309
309
|
}
|
|
310
310
|
}, this.abort = function() {
|
|
311
|
-
|
|
311
|
+
j = true;
|
|
312
312
|
}, this.getCharIndex = function() {
|
|
313
|
-
return
|
|
313
|
+
return M;
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function p(e) {
|
|
317
317
|
var t = e.data, i2 = o[t.workerId], r2 = false;
|
|
318
318
|
if (t.error) i2.userError(t.error, t.file);
|
|
319
319
|
else if (t.results && t.results.data) {
|
|
320
320
|
var n2 = { abort: function() {
|
|
321
321
|
r2 = true, _(t.workerId, { data: [], errors: [], meta: { aborted: true } });
|
|
322
|
-
}, pause:
|
|
323
|
-
if (
|
|
322
|
+
}, pause: g, resume: g };
|
|
323
|
+
if (U(i2.userStep)) {
|
|
324
324
|
for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r2); s2++) ;
|
|
325
325
|
delete t.results;
|
|
326
|
-
} else
|
|
326
|
+
} else U(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
|
|
327
327
|
}
|
|
328
328
|
t.finished && !r2 && _(t.workerId, t.results);
|
|
329
329
|
}
|
|
330
330
|
function _(e, t) {
|
|
331
331
|
var i2 = o[e];
|
|
332
|
-
|
|
332
|
+
U(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete o[e];
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function g() {
|
|
335
335
|
throw new Error("Not implemented.");
|
|
336
336
|
}
|
|
337
337
|
function b(e) {
|
|
@@ -340,37 +340,37 @@ var require_papaparse_min = __commonJS({
|
|
|
340
340
|
for (t in e) i2[t] = b(e[t]);
|
|
341
341
|
return i2;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function m(e, t) {
|
|
344
344
|
return function() {
|
|
345
345
|
e.apply(t, arguments);
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function U(e) {
|
|
349
349
|
return "function" == typeof e;
|
|
350
350
|
}
|
|
351
|
-
return
|
|
351
|
+
return w.parse = function(e, t) {
|
|
352
352
|
var i2 = (t = t || {}).dynamicTyping || false;
|
|
353
|
-
|
|
354
|
-
if (t.dynamicTyping = i2, t.transform = !!
|
|
353
|
+
U(i2) && (t.dynamicTypingFunction = i2, i2 = {});
|
|
354
|
+
if (t.dynamicTyping = i2, t.transform = !!U(t.transform) && t.transform, !t.worker || !w.WORKERS_SUPPORTED) return i2 = null, w.NODE_STREAM_INPUT, "string" == typeof e ? (e = P(e), i2 = new (t.download ? d : f)(t)) : true === e.readable && U(e.read) && U(e.on) ? i2 = new c(t) : (n.File && e instanceof File || e instanceof Object) && (i2 = new l(t)), i2.stream(e);
|
|
355
355
|
(i2 = (() => {
|
|
356
356
|
var e2;
|
|
357
|
-
return !!
|
|
357
|
+
return !!w.WORKERS_SUPPORTED && (e2 = (() => {
|
|
358
358
|
var e3 = n.URL || n.webkitURL || null, t2 = r.toString();
|
|
359
|
-
return
|
|
360
|
-
})(), (e2 = new n.Worker(e2)).onmessage =
|
|
361
|
-
})()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.userError = t.error, t.step =
|
|
362
|
-
},
|
|
363
|
-
var s2 = false,
|
|
359
|
+
return w.BLOB_URL || (w.BLOB_URL = e3.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t2, ")();"], { type: "text/javascript" })));
|
|
360
|
+
})(), (e2 = new n.Worker(e2)).onmessage = p, e2.id = h++, o[e2.id] = e2);
|
|
361
|
+
})()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.userError = t.error, t.step = U(t.step), t.chunk = U(t.chunk), t.complete = U(t.complete), t.error = U(t.error), delete t.worker, i2.postMessage({ input: e, config: t, workerId: i2.id });
|
|
362
|
+
}, w.unparse = function(e, t) {
|
|
363
|
+
var s2 = false, g2 = true, m2 = ",", y = "\r\n", a2 = '"', o2 = a2 + a2, i2 = false, r2 = null, h2 = false, u2 = ((() => {
|
|
364
364
|
if ("object" == typeof t) {
|
|
365
|
-
if ("string" != typeof t.delimiter ||
|
|
365
|
+
if ("string" != typeof t.delimiter || w.BAD_DELIMITERS.filter(function(e2) {
|
|
366
366
|
return -1 !== t.delimiter.indexOf(e2);
|
|
367
|
-
}).length || (m2 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s2 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines), "string" == typeof t.newline && (
|
|
367
|
+
}).length || (m2 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s2 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines), "string" == typeof t.newline && (y = t.newline), "string" == typeof t.quoteChar && (a2 = t.quoteChar, o2 = a2 + a2), "boolean" == typeof t.header && (g2 = t.header), Array.isArray(t.columns)) {
|
|
368
368
|
if (0 === t.columns.length) throw new Error("Option columns is empty");
|
|
369
369
|
r2 = t.columns;
|
|
370
370
|
}
|
|
371
371
|
void 0 !== t.escapeChar && (o2 = t.escapeChar + a2), t.escapeFormulae instanceof RegExp ? h2 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h2 = /^[=+\-@\t\r].*$/);
|
|
372
372
|
}
|
|
373
|
-
})(), new RegExp(
|
|
373
|
+
})(), new RegExp(q(a2), "g"));
|
|
374
374
|
"string" == typeof e && (e = JSON.parse(e));
|
|
375
375
|
if (Array.isArray(e)) {
|
|
376
376
|
if (!e.length || Array.isArray(e[0])) return n2(null, e, i2);
|
|
@@ -379,69 +379,42 @@ var require_papaparse_min = __commonJS({
|
|
|
379
379
|
throw new Error("Unable to serialize unrecognized input");
|
|
380
380
|
function n2(e2, t2, i3) {
|
|
381
381
|
var r3 = "", n3 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length), s3 = !Array.isArray(t2[0]);
|
|
382
|
-
if (n3 &&
|
|
382
|
+
if (n3 && g2) {
|
|
383
383
|
for (var a3 = 0; a3 < e2.length; a3++) 0 < a3 && (r3 += m2), r3 += k(e2[a3], a3);
|
|
384
|
-
0 < t2.length && (r3 +=
|
|
384
|
+
0 < t2.length && (r3 += y);
|
|
385
385
|
}
|
|
386
386
|
for (var o3 = 0; o3 < t2.length; o3++) {
|
|
387
387
|
var h3 = (n3 ? e2 : t2[o3]).length, u3 = false, d2 = n3 ? 0 === Object.keys(t2[o3]).length : 0 === t2[o3].length;
|
|
388
388
|
if (i3 && !n3 && (u3 = "greedy" === i3 ? "" === t2[o3].join("").trim() : 1 === t2[o3].length && 0 === t2[o3][0].length), "greedy" === i3 && n3) {
|
|
389
|
-
for (var
|
|
390
|
-
var c2 = s3 ? e2[
|
|
391
|
-
|
|
389
|
+
for (var l2 = [], f2 = 0; f2 < h3; f2++) {
|
|
390
|
+
var c2 = s3 ? e2[f2] : f2;
|
|
391
|
+
l2.push(t2[o3][c2]);
|
|
392
392
|
}
|
|
393
|
-
u3 = "" ===
|
|
393
|
+
u3 = "" === l2.join("").trim();
|
|
394
394
|
}
|
|
395
395
|
if (!u3) {
|
|
396
396
|
for (var p2 = 0; p2 < h3; p2++) {
|
|
397
397
|
0 < p2 && !d2 && (r3 += m2);
|
|
398
|
-
var
|
|
399
|
-
r3 += k(t2[o3][
|
|
398
|
+
var _2 = n3 && s3 ? e2[p2] : p2;
|
|
399
|
+
r3 += k(t2[o3][_2], p2);
|
|
400
400
|
}
|
|
401
|
-
o3 < t2.length - 1 && (!i3 || 0 < h3 && !d2) && (r3 +=
|
|
401
|
+
o3 < t2.length - 1 && (!i3 || 0 < h3 && !d2) && (r3 += y);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
return r3;
|
|
405
405
|
}
|
|
406
406
|
function k(e2, t2) {
|
|
407
407
|
var i3, r3, n3;
|
|
408
|
-
return null == e2 ? "" : e2.constructor === Date ?
|
|
408
|
+
return null == e2 ? "" : e2.constructor === Date ? isNaN(e2.getTime()) ? "" : e2.toISOString() : (n3 = false, h2 && "string" == typeof e2 && h2.test(e2) && (e2 = "'" + e2, n3 = true), r3 = (i3 = e2.toString()).replace(u2, o2), (n3 = n3 || true === s2 || "function" == typeof s2 && s2(e2, t2) || Array.isArray(s2) && s2[t2] || ((e3, t3) => {
|
|
409
409
|
for (var i4 = 0; i4 < t3.length; i4++) if (-1 < e3.indexOf(t3[i4])) return true;
|
|
410
410
|
return false;
|
|
411
|
-
})(r3,
|
|
412
|
-
}
|
|
413
|
-
}, v.RECORD_SEP = String.fromCharCode(30), v.UNIT_SEP = String.fromCharCode(31), v.BYTE_ORDER_MARK = "\uFEFF", v.BAD_DELIMITERS = ["\r", "\n", '"', v.BYTE_ORDER_MARK], v.WORKERS_SUPPORTED = !s && !!n.Worker, v.NODE_STREAM_INPUT = 1, v.LocalChunkSize = 10485760, v.RemoteChunkSize = 5242880, v.DefaultDelimiter = ",", v.Parser = E, v.ParserHandle = i, v.NetworkStreamer = f, v.FileStreamer = l, v.StringStreamer = c, v.ReadableStreamStreamer = p, n.jQuery && ((d = n.jQuery).fn.parse = function(o2) {
|
|
414
|
-
var i2 = o2.config || {}, h2 = [];
|
|
415
|
-
return this.each(function(e2) {
|
|
416
|
-
if (!("INPUT" === d(this).prop("tagName").toUpperCase() && "file" === d(this).attr("type").toLowerCase() && n.FileReader) || !this.files || 0 === this.files.length) return true;
|
|
417
|
-
for (var t = 0; t < this.files.length; t++) h2.push({ file: this.files[t], inputElem: this, instanceConfig: d.extend({}, i2) });
|
|
418
|
-
}), e(), this;
|
|
419
|
-
function e() {
|
|
420
|
-
if (0 === h2.length) q(o2.complete) && o2.complete();
|
|
421
|
-
else {
|
|
422
|
-
var e2, t, i3, r2, n2 = h2[0];
|
|
423
|
-
if (q(o2.before)) {
|
|
424
|
-
var s2 = o2.before(n2.file, n2.inputElem);
|
|
425
|
-
if ("object" == typeof s2) {
|
|
426
|
-
if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i3 = n2.inputElem, r2 = s2.reason, void (q(o2.error) && o2.error({ name: e2 }, t, i3, r2));
|
|
427
|
-
if ("skip" === s2.action) return void u2();
|
|
428
|
-
"object" == typeof s2.config && (n2.instanceConfig = d.extend(n2.instanceConfig, s2.config));
|
|
429
|
-
} else if ("skip" === s2) return void u2();
|
|
430
|
-
}
|
|
431
|
-
var a2 = n2.instanceConfig.complete;
|
|
432
|
-
n2.instanceConfig.complete = function(e3) {
|
|
433
|
-
q(a2) && a2(e3, n2.file, n2.inputElem), u2();
|
|
434
|
-
}, v.parse(n2.file, n2.instanceConfig);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
function u2() {
|
|
438
|
-
h2.splice(0, 1), e();
|
|
411
|
+
})(r3, w.BAD_DELIMITERS) || -1 < r3.indexOf(m2) || -1 < i3.indexOf(a2) || " " === r3.charAt(0) || " " === r3.charAt(r3.length - 1)) ? a2 + r3 + a2 : r3);
|
|
439
412
|
}
|
|
440
|
-
}), a && (n.onmessage = function(e) {
|
|
413
|
+
}, w.RECORD_SEP = String.fromCharCode(30), w.UNIT_SEP = String.fromCharCode(31), w.BYTE_ORDER_MARK = "\uFEFF", w.BAD_DELIMITERS = ["\r", "\n", '"', w.BYTE_ORDER_MARK], w.WORKERS_SUPPORTED = !s && !!n.Worker, w.NODE_STREAM_INPUT = 1, w.LocalChunkSize = 10485760, w.RemoteChunkSize = 5242880, w.DefaultDelimiter = ",", w.Parser = E, w.ParserHandle = i, w.NetworkStreamer = d, w.FileStreamer = l, w.StringStreamer = f, w.ReadableStreamStreamer = c, a && (n.onmessage = function(e) {
|
|
441
414
|
e = e.data;
|
|
442
|
-
void 0 ===
|
|
443
|
-
"string" == typeof e.input ? n.postMessage({ workerId:
|
|
444
|
-
}), (
|
|
415
|
+
void 0 === w.WORKER_ID && e && (w.WORKER_ID = e.workerId);
|
|
416
|
+
"string" == typeof e.input ? n.postMessage({ workerId: w.WORKER_ID, results: w.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = w.parse(e.input, e.config)) && n.postMessage({ workerId: w.WORKER_ID, results: e, finished: true });
|
|
417
|
+
}), (d.prototype = Object.create(u.prototype)).constructor = d, (l.prototype = Object.create(u.prototype)).constructor = l, (f.prototype = Object.create(f.prototype)).constructor = f, (c.prototype = Object.create(u.prototype)).constructor = c, w;
|
|
445
418
|
});
|
|
446
419
|
}
|
|
447
420
|
});
|
|
@@ -4276,7 +4249,7 @@ ZodNaN.create = (params) => {
|
|
|
4276
4249
|
...processCreateParams(params)
|
|
4277
4250
|
});
|
|
4278
4251
|
};
|
|
4279
|
-
var BRAND = Symbol("zod_brand");
|
|
4252
|
+
var BRAND = /* @__PURE__ */ Symbol("zod_brand");
|
|
4280
4253
|
var ZodBranded = class extends ZodType {
|
|
4281
4254
|
_parse(input) {
|
|
4282
4255
|
const { ctx } = this._processInputParams(input);
|
|
@@ -4851,7 +4824,7 @@ function validateClipboardColumns(columns, table) {
|
|
|
4851
4824
|
papaparse/papaparse.min.js:
|
|
4852
4825
|
(* @license
|
|
4853
4826
|
Papa Parse
|
|
4854
|
-
v5.
|
|
4827
|
+
v5.6.0
|
|
4855
4828
|
https://github.com/mholt/PapaParse
|
|
4856
4829
|
License: MIT
|
|
4857
4830
|
*)
|