@canonry/canonry 7.104.3 → 7.105.0
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/assets/agent-workspace/skills/aero/SKILL.md +11 -0
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +11 -2
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +77 -5
- package/assets/assets/{AccessControls-hIgRxmCY.js → AccessControls-BL5Ohk1o.js} +1 -1
- package/assets/assets/{AgentSetupPage-BEYkXfMI.js → AgentSetupPage-DOlYQxIa.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-B4RSWnDd.js → AuditHistoryPanel-YeKe0CdO.js} +1 -1
- package/assets/assets/{BacklinksPage-CU089NxY.js → BacklinksPage--cebdWId.js} +1 -1
- package/assets/assets/{ChartPrimitives-DfRYjnsb.js → ChartPrimitives-DXCNvCNq.js} +1 -1
- package/assets/assets/{HistoryPage-CtOK4bCH.js → HistoryPage-Bv5Nsm5B.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-C-XeLSL1.js → MeasurementPropertyPage-Czyfi0Cy.js} +1 -1
- package/assets/assets/{ProjectPage-HpOMuZBk.js → ProjectPage-DJe32kjK.js} +9 -9
- package/assets/assets/{RunsPage-CRnzj7dU.js → RunsPage-BBMqOkFs.js} +1 -1
- package/assets/assets/{ServerTrafficSection-x_7QecPB.js → ServerTrafficSection-DGWMEhEc.js} +1 -1
- package/assets/assets/{SettingsPage-BumPFoPz.js → SettingsPage-9PzZpqL2.js} +1 -1
- package/assets/assets/{ToneBadge-BoscSKWW.js → ToneBadge-DRmwaKRk.js} +2 -2
- package/assets/assets/{TrafficPage-CxEO_Y2c.js → TrafficPage-Cejn8Fnv.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-D9me5kmv.js → TrafficSourceDetailPage-DIeCgXFX.js} +1 -1
- package/assets/assets/{account-context-n5iq1FxI.js → account-context-CfBDR6hl.js} +1 -1
- package/assets/assets/{agent-trust-copy-BWQkohiR.js → agent-trust-copy-DMeyA6SQ.js} +1 -1
- package/assets/assets/{card-CnZ3aU1G.js → card-CtxpcVrz.js} +1 -1
- package/assets/assets/{index-DPz1idfn.css → index-BfcVhcae.css} +1 -1
- package/assets/assets/{index-BEk3rfJu.js → index-C9zbuGlp.js} +3 -3
- package/assets/assets/{query-client-CTKEElDQ.js → query-client-HEvA-XRl.js} +1 -1
- package/assets/assets/{react-query-D-G5epGz.js → react-query-D-u-W_MC.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-4Kr0Zt4p.js → react-sigma_core.esm.min-nHUsVjqN.js} +1 -1
- package/assets/assets/{server-traffic-Deh27adW.js → server-traffic-CiE8LDtb.js} +1 -1
- package/assets/assets/{service-Dur_GX4q.js → service-CpuZCGWk.js} +1 -1
- package/assets/index.html +9 -9
- package/dist/{ads-LPBLEQBU.js → ads-SDMYCM7U.js} +3 -3
- package/dist/{agent-NUQQRFIX.js → agent-KAJ7N4K5.js} +7 -7
- package/dist/{agent-ask-RLIEXI6J.js → agent-ask-VRBAA3LD.js} +3 -3
- package/dist/{agent-conversations-HXWBYGSK.js → agent-conversations-UJKZIBTJ.js} +3 -3
- package/dist/{agent-journeys-DZ4OK6RG.js → agent-journeys-ZEXWTKIX.js} +3 -3
- package/dist/{agent-memory-QASRDHY6.js → agent-memory-ZLNG67QP.js} +3 -3
- package/dist/{agent-providers-UNJBT65F.js → agent-providers-DC26H7L7.js} +3 -3
- package/dist/{agent-transcript-IYQDRVLL.js → agent-transcript-LQ7MD25B.js} +3 -3
- package/dist/{analytics-TGZAZQ4V.js → analytics-ECTVTHBL.js} +3 -3
- package/dist/{apply-OVSQL4ND.js → apply-PU5SMSQT.js} +3 -3
- package/dist/{backfill-PB2XFYU2.js → backfill-UOBJ74WV.js} +10 -10
- package/dist/{backlinks-TAEE5NW2.js → backlinks-5ACAELA4.js} +3 -3
- package/dist/{bing-Y47PPL2K.js → bing-EJAYJY2Q.js} +3 -3
- package/dist/{bootstrap-6SVPLI2X.js → bootstrap-67SLL4TQ.js} +10 -10
- package/dist/{cdp-AQQZBCSJ.js → cdp-RRK6SI5J.js} +7 -7
- package/dist/{chunk-MXCBG4Z7.js → chunk-237UH5XU.js} +1 -1
- package/dist/{chunk-2P2YNCJB.js → chunk-2NIALUNF.js} +1 -1
- package/dist/{chunk-VFT4AFA6.js → chunk-342SRLS4.js} +4 -4
- package/dist/{chunk-ZGAOBFAT.js → chunk-36E6ONH7.js} +1 -1
- package/dist/{chunk-WMZYHYKE.js → chunk-3YWBDKEM.js} +2 -2
- package/dist/{chunk-T52VRYI6.js → chunk-4RSE4WVE.js} +4 -4
- package/dist/{chunk-7X5YFLPM.js → chunk-4ZJ5OBHI.js} +2 -2
- package/dist/{chunk-VZXLMIPS.js → chunk-AP6NF7XZ.js} +3 -3
- package/dist/{chunk-FS65HPCW.js → chunk-CIRM6CYI.js} +2 -2
- package/dist/{chunk-FEHIXKYR.js → chunk-DNMJVN2G.js} +3 -3
- package/dist/{chunk-NWOPXLH3.js → chunk-DXHZAE7B.js} +3 -3
- package/dist/{chunk-MUBVE7E5.js → chunk-FX2WXFRS.js} +2 -2
- package/dist/{chunk-34ZFWATV.js → chunk-HOBBF66T.js} +1 -1
- package/dist/{chunk-2DTIIRPL.js → chunk-HUOJB576.js} +5 -5
- package/dist/{chunk-BNSSB6H4.js → chunk-IDSJ2UL7.js} +1 -1
- package/dist/{chunk-BDPFPPPQ.js → chunk-ITTJLJAV.js} +1 -1
- package/dist/{chunk-OBDOHDDJ.js → chunk-JCRR4R6U.js} +2 -2
- package/dist/{chunk-SBQTP5ET.js → chunk-KNDCEG3S.js} +924 -606
- package/dist/{chunk-3FYVI6ZY.js → chunk-KRMQHEHA.js} +22 -22
- package/dist/{chunk-VBNULTRM.js → chunk-KVBHT4RM.js} +1 -1
- package/dist/{chunk-NF2BC4W2.js → chunk-KWZY4DGQ.js} +366 -366
- package/dist/{chunk-QZKQL65D.js → chunk-LOXYLU6K.js} +1 -1
- package/dist/{chunk-DAMXZWN7.js → chunk-NF6H2HWJ.js} +7 -7
- package/dist/{chunk-CPLY2O4L.js → chunk-NW7CHK4V.js} +121 -4
- package/dist/{chunk-W6ORSOMS.js → chunk-QWVE4LB4.js} +1 -1
- package/dist/{chunk-EIJP6Z65.js → chunk-RMH7VXGG.js} +5 -5
- package/dist/{chunk-B3KL6JMP.js → chunk-T3NIHALJ.js} +4 -4
- package/dist/{chunk-TXH5BMVL.js → chunk-T45PRIHN.js} +3 -3
- package/dist/{chunk-T6TLIZEO.js → chunk-TBJKDTRW.js} +1 -1
- package/dist/{chunk-N5YFWTDQ.js → chunk-UPS2WHB3.js} +1 -1
- package/dist/{chunk-73SA4H5D.js → chunk-VTQMKA45.js} +1 -1
- package/dist/{chunk-HUH6676A.js → chunk-VZS2C7IA.js} +4 -4
- package/dist/{chunk-BL3BT3O5.js → chunk-XDCUJC4K.js} +4 -4
- package/dist/{chunk-O3HY3VSN.js → chunk-XZTCLR3G.js} +1 -1
- package/dist/{chunk-4PLVST2T.js → chunk-YO3SECAK.js} +2 -2
- package/dist/{chunk-2FWYWGIR.js → chunk-YW6J3STO.js} +1 -1
- package/dist/{chunk-KPF5NVNC.js → chunk-ZYG7V5RY.js} +7 -7
- package/dist/{citations-EPWMDINT.js → citations-F5X6YTXT.js} +4 -4
- package/dist/{cli-catalog-LOONVW4I.js → cli-catalog-3TK244WS.js} +3 -3
- package/dist/{cli-commands-DCTJL3OA.js → cli-commands-PFMEKY4J.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-XUXFF3N5.js → competitor-3BLGH7MK.js} +3 -3
- package/dist/{content-X4VUI6Q4.js → content-7QRCYQT6.js} +3 -3
- package/dist/{dashboard-TLOEIFYT.js → dashboard-C42KGKG4.js} +6 -6
- package/dist/{demo-24VUW2D7.js → demo-XYLOAE34.js} +1 -1
- package/dist/{demo-server-UHZFCQTB.js → demo-server-PTXOU2UU.js} +65 -15
- package/dist/{discover-Q53AI7AP.js → discover-LYRDQHZJ.js} +4 -4
- package/dist/{discover-eval-72A2EKS5.js → discover-eval-DPXWK35F.js} +3 -3
- package/dist/{doctor-PSJW22ME.js → doctor-57L3Q4O2.js} +3 -3
- package/dist/{evidence-BVP2S73D.js → evidence-K6K7BVTX.js} +3 -3
- package/dist/{export-cmd-3LZAJ24E.js → export-cmd-LIBMZHI5.js} +3 -3
- package/dist/{ga-VRCCYIOW.js → ga-U56VPNRX.js} +46 -5
- package/dist/{gbp-OK4CJ6JF.js → gbp-MRFDJ2HK.js} +3 -3
- package/dist/{google-GULK767N.js → google-QQDJNZ3O.js} +4 -4
- package/dist/{google-marketing-TQPEDQY6.js → google-marketing-MXFKQNQF.js} +1 -1
- package/dist/{health-cmd-IC5IQKBN.js → health-cmd-FECKLV5E.js} +4 -4
- package/dist/{history-EAEYLEVG.js → history-S3UJGH7B.js} +3 -3
- package/dist/index.d.ts +34 -34
- package/dist/index.js +26 -26
- package/dist/{init-V2UHVKFD.js → init-X4WUARKM.js} +12 -12
- package/dist/{insights-ICTSKQD6.js → insights-2UAIY4EV.js} +3 -3
- package/dist/intelligence-service-64ZLE37W.js +16 -0
- package/dist/{journeys-H2BOW42B.js → journeys-44U2W4WQ.js} +3 -3
- package/dist/{keys-OTJZGBGX.js → keys-JKUNWJQN.js} +3 -3
- package/dist/{keyword-ZZ4SPADG.js → keyword-5W3PDFCZ.js} +3 -3
- package/dist/{logs-IH74KKBP.js → logs-67S2VOW2.js} +3 -3
- package/dist/{mcp-U736ZMVE.js → mcp-RBZEEULW.js} +4 -4
- package/dist/mcp.js +10 -10
- package/dist/{measurement-plan-EJ5H5S3X.js → measurement-plan-H2WHPS6M.js} +5 -5
- package/dist/{notify-PVTESANP.js → notify-5MHM43II.js} +3 -3
- package/dist/{organic-evidence-PGDCDE7I.js → organic-evidence-PT37WD5D.js} +3 -3
- package/dist/{overview-3QPRHIML.js → overview-YSGLVOQL.js} +5 -5
- package/dist/{project-FLF4NQYK.js → project-I7VQRW4I.js} +3 -3
- package/dist/{project-setup-HMIMB7LA.js → project-setup-ABNKGLKM.js} +3 -3
- package/dist/{query-WFNBO5IA.js → query-6HCKL366.js} +3 -3
- package/dist/{research-NOC77N5S.js → research-4D3GNHI6.js} +3 -3
- package/dist/{results-export-MQ372TJX.js → results-export-CHHMZU7K.js} +3 -3
- package/dist/{run-KQEZAMFC.js → run-TYIRQZD6.js} +5 -5
- package/dist/{schedule-RXJR7S5O.js → schedule-JLTS2OH4.js} +3 -3
- package/dist/{search-AVPIH3SH.js → search-LRBIRDUD.js} +3 -3
- package/dist/{serve-E5OR75Z5.js → serve-X7MZKZ3B.js} +27 -27
- package/dist/{session-M5GJ7N4T.js → session-F3FYX2QK.js} +14 -14
- package/dist/{settings-FOPSQVXA.js → settings-K5SUV5Y4.js} +3 -3
- package/dist/{sitemaps-GOA3STCM.js → sitemaps-YWWBI67M.js} +3 -3
- package/dist/{skills-XJKTJ6LH.js → skills-ECQG3MBE.js} +2 -2
- package/dist/{snapshot-4W4FLLRV.js → snapshot-62BXAS6C.js} +3 -3
- package/dist/{src-VTBSLT3E.js → src-R53436JE.js} +2 -2
- package/dist/{status-DMP7OCRB.js → status-TNOLPP73.js} +5 -5
- package/dist/{technical-aeo-IBYKY4VO.js → technical-aeo-YDVU5TWC.js} +3 -3
- package/dist/{telemetry-PXSA7GSQ.js → telemetry-WBO4WDQB.js} +4 -4
- package/dist/{tools-K45ODYUR.js → tools-BI3B6WLL.js} +11 -11
- package/dist/{traffic-USZLDNGC.js → traffic-CPSRCVU7.js} +5 -5
- package/dist/{trends-FT5WL6EZ.js → trends-TD6UGUYE.js} +3 -3
- package/dist/{users-C5QGTAEE.js → users-NPOXIJ3C.js} +3 -3
- package/dist/{visibility-stats-FJRKQAIB.js → visibility-stats-VHU4F3VL.js} +4 -4
- package/dist/{wordpress-DII4DF43.js → wordpress-OLPTUY5E.js} +3 -3
- package/package.json +1 -1
- package/dist/intelligence-service-LCVAUMCO.js +0 -16
|
@@ -185,6 +185,17 @@ for the current snapshot. Use the GA referral-history commands for daily series.
|
|
|
185
185
|
Before you quote GA4 data, make sure that `cnry ga status` has a recent
|
|
186
186
|
`lastSyncedAt`. If it is stale, get approval before you run `cnry ga sync`.
|
|
187
187
|
|
|
188
|
+
To say which social or creator platforms are worth advertising on, read
|
|
189
|
+
`socialPlatformPerformance` from `cnry ga traffic`: platforms across every GA4
|
|
190
|
+
channel (tagged ads GA4 files as Paid Other count), each with conversions per
|
|
191
|
+
1,000 sessions and a server rank. It is value per visit, not return on ad
|
|
192
|
+
spend: without cost per click it says what a click is worth, so compare it
|
|
193
|
+
with the platform's real cost before you recommend spend. Quote the rank only
|
|
194
|
+
where the server gave one; a platform below `minSessions` is not ranked, and a
|
|
195
|
+
non-null `conversionRateUnavailableReason` means no rate is quotable. Keep a
|
|
196
|
+
platform's paid and organic figures apart, and remember the credit is GA4 last
|
|
197
|
+
click, which undercounts upper-funnel platforms.
|
|
198
|
+
|
|
188
199
|
For Cloud Run, WordPress, Vercel, or Cloudflare, use `cnry traffic status` and
|
|
189
200
|
`cnry traffic events` for crawler and AI-referral evidence. Before you quote a
|
|
190
201
|
server-side AI referral total, run `cnry traffic referral-assessment` for the
|
|
@@ -1302,7 +1302,16 @@ cnry ga traffic <project> [--window 30d] [--start YYYY-MM-DD] [--end YYYY-MM-DD]
|
|
|
1302
1302
|
# AI last with engine null), socialPlatforms[] (socialReferrals
|
|
1303
1303
|
# grouped by platform; an unmatched source is its own group),
|
|
1304
1304
|
# socialPlatformDaily (top 5 platforms + other, every series
|
|
1305
|
-
# on every day), paidSocialSessions, paidSocialShare
|
|
1305
|
+
# on every day), paidSocialSessions, paidSocialShare,
|
|
1306
|
+
# socialPlatformPerformance (social and creator platforms in
|
|
1307
|
+
# EVERY GA4 channel, so fb_ads ads GA4 files as Paid Other and
|
|
1308
|
+
# ShopMy links in Unassigned count: platforms[] with sessions,
|
|
1309
|
+
# paid/organic, conversions, conversionsPerThousandSessions,
|
|
1310
|
+
# rank (null below minSessions=1,000) and sources[]; a session
|
|
1311
|
+
# crossing hosts counts once; site{} whole-site reference
|
|
1312
|
+
# (null when GA4 daily totals miss a day); rates null with
|
|
1313
|
+
# conversionRateUnavailableReason when sessions and conversions
|
|
1314
|
+
# cover different days). Human output prints the ranking.
|
|
1306
1315
|
cnry ga attribution <project> [--trend] # unified channel breakdown (organic / ai / social / direct
|
|
1307
1316
|
# sessions + raw and display share %s); --trend adds 7d/30d
|
|
1308
1317
|
# direction per channel + biggest mover
|
|
@@ -1988,7 +1997,7 @@ Compact reference for the composite / keyed commands agents read most (shapes ca
|
|
|
1988
1997
|
| `cnry google query-totals <p> [--start …] [--end …] [--window …] [--limit N] [--offset N]` | `GscQueryTotalsDto{ rows[], totalMatching, truncated, window }` @ `contracts/google.ts`. Each row = `{ query, clicks, impressions, ctr, position, days, source(google\|page-summed\|mixed) }`; `window` = `GscWindowRange{ startDate, endDate, latestDataDate, daysSinceLatestData }` plus `earliestDataDate` (first stored per-query date, `null` with none; a window starting before it is only partly covered). Named queries only: the rows do not add up to the property total. | Streams one line per query, each tagged with `project` and `window`. |
|
|
1989
1998
|
| `cnry ga measurement-analysis <p> [--window 30d\|60d\|90d] [--host-scope marketing\|all] [--path-prefix /…]` | `GaMeasurementAnalysisDto` @ `contracts/measurement.ts`: fixed 30-day `acquisition.periods/channels/pages`, configured-event `leads.periods/channels` with explicit attribution/filter scope, `leads.aiEngines{ leadRateAvailable, leadRateUnavailableReason, organic, paid }`, each class `{ periods[], engines[{ engine, label, sources[], periods[] }], unattributed{ sources[], periods[] } }` (lead events per AI engine from GA4 `sessionSource` via the shared `aiEngineForReferralSource` mapping, split by `classifyAiReferralTrafficClass` so tagged ad clicks never pool with organic, with the landing page left out on both sides when leads are channel-scoped; each cohort has `eventCount`, same-source same-class `sessions` under the same host/path filters, and `leadRate` = eventCount / sessions as a fraction, `null` on 0 sessions or when `leadRateAvailable` is false; `leadRateUnavailableReason` is `no-data`, `sync-not-ready` (latest acquisition or lead sync failed), `channel-leads-unfiltered` (channel-scoped leads cannot follow the host/path filters), `paid-split-needs-landing-page` (channel-scoped leads, and some AI sessions were paid only by landing-page utm tags, so they count as organic), `sessions-behind-leads` (leads stored past the last acquisition date) or `sessions-missing-on-lead-days` (a day in the window has leads but no stored acquisition rows); `unattributed` is GA4 `AI Assistant` channel rows matching no engine; a class's `periods[]` is its engines plus `unattributed`), and `searchDemand.periods/queries/pages` with property totals, reported branded/non-brand rows, and unreported residuals. Each GA component carries independent status/error/sync freshness. | → degrades to the `json` document |
|
|
1990
1999
|
| `cnry ga search-landing-pages <p> [--window 7d\|28d\|90d\|180d] [--limit N] [--offset N]` | `GaSearchLandingPagesResponse` @ `contracts/ga.ts`: `{ source, status(never-synced\|ready\|unavailable\|error), error, syncedAt, attemptedAt, window, windowStart, windowEnd, windowDays, timeZone, subjectToThresholding, dataLossFromOtherRow, total, reportRowCount, rowsCapped, totalRows, limit, offset, rows[], searchConsoleLink }`. `searchConsoleLink` = `{ state: has-data\|not-linked\|no-search-data\|unknown, searchConsoleImpressions (Canonry's own Search Console impressions for the window's days, null when none) }`, null with no snapshot. `total` and each `rows[]` entry = `{ organicGoogleSearchClicks, organicGoogleSearchImpressions, organicGoogleSearchClickThroughRate (0..1, null with no impressions), organicGoogleSearchAveragePosition (null with no impressions), activeUsers }` (+ `landingPage`, GA4's raw `landingPagePlusQueryString`, on rows). `total` is GA4's TOTAL row and null with no snapshot. `rowsCapped` = GA4 reported `reportRowCount` pages and only the top 10,000 by clicks, then impressions, were stored. | ✅ streams `rows` one / line as `{project, window, windowStart, windowEnd, …row}` (the Total is in `json` only) |
|
|
1991
|
-
| `cnry ga traffic <p> [--window …]` | Object summary — `GA4TrafficSummaryDto` / `GaTrafficResponse` @ `contracts/ga.ts`: `{ totalSessions, totalOrganicSessions, totalDirectSessions, totalUsers, aiSessionsDeduped, paidAiSessionsDeduped, organicAiSessionsDeduped, aiSessionsBySession, paidAiSessionsBySession, organicAiSessionsBySession, socialSessions, socialUsers, paidSocialSessions, paidSocialShare, channelBreakdown{organic,social,direct,ai,other→{sessions,sharePct,sharePctDisplay}}, *SharePct (+ `*Display`), topPages[], aiReferrals[], aiEngines[{engine,label,sessions,organicSessions,paidSessions,share,sources[]}], aiReferralLandingPages[], socialReferrals[], socialPlatforms[{platform,label,sessions,organicSessions,paidSessions,share,sources[]}], socialPlatformDaily{series[],otherCount,days[{date,sessions,values}]}, lastSyncedAt, periodStart, periodEnd }`. Groups partition their rows: `aiEngines` sums to the `aiReferrals` sessions and `socialPlatforms` to `socialSessions`; AI traffic whose source names no engine is the `engine: null` group, never assigned an engine. **AI referrals are sessions only.** The six `ai*Users*` fields and the `users` on `aiReferrals[]` / `aiReferralLandingPages[]` were withdrawn in 4.135.0 — GA reports users as a COUNT DISTINCT at the grain requested, so the stored column re-counted one visitor per landing page, medium, channel and date, and no un-dimensioned AI-referral fetch exists to supply a correct figure. `totalUsers` and `socialUsers` are unaffected. | → degrades to the `json` document |
|
|
2000
|
+
| `cnry ga traffic <p> [--window …]` | Object summary — `GA4TrafficSummaryDto` / `GaTrafficResponse` @ `contracts/ga.ts`: `{ totalSessions, totalOrganicSessions, totalDirectSessions, totalUsers, aiSessionsDeduped, paidAiSessionsDeduped, organicAiSessionsDeduped, aiSessionsBySession, paidAiSessionsBySession, organicAiSessionsBySession, socialSessions, socialUsers, paidSocialSessions, paidSocialShare, socialPlatformPerformance{status, unavailableReason, sessions, sharePct(+Display), paidSessions, paidShare, conversions, conversionRateAvailable, conversionRateUnavailableReason, countedEventNames[], minSessions, site{sessions, conversions, conversionsPerThousandSessions(+Display)}, platforms[{key, platform, label, sessions, organicSessions, paidSessions, share, conversions, conversionsPerThousandSessions(+Display), enoughSessions, rank, paid{}, organic{}, channelGroups[], sources[{source, medium, channelGroup, trafficClass, sessions, share, conversions, conversionsPerThousandSessions(+Display)}]}], daily} (every GA4 channel; ranked by conversions per 1,000 sessions from minSessions), channelBreakdown{organic,social,direct,ai,other→{sessions,sharePct,sharePctDisplay}}, *SharePct (+ `*Display`), topPages[], aiReferrals[], aiEngines[{engine,label,sessions,organicSessions,paidSessions,share,sources[]}], aiReferralLandingPages[], socialReferrals[], socialPlatforms[{platform,label,sessions,organicSessions,paidSessions,share,sources[]}], socialPlatformDaily{series[],otherCount,days[{date,sessions,values}]}, lastSyncedAt, periodStart, periodEnd }`. Groups partition their rows: `aiEngines` sums to the `aiReferrals` sessions and `socialPlatforms` to `socialSessions`; AI traffic whose source names no engine is the `engine: null` group, never assigned an engine. **AI referrals are sessions only.** The six `ai*Users*` fields and the `users` on `aiReferrals[]` / `aiReferralLandingPages[]` were withdrawn in 4.135.0 — GA reports users as a COUNT DISTINCT at the grain requested, so the stored column re-counted one visitor per landing page, medium, channel and date, and no un-dimensioned AI-referral fetch exists to supply a correct figure. `totalUsers` and `socialUsers` are unaffected. | → degrades to the `json` document |
|
|
1992
2001
|
| `cnry ga attribution <p> [--trend]` | Object — a **renamed projection** of `GaTrafficResponse` (⚠️ field names differ from the DTO): `aiSessions`(←`aiSessionsDeduped`), `organicSessions`(←`totalOrganicSessions`), `directSessions`(←`totalDirectSessions`), plus `totalSessions, totalUsers, paidAiSessions, organicAiSessions, aiSessionsBySession, paidAiSessionsBySession, organicAiSessionsBySession, socialSessions, socialUsers, {ai,social,organic,direct}SharePct (+ `*Display`), otherSessions, otherSharePct, channelBreakdown, aiReferrals[], aiReferralLandingPages[], socialReferrals[], periodStart, periodEnd`. With `--trend`: drops `periodStart/End`, adds `trend` (`GaAttributionTrendResponse`). Assembled inline in `commands/ga.ts`. | → degrades to the `json` document |
|
|
1993
2002
|
| `cnry key list` / `key create` / `key revoke <id>` | `list`: `{ keys[] }` — each `ApiKeyDto{ id, name, keyPrefix, scopes[], projectId, projectName, readOnly, createdAt, lastUsedAt, revokedAt }` (SAFE metadata, never the hash or plaintext). `create`: `CreatedApiKeyDto` = `ApiKeyDto` **plus a one-time `key`** (the plaintext `cnry_…` token, shown once). `revoke`: the `ApiKeyDto` with `revokedAt` set. @ `contracts/api-keys.ts` | `key list` streams one key / line; `create` / `revoke` degrade to the `json` document |
|
|
1994
2003
|
| `cnry gbp summary <p> [--location …]` | `{ scope{locationName,locationCount}, performance{totals,recent7d,prior7d,deltaPct} (metric-keyed maps; keys are raw `BUSINESS_*` / `WEBSITE_CLICKS` tokens — label via `formatGbpMetricLabel`), freshness{dataThroughDate,latestStoredDate,pendingDays}, timeseries[], keywords{total,thresholdedCount,thresholdedPct}, placeActions{total,hasReservationCta,hasBookingCta,hasDirectMerchantCta}, lodging{lodgingLocationCount,populatedLodgingCount,emptyLodgingCount}, profileCompleteness{locationCount,withSecondaryCategories,secondaryCategoryTotal,withDescription,withServiceArea,withHours,withPrimaryPhone,permanentlyClosed,temporarilyClosed} }` — `GbpSummaryDto` @ `contracts/gbp.ts`; `emptyLodgingCount` means 0 readable Lodging API groups, a verify signal rather than proof the Hotel details panel is empty. `timeseries[]`=`{date,pending,metrics}`. | → degrades to the `json` document |
|
|
@@ -129,12 +129,10 @@ Application Password. It has no browser-side capture path.
|
|
|
129
129
|
> AI-agent traffic, bypass **every** cache layer for the selected AI user
|
|
130
130
|
> agents, or capture from access/edge logs instead.
|
|
131
131
|
|
|
132
|
-
**Which user-agents to exclude from the cache** (
|
|
133
|
-
|
|
134
|
-
`rocket_cache_reject_ua`, or W3TC / WP Super Cache "Rejected User
|
|
135
|
-
Agents"):
|
|
132
|
+
**Which user-agents to exclude from the cache** (enter them as described in
|
|
133
|
+
"Entering the list" below):
|
|
136
134
|
|
|
137
|
-
```
|
|
135
|
+
```text
|
|
138
136
|
GPTBot
|
|
139
137
|
OAI-SearchBot
|
|
140
138
|
OAI-AdsBot
|
|
@@ -184,6 +182,80 @@ Claude-Agent) and any it names later. Do NOT add traditional search agents
|
|
|
184
182
|
helps them crawl efficiently, and the important Google/Bing crawl evidence is
|
|
185
183
|
available through their webmaster tools.
|
|
186
184
|
|
|
185
|
+
**Entering the list.** Each cache plugin matches entries differently. A wrong
|
|
186
|
+
format fails silently: the agent keeps receiving cached pages and the plugin
|
|
187
|
+
never sees it.
|
|
188
|
+
|
|
189
|
+
- **LiteSpeed Cache** (Cache → Excludes → "Do Not Cache User Agents") and
|
|
190
|
+
**W3 Total Cache** (Performance → Page Cache → Advanced → "Rejected user
|
|
191
|
+
agents"): paste the list as-is, one per line. Both match case-insensitively
|
|
192
|
+
anywhere in the user agent.
|
|
193
|
+
- **WP Rocket** ("Never Cache User Agent(s)"): paste the WP Rocket list
|
|
194
|
+
below. WP Rocket's `.htaccess` rule only matches user agents that *start*
|
|
195
|
+
with an entry, and most AI agents' user agents start with `Mozilla/5.0`, so
|
|
196
|
+
plain entries keep receiving cached pages on Apache and LiteSpeed servers.
|
|
197
|
+
The `(.*)` prefix matches anywhere in the user agent. Keep the casing shown,
|
|
198
|
+
because WP Rocket's PHP check is case-sensitive. Use this form only in WP
|
|
199
|
+
Rocket: the other plugins read `(.*)` as literal text.
|
|
200
|
+
- **WP Super Cache**: its "Rejected User Agents" setting only stops these
|
|
201
|
+
agents from creating cache files; it still serves them existing cached
|
|
202
|
+
pages. In **Simple** delivery mode, add the WP Super Cache snippet below to
|
|
203
|
+
`wp-config.php`, above the `/* That's all, stop editing! */` line. **Expert**
|
|
204
|
+
delivery mode serves cached files from `.htaccess` before PHP runs and has
|
|
205
|
+
no user-agent bypass: switch to Simple, or capture from access/edge logs.
|
|
206
|
+
|
|
207
|
+
**WP Rocket list:**
|
|
208
|
+
|
|
209
|
+
```text
|
|
210
|
+
(.*)GPTBot
|
|
211
|
+
(.*)OAI-SearchBot
|
|
212
|
+
(.*)OAI-AdsBot
|
|
213
|
+
(.*)ChatGPT-User
|
|
214
|
+
(.*)openai-mcp
|
|
215
|
+
(.*)ClaudeBot
|
|
216
|
+
(.*)Claude-
|
|
217
|
+
(.*)anthropic-ai
|
|
218
|
+
(.*)PerplexityBot
|
|
219
|
+
(.*)Perplexity-User
|
|
220
|
+
(.*)ShapBot
|
|
221
|
+
(.*)Shap-User
|
|
222
|
+
(.*)Google-Agent
|
|
223
|
+
(.*)Google-GeminiNotebook
|
|
224
|
+
(.*)Google-NotebookLM
|
|
225
|
+
(.*)Google-CloudVertexBot
|
|
226
|
+
(.*)Bytespider
|
|
227
|
+
(.*)Applebot
|
|
228
|
+
(.*)meta-externalagent
|
|
229
|
+
(.*)meta-webindexer
|
|
230
|
+
(.*)meta-externalfetcher
|
|
231
|
+
(.*)CCBot
|
|
232
|
+
(.*)cohere-ai
|
|
233
|
+
(.*)Diffbot
|
|
234
|
+
(.*)MistralAI-User
|
|
235
|
+
(.*)MistralAI-Index
|
|
236
|
+
(.*)MistralAI-Training
|
|
237
|
+
(.*)MistralBot
|
|
238
|
+
(.*)DeepSeekBot
|
|
239
|
+
(.*)xAI-Bot
|
|
240
|
+
(.*)Grok-Bot
|
|
241
|
+
(.*)GrokBot
|
|
242
|
+
(.*)YouBot
|
|
243
|
+
(.*)ExaSearchBot
|
|
244
|
+
(.*)DuckAssistBot
|
|
245
|
+
(.*)Amazonbot
|
|
246
|
+
(.*)Amzn-SearchBot
|
|
247
|
+
(.*)Amzn-User
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**WP Super Cache snippet** (`wp-config.php`):
|
|
251
|
+
|
|
252
|
+
```php
|
|
253
|
+
// Canonry Traffic Logger: don't serve cached pages to AI agents, so the plugin records their visits.
|
|
254
|
+
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/GPTBot|OAI-SearchBot|OAI-AdsBot|ChatGPT-User|openai-mcp|ClaudeBot|Claude-|anthropic-ai|PerplexityBot|Perplexity-User|ShapBot|Shap-User|Google-Agent|Google-GeminiNotebook|Google-NotebookLM|Google-CloudVertexBot|Bytespider|Applebot|meta-externalagent|meta-webindexer|meta-externalfetcher|CCBot|cohere-ai|Diffbot|MistralAI-User|MistralAI-Index|MistralAI-Training|MistralBot|DeepSeekBot|xAI-Bot|Grok-Bot|GrokBot|YouBot|ExaSearchBot|DuckAssistBot|Amazonbot|Amzn-SearchBot|Amzn-User/i', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
255
|
+
define( 'WPSC_SERVE_DISABLED', true );
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
187
259
|
> **1.1.0 -> 1.1.1 measurement boundary.** Plugin 1.1.0 briefly added a
|
|
188
260
|
> JavaScript beacon to recover browser/referral page views served from cache.
|
|
189
261
|
> Plugin 1.1.1 removes it and returns to PHP-only capture. This intentionally
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{Vc as t,Wc as n,r}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{Vc as t,Wc as n,r}from"./ToneBadge-DRmwaKRk.js";import{D as i,E as a,h as o}from"./ChartPrimitives-DXCNvCNq.js";import{n as s,r as c}from"./account-context-CfBDR6hl.js";import{a as l,i as u,n as d,r as f,t as ee}from"./card-CtxpcVrz.js";function p(e,t=[]){let n=e.trim().split(`/`),r=n.length>1?n.shift():``,i=n.join(`/`),a=r===`google`&&/^gemini(?:[-_]|$)/i.test(i)?`Google`:r===`anthropic`&&/^claude(?:[-_]|$)/i.test(i)?`Anthropic`:r===`openai`&&/^(?:gpt(?:[-_]|$)|o\d)/i.test(i)?`OpenAI`:``,o=t.find(t=>t.id===e)?.displayName.trim();if(o){let e=`${a}:`;return a&&o.startsWith(e)&&o.slice(e.length).trim()||o}let s=e=>e.replace(/(?<!\d)[-_]|[-_](?!\d)/g,` `).replace(/:\s*/g,`: `).replace(/\b[a-z]+/gi,e=>e.toLowerCase()===`gpt`?`GPT`:e.toLowerCase()===`ai`?`AI`:e===`o`?e:e.charAt(0).toUpperCase()+e.slice(1)).replace(/\bGPT (?=\d)/g,`GPT-`),c=s(i);return r&&!a?`${s(r)}: ${c}`:c}var m=`__cited__`,h=`__mentioned__`,g=`__mentionShare__`;function _(e){let t=e,{dataStartDate:n,dataEndDate:r}=t;return typeof n!=`string`||typeof r!=`string`?null:{start:o(n),end:o(r),sweepCount:t.sweepCount??1}}function v(e,t=new Date){return i(e,t)}function y(e,t=new Date){let n=_(e);if(!n)return null;let r=v(n.start,t),i=v(n.end,t);return r===i?r:`${r} to ${i}`}function b(e,t=new Date){let n=_(e),r=y(e,t);return!n||!r?`Check date unavailable`:`${r} · ${n.sweepCount} ${n.sweepCount===1?`check`:`checks`}`}function x(e){let t=_(e);return t?a(t.start):``}function S(e){return e.trim().toLowerCase()}function C(e,t={}){return e.map(e=>{let n=e.trim().toLowerCase(),r=(t[e]??[]).map(e=>e.trim().toLowerCase()).filter(Boolean).sort();return n&&r.length>0?`${n}=${r.join(`|`)}`:n}).filter(Boolean).sort().join(`
|
|
2
2
|
`)}function te(e,r){let i=n(e);return i?`${p(i,r?.find(e=>e.name===`openrouter`)?.knownModels??r?.find(t=>t.name===e)?.knownModels)} via OpenRouter`:r?.find(t=>t.name===e)?.displayName?.trim()||t(e)}function w(e){return Math.round(e*1e3)/10}function T(e){return e===null?null:w(e)}function E(e){return e.byProvider??{}}function D(e,t,n){let r=e.buckets.length>0,i=e.buckets.length===1;if(n===`overall`){let n=t===`cited`?m:h,a=t===`cited`?`citationRate`:`mentionRate`;return{rows:e.buckets.map(e=>({date:e.startDate,[n]:T(e[a])})),series:[n],hasData:r,singleBucket:i}}let a=t===`mentioned`?`mentionRate`:`citationRate`,o=[...new Set(e.buckets.flatMap(e=>Object.keys(E(e))))].sort();return{rows:e.buckets.map(e=>{let t={date:e.startDate},n=E(e);for(let e of o){let r=n[e];t[e]=r?T(r[a]):null}return t}),series:o,hasData:r,singleBucket:i}}function O(e){let t=e;return Object.hasOwn(t,`modelEvidenceByProvider`)?t.modelEvidenceByProvider??{}:null}function ne(e){let t=e;return Object.hasOwn(t,`modelAttribution`)?t.modelAttribution??{}:null}function re(e){return e.servedModelAttribution??{}}function ie(e){return e.modelServiceMismatch??{}}function ae(e){return e.modelPointerChanges??{}}function k(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function A(e){switch(e.status){case`known`:return e.model.includes(`/`)?p(e.model):e.model;case`unknown`:return`Unknown model`;case`mixed`:return e.models.length===0?`Unknown model`:`${e.models.map(e=>e.includes(`/`)?p(e):e).join(`, `)}${e.includesUnknown?` and an unknown model`:``}`}}function j(e){return k([...e.models.map(e=>e.includes(`/`)?p(e):e),...e.includesUnknown?[`an unknown model`]:[]])}function M(e){let t=new Map;for(let[n,r]of Object.entries(e))for(let e of r.events){let r=t.get(e.bucketStartDate)??[];r.push({provider:n,event:e}),t.set(e.bucketStartDate,r)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucketStartDate:e,events:[...t].sort((e,t)=>e.provider.localeCompare(t.provider)||e.event.observedAt.localeCompare(t.event.observedAt))}))}function N(e){let t={},n=[];for(let[r,i]of Object.entries(e)){let e=i.events.filter(e=>!e.fromPreWindowAnchor);for(let e of i.events)e.fromPreWindowAnchor&&n.push({provider:r,event:e});e.length>0&&(t[r]={...i,events:e})}return{buckets:M(t),beforeWindow:n.sort((e,t)=>e.event.observedAt.localeCompare(t.event.observedAt)||e.provider.localeCompare(t.provider))}}function P(e){let t=[];for(let[n,r]of Object.entries(e)){let e=r.eventTotal??r.events.length;e>r.events.length&&t.push({provider:n,shown:r.events.length,total:e})}return t.sort((e,t)=>e.provider.localeCompare(t.provider))}function F(e){let t=e.buckets.map(e=>{let t=e.mentionShare;return{date:e.startDate,[g]:t?.rate==null?null:w(t.rate)}}),n=t.map(e=>e[g]).filter(e=>typeof e==`number`&&Number.isFinite(e));return{rows:t,series:[g],hasData:n.length>0,singleBucket:n.length===1}}function I(e,t,n){return t===`mentionShare`?F(e):D(e,t,n)}function L(e,t){if(t===`mentionShare`)return e.buckets.flatMap(e=>{let t=e.mentionShare?.rate;return typeof t==`number`&&Number.isFinite(t)?[t]:[]});let n=t===`cited`?`citationRate`:`mentionRate`;return e.buckets.flatMap(e=>{let t=e[n];return t===null?[]:[t]})}function R(e){return e.buckets.some(e=>e.citationRate!==null)}function z(e,t){let n=e.buckets.flatMap(e=>{let n=E(e)[t];return n?[n]:[]});return n.length>0&&n.every(e=>e.citationRate===null)}function B(e,t){let n=e.windowChange;if(!n)return null;switch(t){case`cited`:return n.citationRate;case`mentioned`:return n.mentionRate;case`mentionShare`:return n.mentionShare}}function V(e,t,n){let r=n===`mentioned`?`mentionRate`:`citationRate`;for(let n=e.buckets.length-1;n>=0;n--){let i=E(e.buckets[n])[t]?.[r];if(i!=null)return i}return null}function H(e){return Date.parse(e)}function U(e,t){let n=_(e);if(!n)return!1;let r=H(t);return r>=H(n.start)&&r<=H(n.end)}function W(e){return e.basketChanges??[]}function oe(e,t){return t.filter(t=>U(e,t.at)).sort((e,t)=>H(e.at)-H(t.at))}function G(e,t){return S(e)===`perplexity`&&t.status===`known`&&!t.model.includes(`/`)}function K(e){return Object.entries(e).filter(([e,t])=>!G(e,t.configured)).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({provider:e,mismatch:t}))}function q(e){return[...W(e)].sort((e,t)=>H(t.at)-H(e.at)).map(e=>({at:o(e.at),added:e.added,removed:e.removed}))}function se(e,t){let n=[...e.events].sort((e,t)=>H(e.observedAt)-H(t.observedAt)),r=n[0]?.from??e.latestObservation.state;for(let e of n)H(e.observedAt)<=H(t)&&(r=e.to);return r}function J(e,t,n,r){return{provider:e,at:o(t.observedAt),onOrBefore:t.fromPreWindowAnchor===!0,anchorAt:t.anchorObservedAt?o(t.anchorObservedAt):null,from:t.from,to:t.to,served:n,reroute:r}}function ce(e,t){let n=[];for(let[r,i]of Object.entries(e)){let e=t[r]?.events??[],a=new Set(i.events.map(e=>e.observedAt));for(let t of i.events){let i=G(r,t.to)?e.find(e=>e.observedAt===t.observedAt):void 0;n.push(J(r,t,i?{from:i.from,to:i.to}:null,!1))}for(let t of e)a.has(t.observedAt)||G(r,se(i,t.observedAt))&&n.push(J(r,t,null,!0))}return n.sort((e,t)=>H(t.at)-H(e.at)||e.provider.localeCompare(t.provider))}function le({latest:e,queryChanges:t,modelRows:n,now:r=new Date}){let i=[...t.map(e=>e.at),...n.map(e=>e.at)];if(i.length===0)return null;let a=t=>e!==void 0&&U(e,t),o=t.filter(e=>a(e.at)),s=o.reduce((e,t)=>e+t.added.length,0),c=o.reduce((e,t)=>e+t.removed.length,0),l=n.filter(e=>a(e.at)).length,u=e?y(e,r):null;if(u===null||s+c+l===0)return`No changes since ${v(i.reduce((e,t)=>H(t)>H(e)?t:e),r)}`;let d=[u];return s>0&&d.push(`${s} ${s===1?`query`:`queries`} added`),c>0&&d.push(`${c} ${c===1?`query`:`queries`} removed`),l>0&&d.push(`${l} new ${l===1?`model`:`models`}`),d.join(` · `)}function ue(e,t,n,r=null){let i=H(e);if(!Number.isFinite(i))return null;let a=t.filter(e=>H(e)<i);if(a.length>0)return o(a.reduce((e,t)=>H(t)>H(e)?t:e));let s=n.map(e=>_(e)).filter(e=>e!==null).sort((e,t)=>H(e.start)-H(t.start)),c=s.findIndex(e=>H(e.start)<=i&&i<=H(e.end));if(c===-1)return null;let l=s[c];return H(l.start)===i?c>0?s[c-1].end:r&&H(r)<i?o(r):null:l.sweepCount===2&&H(l.end)===i?l.start:null}function de(e){let t=new Map,n=(e,n)=>{let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t of[...e].sort((e,t)=>e.revision-t.revision)){let e=H(t.at);for(let r of t.removed)n(r,{at:e,member:!1});for(let r of t.added)n(r,{at:e,member:!0})}return new Map([...t].filter(([,e])=>e.at(-1).member))}function Y(e,t){let n=!e[0].member;for(let r of e)r.at<=t&&(n=r.member);return n}function fe(e,t,n){return e.some(e=>e.at>t&&e.at<=n)}function X(e,t){let n=H(t.start),r=H(t.end);return t.sweepCount>2?fe(e,n,r):Y(e,n)!==Y(e,r)}function Z(e,t,n,r){let i=H(t),a=H(n),o={added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]},s=new Set;for(let[t,n]of de(e)){if(!r(n))continue;s.add(t);let e=Y(n,i),c=Y(n,a);e===c?(e?o.removedAndAddedBack:o.addedAndRemovedAgain).push(t):(c?o.added:o.removed).push(t)}if(s.size===0)return null;let c=e=>[...e.added,...e.removed].some(e=>s.has(e)),l=e.filter(e=>H(e.at)>i&&H(e.at)<=a&&c(e)).sort((e,t)=>H(e.at)-H(t.at));return{changes:l,keys:[...new Set(l.flatMap(e=>[...e.added,...e.removed]))].filter(e=>s.has(e)),moves:o}}function pe(e,t){if(e.length<2)return null;let n=e[0],r=e.at(-1),i=_(n),a=_(r),o=i?.start??n.startDate,s=a?.end??r.endDate,c=Z(t,o,s,e=>Y(e,H(o))!==Y(e,H(s))||i!==null&&X(e,i)||a!==null&&X(e,a));return!c&&n.queryCount===r.queryCount?null:{...c??{changes:[],keys:[],moves:{added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]}},firstCount:n.queryCount,latestCount:r.queryCount}}function me(e,t){let n=_(e);if(!n)return null;let r=Z(t,n.start,n.end,e=>X(e,n));return r?{...r,firstCount:e.queryCount,latestCount:e.queryCount}:null}function Q(e){return`${e} ${e===1?`query`:`queries`}`}function he(e){let t=[],n=e=>t.length===0?Q(e):String(e);return e.added.length>0&&t.push(`${n(e.added.length)} added`),e.removed.length>0&&t.push(`${n(e.removed.length)} removed`),e.removedAndAddedBack.length>0&&t.push(`${Q(e.removedAndAddedBack.length)} removed and added back`),e.addedAndRemovedAgain.length>0&&t.push(`${Q(e.addedAndRemovedAgain.length)} added and removed again`),k(t)}function ge(e,t,n,r){return e?t!==`mentionShare`||n!==`non-brand`||!r?!1:e.keys.length>0&&e.keys.every(e=>r(e)===`branded`):!0}var $=e();function _e({disabled:e,title:t,...n}){let{canWrite:i}=c();return i?(0,$.jsx)(r,{disabled:e,title:t,...n}):(0,$.jsx)(r,{...n,disabled:!0,title:s})}function ve({title:e,children:t}){let{isAdmin:n}=c();return n?(0,$.jsx)($.Fragment,{children:t}):(0,$.jsxs)(ee,{className:`surface-card mx-auto mt-8 max-w-lg`,children:[(0,$.jsxs)(u,{children:[(0,$.jsxs)(l,{children:[e,` is for administrators`]}),(0,$.jsx)(f,{children:`Your account has view-only access. You can read everything this install has measured; changing how it is set up needs an administrator account.`})]}),(0,$.jsx)(d,{children:(0,$.jsx)(`p`,{className:`supporting-copy`,children:`If you need to make a change here, ask an administrator on this install.`})})]})}export{W as A,P as B,L as C,q as D,te as E,ie as F,p as H,re as I,ge as L,_ as M,ne as N,he as O,ae as P,K as R,N as S,z as T,le as V,k as _,g as a,ce as b,R as c,x as d,y as f,G as g,v as h,h as i,O as j,pe as k,C as l,A as m,_e as n,oe as o,j as p,m as r,I as s,ve as t,b as u,V as v,me as w,S as x,B as y,ue as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,W as n,ft as r,tt as i}from"./vendor-lucide-iE5MEh2-.js";import{r as a}from"./vendor-markdown-BBGbNklj.js";import{At as o,Mt as s,fs as c,jt as l,ms as u,mt as d,on as f,ps as p,r as m,sn as h,t as g,zn as _}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,W as n,ft as r,tt as i}from"./vendor-lucide-iE5MEh2-.js";import{r as a}from"./vendor-markdown-BBGbNklj.js";import{At as o,Mt as s,fs as c,jt as l,ms as u,mt as d,on as f,ps as p,r as m,sn as h,t as g,zn as _}from"./ToneBadge-DRmwaKRk.js";import{r as v}from"./account-context-CfBDR6hl.js";import{t as y}from"./async-handler-Bj3TnIRw.js";import{at as b,lt as x}from"./index-C9zbuGlp.js";var S=e(r(),1),C=`Use the official Canonry docs:
|
|
2
2
|
- Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent
|
|
3
3
|
- CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md
|
|
4
4
|
- Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{r as n}from"./vendor-markdown-BBGbNklj.js";import{x as r}from"./vendor-tanstack-B90HW50P.js";import{bt as i,r as a,t as o}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{r as n}from"./vendor-markdown-BBGbNklj.js";import{x as r}from"./vendor-tanstack-B90HW50P.js";import{bt as i,r as a,t as o}from"./ToneBadge-DRmwaKRk.js";import{_n as s,c,vt as l}from"./react-query-D-u-W_MC.js";import{t as u}from"./card-CtxpcVrz.js";var d=e(t(),1),f=n(),p=100;function m(e){if(e===`all`)return;let t=Number.parseInt(e,10);return new Date(Date.now()-t*24*60*60*1e3).toISOString()}function h(e){let t=e.userAgent?.toLowerCase()??``;return t.includes(`canonry-mcp`)?`MCP`:t.includes(`canonry-cli`)?`CLI`:t.includes(`mozilla/`)?`Dashboard`:e.actor===`scheduler`?`Scheduler`:e.actor===`agent`?`Agent`:e.actor===`mcp`?`MCP`:e.actor===`cli`?`CLI`:e.actor}function g(e){return/delete|remove|revoke|disconnect|failed|refused/.test(e)?`negative`:/create|add|connect|completed/.test(e)?`positive`:/update|replace|sync|apply/.test(e)?`caution`:`neutral`}function _(e){return[e.action,e.actor,e.entityType,e.entityId,e.actorSession,e.userAgent,e.diff==null?``:JSON.stringify(e.diff)].filter(Boolean).join(` `).toLowerCase()}function v({projectName:e}){let[t,n]=(0,d.useState)(0),[v,y]=(0,d.useState)(`90d`),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(``),w=(0,d.useMemo)(()=>m(v),[v]),T={limit:p,offset:t*p,since:w,actor:b||void 0},E=r({...l({client:i,path:{name:e??``},query:T}),enabled:!!e}),D=r({...c({client:i,query:T}),enabled:!e}),O=r({...s({client:i}),enabled:!e}),k=e?E:D,A=k.data??[],j=(0,d.useMemo)(()=>new Map((O.data??[]).map(e=>[e.id,e.displayName||e.name])),[O.data]),M=S.trim().toLowerCase(),N=(0,d.useMemo)(()=>M?A.filter(e=>_(e).includes(M)):A,[A,M]),P=e=>{n(0),e()};return k.isLoading?(0,f.jsx)(`p`,{className:`supporting-copy mt-6`,role:`status`,children:`Loading change history…`}):(0,f.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`change-history-heading`,children:[(0,f.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,f.jsx)(`div`,{children:(0,f.jsx)(`h2`,{id:`change-history-heading`,className:e?void 0:`sr-only`,children:`Change history`})}),(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void k.refetch(),disabled:k.isFetching,children:k.isFetching?`Refreshing…`:`Refresh`})]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,f.jsx)(`input`,{type:`search`,"aria-label":`Search change history`,value:S,onChange:e=>C(e.target.value),placeholder:`Search actions, entities, or details`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by actor`,value:b,onChange:e=>P(()=>x(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:``,children:`All actors`}),(0,f.jsx)(`option`,{value:`api`,children:`API and dashboard`}),(0,f.jsx)(`option`,{value:`cli`,children:`CLI`}),(0,f.jsx)(`option`,{value:`scheduler`,children:`Scheduler`}),(0,f.jsx)(`option`,{value:`agent`,children:`Agent`}),(0,f.jsx)(`option`,{value:`mcp`,children:`MCP`})]}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by date range`,value:v,onChange:e=>P(()=>y(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:`30d`,children:`Last 30 days`}),(0,f.jsx)(`option`,{value:`90d`,children:`Last 90 days`}),(0,f.jsx)(`option`,{value:`365d`,children:`Last year`}),(0,f.jsx)(`option`,{value:`all`,children:`All retained history`})]})]}),k.isError?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`Change history unavailable`}),(0,f.jsx)(`p`,{children:k.error instanceof Error?k.error.message:`Could not load the audit trail.`})]}):N.length===0?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`No changes match these filters`}),(0,f.jsx)(`p`,{children:`Widen the date range or clear the actor and search filters.`})]}):(0,f.jsx)(`div`,{className:`evidence-table-wrap mt-4`,children:(0,f.jsxs)(`table`,{className:`evidence-table`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`When`}),e?null:(0,f.jsx)(`th`,{children:`Scope`}),(0,f.jsx)(`th`,{children:`Action`}),(0,f.jsx)(`th`,{children:`Entity`}),(0,f.jsx)(`th`,{children:`Origin`}),(0,f.jsx)(`th`,{children:`Details`})]})}),(0,f.jsx)(`tbody`,{children:N.map(t=>(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{className:`whitespace-nowrap tabular-nums text-muted`,children:new Date(t.createdAt).toLocaleString()}),e?null:(0,f.jsx)(`td`,{className:`text-secondary`,children:t.projectId?j.get(t.projectId)??`Deleted project · ${t.projectId}`:`Instance settings`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(o,{tone:g(t.action),children:t.action})}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-strong`,children:t.entityType}),t.entityId?(0,f.jsx)(`span`,{className:`mt-0.5 block max-w-48 truncate text-label-12-mono text-faint`,title:t.entityId,children:t.entityId}):null]}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-secondary`,children:h(t)}),t.actorSession?(0,f.jsxs)(`span`,{className:`mt-0.5 block max-w-40 truncate text-label-12-mono text-faint`,title:t.actorSession,children:[`Session `,t.actorSession]}):null]}),(0,f.jsx)(`td`,{children:t.diff==null?(0,f.jsx)(`span`,{className:`text-faint`,children:`No field diff`}):(0,f.jsxs)(`details`,{children:[(0,f.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary hover:text-strong`,children:`View diff`}),(0,f.jsx)(`pre`,{className:`max-h-72 max-w-xl overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-elevated p-3 text-copy-13 text-secondary`,children:JSON.stringify(t.diff,null,2)})]})})]},t.id))})]})}),!k.isError&&(t>0||A.length===p)?(0,f.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,disabled:t===0,onClick:()=>n(e=>Math.max(0,e-1)),children:`Previous`}),(0,f.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`Page `,t+1]}),(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,disabled:A.length<p,onClick:()=>n(e=>e+1),children:`Next`})]}):null]})}export{v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,U as n,c as r,ft as i,s as a,w as o}from"./vendor-lucide-iE5MEh2-.js";import{r as s}from"./vendor-markdown-BBGbNklj.js";import{$ as c,At as l,H as u,J as d,U as f,o as p,q as m,r as h,t as g,wt as _,xn as v,zt as y}from"./ToneBadge-BoscSKWW.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-CnZ3aU1G.js";import{t as S}from"./Hint-3TTi0MgX.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([u(),d().catch(()=>null),c().catch(()=>[]),f().catch(()=>[]),m().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await _();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await v(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof p&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await y(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Backlink source`})}),e?.duckdbInstalled?(0,w.jsx)(g,{tone:`positive`,children:`Installed`}):(0,w.jsx)(g,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!l()&&(0,w.jsxs)(h,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})}),s&&(0,w.jsx)(g,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!l()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(h,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),l()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(`div`,{className:`overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!l()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(g,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!l()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(h,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:l()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Past release syncs`})})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(g,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,U as n,c as r,ft as i,s as a,w as o}from"./vendor-lucide-iE5MEh2-.js";import{r as s}from"./vendor-markdown-BBGbNklj.js";import{$ as c,At as l,H as u,J as d,U as f,o as p,q as m,r as h,t as g,wt as _,xn as v,zt as y}from"./ToneBadge-DRmwaKRk.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-CtxpcVrz.js";import{t as S}from"./Hint-3TTi0MgX.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([u(),d().catch(()=>null),c().catch(()=>[]),f().catch(()=>[]),m().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await _();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await v(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof p&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await y(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Backlink source`})}),e?.duckdbInstalled?(0,w.jsx)(g,{tone:`positive`,children:`Installed`}):(0,w.jsx)(g,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!l()&&(0,w.jsxs)(h,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})}),s&&(0,w.jsx)(g,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!l()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(h,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),l()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(`div`,{className:`overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!l()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(g,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!l()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(h,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:l()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Past release syncs`})})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(g,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{c as t,f as n,i as r,m as i,r as a,s as o,t as s,u as c}from"./vendor-recharts-D3MLFU3q.js";import{Fc as l,dc as u}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{c as t,f as n,i as r,m as i,r as a,s as o,t as s,u as c}from"./vendor-recharts-D3MLFU3q.js";import{Fc as l,dc as u}from"./ToneBadge-DRmwaKRk.js";var d={ambiguous:`Property identity unverified`},f=`No answer could be tied to one property`;function p(e){return e.denominator===null||e.denominator===void 0||e.unattributed===void 0||e.unattributed<=0?null:`${e.unattributed} of ${e.denominator+e.unattributed} answers could not be tied to one property`}function m(e){if(e.denominator===null||e.denominator===void 0||e.unchecked===void 0||e.unchecked<=0)return null;let t=e.denominator+e.unchecked+(e.citationNotMeasured??0);return`${e.unchecked} of ${t} ${t===1?`answer`:`answers`} had sources that could not be checked`}var h=`The engine returns no sources, so whether it cites you is not measured.`;function g(e){if(e.denominator===null||e.denominator===void 0||e.citationNotMeasured===void 0||e.citationNotMeasured<=0)return null;let t=e.denominator+(e.unchecked??0)+e.citationNotMeasured;return`${e.citationNotMeasured} of ${t} ${t===1?`answer`:`answers`} came from engines that return no sources`}var _={label:`Not measured`,signal:`Citation not measured`,timeline:`citation not measured`,sources:h},v=function(e){return e.Clicks=`clicks`,e.Impressions=`impressions`,e.CTR=`ctr`,e.Position=`position`,e}({}),y={clicks:`Clicks`,impressions:`Impressions`,ctr:`CTR`,position:`Position`},b=u;function x(e){return e.endsWith(`%`)?{figure:e.slice(0,-1),sign:`%`}:{figure:e,sign:``}}function S(e,t){if(t!==`cited`)return p(e);let n=[m(e),g(e)].filter(e=>e!==null);return n.length===0?null:n.join(`; `)}function C(e,t){let n=S(e,t);if(n===null)return null;let r=t===`cited`?[...e.unchecked?[`${e.unchecked} unchecked`]:[],...e.citationNotMeasured?[`${e.citationNotMeasured} not measured`]:[]]:e.unattributed?[`${e.unattributed} unattributed`]:[],i=t===`cited`?(e.unchecked??0)+(e.citationNotMeasured??0):e.unattributed??0;if(r.length===0)return null;let a=r.join(`, `);return{label:a,text:`${a}. ${n}, so this rate leaves ${i===1?`it`:`them`} out.`}}function w(e,t){let n=l(e);switch(t){case`cited`:return`${n} cited (any page)`;case`emerging`:return`${n} newly cited (any page)`;case`lost`:return`${n} citation lost (any page)`;case`not-cited`:return`${n} not cited (any page)`;case`not-measured`:return`${n} citation not measured`;case`pending`:return`Pending`}}var T={cited:`Cited`,"not-cited":`Not cited`,"not-measured":_.label};function E(e){let t=[];if(e.message&&t.push(e.message),e.providers)for(let[n,r]of Object.entries(e.providers)){let e=`[${n}] ${r.message}`;r.raw===void 0?t.push(e):t.push(`${e}\n\n${JSON.stringify(r.raw,null,2)}`)}return t.length>0?t.join(`
|
|
2
2
|
|
|
3
3
|
`):`Run failed.`}function D(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function O(e,t,n=new Date){let r=new Date(e);if(Number.isNaN(r.getTime()))return e;let i=r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`});return t&&new Date(t).toDateString()===r.toDateString()?i:`${k(e,n)}, ${i}`}function k(e,t=new Date){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.getFullYear()===t.getFullYear()?A(e):n.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function j(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function M(e){return e===null?`Unknown`:e?`Pass`:`Fail`}function N(e){return e===0?`12:00 AM`:e<12?`${e}:00 AM`:e===12?`12:00 PM`:`${e-12}:00 PM`}function P(e,t){return e===`twice-daily`?`twice-daily`:e.startsWith(`weekly@`)?`${e}@${t}`:`daily@${t}`}function F(e,t){if(!e)return{freq:`custom`,hour:6,customCron:t};if(e===`twice-daily`)return{freq:`twice-daily`,hour:6,customCron:``};let n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:`daily`,hour:n[1]?parseInt(n[1]):6,customCron:``};let r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:``}:{freq:`custom`,hour:6,customCron:t}}function I(e,t,n){let r=n===`UTC`?`UTC`:n.split(`/`).pop()?.replace(/_/g,` `)??n;if(!e)return`Custom: ${t} · ${r}`;if(e===`twice-daily`)return`Twice a day (6am & 6pm) · ${r}`;let i=e.match(/^daily(?:@(\d+))?$/);if(i)return`Every day at ${N(i[1]?parseInt(i[1]):6)} · ${r}`;let a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){let e={mon:`Monday`,tue:`Tuesday`,wed:`Wednesday`,thu:`Thursday`,fri:`Friday`,sat:`Saturday`,sun:`Sunday`},t=a[2]?parseInt(a[2]):6;return`Every ${e[a[1]]} at ${N(t)} · ${r}`}return`${e} · ${r}`}function L(e,t){return t&&t!==e?`${e} · ${t}`:e}function R(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=new Intl.DateTimeFormat(`en-US`,{timeZoneName:`short`}).formatToParts().find(e=>e.type===`timeZoneName`)?.value;return L(e,t)}var z=e(),B={contentStyle:{backgroundColor:`var(--chart-tooltip-bg, #0a0a0a)`,border:`none`,borderRadius:`var(--radius-material-tooltip)`,boxShadow:`var(--shadow-material-tooltip)`,fontSize:13,lineHeight:`18px`,fontWeight:400},labelStyle:{color:`var(--chart-tooltip-label, #ededed)`},itemStyle:{color:`var(--chart-tooltip-item, #a1a1a1)`}},V={fill:`var(--chart-neutral-text-dim, #a1a1a1)`,fontSize:12},H=`var(--chart-grid, #2e2e2e)`,U=`var(--chart-axis, #2e2e2e)`,W=[`var(--chart-series-1, #34d399)`,`var(--chart-series-2, #60a5fa)`,`var(--chart-series-3, #f472b6)`,`var(--chart-series-4, #facc15)`,`var(--chart-series-5, #a78bfa)`,`var(--chart-series-6, #fb923c)`,`var(--chart-series-7, #22d3ee)`,`var(--chart-series-8, #f87171)`],G={gemini:`#60a5fa`,openai:`#34d399`,claude:`#fb923c`,perplexity:`#22d3ee`,muse:`#818cf8`,local:`#a78bfa`};function K(e,t=0){return G[e]??W[t%W.length]}var q={text:`var(--chart-neutral-text, #a1a1a1)`,textDim:`var(--chart-neutral-text-dim, #a1a1a1)`,textFaint:`var(--chart-neutral-text-faint, #7d7d7d)`,surface:`var(--chart-neutral-surface, #2e2e2e)`,trackSubtle:`var(--chart-neutral-track-subtle, rgb(255 255 255 / 0.04))`,gridLine:`var(--chart-neutral-grid-line, rgb(255 255 255 / 0.06))`},J={positive:`var(--chart-tone-positive, #34d399)`,positiveDeep:`var(--chart-tone-positive-deep, #10b981)`,caution:`var(--chart-tone-caution, #fbbf24)`,negative:`var(--chart-tone-negative, #fb7185)`,neutral:`var(--chart-tone-neutral, #a1a1a1)`};function Y(e){return e}function X(e){let t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);return t?{year:Number(t[1]),month:Number(t[2]),day:Number(t[3])}:null}function Z(e){let t=String(e),n=X(t);return n?new Date(Date.UTC(n.year,n.month-1,n.day)).toLocaleDateString(void 0,{timeZone:`UTC`,month:`short`,day:`numeric`,year:`numeric`}):t}function Q(e){let t=X(String(e));return t?`${t.month}/${t.day}`:String(e)}function $(e){let t=X(String(e));return t?new Date(Date.UTC(t.year,t.month-1,t.day)).toLocaleDateString(void 0,{timeZone:`UTC`,month:`short`,day:`numeric`}):String(e)}function ee(e){return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function te(e){return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function ne(e){return new Date(e).getFullYear()}function re(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`}function ie({data:e,xKey:l,series:u,height:d=260,xTickFormatter:f,labelFormatter:p,onSelectX:m,selectedX:h,accessibilityLayer:g=!0,ariaLabel:_}){let v=[...new Set(u.map(e=>e.axisId))],y=new Map(u.map(e=>[e.label,e.formatValue])),b=e.map((t,n)=>{let r={...t};for(let t of u){if(!t.trend)continue;let i=t.trend.startIndex??0,a=t.trend.endIndex??e.length-1;n<i||n>a?r[`${t.dataKey}__trend`]=null:r[`${t.dataKey}__trend`]=a<=i?t.trend.start:t.trend.start+(t.trend.end-t.trend.start)*(n-i)/(a-i)}return r});return(0,z.jsx)(i,{width:`100%`,height:d,children:(0,z.jsxs)(s,{data:b,accessibilityLayer:g,"aria-label":_,margin:{top:8,right:8,bottom:4,left:0},onClick:m?e=>{e?.activeLabel!==void 0&&m(String(e.activeLabel))}:void 0,style:m?{cursor:`pointer`}:void 0,children:[(0,z.jsx)(t,{stroke:H,strokeDasharray:`3 3`,vertical:!1}),h!=null&&(0,z.jsx)(c,{x:h,yAxisId:v[0],stroke:q.text,strokeDasharray:`2 3`,strokeWidth:1}),(0,z.jsx)(r,{dataKey:l,tick:V,stroke:U,tickFormatter:f,minTickGap:24}),v.map((e,t)=>{let n=u.find(t=>t.axisId===e);return(0,z.jsx)(a,{yAxisId:e,orientation:t===1?`right`:`left`,hide:t>1,reversed:n.inverted??!1,domain:n.inverted?[1,`auto`]:[0,`auto`],tick:V,stroke:U,width:48,tickFormatter:n.formatValue},e)}),(0,z.jsx)(n,{...B,labelFormatter:e=>{let t=typeof e==`string`||typeof e==`number`?String(e):``;return p?p(t):t},formatter:(e,t)=>{let n=String(t??``);return typeof e==`number`?[y.get(n)?.(e)??e.toLocaleString(),n]:[String(e??``),n]}}),u.filter(e=>e.trend).map(e=>(0,z.jsx)(o,{yAxisId:e.axisId,dataKey:`${e.dataKey}__trend`,name:`${e.label} trend`,stroke:e.color,strokeWidth:1.5,strokeDasharray:`5 4`,strokeOpacity:.55,dot:!1,activeDot:!1,isAnimationActive:!1,legendType:`none`,tooltipType:`none`},`${e.dataKey}-trend`)),u.map(e=>(0,z.jsx)(o,{yAxisId:e.axisId,dataKey:e.dataKey,name:e.label,stroke:e.color,strokeWidth:2,dot:!1,activeDot:{r:3},connectNulls:e.connectNulls??!1,isAnimationActive:!1},e.dataKey))]})})}export{R as A,d as B,M as C,k as D,A as E,b as F,D as I,_ as L,I as M,w as N,O,x as P,h as R,C as S,N as T,K as _,W as a,v as b,ie as c,Q as d,ee as f,ne as g,Y as h,q as i,F as j,j as k,Z as l,re as m,V as n,J as o,te as p,H as r,B as s,U as t,$ as u,T as v,E as w,P as x,y,f as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{t}from"./AuditHistoryPanel-
|
|
1
|
+
import{r as e}from"./vendor-markdown-BBGbNklj.js";import{t}from"./AuditHistoryPanel-YeKe0CdO.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`page-container`,children:[(0,n.jsx)(`div`,{className:`page-header`,children:(0,n.jsxs)(`div`,{className:`page-header-left`,children:[(0,n.jsx)(`h1`,{className:`page-title`,children:`History`}),(0,n.jsx)(`p`,{className:`page-subtitle`,children:`Changes to projects and settings.`})]})}),(0,n.jsx)(t,{})]})}export{r as HistoryPage};
|
package/assets/assets/{MeasurementPropertyPage-C-XeLSL1.js → MeasurementPropertyPage-Czyfi0Cy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t,ut as n}from"./vendor-lucide-iE5MEh2-.js";import{r}from"./vendor-markdown-BBGbNklj.js";import{_ as i,d as a,f as o,p as s,u as c,v as l,x as u}from"./vendor-tanstack-B90HW50P.js";import{Es as d,Ts as f,bt as p,ft as m,kt as h,r as g,t as _,ws as v,xc as ee,zs as y}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t,ut as n}from"./vendor-lucide-iE5MEh2-.js";import{r}from"./vendor-markdown-BBGbNklj.js";import{_ as i,d as a,f as o,p as s,u as c,v as l,x as u}from"./vendor-tanstack-B90HW50P.js";import{Es as d,Ts as f,bt as p,ft as m,kt as h,r as g,t as _,ws as v,xc as ee,zs as y}from"./ToneBadge-DRmwaKRk.js";import{E as b,H as x,n as te}from"./AccessControls-BL5Ohk1o.js";import{R as S,S as C,f as w,h as T,z as E}from"./ChartPrimitives-DXCNvCNq.js";import{r as ne}from"./account-context-CfBDR6hl.js";import{At as D,Ct as re,Dt as ie,Et as O,Nt as k,Tt as A,gn as j,wt as M}from"./react-query-D-u-W_MC.js";import{t as N}from"./InfoTooltip-D29JcNMW.js";import{$ as ae,Lt as oe,Vt as se,X as P,dt as F,et as I,ft as ce,gt as L,nt as le,pt as ue,q as de,zt as fe}from"./index-C9zbuGlp.js";import{c as R,r as z,s as pe,t as me,u as B}from"./service-CpuZCGWk.js";var V=e(t(),1),H=r(),U={heading:`Names that count as this Property`,help:`These names identify this Property in answer text. Source titles and URLs do not count as mentions. Qualified names add distinguishing words when several Properties share a name, such as a product line, service, or location.`,names:`Names`,qualifiedNames:`Qualified names`,noNames:`No names are set, so answers can cite this Property but never mention it.`,edit:`Edit names`,save:`Save to draft`,saving:`Saving…`,cancel:`Cancel`,namesHint:`One name per line.`,qualifiedHint:`One per line. Include a name above plus words that identify this specific Property.`,qualifiedNote:`With qualified names set, an answer that uses only a plain name counts as a mention only when it also cites this Property’s own page. Otherwise it is left out as not tied to one property.`,draftOnly:`Saving changes the draft only. Nothing is measured differently until the setup is published.`,saved:`Saved to the draft. Publish the setup to start using these names.`,pending:`Name changes are saved in the draft and not published yet.`,review:`Review and publish`,noChanges:`No changes to save.`,staleDraft:`The draft is based on an older published setup. Open measurement setup to restart it before editing names.`,missingFromDraft:`This Property is not included in the current draft. Open measurement setup to review it.`,conflict:`The draft changed in another session. The latest names are loaded; review them and save again.`,failed:`Could not save these names. Try again.`};function he(e){return[...new Set(e.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(Boolean))]}function ge(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function W(e,t){return ge(e.aliases,t.aliases)&&ge(e.identityAliases??[],t.identityAliases??[])}function _e(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function G({label:e,names:t}){return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e}),(0,H.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,H.jsx)(`li`,{className:`text-label-14 text-secondary`,children:e},e))})]})}function K({id:e,issues:t}){return t.length===0?null:(0,H.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,H.jsx)(`li`,{className:`text-label-14 text-caution`,children:v(e)},`${e.field}:${e.index}`))})}function ve({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:i,service:a=me}){let{canWrite:o}=ne(),s=(0,V.useId)(),m=u({...M({client:p,path:{name:e}}),enabled:o}),h=u({...k({client:p,path:{name:e}}),enabled:o}),_=m.data?.draft?.authoring.targets.find(e=>e.stableKey===t),v=n.identityAliases??[],ee=_!==void 0&&m.data?.draft?.baseActiveRevision===r&&!W(_,n),y=!m.isFetching&&!h.isPending,b=h.data,x=(0,V.useMemo)(()=>b?d(b):i,[b,i]),[S,C]=(0,V.useState)(!1),[w,T]=(0,V.useState)(``),[E,D]=(0,V.useState)(``),[re,ie]=(0,V.useState)(n),[O,A]=(0,V.useState)(null),j=`${e}\u0000${t}`,[ae,oe]=(0,V.useState)(j);ae!==j&&(oe(j),C(!1),T(``),D(``),ie(n),A(null));let se=(0,V.useRef)(j);se.current=j;let P=(0,V.useMemo)(()=>he(w),[w]),F=(0,V.useMemo)(()=>he(E),[E]),I=(0,V.useMemo)(()=>f({aliases:P,identityAliases:F,brandNames:x}),[P,F,x]),ce=I.filter(e=>e.field===`aliases`),L=I.filter(e=>e.field===`identityAliases`);function le(e){T(e.aliases.join(`
|
|
3
3
|
`)),D((e.identityAliases??[]).join(`
|
|
4
4
|
`)),ie({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function ue(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function de(){le(ee?_:n),A(null),C(!0)}function fe(e){e&&le(e),A({tone:`negative`,text:U.conflict,review:!1})}let R=l({mutationFn:async i=>{let o=await a.loadDraft(e);if(!o.draft){if(W(i.names,n))return{outcome:`unchanged`};if(!W(i.base,n))return{outcome:`conflict`,latest:n};await a.createDraft(e,r),o=await a.loadDraft(e)}let s=o.draft;if(!s||!o.etag)throw Error(U.failed);if(s.baseActiveRevision!==r)return{outcome:`stale`};let c=s.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:W(i.names,c)?{outcome:`unchanged`}:W(i.base,c)?(await a.upsertTarget(e,o.etag,_e(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===se.current)switch(e.outcome){case`saved`:C(!1),A({tone:`positive`,text:U.saved,review:!0});return;case`unchanged`:C(!1),A({tone:`positive`,text:U.noChanges,review:!1});return;case`stale`:A({tone:`negative`,text:U.staleDraft,review:!0});return;case`missing`:A({tone:`negative`,text:U.missingFromDraft,review:!0});return;case`conflict`:fe(e.latest),m.refetch();return}},onError:(e,t)=>{t.openFor===se.current&&(z(e)?(fe(null),m.refetch().then(e=>{e.isSuccess&&fe(ue(e.data))})):A({tone:`negative`,text:U.failed,review:!1}))}}),pe=(0,H.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:U.review}),B=n.aliases.length+v.length;return(0,H.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-names`,className:`text-heading-16 text-heading`,children:U.heading}),(0,H.jsx)(N,{text:U.help})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[B,` `,B===1?`name`:`names`]}),o&&!S?(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!y,onClick:de,children:U.edit}):null]})]}),O?(0,H.jsxs)(`p`,{role:O.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${O.tone===`negative`?`text-negative`:`text-positive`}`,children:[O.text,O.review?(0,H.jsxs)(H.Fragment,{children:[` `,pe]}):null]}):ee&&!S?(0,H.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[U.pending,` `,pe]}):null,S?(0,H.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!R.isPending&&R.mutate({names:{aliases:P,identityAliases:F},base:re,openFor:j})},children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`label`,{htmlFor:`${s}-names`,className:`block text-label-14-strong text-heading`,children:U.names}),(0,H.jsx)(`p`,{id:`${s}-names-hint`,className:`text-copy-14 text-secondary`,children:U.namesHint}),(0,H.jsx)(`textarea`,{id:`${s}-names`,className:`mt-1 min-h-24 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-names-hint${ce.length?` ${s}-names-issues`:``}`,value:w,onChange:e=>T(e.target.value)}),(0,H.jsx)(K,{id:`${s}-names-issues`,issues:ce}),P.length===0?(0,H.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:U.noNames}):null]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`label`,{htmlFor:`${s}-qualified`,className:`block text-label-14-strong text-heading`,children:U.qualifiedNames}),(0,H.jsx)(`p`,{id:`${s}-qualified-hint`,className:`text-copy-14 text-secondary`,children:U.qualifiedHint}),(0,H.jsx)(`textarea`,{id:`${s}-qualified`,className:`mt-1 min-h-20 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-qualified-hint ${s}-qualified-note${L.length?` ${s}-qualified-issues`:``}`,value:E,onChange:e=>D(e.target.value)}),(0,H.jsx)(K,{id:`${s}-qualified-issues`,issues:L}),(0,H.jsx)(`p`,{id:`${s}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:U.qualifiedNote})]}),(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:U.draftOnly}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsx)(te,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:R.isPending,children:R.isPending?U.saving:U.save}),(0,H.jsx)(g,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:R.isPending,onClick:()=>{C(!1),A(null)},children:U.cancel})]})]}):B===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:U.noNames}):(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,H.jsx)(G,{label:U.names,names:n.aliases}):null,v.length>0?(0,H.jsx)(G,{label:U.qualifiedNames,names:v}):null]})]})}var ye=50,q={branded:{technical:`Branded queries`},"non-brand":{technical:`Non-brand queries`}},J={plan_v1:`Setup update required`,no_completed_run:`No completed measurement yet`,no_population:`No queries of this type are assigned`,evidence_incomplete:`Source evidence is incomplete`,identity_ambiguous:E,not_applicable:`Not applicable for this Property`,citation_not_measured:`The engines return no sources`},be={complete:{label:`Measured`,tone:`positive`},partial:{label:`Partly measured`,tone:`caution`},running:{label:`Measuring now`,tone:`neutral`},queued:{label:`Measurement queued`,tone:`neutral`},failed:{label:`Measurement failed`,tone:`negative`},not_measured:{label:`Not measured`,tone:`neutral`}},Y={assigned:{label:`Matches this Property`,tone:`positive`},sibling:{label:`Matches another Property`,tone:`caution`},ownedUnmapped:{label:`Site URL not in a Property`,tone:`caution`},external:{label:`External URL`,tone:`neutral`},ambiguous:{label:`Matches multiple Properties`,tone:`caution`},invalid:{label:`Invalid URL`,tone:`negative`}};function X(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function xe(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function Se({row:e}){return e.mentioned===null?(0,H.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,H.jsx)(_,{tone:`neutral`,children:`Not measured`}),(0,H.jsx)(`span`,{className:`text-label-12 text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,H.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,H.jsx)(_,{tone:`neutral`,children:`Not mentioned`}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[L.label,(0,H.jsx)(N,{text:L.property})]})]}):(0,H.jsx)(_,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var Ce=`—`;function we({row:e}){return e.cited===null?(0,H.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,H.jsx)(_,{tone:`neutral`,children:`Not measured`}),(0,H.jsx)(`span`,{className:`text-label-12 text-muted`,children:e.citationMeasured===!1?`The engine returns no sources`:`Sources were not fully captured`})]}):(0,H.jsx)(_,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Te({row:e}){return e.citationMeasured===!1?(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:S}):e.cited===null&&e.sources.length===0?(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`The sources for this answer were not fully captured, so none can be shown.`}):e.sources.length===0?(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer returned no source URLs at all.`}):(0,H.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,H.jsxs)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[ce,` (`,e.sources.length,`)`]}),(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,H.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Match`}),(0,H.jsx)(`th`,{children:`URL`})]})}),(0,H.jsx)(`tbody`,{children:X(e.sources).map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(_,{tone:Y[e.classification].tone,children:Y[e.classification].label})}),(0,H.jsx)(`td`,{children:(0,H.jsx)(F,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function Ee({project:e,targetKey:t,resultId:n}){let r=u({...D({client:p,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`alert`,children:`Could not load this answer.`});let i=r.data?.answer;return i==null||i.trim()===``?(0,H.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(ue,{headingLevel:4,copyable:!0,children:i})})}function De(e){return J[e.reason]??`Not measured`}function Oe({metric:e,signal:t,queryClass:n,emphasis:r=!1,compact:i=!1}){if(e.state===`unavailable`)return(0,H.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:r?`text-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),(0,H.jsx)(`span`,{className:`text-label-14 text-secondary`,children:De(e)})]});let a=y(e.value),o=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,s=C(e,t);return i?(0,H.jsxs)(`span`,{className:`inline-flex flex-col items-end gap-0.5`,children:[(0,H.jsxs)(`span`,{className:`engine-comparison-metric`,children:[(0,H.jsx)(`span`,{className:`text-label-14-strong text-primary`,children:a}),o?(0,H.jsxs)(`span`,{className:`text-label-13 text-secondary`,"aria-hidden":`true`,children:[e.numerator,`/`,e.denominator]}):null,(0,H.jsxs)(`span`,{className:`sr-only`,children:[o?` · ${o} answers`:``,` · `,n,` queries`]})]}),s?(0,H.jsx)(`span`,{className:`flex`,children:(0,H.jsx)(N,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]}):(0,H.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,H.jsx)(`span`,{className:r?`text-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:a}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),o?(0,H.jsx)(`span`,{className:`text-label-12 text-muted`,children:o}):null,s?(0,H.jsx)(`span`,{className:`-ml-2 flex`,children:(0,H.jsx)(N,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]})}function ke(e,t,n){return re({client:p,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function Ae(e){return e?.properties.items.at(0)}function je({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${w(T(e))}`;return r===null&&t===void 0?null:(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function Me({project:e,groups:t}){return t.length===0?null:(0,H.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-market`,className:`text-heading-16 text-heading`,children:`Measured at the market level`}),(0,H.jsx)(N,{text:`Competitors are attached to groups. Share of voice and competitor pressure use the group or market that includes this Property.`})]})}),(0,H.jsx)(g,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,H.jsx)(c,{to:`/projects/$projectName`,params:{projectName:e},search:e=>I(P(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,H.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-label-14 text-strong`,children:[e.label,(0,H.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Ne({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,H.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,H.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-brand-contrast`,className:`text-heading-16 text-heading`,children:`Coverage for this Property`}),(0,H.jsx)(N,{text:`Non-brand queries do not name this Property. Branded queries name it. Each rate uses only the measured answers for that query type. Mentioned means the Property was named in the answer; cited means its URL appeared in the sources. Unchecked sources are not counted as a citation miss.`})]})}),(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Query type`}),(0,H.jsx)(`th`,{children:`Mentioned in the answer`}),(0,H.jsx)(`th`,{children:`Cited as a source`})]})}),(0,H.jsx)(`tbody`,{children:[{queryClass:`non-brand`,row:t,isError:r},{queryClass:`branded`,row:e,isError:n}].map(({queryClass:e,row:t,isError:n})=>(0,H.jsxs)(`tr`,{children:[(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:q[e].technical}),t&&n?(0,H.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,H.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,H.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]}):null]}),t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(Oe,{metric:t.mentionCoverage,signal:`mentioned`,queryClass:e,emphasis:!0})}),(0,H.jsx)(`td`,{children:(0,H.jsx)(Oe,{metric:t.citationCoverage,signal:`cited`,queryClass:e,emphasis:!0})})]}):n?(0,H.jsx)(`td`,{colSpan:2,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,H.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,H.jsxs)(g,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]})}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})}),(0,H.jsx)(`td`,{children:(0,H.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Pe({row:e,queryClass:t,isError:n}){return(0,H.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,H.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-providers`,className:`text-heading-16 text-heading`,children:`Which engines answer for this Property`}),(0,H.jsx)(N,{text:`Each row is measured over the queries that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%.`})]})})}),e===void 0&&n?(0,H.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Details for `,q[t].technical.toLocaleLowerCase(),` are unavailable. Retry that query type above.`]}):e===void 0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,H.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No answer engine has measured `,q[t].technical.toLocaleLowerCase(),` for this Property.`,e.mentionCoverage.state===`unavailable`?` ${De(e.mentionCoverage)}.`:``]}):(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`engine-comparison`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{scope:`col`,children:`Engine`}),(0,H.jsx)(`th`,{scope:`col`,children:`Mentioned`}),(0,H.jsx)(`th`,{scope:`col`,children:`Cited`})]})}),(0,H.jsx)(`tbody`,{children:e.providers.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(B,{provider:e.provider})}),(0,H.jsx)(`td`,{children:(0,H.jsx)(Oe,{metric:e.mentionCoverage,signal:`mentioned`,queryClass:t,compact:!0})}),(0,H.jsx)(`td`,{children:(0,H.jsx)(Oe,{metric:e.citationCoverage,signal:`cited`,queryClass:t,compact:!0})})]},e.provider))})]})})]})}function Z(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Fe({project:e,targetKey:t,queryClass:n}){let r=u({...O({client:p,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],a=r.data?.basis;return(0,H.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-named-instead`,className:`text-heading-16 text-heading`,children:`Named instead of this Property`}),(0,H.jsx)(N,{text:`Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once.`})]})}),i.length>0?(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No rival was named in the answers this Property missed. Nothing to compete with here yet.`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Named`}),(0,H.jsx)(`th`,{children:`Answers`}),(0,H.jsx)(`th`,{children:`Engines`}),(0,H.jsx)(`th`,{children:`Queries`})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,H.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,H.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.map(e=>b(e)).join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,H.jsx)(`td`,{className:`text-right`,children:(0,H.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,H.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,H.jsx)(N,{text:Z(e)})]})})]},e.name))})]})}),a?.state===`available`?(0,H.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[a.targetMissResults,` of `,a.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Ie({questions:e,queryClass:t}){return(0,H.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`h2`,{id:`property-questions`,className:`text-heading-16 text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,H.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No `,q[t].technical.toLocaleLowerCase(),` are assigned. Add one in advanced measurement setup to measure this class.`]}):(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{children:(0,H.jsx)(`th`,{children:`Query`})})}),(0,H.jsx)(`tbody`,{children:e.map(e=>(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Le({urls:e}){return(0,H.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-urls`,className:`text-heading-16 text-heading`,children:`URLs that count as this Property`}),(0,H.jsx)(N,{text:`A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either.`})]})}),(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No URLs are configured for this Property.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{children:(0,H.jsx)(`th`,{children:`URL`})})}),(0,H.jsx)(`tbody`,{children:e.map(e=>(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{className:`break-all text-secondary`,children:e})},e))})]})})]})}var Q={heading:`Cited on other queries`,help:`Answers to queries assigned to other properties that still cited one of this Property’s own pages. This Property was not measured on those queries, so these answers are not in its Mentioned or Cited rates.`,notCounted:`not in this Property’s rates`,empty:`No answer to a query assigned elsewhere cited this Property’s pages in the displayed measurement.`,loadError:`Citations from other queries could not be loaded.`,partlySaved:`Sources partly saved`};function Re({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:a}){let[o,s]=(0,V.useState)(new Set),l={client:p,path:{name:e},query:{targetKey:t,queryClass:n,shape:ee[`other-queries`],limit:ye,...r?{runId:r}:{}}},u=i({...ie(l),initialPageParam:l,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:l.path,query:{...l.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=u.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),m=d[0]?.otherQueries?.totalEstimate??f.length,h=e=>`${e.expectedSlotId}:${e.queryClass}`,_=q[n].technical.toLocaleLowerCase();return(0,H.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-other-queries`,className:`text-heading-16 text-heading`,children:Q.heading}),(0,H.jsx)(N,{text:Q.help})]}),u.data?(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[m,` `,m===1?`answer`:`answers`,` · `,_,` · `,Q.notCounted]}):null]}),u.isPending?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):u.isError&&f.length===0?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,H.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{u.refetch()},children:`Retry`})]}):f.length===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:Q.empty}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Query`}),(0,H.jsx)(`th`,{children:`Assigned to`}),(0,H.jsx)(`th`,{children:`Pages cited`}),(0,H.jsx)(`th`,{children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,H.jsx)(`tbody`,{children:f.map(t=>{let n=h(t),r=o.has(n),i=`property-other-query-${encodeURIComponent(n)}`;return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsxs)(`tr`,{children:[(0,H.jsxs)(`td`,{className:`text-secondary`,children:[(0,H.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:t.queryText}),(0,H.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[b(t.provider),t.location].filter(Boolean).join(` · `)})]}),(0,H.jsx)(`td`,{children:(0,H.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(c,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:P,className:`text-label-14 text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:a.get(t)??t})},t))})}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsx)(F,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,H.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,H.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,H.jsx)(`td`,{className:`text-right`,children:(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":r,"aria-label":r?`Hide the answer for ${t.queryText}`:`Read the answer for ${t.queryText}`,"aria-controls":r?i:void 0,onClick:()=>s(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{id:i,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,H.jsx)(Ee,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),u.hasNextPage?(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,H.jsxs)(`span`,{children:[`Showing `,f.length,` of `,m]}),(0,H.jsx)(g,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:u.isFetchingNextPage?`Loading…`:`Show ${ye} more`})]}):null]})]})}function ze(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${b(e.provider)} answer engine`:null,e.model?`the ${x(e.model)} model`:null,e.location?`location ${e.location}`:null,e.from||e.to?`a date range`:null,e.measurementRunId?`a saved check`:null].filter(e=>e!==null);return n.length===0?null:`AI Visibility is filtered to ${n.join(`, `)}. This page shows the latest measurement for ${R.allMarkets.toLocaleLowerCase()} and answer engines.`}function Be(){let{projectName:e,targetKey:t}=s({strict:!1}),r=a(),l=o({strict:!1}),d=(0,V.useMemo)(()=>ae(l),[l]),[f,v]=(0,V.useState)(new Set),y=e??``,x=t??``,te=!!y&&!!x,S=(0,V.useMemo)(()=>fe(`portfolio`,oe(m())),[]),C=te&&S,{canWrite:w}=ne(),T=u({...A({client:p,path:{name:y}}),enabled:C}),E=T.data?.active?.plan,D=E?.schemaVersion===2?E:null,re=d.queryClass===`branded`||d.queryClass===`non-brand`?d.queryClass:null,O=e=>D?.assignments.some(t=>t.targetKey===x&&t.queryClass===e)??!1,k=re??(!O(`non-brand`)&&O(`branded`)?`branded`:`non-brand`);(0,V.useEffect)(()=>{D&&!re&&r({to:`.`,replace:!0,search:e=>I(e,{queryClass:k})})},[D,re,k,r]);let M=u({...ke(y,x,`branded`),enabled:C}),F=u({...ke(y,x,`non-brand`),enabled:C}),L=Ae(M.data),ue=Ae(F.data),R=k===`branded`?M.data:F.data,z=k===`branded`?L:ue,me=(k===`branded`?M.isError:F.isError)&&z===void 0,B=R?.measurement.displayedRunId;se(y,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:x,queryClass:k,limit:10,...B?{runId:B}:{}}});let U=z?.mentionCoverage.state===`unavailable`?De(z.mentionCoverage):void 0,he=R===void 0?void 0:R.measurement.completedAt??null,ge=R!==void 0&&(R.measurement.state===`not_measured`||R.nextAction.kind===`run_measurement`),W=e=>I(P(e),{measurementScope:`property`,measurementScopeKey:x,queryClass:k,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),_e=u({...j({client:p,path:{name:y},query:le(ae(W(l)))}),enabled:C&&ge,retry:!1}).data,G=_e!==void 0&&_e.selection.measurement.measuredRevision!==null&&(_e.populations.find(e=>e.queryClass===k)?.summary.queryCount??0)>0,K={client:p,path:{name:y},query:{targetKey:x,queryClass:k,shape:ee.answers,limit:ye,...B?{runId:B}:{}}},J=i({...ie(K),enabled:C&&R!==void 0,initialPageParam:K,getNextPageParam:e=>e.answers?.nextCursor?{path:K.path,query:{...K.query,cursor:e.answers.nextCursor}}:void 0}),Y=T.data?.active??null,X=Y?.plan.schemaVersion===2?Y.plan:null,Oe=Y!==null&&X===null,Z=X?.targets.find(e=>e.stableKey===x)??null,Q=ze(d,X?.reportingScopes?.find(e=>e.stableKey===d.marketKey)?.label),Be=(0,V.useMemo)(()=>{if(!X)return[];let e=new Map(X.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(X.assignments.filter(e=>e.targetKey===x&&e.queryClass===k).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[X,x,k]),Ve=(0,V.useMemo)(()=>Z?.urlMatchers.map(pe)??[],[Z]),He=(0,V.useMemo)(()=>new Map((X?.targets??[]).map(e=>[e.stableKey,e.label])),[X]),Ue=(0,V.useMemo)(()=>X?.groups.filter(e=>e.targetKeys.includes(x))??[],[X,x]),$=(0,V.useMemo)(()=>(J.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[J.data]),We=J.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(J.data?.pages??[]).length>0&&(J.data?.pages??[]).every(e=>e.answers===void 0),Ke=J.data?.pages[0]?.measurement.state,qe=(0,H.jsxs)(c,{to:`/projects/$projectName`,params:{projectName:y},search:P,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,H.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!te)return(0,H.jsx)(`div`,{className:`page-container`,children:(0,H.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!S)return(0,H.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,H.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(T.isPending&&!T.isError)return(0,H.jsx)(`div`,{className:`page-container`,children:(0,H.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,H.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=T.isError&&T.data===void 0,Ye=M.isError&&M.data===void 0,Xe=F.isError&&F.data===void 0;return Je||Ye&&Xe?(0,H.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,H.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative`,children:`Could not load this Property.`}),(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{T.refetch(),M.refetch(),F.refetch()},children:`Try again`})]}):!X||!Z?(0,H.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,H.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:X?`This Property is not in the published setup. It may have been renamed or removed.`:`A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab.`}),(0,H.jsx)(g,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,H.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:y},children:w?Oe?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,H.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,H.jsxs)(`div`,{className:`page-header`,children:[(0,H.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,H.jsx)(`h1`,{className:`page-title mt-2`,children:Z.label}),(0,H.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,y,Q?(0,H.jsxs)(H.Fragment,{children:[` · Filters not applied `,(0,H.jsx)(N,{text:Q})]}):null]})]}),(0,H.jsxs)(`div`,{className:`page-header-right`,children:[R?(0,H.jsx)(_,{tone:be[R.measurement.state].tone,children:be[R.measurement.state].label}):null,z&&z.flags>0?(0,H.jsxs)(_,{tone:`caution`,children:[z.flags,` flagged`]}):null]})]}),(0,H.jsx)(Ne,{branded:L,nonBrand:ue,brandedError:M.isError,nonBrandError:F.isError,onRetry:e=>{e===`branded`?M.refetch():F.refetch()}}),ge?(0,H.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 py-4`,"aria-label":`Measurement next step`,children:[(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:h()?de:w?`Run a measurement from the project overview to collect this Property’s coverage and source evidence.${G?` AI Visibility still shows the last results.`:``}`:`This Property needs a new measurement before coverage and source evidence are available.`}),(0,H.jsx)(g,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,H.jsx)(c,{to:`/projects/$projectName`,params:{projectName:y},search:G?W:P,children:G?`See the last results`:w?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 py-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-label-14-strong text-heading`,children:`Query type`}),(0,H.jsxs)(`select`,{id:`property-query-class`,value:k,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>I(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-label-14 text-primary focus:outline-none focus:ring-2 focus:ring-mono-400`,children:[(0,H.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,H.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,H.jsx)(je,{measuredAt:he,unmeasuredReason:U,queryClass:k})]}),(0,H.jsx)(Pe,{row:z,queryClass:k,isError:me}),(0,H.jsx)(Fe,{project:y,targetKey:x,queryClass:k}),(0,H.jsx)(Ie,{questions:Be,queryClass:k}),(0,H.jsx)(ve,{projectName:y,targetKey:x,published:Z,activeRevision:Y.revision,publishedBrandNames:X.identities.projectBrand.names}),(0,H.jsx)(Le,{urls:Ve}),(0,H.jsx)(Me,{project:y,groups:Ue}),(0,H.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,H.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`h2`,{id:`property-evidence`,className:`text-heading-16 text-heading`,children:`Answers the engines gave`}),(0,H.jsx)(N,{text:`Answers for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent. Missing answer text shows Not measured. Open an answer to read its text and sources, including any other Property it named.`})]})}),$.length>0?(0,H.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),me?(0,H.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Evidence for `,q[k].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):J.isPending&&$.length===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):J.isError&&$.length===0?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,H.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{J.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:h()?de:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,H.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-caution`,children:`This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected.`}):$.length===0?(0,H.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`Query`}),(0,H.jsx)(`th`,{children:`Mentioned in the answer`}),(0,H.jsx)(`th`,{children:`Cited as a source`}),(0,H.jsx)(`th`,{children:`Sources`}),(0,H.jsx)(`th`,{children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,H.jsx)(`tbody`,{children:$.map(e=>{let t=xe(e),n=f.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,H.jsxs)(`td`,{className:`text-secondary`,children:[(0,H.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e.queryText}),(0,H.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[b(e.provider),e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,H.jsx)(`span`,{className:`mt-1 flex`,children:(0,H.jsx)(_,{tone:`caution`,children:`Historical`})}):null]}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,H.jsx)(Se,{row:e})]}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,H.jsx)(we,{row:e})]}),(0,H.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,H.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:ce}),e.cited===null?Ce:e.sources.length]}),(0,H.jsx)(`td`,{className:`text-right`,children:(0,H.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":n,"aria-label":n?`Hide the answer for ${e.queryText}`:`Read the answer for ${e.queryText}`,"aria-controls":n?r:void 0,onClick:()=>v(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,H.jsx)(`tr`,{className:`property-answer-detail`,children:(0,H.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,H.jsx)(Ee,{project:y,targetKey:x,resultId:e.observationId}),(0,H.jsx)(Te,{row:e})]})}):null]},t)})})]})}),J.hasNextPage?(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,H.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),J.isFetchNextPageError?(0,H.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,H.jsx)(g,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:J.isFetchingNextPage,onClick:()=>{J.fetchNextPage()},children:J.isFetchingNextPage?`Loading…`:J.isFetchNextPageError?`Retry more evidence`:`Show ${ye} more`})]}):null]})]}),R?(0,H.jsx)(Re,{project:y,targetKey:x,queryClass:k,runId:B,targetLabels:He}):null]})}export{Y as EVIDENCE_LABELS,Be as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};
|