@ainyc/canonry 5.2.1 → 5.3.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/README.md +2 -2
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -0
- package/assets/assets/{AuditHistoryPanel-CkBLHz2H.js → AuditHistoryPanel-D5cOFMKE.js} +1 -1
- package/assets/assets/{BacklinksPage-D2YWJUf9.js → BacklinksPage-BiOj8ztV.js} +1 -1
- package/assets/assets/{HistoryPage-C9j3RzMN.js → HistoryPage-DDBCwooU.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-CMoU2yA_.js +1 -0
- package/assets/assets/ProjectPage-CrFybBls.js +8 -0
- package/assets/assets/{RunRow-DTJuJ8mb.js → RunRow-BLBAwIot.js} +1 -1
- package/assets/assets/{RunsPage-CdKorpOj.js → RunsPage-BVgBbE1M.js} +1 -1
- package/assets/assets/{SettingsPage-BOjZh2vW.js → SettingsPage-DYtN-1_-.js} +1 -1
- package/assets/assets/{SiteHealthSection-D7sPztpW.js → SiteHealthSection-ElUwcAS4.js} +3 -3
- package/assets/assets/{TrafficPage-BCodKdgN.js → TrafficPage-D6QT_2hU.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-D_zueOK5.js → TrafficSourceDetailPage-BnLzF82w.js} +1 -1
- package/assets/assets/{extract-error-message-BZYGBapN.js → extract-error-message-DIzjGZxl.js} +1 -1
- package/assets/assets/{index-aZ69fB-u.js → index-CoQVOsWw.js} +3 -3
- package/assets/assets/{react-sigma_core.esm.min-m72qsd73.js → react-sigma_core.esm.min-DTbIcdn4.js} +1 -1
- package/assets/assets/v2-overview-adapter-B_N4ilQV.js +1 -0
- package/assets/assets/{vendor-lucide-D_WBzb76.js → vendor-lucide-nVpYViBH.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-AGUCTX7L.js → chunk-HOOU4NS2.js} +194 -56
- package/dist/{chunk-5VONCLVQ.js → chunk-MNUFMEAX.js} +1 -1
- package/dist/{chunk-YQNKULAD.js → chunk-QAGZWYPI.js} +815 -366
- package/dist/cli.js +6 -6
- package/dist/{demo-server-BIPT53EY.js → demo-server-Y7YWLPU7.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{intelligence-service-SJO5E7WN.js → intelligence-service-PR6T6JKY.js} +1 -1
- package/package.json +8 -8
- package/assets/assets/MeasurementPropertyPage-Ci3CUr7Q.js +0 -1
- package/assets/assets/ProjectPage-Bdq_KTXX.js +0 -8
- package/assets/assets/v2-overview-adapter-BgsdlByS.js +0 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
trackCliCommandFinished,
|
|
34
34
|
trackEvent,
|
|
35
35
|
waitForServerRuntimeStartup
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HOOU4NS2.js";
|
|
37
37
|
import {
|
|
38
38
|
autoSyncSkills,
|
|
39
39
|
formatAutoSyncNotice
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
trustedProxiesProblem,
|
|
70
70
|
trustedProxyProblem
|
|
71
71
|
} from "./chunk-RB2F4D3Z.js";
|
|
72
|
-
import "./chunk-
|
|
72
|
+
import "./chunk-MNUFMEAX.js";
|
|
73
73
|
import "./chunk-AOJU5LKX.js";
|
|
74
74
|
import {
|
|
75
75
|
CLOUDFLARE_WORKER_BINDINGS,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
projects,
|
|
85
85
|
queries,
|
|
86
86
|
renderReportHtml
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-QAGZWYPI.js";
|
|
88
88
|
import {
|
|
89
89
|
AdsDeliverySnapshotStatuses,
|
|
90
90
|
AdsHistoricalCampaignRollupStatuses,
|
|
@@ -428,7 +428,7 @@ function parseDemoTrustedProxies(values) {
|
|
|
428
428
|
async function demoCommand(options) {
|
|
429
429
|
const { host, port } = parseDemoListenOptions(options);
|
|
430
430
|
const trustProxy = parseDemoTrustedProxies(options.trustProxy);
|
|
431
|
-
const { createDemoServer } = await import("./demo-server-
|
|
431
|
+
const { createDemoServer } = await import("./demo-server-Y7YWLPU7.js");
|
|
432
432
|
const app = await createDemoServer({ trustProxy });
|
|
433
433
|
let stopping = false;
|
|
434
434
|
const stop = () => {
|
|
@@ -11021,8 +11021,8 @@ var EVENT_DESCRIPTIONS = {
|
|
|
11021
11021
|
"run.failed": "An AEO sweep failed",
|
|
11022
11022
|
"insight.critical": "A critical-severity insight was generated",
|
|
11023
11023
|
"insight.high": "A high-severity insight was generated",
|
|
11024
|
-
"health.degraded": "A scheduled health check found the measurement
|
|
11025
|
-
"health.recovered": "A
|
|
11024
|
+
"health.degraded": "A scheduled health check found the measurement degraded, daily data stopped arriving, or the website stopped answering (sent on change, not every pass)",
|
|
11025
|
+
"health.recovered": "A degraded health check is passing again, or a website that was paged as down answers again"
|
|
11026
11026
|
};
|
|
11027
11027
|
function listEvents(format, target = "local") {
|
|
11028
11028
|
if (target === "server") return getClient16().listNotificationEvents().then((events) => printEvents(events, format));
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
layoutSiteCrawlGraphInput,
|
|
6
6
|
persistSiteCrawlGraphLayout
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MNUFMEAX.js";
|
|
8
8
|
import {
|
|
9
9
|
PACKAGE_VERSION
|
|
10
10
|
} from "./chunk-AOJU5LKX.js";
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
siteCrawlPages,
|
|
84
84
|
siteCrawlSnapshots,
|
|
85
85
|
trafficSources
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-QAGZWYPI.js";
|
|
87
87
|
import {
|
|
88
88
|
RunKinds,
|
|
89
89
|
SiteCrawlFetchStates,
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
createGoogleMarketingCredentialStore,
|
|
4
4
|
createGoogleMarketingRuntime,
|
|
5
5
|
createServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HOOU4NS2.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
9
|
} from "./chunk-IOP36L3C.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MNUFMEAX.js";
|
|
11
11
|
import "./chunk-AOJU5LKX.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QAGZWYPI.js";
|
|
13
13
|
import "./chunk-2U5IW3G5.js";
|
|
14
14
|
export {
|
|
15
15
|
GoogleMarketingRuntimeError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -88,29 +88,29 @@
|
|
|
88
88
|
"tsx": "^4.19.0",
|
|
89
89
|
"@ainyc/canonry-web": "0.0.0",
|
|
90
90
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
91
|
-
"@ainyc/canonry-config": "0.0.0",
|
|
92
91
|
"@ainyc/canonry-api-client": "0.0.0",
|
|
92
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
93
93
|
"@ainyc/canonry-contracts": "0.0.0",
|
|
94
94
|
"@ainyc/canonry-db": "0.0.0",
|
|
95
95
|
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
96
|
-
"@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
|
|
97
|
-
"@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
|
|
98
96
|
"@ainyc/canonry-integration-cloud-run": "0.0.0",
|
|
99
|
-
"@ainyc/canonry-integration-
|
|
97
|
+
"@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
|
|
100
98
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
99
|
+
"@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
|
|
101
100
|
"@ainyc/canonry-integration-google-ads": "0.0.0",
|
|
102
|
-
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
103
101
|
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
102
|
+
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
103
|
+
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
104
104
|
"@ainyc/canonry-integration-google-tag-manager": "0.0.0",
|
|
105
105
|
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
106
106
|
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
107
|
+
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
107
108
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
108
109
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
109
|
-
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
110
110
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
111
111
|
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
112
|
-
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
113
112
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
113
|
+
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
114
114
|
"@ainyc/canonry-provider-openai": "0.0.0"
|
|
115
115
|
},
|
|
116
116
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as me,r as g,u as E,C as xe,j as e,L as k}from"./vendor-tanstack-ZXXkndVj.js";import{cL as pe,co as ue,cm as je,w as ye,cD as be,dN as ve,i as L,dO as ge,B as j,T as N,ax as H,ay as G,I as w,dP as Ne,dQ as fe,dR as we,z as Pe}from"./index-aZ69fB-u.js";import{j as Ce,o as Ee}from"./ChartPrimitives-Bxa_vFmq.js";import{m as Le,a as se,A as Me}from"./v2-overview-adapter-BgsdlByS.js";import{J as Re}from"./vendor-lucide-D_WBzb76.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";const J=50,h={branded:{headline:"When they know your name",technical:"Branded queries"},"non-brand":{headline:"When they don't",technical:"Non-brand queries"}},Se={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",not_applicable:"Not applicable for this Property"},Y={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"}},Z={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 Ae(s){return[...s].sort((t,a)=>+(a.classification==="assigned")-+(t.classification==="assigned"))}function Te(s){return`${s.expectedSlotId}:${s.usageEdgeId}`}function ke({row:s}){return s.mentioned===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(N,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"No mention signal for this Property"})]}):e.jsx(N,{tone:s.mentioned?"positive":"neutral",children:s.mentioned?"Mentioned":"Not mentioned"})}const qe="—";function Ue({row:s}){return s.cited===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(N,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"Sources were not fully captured"})]}):e.jsx(N,{tone:s.cited?"positive":"neutral",children:s.cited?"Cited":"Not cited"})}function Be({row:s}){return s.cited===null&&s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"The sources for this answer were not fully captured, so none can be shown."}):s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"This answer returned no source URLs at all."}):e.jsxs("details",{className:"mt-2","data-answer-sources":!0,children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-sm text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[se," (",s.sources.length,")"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsxs("caption",{className:"sr-only",children:["Source URLs for ",s.queryText]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Match"}),e.jsx("th",{children:"URL"})]})}),e.jsx("tbody",{children:Ae(s.sources).map(t=>{const a=Pe(t.sourceUrl);return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(N,{tone:Z[t.classification].tone,children:Z[t.classification].label})}),e.jsx("td",{className:"break-all text-secondary",children:a?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:t.sourceUrl}):t.sourceUrl})]},t.sourceUrl)})})]})})]})}function Ie({project:s,targetKey:t,row:a}){const n=E({...we({client:L,path:{name:s},query:{targetKey:t,resultId:a.observationId}})});if(n.isPending)return e.jsx("p",{className:"py-2 text-sm text-secondary",role:"status","aria-live":"polite",children:"Loading the answer…"});if(n.isError)return e.jsx("p",{className:"py-2 text-sm text-secondary",role:"alert",children:"Could not load this answer."});const o=n.data?.answer;return o==null||o.trim()===""?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"This answer was measured, but its text was not stored."}):e.jsx("div",{className:"py-2",children:e.jsx(Me,{headingLevel:4,copyable:!0,children:o})})}function U(s){return Se[s.reason]??"Not measured"}function q({metric:s,emphasis:t=!1}){if(s.state==="unavailable")return e.jsxs("span",{className:"inline-flex flex-col gap-0.5",children:[e.jsx("span",{className:t?"text-lg font-semibold text-secondary":"text-sm font-medium text-secondary",children:"Not measured"}),e.jsx("span",{className:"text-sm text-secondary",children:U(s)})]});const a=`${Math.round(s.value*100)}%`,n=s.numerator===void 0||s.denominator===void 0?null:`${s.numerator} of ${s.denominator}`;return e.jsxs("span",{className:"inline-flex flex-col gap-0.5 tabular-nums",children:[e.jsx("span",{className:t?"text-lg font-semibold text-heading":"text-sm font-medium text-primary",children:a}),n?e.jsx("span",{className:"text-xs text-muted",children:n}):null]})}function X(s,t,a){return Ne({client:L,path:{name:s},query:{scope:"property",targetKey:t,queryClass:a}})}function ee(s){return s?.properties.items.at(0)}function _e({measuredAt:s,unmeasuredReason:t,queryClass:a}){const n=s===void 0?null:s===null?"No completed sweep yet":`Measured ${Ce(Ee(s))}`;return n===null&&t===void 0?null:e.jsxs("p",{className:"supporting-copy",children:[[n,t].filter(Boolean).join(" · "),n!==null&&t===void 0?` · ${h[a].technical.toLocaleLowerCase()} only`:""]})}function $e({project:s,groups:t}){return t.length===0?null:e.jsxs("section",{"aria-labelledby":"property-market",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitive comparison"}),e.jsxs("h2",{id:"property-market",className:"text-base font-semibold text-heading",children:["Measured at the market level",e.jsx(w,{text:"Competitors are attached to a market rather than to a single Property, because one building has nobody to be compared against. Share of voice and competitor pressure are reported for the market this Property sits in."})]})]}),e.jsx(j,{asChild:!0,type:"button",size:"sm",variant:"outline",children:e.jsx(k,{to:"/projects/$projectName",params:{projectName:s},children:"Open measurement overview"})})]}),e.jsx("ul",{className:"flex flex-wrap gap-2",children:t.map(a=>e.jsxs("li",{className:"rounded-md border border-default px-3 py-1.5 text-sm text-strong",children:[a.label,e.jsxs("span",{className:"ml-2 text-xs text-muted",children:[a.competitors.length," ",a.competitors.length===1?"competitor":"competitors"]})]},a.stableKey))})]})}function T({label:s,metric:t,failed:a=!1}){if(t===void 0)return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsx("p",{className:"aeo-hero-row-value text-base font-semibold text-secondary",children:a?"Unavailable":"…"}),a?e.jsx("div",{}):e.jsx("div",{className:"aeo-hero-row-bar","aria-hidden":"true"}),e.jsx("p",{className:"aeo-hero-row-detail",children:a?"Could not be loaded":"Loading"})]});if(t.state==="unavailable"){const x=U(t);return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsx("p",{className:"aeo-hero-row-value text-base font-semibold text-secondary",children:"Not measured"}),e.jsx("div",{}),e.jsx("p",{className:"aeo-hero-row-detail",children:x==="Not measured"?"":x})]})}const n=Math.round(t.value*100),o=t.numerator===void 0||t.denominator===void 0?null:`${t.numerator} of ${t.denominator}`;return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsxs("p",{className:"aeo-hero-row-value text-heading",children:[n,e.jsx("span",{className:"text-faint",children:"%"})]}),e.jsx("div",{className:"aeo-hero-row-bar","aria-hidden":"true",children:e.jsx("div",{className:"metric-card-bar-fill progress-fill-neutral",style:{width:`${n}%`}})}),e.jsx("p",{className:"aeo-hero-row-detail tabular-nums",children:o??""})]})}function Oe({branded:s,nonBrand:t,brandedFailed:a=!1,nonBrandFailed:n=!1}){return e.jsxs("section",{"aria-labelledby":"property-coverage-hero",children:[e.jsx("h2",{id:"property-coverage-hero",className:"sr-only",children:"Coverage for this Property"}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Non-brand · the demand to earn"}),e.jsx(T,{label:"Mentioned",metric:t?.mentionCoverage,failed:n}),e.jsx(T,{label:"Cited",metric:t?.citationCoverage,failed:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Branded · already named"}),e.jsx(T,{label:"Mentioned",metric:s?.mentionCoverage,failed:a}),e.jsx(T,{label:"Cited",metric:s?.citationCoverage,failed:a})]})]})]})}function Qe({branded:s,nonBrand:t,brandedError:a,nonBrandError:n,onRetry:o}){const x=[{queryClass:"branded",row:s,isError:a},{queryClass:"non-brand",row:t,isError:n}];return e.jsxs("section",{"aria-labelledby":"property-brand-contrast",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"The gap"}),e.jsxs("h2",{id:"property-brand-contrast",className:"text-base font-semibold text-heading",children:["Named versus not named",e.jsx(w,{text:"Branded queries already contain your name, so an answer engine has an easy path back to you. Non-brand queries describe the need instead, and that is the demand you have to earn. Each row is measured only over the queries assigned to this Property in that class; a class with no assigned query reads Not measured rather than 0%."})]})]})}),e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[560px]",children:[e.jsx("caption",{className:"sr-only",children:"Mention and citation coverage for this Property, split by query class"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Query type"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"})]})}),e.jsx("tbody",{children:x.map(({queryClass:r,row:l,isError:C})=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:"block font-medium text-heading",children:h[r].headline}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:h[r].technical}),l&&C?e.jsxs("span",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm text-caution",children:[e.jsx("span",{role:"status",children:"Refresh failed."}),e.jsxs(j,{type:"button",size:"sm",variant:"ghost",className:"h-11 px-3 text-sm md:h-11",onClick:()=>o(r),children:["Retry ",h[r].technical.toLocaleLowerCase()]})]}):null]}),l?e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx(q,{metric:l.mentionCoverage,emphasis:!0})}),e.jsx("td",{children:e.jsx(q,{metric:l.citationCoverage,emphasis:!0})})]}):C?e.jsx("td",{colSpan:2,children:e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{role:"alert",children:["Could not load ",h[r].technical.toLocaleLowerCase(),"."]}),e.jsxs(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>o(r),children:["Retry ",h[r].technical.toLocaleLowerCase()]})]})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})}),e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})})]})]},r))})]})})]})}function Ve({row:s,queryClass:t,isError:a}){return e.jsxs("section",{"aria-labelledby":"property-providers",className:"page-section-divider",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsx("div",{children:e.jsxs("h2",{id:"property-providers",className:"text-base font-semibold text-heading",children:["Which engines answer for this Property",e.jsx(w,{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%."})]})})}),s===void 0&&a?e.jsxs("p",{className:"text-sm text-secondary",children:["Details for ",h[t].technical.toLocaleLowerCase()," are unavailable. Retry that query type above."]}):s===void 0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading…"}):s.providers.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No answer engine has measured ",h[t].technical.toLocaleLowerCase()," for this Property.",s.mentionCoverage.state==="unavailable"?` ${U(s.mentionCoverage)}.`:""]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[520px]",children:[e.jsx("caption",{className:"sr-only",children:"Per-engine mention and citation coverage"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Engine"}),e.jsx("th",{children:"Mentioned"}),e.jsx("th",{children:"Cited"})]})}),e.jsx("tbody",{children:s.providers.map(n=>e.jsxs("tr",{children:[e.jsx("td",{className:"font-medium text-heading",children:n.provider}),e.jsx("td",{children:e.jsx(q,{metric:n.mentionCoverage})}),e.jsx("td",{children:e.jsx(q,{metric:n.citationCoverage})})]},n.provider))})]})})]})}function Fe(s){const t=s.questions.join(" · ");return s.questionsTruncated?`${t} +${s.questionTotal-s.questions.length} more`:t}function ze({project:s,targetKey:t,queryClass:a}){const n=E({...fe({client:L,path:{name:s},query:{targetKey:t,queryClass:a}})});if(n.isPending||n.isError)return null;const o=n.data?.competitors??[],x=n.data?.basis;return e.jsxs("section",{"aria-labelledby":"property-named-instead",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-named-instead",className:"text-base font-semibold text-heading",children:["Named instead of this Property",e.jsx(w,{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."})]})}),o.length>0?e.jsxs("p",{className:"supporting-copy",children:[n.data?.total??o.length," named"]}):null]}),o.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No rival was named in the answers this Property missed. Nothing to compete with here yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"Names the engines gave instead of this Property"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Named"}),e.jsx("th",{children:"Answers"}),e.jsx("th",{children:"Engines"}),e.jsx("th",{children:"Queries"})]})}),e.jsx("tbody",{children:o.map(r=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-strong",children:r.name}),e.jsx("td",{className:"tabular-nums text-secondary",children:r.occurrences}),e.jsxs("td",{className:"text-secondary",children:[r.providers.join(", "),r.providersTruncated?` +${r.providerTotal-r.providers.length}`:""]}),e.jsx("td",{className:"text-right",children:e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[e.jsx("span",{className:"tabular-nums text-secondary",children:r.questionTotal}),e.jsx(w,{text:Fe(r)})]})})]},r.name))})]})}),x?.state==="available"?e.jsxs("p",{className:"supporting-copy mt-2",children:[x.targetMissResults," of ",x.answeredResults," answers to ",h[a].technical.toLocaleLowerCase()," did not name this Property."]}):null]})]})}function Ke({questions:s,queryClass:t}){return e.jsxs("section",{"aria-labelledby":"property-questions",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-questions",className:"text-base font-semibold text-heading",children:[h[t].technical," assigned to this Property"]})}),e.jsxs("p",{className:"supporting-copy",children:[s.length," assigned"]})]}),s.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No ",h[t].technical.toLocaleLowerCase()," are assigned. Add one in advanced measurement setup to measure this class."]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"Queries assigned to this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"Query"})})}),e.jsx("tbody",{children:s.map(a=>e.jsx("tr",{children:e.jsx("td",{className:"text-secondary",children:a})},a))})]})})]})}function De({urls:s}){return e.jsxs("section",{"aria-labelledby":"property-urls",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-urls",className:"text-base font-semibold text-heading",children:["URLs that count as this Property",e.jsx(w,{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."})]})}),e.jsxs("p",{className:"supporting-copy",children:[s.length," configured"]})]}),s.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No URLs are configured for this Property."}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"URL matchers configured for this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"URL"})})}),e.jsx("tbody",{children:s.map(t=>e.jsx("tr",{children:e.jsx("td",{className:"break-all text-secondary",children:t})},t))})]})})]})}function as(){const{projectName:s,targetKey:t}=me({strict:!1}),[a,n]=g.useState("non-brand"),[o,x]=g.useState(new Set),r=s??"",l=t??"",C=!!r&&!!l,Q=g.useMemo(()=>pe("portfolio",ue(je())),[]),M=C&&Q,{canWrite:B}=ye(),P=E({...be({client:L,path:{name:r}}),enabled:M}),y=E({...X(r,l,"branded"),enabled:M}),b=E({...X(r,l,"non-brand"),enabled:M}),I=ee(y.data),_=ee(b.data),p=a==="branded"?y.data:b.data,f=a==="branded"?I:_,V=(a==="branded"?y.isError:b.isError)&&f===void 0,F=p?.measurement.displayedRunId,te=f?.mentionCoverage.state==="unavailable"?U(f.mentionCoverage):void 0,ae=p===void 0?void 0:p.measurement.completedAt??null,R={client:L,path:{name:r},query:{targetKey:l,queryClass:a,shape:ve.answers,limit:J,...F?{runId:F}:{}}},c=xe({...ge(R),enabled:M&&p!==void 0,initialPageParam:R,getNextPageParam:i=>i.answers?.nextCursor?{path:R.path,query:{...R.query,cursor:i.answers.nextCursor}}:void 0}),$=P.data?.active??null,u=$?.plan.schemaVersion===2?$.plan:null,ne=$!==null&&u===null,S=u?.targets.find(i=>i.stableKey===l)??null,re=g.useMemo(()=>{if(!u)return[];const i=new Map(u.querySnapshots.map(d=>[d.queryId,d.queryText]));return[...new Set(u.assignments.filter(d=>d.targetKey===l&&d.queryClass===a).flatMap(d=>{const m=i.get(d.queryId);return m===void 0?[]:[m]}))].sort((d,m)=>d.localeCompare(m))},[u,l,a]),ie=g.useMemo(()=>S?.urlMatchers.map(Le)??[],[S]),oe=g.useMemo(()=>u?.groups.filter(i=>i.targetKeys.includes(l))??[],[u,l]),v=g.useMemo(()=>(c.data?.pages??[]).flatMap(m=>m.answers?.items??[]),[c.data]),z=c.data?.pages[0]?.answers?.totalEstimate??v.length,le=(c.data?.pages??[]).length>0&&(c.data?.pages??[]).every(i=>i.answers===void 0),de=c.data?.pages[0]?.measurement.state,A=e.jsxs(k,{to:"/projects/$projectName",params:{projectName:r},className:"inline-flex items-center gap-1 text-xs text-muted hover:text-strong",children:[e.jsx(Re,{className:"size-3.5","aria-hidden":"true"}),"Back to measurement overview"]});if(!C)return e.jsx("div",{className:"page-container",children:e.jsx("p",{className:"text-sm text-muted",children:"Missing project name or Property key in URL."})});if(!Q)return e.jsxs("div",{className:"page-container space-y-3",children:[A,e.jsx("p",{className:"text-sm text-muted",children:"This view is not available here."})]});if(P.isPending&&!P.isError)return e.jsx("div",{className:"page-container",children:e.jsxs("div",{role:"status","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading Property"}),e.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-subtle","aria-hidden":"true"})]})});const ce=P.isError&&P.data===void 0,K=y.isError&&y.data===void 0,D=b.isError&&b.data===void 0;return ce||K&&D?e.jsxs("div",{className:"page-container space-y-3",children:[A,e.jsx("p",{role:"alert",className:"text-sm text-negative",children:"Could not load this Property."}),e.jsx(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{P.refetch(),y.refetch(),b.refetch()},children:"Try again"})]}):!u||!S?e.jsxs("div",{className:"page-container space-y-3",children:[A,e.jsx("p",{role:"status",className:"text-sm text-secondary",children:u?"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."}),e.jsx(j,{asChild:!0,type:"button",variant:"outline",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(k,{to:"/projects/$projectName/portfolio",params:{projectName:r},children:B?ne?"Republish setup":"Open measurement setup":"View measurement setup"})})]}):e.jsxs("div",{className:"page-container space-y-8",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{className:"page-header-left",children:[A,e.jsx("h1",{className:"page-title mt-2",children:S.label}),e.jsxs("p",{className:"page-subtitle",children:["Property in ",r]})]}),e.jsxs("div",{className:"page-header-right",children:[p?e.jsx(N,{tone:Y[p.measurement.state].tone,children:Y[p.measurement.state].label}):null,f&&f.flags>0?e.jsxs(N,{tone:"caution",children:[f.flags," flagged"]}):null]})]}),e.jsx(Oe,{branded:I,nonBrand:_,brandedFailed:K,nonBrandFailed:D}),e.jsx(Qe,{branded:I,nonBrand:_,brandedError:y.isError,nonBrandError:b.isError,onRetry:i=>{i==="branded"?y.refetch():b.refetch()}}),p&&(p.measurement.state==="not_measured"||p.nextAction.kind==="run_measurement")?e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-y border-default py-4","aria-label":"Measurement next step",children:[e.jsx("p",{className:"text-sm text-secondary",children:G()?H:B?"Run a measurement from the project overview to collect this Property’s coverage and source evidence.":"This Property needs a new measurement before coverage and source evidence are available."}),e.jsx(j,{asChild:!0,type:"button",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(k,{to:"/projects/$projectName",params:{projectName:r},children:B?"Go to measurement overview":"View measurement overview"})})]}):null,e.jsxs("div",{className:"flex flex-wrap items-end gap-4 border-y border-default py-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"property-query-class",className:"block text-sm font-medium text-heading",children:"Query type"}),e.jsxs("select",{id:"property-query-class",value:a,onChange:i=>n(i.target.value==="branded"?"branded":"non-brand"),className:"h-11 rounded-md border border-default bg-surface px-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-mono-400",children:[e.jsx("option",{value:"non-brand",children:h["non-brand"].technical}),e.jsx("option",{value:"branded",children:h.branded.technical})]})]}),e.jsx(_e,{measuredAt:ae,unmeasuredReason:te,queryClass:a})]}),e.jsx(Ve,{row:f,queryClass:a,isError:V}),e.jsx(ze,{project:r,targetKey:l,queryClass:a}),e.jsx(Ke,{questions:re,queryClass:a}),e.jsx(De,{urls:ie}),e.jsx($e,{project:r,groups:oe}),e.jsxs("section",{"aria-labelledby":"property-evidence",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-evidence",className:"text-base font-semibold text-heading",children:["Answers the engines gave",e.jsx(w,{text:"One row per answer an engine gave for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent: an answer can name this Property without linking it, or link it without naming it. Answers that did neither are listed first, because those are what a gap is made of. Where the answer text was not stored the mention reads Not measured, never a zero. Open a row to read what the engine actually said, followed by the source URLs it returned, this Property's own first. The answer is where a miss becomes actionable: a query this Property was not named in may still have named a sibling building."})]})}),v.length>0?e.jsxs("p",{className:"supporting-copy",children:[v.length," of ",z]}):null]}),V?e.jsxs("p",{className:"text-sm text-secondary",children:["Evidence for ",h[a].technical.toLocaleLowerCase()," is unavailable. Retry that query type above."]}):c.isPending&&v.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading evidence…"}):c.isError&&v.length===0?e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsx("span",{role:"alert",children:"Evidence could not be loaded."}),e.jsx(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{c.refetch()},children:"Retry evidence"})]}):de==="not_measured"?e.jsx("p",{className:"text-sm text-secondary",children:G()?H:"Not measured yet. Run a measurement to collect the answers for this Property."}):le?e.jsx("p",{role:"alert",className:"text-sm text-caution",children:"This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected."}):v.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No answers matched this Property in the displayed measurement."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"property-answer-table-container overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table property-evidence-table",children:[e.jsx("caption",{className:"sr-only",children:"Answers measured for this Property"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Query"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"}),e.jsx("th",{children:"Sources"}),e.jsx("th",{children:e.jsx("span",{className:"sr-only",children:"Sources detail"})})]})}),e.jsx("tbody",{children:v.map(i=>{const d=Te(i),m=o.has(d),W=`property-answer-${encodeURIComponent(d)}`;return e.jsxs(g.Fragment,{children:[e.jsxs("tr",{className:"property-answer-summary",children:[e.jsxs("td",{className:"text-secondary",children:[e.jsx("h3",{className:"text-sm font-medium text-heading",children:i.queryText}),e.jsx("span",{className:"mt-1 block text-xs text-muted",children:[i.provider,i.location].filter(Boolean).join(" · ")}),i.historical||i.bridged?e.jsx("span",{className:"mt-1 flex",children:e.jsx(N,{tone:"caution",children:"Historical"})}):null]}),e.jsxs("td",{children:[e.jsx("span",{className:"property-evidence-mobile-label","aria-hidden":"true",children:"Mentioned"}),e.jsx(ke,{row:i})]}),e.jsxs("td",{children:[e.jsx("span",{className:"property-evidence-mobile-label","aria-hidden":"true",children:"Cited"}),e.jsx(Ue,{row:i})]}),e.jsxs("td",{className:"tabular-nums text-secondary",children:[e.jsx("span",{className:"property-evidence-mobile-label","aria-hidden":"true",children:se}),i.cited===null?qe:i.sources.length]}),e.jsx("td",{className:"text-right",children:e.jsx(j,{type:"button",size:"sm",variant:"ghost",className:"h-auto min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto","aria-expanded":m,"aria-label":m?`Hide the answer for ${i.queryText}`:`Read the answer for ${i.queryText}`,"aria-controls":m?W:void 0,onClick:()=>x(he=>{const O=new Set(he);return O.delete(d)||O.add(d),O}),children:m?"Hide answer":"Read answer"})})]}),m?e.jsx("tr",{className:"property-answer-detail",children:e.jsxs("td",{id:W,colSpan:5,className:"bg-surface-subtle px-4",children:[e.jsx(Ie,{project:r,targetKey:l,row:i}),e.jsx(Be,{row:i})]})}):null]},d)})})]})}),c.hasNextPage?e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{children:["Showing ",v.length," of ",z]}),c.isFetchNextPageError?e.jsx("span",{role:"alert",children:"Could not load more evidence."}):null,e.jsx(j,{size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",disabled:c.isFetchingNextPage,onClick:()=>{c.fetchNextPage()},children:c.isFetchingNextPage?"Loading…":c.isFetchNextPageError?"Retry more evidence":`Show ${J} more`})]}):null]})]})]})}export{Z as EVIDENCE_LABELS,as as MeasurementPropertyPage};
|