@burdenoff/microfe-support 2026.902.2 → 2026.902.3

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.
@@ -18,6 +18,7 @@ var r = {
18
18
  n.Interview,
19
19
  n.Hired,
20
20
  n.Rejected,
21
+ n.EmailSent,
21
22
  n.Archived
22
23
  ], l = [
23
24
  t.Scheduled,
@@ -1 +1 @@
1
- {"version":3,"file":"jobApplicationFilterParams.js","names":[],"sources":["../../../src/support/utils/jobApplicationFilterParams.ts"],"sourcesContent":["import {\n ConfiguredRoundState,\n InterviewRoundStatus,\n JobApplicationStatus,\n} from '../../generated/global-types';\n\n/**\n * URL-backed filter state for the Career → Job Applications list (BOFF-7068).\n *\n * The list unmounts whenever a reviewer opens a submission, so component state\n * cannot survive the round trip. The query string can: both the row link and\n * the detail page's \"Back to Applications\" button already forward\n * `location.search` verbatim, so filters parked here come back for free — and\n * they also survive a refresh and can be shared as a link.\n *\n * Everything is parsed defensively. A hand-edited or stale URL must never reach\n * the GraphQL variables with an unknown enum value, and must never produce a\n * combination the UI cannot render.\n */\n\nexport type JobApplicationViewMode = 'list' | 'kanban';\n\nexport interface JobApplicationFilterState {\n search: string;\n statuses: JobApplicationStatus[];\n roundStatuses: InterviewRoundStatus[];\n productId: string;\n jobPostingId: string;\n roundConfigId: string;\n configuredRoundState: ConfiguredRoundState | '';\n duplicateEmail: boolean;\n assignmentOwnerEmail: string;\n interviewerId: string;\n}\n\n/** Query-string key for each filter. Short names keep shared links readable. */\nexport const JOB_APPLICATION_FILTER_PARAM_KEYS = {\n search: 'q',\n statuses: 'status',\n roundStatuses: 'stage',\n productId: 'product',\n jobPostingId: 'posting',\n roundConfigId: 'round',\n configuredRoundState: 'roundState',\n duplicateEmail: 'dupes',\n assignmentOwnerEmail: 'owner',\n interviewerId: 'interviewer',\n} as const satisfies Record<keyof JobApplicationFilterState, string>;\n\n/** View mode and filter-panel disclosure are presentation, not filters. */\nexport const JOB_APPLICATION_VIEW_PARAM_KEY = 'view';\nexport const JOB_APPLICATION_FILTERS_OPEN_PARAM_KEY = 'filters';\n\nexport const EMPTY_JOB_APPLICATION_FILTERS: JobApplicationFilterState = {\n search: '',\n statuses: [],\n roundStatuses: [],\n productId: '',\n jobPostingId: '',\n roundConfigId: '',\n configuredRoundState: '',\n duplicateEmail: false,\n assignmentOwnerEmail: '',\n interviewerId: '',\n};\n\n/**\n * Free text goes straight into GraphQL variables, so cap it. Nobody searches\n * with 4 KB of text; a URL that claims otherwise was not typed by a user.\n */\nconst MAX_TEXT_LENGTH = 200;\n/** Identifiers are UUIDs in practice — this is only an upper sanity bound. */\nconst MAX_ID_LENGTH = 128;\n\nconst STATUS_ORDER = [\n JobApplicationStatus.New,\n JobApplicationStatus.Screening,\n JobApplicationStatus.Shortlisted,\n JobApplicationStatus.Interview,\n JobApplicationStatus.Hired,\n JobApplicationStatus.Rejected,\n JobApplicationStatus.Archived,\n] as const;\n\nconst ROUND_STATUS_ORDER = [\n InterviewRoundStatus.Scheduled,\n InterviewRoundStatus.AwaitingSubmission,\n InterviewRoundStatus.Submitted,\n InterviewRoundStatus.Completed,\n InterviewRoundStatus.Passed,\n InterviewRoundStatus.Failed,\n InterviewRoundStatus.NoShow,\n InterviewRoundStatus.Cancelled,\n] as const;\n\nconst CONFIGURED_ROUND_STATES = Object.values(ConfiguredRoundState);\n\n/**\n * The bound applied to every free-text filter, exported so a caller that has to\n * predict what serialization will write (the debounced inputs) uses this rule\n * rather than a second copy of it.\n */\nexport function normalizeJobApplicationFilterText(value: string): string {\n return value.trim().slice(0, MAX_TEXT_LENGTH);\n}\n\nfunction readText(raw: string | null, maxLength: number): string {\n return (raw ?? '').trim().slice(0, maxLength);\n}\n\n/**\n * Parses a comma-separated enum list, dropping anything unrecognised and\n * de-duplicating. Values come back in `allowed` order rather than URL order so\n * that two URLs selecting the same set serialize identically — which keeps the\n * page's query-scope key (and therefore Apollo's cache key) stable.\n */\nfunction readEnumList<T extends string>(raw: string | null, allowed: readonly T[]): T[] {\n if (!raw) return [];\n const requested = new Set(raw.split(',').map((piece) => piece.trim().toUpperCase()));\n return allowed.filter((value) => requested.has(value));\n}\n\n/**\n * Applies the dependency rules the filter UI enforces through its own controls,\n * so a URL can never describe a state the panel could not have produced:\n * round/duplicate filters need a posting, an assignment state needs a round,\n * and \"missing this round\" is incompatible with round-stage chips.\n */\nfunction normalizeJobApplicationFilters(\n state: JobApplicationFilterState\n): JobApplicationFilterState {\n // Bounds live here rather than only in the parse path: a value committed from\n // a control (a 500-character paste into the search box) is serialized without\n // ever passing through `parseJobApplicationFilters`, and an uncapped value\n // written to the query string rides on into history, detail links and shared\n // URLs even though the parse that follows would clamp it.\n const jobPostingId = state.jobPostingId.trim().slice(0, MAX_ID_LENGTH);\n const roundConfigId = jobPostingId ? state.roundConfigId.trim().slice(0, MAX_ID_LENGTH) : '';\n const configuredRoundState = roundConfigId ? state.configuredRoundState : '';\n const roundStatuses =\n configuredRoundState === ConfiguredRoundState.Missing ? [] : state.roundStatuses;\n\n return {\n ...state,\n search: normalizeJobApplicationFilterText(state.search),\n assignmentOwnerEmail: normalizeJobApplicationFilterText(state.assignmentOwnerEmail),\n productId: state.productId.trim().slice(0, MAX_ID_LENGTH),\n interviewerId: state.interviewerId.trim().slice(0, MAX_ID_LENGTH),\n jobPostingId,\n roundConfigId,\n configuredRoundState,\n roundStatuses,\n duplicateEmail: jobPostingId ? state.duplicateEmail : false,\n };\n}\n\nexport function parseJobApplicationFilters(params: URLSearchParams): JobApplicationFilterState {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n\n const configuredRoundStateRaw = readText(params.get(keys.configuredRoundState), MAX_ID_LENGTH);\n const configuredRoundState =\n CONFIGURED_ROUND_STATES.find((state) => state === configuredRoundStateRaw.toUpperCase()) ?? '';\n\n return normalizeJobApplicationFilters({\n search: readText(params.get(keys.search), MAX_TEXT_LENGTH),\n statuses: readEnumList(params.get(keys.statuses), STATUS_ORDER),\n roundStatuses: readEnumList(params.get(keys.roundStatuses), ROUND_STATUS_ORDER),\n productId: readText(params.get(keys.productId), MAX_ID_LENGTH),\n jobPostingId: readText(params.get(keys.jobPostingId), MAX_ID_LENGTH),\n roundConfigId: readText(params.get(keys.roundConfigId), MAX_ID_LENGTH),\n configuredRoundState,\n duplicateEmail: params.get(keys.duplicateEmail) === '1',\n assignmentOwnerEmail: readText(params.get(keys.assignmentOwnerEmail), MAX_TEXT_LENGTH),\n interviewerId: readText(params.get(keys.interviewerId), MAX_ID_LENGTH),\n });\n}\n\n/**\n * Serializes to `{ key: value | null }`, where `null` means \"remove this key\".\n * Inactive filters are removed rather than written as empty values so a list\n * with nothing applied has a clean URL.\n */\nexport function serializeJobApplicationFilters(\n state: JobApplicationFilterState\n): Record<string, string | null> {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n const normalized = normalizeJobApplicationFilters(state);\n\n return {\n [keys.search]: normalized.search || null,\n [keys.statuses]: normalized.statuses.length > 0 ? normalized.statuses.join(',') : null,\n [keys.roundStatuses]:\n normalized.roundStatuses.length > 0 ? normalized.roundStatuses.join(',') : null,\n [keys.productId]: normalized.productId || null,\n [keys.jobPostingId]: normalized.jobPostingId || null,\n [keys.roundConfigId]: normalized.roundConfigId || null,\n [keys.configuredRoundState]: normalized.configuredRoundState || null,\n [keys.duplicateEmail]: normalized.duplicateEmail ? '1' : null,\n [keys.assignmentOwnerEmail]: normalized.assignmentOwnerEmail || null,\n [keys.interviewerId]: normalized.interviewerId || null,\n };\n}\n\n/**\n * Writes the filter state onto `current`, leaving every unrelated key\n * (`org`, `workspace`, `project`, `view`, …) exactly as it was.\n */\nexport function applyJobApplicationFilters(\n current: URLSearchParams,\n state: JobApplicationFilterState\n): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const [key, value] of Object.entries(serializeJobApplicationFilters(state))) {\n if (value === null) next.delete(key);\n else next.set(key, value);\n }\n return next;\n}\n\n/** Drops every filter key and nothing else — context params and view survive. */\nexport function clearJobApplicationFilters(current: URLSearchParams): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const key of Object.values(JOB_APPLICATION_FILTER_PARAM_KEYS)) next.delete(key);\n return next;\n}\n\n/**\n * Number of filters shown inside the filter panel that are currently applied —\n * drives the count badge on the Filters button. The search box sits outside the\n * panel and is visible on its own, so it is deliberately not counted here.\n */\nexport function countActiveJobApplicationFilters(state: JobApplicationFilterState): number {\n const normalized = normalizeJobApplicationFilters(state);\n return (\n (normalized.statuses.length > 0 ? 1 : 0) +\n (normalized.roundStatuses.length > 0 ? 1 : 0) +\n (normalized.productId ? 1 : 0) +\n (normalized.jobPostingId ? 1 : 0) +\n (normalized.roundConfigId ? 1 : 0) +\n (normalized.configuredRoundState ? 1 : 0) +\n (normalized.duplicateEmail ? 1 : 0) +\n (normalized.assignmentOwnerEmail ? 1 : 0) +\n (normalized.interviewerId ? 1 : 0)\n );\n}\n\n/** True when anything at all narrows the list, including the search box. */\nexport function hasActiveJobApplicationFilters(state: JobApplicationFilterState): boolean {\n return countActiveJobApplicationFilters(state) > 0 || state.search.length > 0;\n}\n\nexport function parseJobApplicationViewMode(raw: string | null): JobApplicationViewMode {\n return raw === 'kanban' ? 'kanban' : 'list';\n}\n\n/**\n * fe-libs' `ActiveContextProvider` writes `org`/`workspace`/`project` with a raw\n * `history.replaceState`, which `BrowserRouter` never observes — so React\n * Router's snapshot of the query string can be missing params that really are\n * in the address bar. Writing that snapshot back would silently strip the\n * active context from the URL.\n *\n * The address bar is therefore the base, and the router snapshot only\n * contributes keys the address bar lacks (which is how the MemoryRouter used by\n * standalone mode and by tests keeps working, since there `window.location`\n * never moves).\n */\nexport function mergeSearchParams(\n routerParams: URLSearchParams,\n windowSearch: string\n): URLSearchParams {\n const merged = new URLSearchParams(windowSearch);\n for (const [key, value] of routerParams.entries()) {\n if (!merged.has(key)) merged.set(key, value);\n }\n return merged;\n}\n\n/**\n * Identity of the active support context as one comparable string. Filters are\n * only meaningful inside a single org/workspace/product, so this key is what\n * both the list page and `JobApplicationFilterContextGuard` compare to decide\n * whether the URL-persisted filters still belong to the context on screen.\n */\nexport function buildSupportContextKey(\n organizationId: string | undefined,\n workspaceId: string | undefined,\n productId: string | undefined\n): string {\n return `${organizationId ?? ''}|${workspaceId ?? ''}|${productId ?? ''}`;\n}\n\n/**\n * True when every axis that changed went from empty to a value — the shell\n * finishing its context resolution, not the reviewer switching context.\n *\n * The distinction matters because the shell hands the microfrontend\n * `activeContext.workspaceId ?? ''`, and `??` does not catch the empty string,\n * so a microfrontend that mounts before the context settles observes\n * `'' -> id`. Treated as a switch, that would strip the filters off a\n * deep-linked or refreshed URL before the reviewer ever saw them.\n *\n * Only a fill counts: an axis moving between two non-empty values, or being\n * emptied, is a genuine switch and must still clear the filters.\n */\nexport function isSupportContextHydration(previousKey: string, nextKey: string): boolean {\n const previous = previousKey.split('|');\n const next = nextKey.split('|');\n // Differing arity means one side is not a key this module built, so it cannot\n // be read as a fill — fall through to the switch path, which clears.\n if (previous.length !== next.length) return false;\n return previous.every((value, index) => value === next[index] || value === '');\n}\n"],"mappings":";;AAoCA,IAAa,IAAoC;CAC/C,QAAQ;CACR,UAAU;CACV,eAAe;CACf,WAAW;CACX,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,gBAAgB;CAChB,sBAAsB;CACtB,eAAe;AACjB,GAGa,IAAiC,QACjC,IAAyC,WAmBhD,IAAkB,KAElB,IAAgB,KAEhB,IAAe;CACnB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;AACvB,GAEM,IAAqB;CACzB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;AACvB,GAEM,IAA0B,OAAO,OAAO,CAAoB;AAOlE,SAAgB,EAAkC,GAAuB;CACvE,OAAO,EAAM,KAAK,CAAC,CAAC,MAAM,GAAG,CAAe;AAC9C;AAEA,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;AACT;AAOA,SAAgB,EAAiC,GAA0C;CACzF,IAAM,IAAa,EAA+B,CAAK;CACvD,OACG,IAAW,SAAS,SAAS,KAC7B,IAAW,cAAc,SAAS,KAClC,KAAW,YACX,KAAW,eACX,KAAW,gBACX,KAAW,uBACX,KAAW,iBACX,KAAW,uBACX,KAAW;AAEhB;AAGA,SAAgB,EAA+B,GAA2C;CACxF,OAAO,EAAiC,CAAK,IAAI,KAAK,EAAM,OAAO,SAAS;AAC9E;AAEA,SAAgB,EAA4B,GAA4C;CACtF,OAAO,MAAQ,WAAW,WAAW;AACvC;AAcA,SAAgB,EACd,GACA,GACiB;CACjB,IAAM,IAAS,IAAI,gBAAgB,CAAY;CAC/C,KAAK,IAAM,CAAC,GAAK,MAAU,EAAa,QAAQ,GAC9C,AAAK,EAAO,IAAI,CAAG,KAAG,EAAO,IAAI,GAAK,CAAK;CAE7C,OAAO;AACT;AAQA,SAAgB,EACd,GACA,GACA,GACQ;CACR,OAAO,GAAG,KAAkB,GAAG,GAAG,KAAe,GAAG,GAAG,KAAa;AACtE;AAeA,SAAgB,EAA0B,GAAqB,GAA0B;CACvF,IAAM,IAAW,EAAY,MAAM,GAAG,GAChC,IAAO,EAAQ,MAAM,GAAG;CAI9B,OADI,EAAS,WAAW,EAAK,UACtB,EAAS,OAAO,GAAO,MAAU,MAAU,EAAK,MAAU,MAAU,EAAE;AAC/E"}
1
+ {"version":3,"file":"jobApplicationFilterParams.js","names":[],"sources":["../../../src/support/utils/jobApplicationFilterParams.ts"],"sourcesContent":["import {\n ConfiguredRoundState,\n InterviewRoundStatus,\n JobApplicationStatus,\n} from '../../generated/global-types';\n\n/**\n * URL-backed filter state for the Career → Job Applications list (BOFF-7068).\n *\n * The list unmounts whenever a reviewer opens a submission, so component state\n * cannot survive the round trip. The query string can: both the row link and\n * the detail page's \"Back to Applications\" button already forward\n * `location.search` verbatim, so filters parked here come back for free — and\n * they also survive a refresh and can be shared as a link.\n *\n * Everything is parsed defensively. A hand-edited or stale URL must never reach\n * the GraphQL variables with an unknown enum value, and must never produce a\n * combination the UI cannot render.\n */\n\nexport type JobApplicationViewMode = 'list' | 'kanban';\n\nexport interface JobApplicationFilterState {\n search: string;\n statuses: JobApplicationStatus[];\n roundStatuses: InterviewRoundStatus[];\n productId: string;\n jobPostingId: string;\n roundConfigId: string;\n configuredRoundState: ConfiguredRoundState | '';\n duplicateEmail: boolean;\n assignmentOwnerEmail: string;\n interviewerId: string;\n}\n\n/** Query-string key for each filter. Short names keep shared links readable. */\nexport const JOB_APPLICATION_FILTER_PARAM_KEYS = {\n search: 'q',\n statuses: 'status',\n roundStatuses: 'stage',\n productId: 'product',\n jobPostingId: 'posting',\n roundConfigId: 'round',\n configuredRoundState: 'roundState',\n duplicateEmail: 'dupes',\n assignmentOwnerEmail: 'owner',\n interviewerId: 'interviewer',\n} as const satisfies Record<keyof JobApplicationFilterState, string>;\n\n/** View mode and filter-panel disclosure are presentation, not filters. */\nexport const JOB_APPLICATION_VIEW_PARAM_KEY = 'view';\nexport const JOB_APPLICATION_FILTERS_OPEN_PARAM_KEY = 'filters';\n\nexport const EMPTY_JOB_APPLICATION_FILTERS: JobApplicationFilterState = {\n search: '',\n statuses: [],\n roundStatuses: [],\n productId: '',\n jobPostingId: '',\n roundConfigId: '',\n configuredRoundState: '',\n duplicateEmail: false,\n assignmentOwnerEmail: '',\n interviewerId: '',\n};\n\n/**\n * Free text goes straight into GraphQL variables, so cap it. Nobody searches\n * with 4 KB of text; a URL that claims otherwise was not typed by a user.\n */\nconst MAX_TEXT_LENGTH = 200;\n/** Identifiers are UUIDs in practice — this is only an upper sanity bound. */\nconst MAX_ID_LENGTH = 128;\n\nconst STATUS_ORDER = [\n JobApplicationStatus.New,\n JobApplicationStatus.Screening,\n JobApplicationStatus.Shortlisted,\n JobApplicationStatus.Interview,\n JobApplicationStatus.Hired,\n JobApplicationStatus.Rejected,\n JobApplicationStatus.EmailSent,\n JobApplicationStatus.Archived,\n] as const;\n\nconst ROUND_STATUS_ORDER = [\n InterviewRoundStatus.Scheduled,\n InterviewRoundStatus.AwaitingSubmission,\n InterviewRoundStatus.Submitted,\n InterviewRoundStatus.Completed,\n InterviewRoundStatus.Passed,\n InterviewRoundStatus.Failed,\n InterviewRoundStatus.NoShow,\n InterviewRoundStatus.Cancelled,\n] as const;\n\nconst CONFIGURED_ROUND_STATES = Object.values(ConfiguredRoundState);\n\n/**\n * The bound applied to every free-text filter, exported so a caller that has to\n * predict what serialization will write (the debounced inputs) uses this rule\n * rather than a second copy of it.\n */\nexport function normalizeJobApplicationFilterText(value: string): string {\n return value.trim().slice(0, MAX_TEXT_LENGTH);\n}\n\nfunction readText(raw: string | null, maxLength: number): string {\n return (raw ?? '').trim().slice(0, maxLength);\n}\n\n/**\n * Parses a comma-separated enum list, dropping anything unrecognised and\n * de-duplicating. Values come back in `allowed` order rather than URL order so\n * that two URLs selecting the same set serialize identically — which keeps the\n * page's query-scope key (and therefore Apollo's cache key) stable.\n */\nfunction readEnumList<T extends string>(raw: string | null, allowed: readonly T[]): T[] {\n if (!raw) return [];\n const requested = new Set(raw.split(',').map((piece) => piece.trim().toUpperCase()));\n return allowed.filter((value) => requested.has(value));\n}\n\n/**\n * Applies the dependency rules the filter UI enforces through its own controls,\n * so a URL can never describe a state the panel could not have produced:\n * round/duplicate filters need a posting, an assignment state needs a round,\n * and \"missing this round\" is incompatible with round-stage chips.\n */\nfunction normalizeJobApplicationFilters(\n state: JobApplicationFilterState\n): JobApplicationFilterState {\n // Bounds live here rather than only in the parse path: a value committed from\n // a control (a 500-character paste into the search box) is serialized without\n // ever passing through `parseJobApplicationFilters`, and an uncapped value\n // written to the query string rides on into history, detail links and shared\n // URLs even though the parse that follows would clamp it.\n const jobPostingId = state.jobPostingId.trim().slice(0, MAX_ID_LENGTH);\n const roundConfigId = jobPostingId ? state.roundConfigId.trim().slice(0, MAX_ID_LENGTH) : '';\n const configuredRoundState = roundConfigId ? state.configuredRoundState : '';\n const roundStatuses =\n configuredRoundState === ConfiguredRoundState.Missing ? [] : state.roundStatuses;\n\n return {\n ...state,\n search: normalizeJobApplicationFilterText(state.search),\n assignmentOwnerEmail: normalizeJobApplicationFilterText(state.assignmentOwnerEmail),\n productId: state.productId.trim().slice(0, MAX_ID_LENGTH),\n interviewerId: state.interviewerId.trim().slice(0, MAX_ID_LENGTH),\n jobPostingId,\n roundConfigId,\n configuredRoundState,\n roundStatuses,\n duplicateEmail: jobPostingId ? state.duplicateEmail : false,\n };\n}\n\nexport function parseJobApplicationFilters(params: URLSearchParams): JobApplicationFilterState {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n\n const configuredRoundStateRaw = readText(params.get(keys.configuredRoundState), MAX_ID_LENGTH);\n const configuredRoundState =\n CONFIGURED_ROUND_STATES.find((state) => state === configuredRoundStateRaw.toUpperCase()) ?? '';\n\n return normalizeJobApplicationFilters({\n search: readText(params.get(keys.search), MAX_TEXT_LENGTH),\n statuses: readEnumList(params.get(keys.statuses), STATUS_ORDER),\n roundStatuses: readEnumList(params.get(keys.roundStatuses), ROUND_STATUS_ORDER),\n productId: readText(params.get(keys.productId), MAX_ID_LENGTH),\n jobPostingId: readText(params.get(keys.jobPostingId), MAX_ID_LENGTH),\n roundConfigId: readText(params.get(keys.roundConfigId), MAX_ID_LENGTH),\n configuredRoundState,\n duplicateEmail: params.get(keys.duplicateEmail) === '1',\n assignmentOwnerEmail: readText(params.get(keys.assignmentOwnerEmail), MAX_TEXT_LENGTH),\n interviewerId: readText(params.get(keys.interviewerId), MAX_ID_LENGTH),\n });\n}\n\n/**\n * Serializes to `{ key: value | null }`, where `null` means \"remove this key\".\n * Inactive filters are removed rather than written as empty values so a list\n * with nothing applied has a clean URL.\n */\nexport function serializeJobApplicationFilters(\n state: JobApplicationFilterState\n): Record<string, string | null> {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n const normalized = normalizeJobApplicationFilters(state);\n\n return {\n [keys.search]: normalized.search || null,\n [keys.statuses]: normalized.statuses.length > 0 ? normalized.statuses.join(',') : null,\n [keys.roundStatuses]:\n normalized.roundStatuses.length > 0 ? normalized.roundStatuses.join(',') : null,\n [keys.productId]: normalized.productId || null,\n [keys.jobPostingId]: normalized.jobPostingId || null,\n [keys.roundConfigId]: normalized.roundConfigId || null,\n [keys.configuredRoundState]: normalized.configuredRoundState || null,\n [keys.duplicateEmail]: normalized.duplicateEmail ? '1' : null,\n [keys.assignmentOwnerEmail]: normalized.assignmentOwnerEmail || null,\n [keys.interviewerId]: normalized.interviewerId || null,\n };\n}\n\n/**\n * Writes the filter state onto `current`, leaving every unrelated key\n * (`org`, `workspace`, `project`, `view`, …) exactly as it was.\n */\nexport function applyJobApplicationFilters(\n current: URLSearchParams,\n state: JobApplicationFilterState\n): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const [key, value] of Object.entries(serializeJobApplicationFilters(state))) {\n if (value === null) next.delete(key);\n else next.set(key, value);\n }\n return next;\n}\n\n/** Drops every filter key and nothing else — context params and view survive. */\nexport function clearJobApplicationFilters(current: URLSearchParams): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const key of Object.values(JOB_APPLICATION_FILTER_PARAM_KEYS)) next.delete(key);\n return next;\n}\n\n/**\n * Number of filters shown inside the filter panel that are currently applied —\n * drives the count badge on the Filters button. The search box sits outside the\n * panel and is visible on its own, so it is deliberately not counted here.\n */\nexport function countActiveJobApplicationFilters(state: JobApplicationFilterState): number {\n const normalized = normalizeJobApplicationFilters(state);\n return (\n (normalized.statuses.length > 0 ? 1 : 0) +\n (normalized.roundStatuses.length > 0 ? 1 : 0) +\n (normalized.productId ? 1 : 0) +\n (normalized.jobPostingId ? 1 : 0) +\n (normalized.roundConfigId ? 1 : 0) +\n (normalized.configuredRoundState ? 1 : 0) +\n (normalized.duplicateEmail ? 1 : 0) +\n (normalized.assignmentOwnerEmail ? 1 : 0) +\n (normalized.interviewerId ? 1 : 0)\n );\n}\n\n/** True when anything at all narrows the list, including the search box. */\nexport function hasActiveJobApplicationFilters(state: JobApplicationFilterState): boolean {\n return countActiveJobApplicationFilters(state) > 0 || state.search.length > 0;\n}\n\nexport function parseJobApplicationViewMode(raw: string | null): JobApplicationViewMode {\n return raw === 'kanban' ? 'kanban' : 'list';\n}\n\n/**\n * fe-libs' `ActiveContextProvider` writes `org`/`workspace`/`project` with a raw\n * `history.replaceState`, which `BrowserRouter` never observes — so React\n * Router's snapshot of the query string can be missing params that really are\n * in the address bar. Writing that snapshot back would silently strip the\n * active context from the URL.\n *\n * The address bar is therefore the base, and the router snapshot only\n * contributes keys the address bar lacks (which is how the MemoryRouter used by\n * standalone mode and by tests keeps working, since there `window.location`\n * never moves).\n */\nexport function mergeSearchParams(\n routerParams: URLSearchParams,\n windowSearch: string\n): URLSearchParams {\n const merged = new URLSearchParams(windowSearch);\n for (const [key, value] of routerParams.entries()) {\n if (!merged.has(key)) merged.set(key, value);\n }\n return merged;\n}\n\n/**\n * Identity of the active support context as one comparable string. Filters are\n * only meaningful inside a single org/workspace/product, so this key is what\n * both the list page and `JobApplicationFilterContextGuard` compare to decide\n * whether the URL-persisted filters still belong to the context on screen.\n */\nexport function buildSupportContextKey(\n organizationId: string | undefined,\n workspaceId: string | undefined,\n productId: string | undefined\n): string {\n return `${organizationId ?? ''}|${workspaceId ?? ''}|${productId ?? ''}`;\n}\n\n/**\n * True when every axis that changed went from empty to a value — the shell\n * finishing its context resolution, not the reviewer switching context.\n *\n * The distinction matters because the shell hands the microfrontend\n * `activeContext.workspaceId ?? ''`, and `??` does not catch the empty string,\n * so a microfrontend that mounts before the context settles observes\n * `'' -> id`. Treated as a switch, that would strip the filters off a\n * deep-linked or refreshed URL before the reviewer ever saw them.\n *\n * Only a fill counts: an axis moving between two non-empty values, or being\n * emptied, is a genuine switch and must still clear the filters.\n */\nexport function isSupportContextHydration(previousKey: string, nextKey: string): boolean {\n const previous = previousKey.split('|');\n const next = nextKey.split('|');\n // Differing arity means one side is not a key this module built, so it cannot\n // be read as a fill — fall through to the switch path, which clears.\n if (previous.length !== next.length) return false;\n return previous.every((value, index) => value === next[index] || value === '');\n}\n"],"mappings":";;AAoCA,IAAa,IAAoC;CAC/C,QAAQ;CACR,UAAU;CACV,eAAe;CACf,WAAW;CACX,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,gBAAgB;CAChB,sBAAsB;CACtB,eAAe;AACjB,GAGa,IAAiC,QACjC,IAAyC,WAmBhD,IAAkB,KAElB,IAAgB,KAEhB,IAAe;CACnB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;AACvB,GAEM,IAAqB;CACzB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;AACvB,GAEM,IAA0B,OAAO,OAAO,CAAoB;AAOlE,SAAgB,EAAkC,GAAuB;CACvE,OAAO,EAAM,KAAK,CAAC,CAAC,MAAM,GAAG,CAAe;AAC9C;AAEA,SAAS,EAAS,GAAoB,GAA2B;CAC/D,QAAQ,KAAO,GAAA,CAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAS;AAC9C;AAQA,SAAS,EAA+B,GAAoB,GAA4B;CACtF,IAAI,CAAC,GAAK,OAAO,CAAC;CAClB,IAAM,IAAY,IAAI,IAAI,EAAI,MAAM,GAAG,CAAC,CAAC,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;CACnF,OAAO,EAAQ,QAAQ,MAAU,EAAU,IAAI,CAAK,CAAC;AACvD;AAQA,SAAS,EACP,GAC2B;CAM3B,IAAM,IAAe,EAAM,aAAa,KAAK,CAAC,CAAC,MAAM,GAAG,CAAa,GAC/D,IAAgB,IAAe,EAAM,cAAc,KAAK,CAAC,CAAC,MAAM,GAAG,CAAa,IAAI,IACpF,IAAuB,IAAgB,EAAM,uBAAuB,IACpE,IACJ,MAAyB,EAAqB,UAAU,CAAC,IAAI,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CACR,OAAO,GAAG,KAAkB,GAAG,GAAG,KAAe,GAAG,GAAG,KAAa;AACtE;AAeA,SAAgB,EAA0B,GAAqB,GAA0B;CACvF,IAAM,IAAW,EAAY,MAAM,GAAG,GAChC,IAAO,EAAQ,MAAM,GAAG;CAI9B,OADI,EAAS,WAAW,EAAK,UACtB,EAAS,OAAO,GAAO,MAAU,MAAU,EAAK,MAAU,MAAU,EAAE;AAC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-support",
3
- "version": "2026.902.2",
3
+ "version": "2026.902.3",
4
4
  "description": "Burdenoff Support Microfrontend - Complete customer support and ticketing interface",
5
5
  "type": "module",
6
6
  "files": [