@uibot/page-annotation 0.19.0 → 0.20.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/dist/host.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var B="uibot.annotation.host.v1",V="uibot.annotation.page.v1",Ee=1048576,j=20,q=262144,U=2;function v(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var z=["--pa-accent","--pa-accent-soft","--pa-outline","--pa-accent-contrast","--pa-surface","--pa-surface-contrast","--pa-shadow","--pa-muted","--pa-hover","--pa-border","--pa-popover-contrast","--pa-popover","--pa-focus","--pa-selected","--pa-accent-halo","--pa-field","--pa-checker","--pa-success","--pa-success-contrast","--pa-danger","--pa-danger-contrast","--pa-color-default"],De=8192;function w(e){if(typeof e!=="string"||e.length>256||!e.trim())return!1;if(/[;{}\\<>!@'"]/.test(e)||[...e].some((o)=>o.charCodeAt(0)<32)||/url\s*\(|var\s*\(|\/\*|\*\//i.test(e))return!1;let t=e.trim();if(/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(t))return!0;if(new Set("aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen".split(" ")).has(t.toLowerCase()))return!0;let r=t.match(/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\(([^()]+)\)$/i);if(r){let o=(r[1]??"").toLowerCase(),a=(r[2]??"").trim(),l=a.includes(",");if(l&&(!/^(rgb|rgba|hsl|hsla)$/.test(o)||a.includes("/")))return!1;let u=a.split("/");if(u.length>2)return!1;let g=l?a.split(",").map((y)=>y.trim()):(u[0]??"").trim().split(/\s+/),f=l?g[3]:u[1]?.trim();if(g.length!==3&&!(l&&g.length===4))return!1;let c=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?%?$/i;if(f!==void 0&&!c.test(f)&&!(f==="none"&&!l))return!1;return g.slice(0,3).every((y,S)=>{if(y==="none")return!l;let p=/^(hsl|hsla|hwb)$/.test(o)?S===0:/^(lch|oklch)$/.test(o)&&S===2;return c.test(y)||p&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(deg|rad|grad|turn)$/i.test(y)})}let i=t.match(/^color\((srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|xyz|xyz-d50|xyz-d65) ([^()]+)\)$/i);if(i)return w(`rgb(${i[2]})`);let s=t.match(/^color-mix\(in srgb, (.+) (\d+(?:\.\d+)?)%, (.+)\)$/i);return!!s&&Number(s[2])<=100&&w(s[1])&&w(s[3])}function I(e){if(!e||typeof e!=="object"||Array.isArray(e))return{};try{if(new TextEncoder().encode(JSON.stringify(e)).length>8192)return{}}catch{return{}}let t={};for(let n of z){let r=Object.hasOwn(e,n)?e[n]:void 0;if(w(r))t[n]=r.trim()}return t}function Ne(e,t){let n=I(t);for(let r of z){let i=n[r];if(i===void 0)e.style.removeProperty(r);else e.style.setProperty(r,i)}}var se={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},St=Array.from(new Set(Object.values(se).flat()));var Et=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var ae=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],Nt=[...ae,"radius","font-display","font-body","font-mono"];var R={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function E(e){if(!e||typeof e!=="object"||Array.isArray(e))throw Error("Invalid annotation object");return e}function P(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error("Unknown annotation field")}function b(e,t,n=!1){if(typeof e!=="string"||!n&&!e.trim()||e.length>t||Array.from(e).some((r)=>{let i=r.charCodeAt(0);return i===127||i<32&&i!==9&&i!==10&&i!==13}))throw Error("Invalid annotation text");return e}function H(e){let t=E(e);P(t,["x","y","width","height"]);for(let n of["x","y","width","height"])if(typeof t[n]!=="number"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error("Invalid annotation coordinates");if(t.width<0||t.height<0)throw Error("Invalid annotation dimensions");return{x:t.x,y:t.y,width:t.width,height:t.height}}function W(e){if(!Array.isArray(e)||!e.length||e.length>R.count)throw Error("Expected 1 to 20 annotations");if(new TextEncoder().encode(JSON.stringify(e)).length>R.messageBytes)throw Error("Annotations exceed the message budget");let t=0,n=new Set;return e.map((r)=>{let i=E(r);P(i,["id","comment","target","type","priority","edits","screenshot"]);let s=b(i.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(s)||n.has(s))throw Error("Invalid or duplicate annotation ID");n.add(s);let o=b(i.comment,R.comment).trim();if(!["bug","style","copywriting","feature","interaction","data","other"].includes(i.type)||!["low","medium","high","blocker"].includes(i.priority))throw Error("Invalid annotation classification");let a=E(i.target),l;if(a.kind==="element"){P(a,["kind","cssSelector","xpath","tagName","textContent","boundingBox","uibotId"]);let f=b(a.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(f))throw Error("Invalid annotation tag");let c=a.uibotId===void 0?void 0:b(a.uibotId,200);if(c!==void 0&&!/^[\w:.-]+$/.test(c))throw Error("Invalid annotation element ID");l={kind:"element",cssSelector:b(a.cssSelector,R.selector),xpath:b(a.xpath,R.selector,!0),tagName:f,boundingBox:H(a.boundingBox),...a.textContent===void 0?{}:{textContent:b(a.textContent,1000,!0)},...c===void 0?{}:{uibotId:c}}}else if(a.kind==="region")P(a,["kind","rect"]),l={kind:"region",rect:H(a.rect)};else throw Error("Invalid annotation target");let u;if(i.edits!==void 0){if(!Array.isArray(i.edits)||i.edits.length>R.edits)throw Error("Invalid annotation edits");u=i.edits.map((f)=>{let c=E(f);if(P(c,["kind","label","property","before","after"]),c.kind!=="style"&&c.kind!=="text")throw Error("Invalid annotation edit kind");let y=c.property===void 0?void 0:b(c.property,100);if(y!==void 0&&!/^[-a-zA-Z][\w-]*$/.test(y))throw Error("Invalid annotation style property");return{kind:c.kind,label:b(c.label,200),before:b(c.before,4000,!0),after:b(c.after,4000,!0),...y===void 0?{}:{property:y}}})}let g;if(i.screenshot!==void 0){if(g=b(i.screenshot,R.screenshotBytes),!/^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(g)||++t>R.screenshots)throw Error("Invalid annotation screenshot")}return{id:s,comment:o,type:i.type,priority:i.priority,target:l,...u?{edits:u}:{},...g?{screenshot:g}:{}}})}function ir(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,r)=>t[n.priority]-t[r.priority]||n.createdAt.localeCompare(r.createdAt))}function sr(e,t){if(e.target.kind==="region")return`${t==="zh"?"\u533A\u57DF":"Region"} ${Math.round(e.target.rect.width)}\xD7${Math.round(e.target.rect.height)}`;return`${e.target.tagName}\u300C${(e.target.textContent??e.target.cssSelector).slice(0,48)}\u300D`}function K(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind==="region"?{kind:"region",rect:t.rect}:{kind:"element",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes["data-uibot-id"]?{uibotId:t.attributes["data-uibot-id"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}var Y=[{id:"red",value:"#ef4444",label:"\u7EA2"},{id:"orange",value:"#f97316",label:"\u6A59"},{id:"yellow",value:"#eab308",label:"\u9EC4"},{id:"green",value:"#22c55e",label:"\u7EFF"},{id:"blue",value:"#3b82f6",label:"\u84DD"},{id:"white",value:"#f8fafc",label:"\u767D"}],lr=12,cr=48,dr=4,ur=16;function G(e){let t=Math.round(e/4)*4;return Math.min(48,Math.max(12,t))}function le(e,t){let n=G(t),r=Math.max(1,[...e].length);return{width:Math.max(n,r*n),height:Math.ceil(n*1.35)}}var ce=new Set(Y.map((e)=>e.value));function de(e){return ce.has(e)}function pr(){return Y[0].value}function h(e){return typeof e==="number"&&Number.isFinite(e)}function ue(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e;if(typeof t.color!=="string"||!de(t.color))return null;if(t.kind==="rect"){if(!h(t.x)||!h(t.y)||!h(t.width)||!h(t.height))return null;if(t.width<8||t.height<8)return null;return{kind:"rect",color:t.color,x:t.x,y:t.y,width:t.width,height:t.height}}if(t.kind==="arrow"){if(!h(t.x1)||!h(t.y1)||!h(t.x2)||!h(t.y2))return null;return{kind:"arrow",color:t.color,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}if(t.kind==="text"){if(!h(t.x)||!h(t.y)||typeof t.text!=="string")return null;let n=t.text.trim();if(!n)return null;let r=t.fontSize===void 0?16:h(t.fontSize)?G(t.fontSize):null;if(r==null)return null;return{kind:"text",color:t.color,x:t.x,y:t.y,text:n,fontSize:r}}return null}function J(e){if(e===void 0)return;if(!Array.isArray(e))return;let t=[];for(let n of e){let r=ue(n);if(!r)return;t.push(r)}return t}function gr(e){if(e.length===0)return"\u533A\u57DF\u6807\u6CE8";let t=e.filter((s)=>s.kind==="rect").length,n=e.filter((s)=>s.kind==="arrow").length,r=e.filter((s)=>s.kind==="text"),i=[];if(t)i.push(`${t} \u4E2A\u6846`);if(n)i.push(`${n} \u4E2A\u7BAD\u5934`);if(r.length){let s=r.map((o)=>o.text.trim()).filter(Boolean).slice(0,3).map((o)=>`\u300C${o.length>16?`${o.slice(0,16)}\u2026`:o}\u300D`);i.push(s.length?`\u6587\u672C ${s.join(" ")}`:`${r.length} \u5904\u6587\u672C`)}return`\u533A\u57DF\u6807\u6CE8\uFF08${i.join("\uFF0C")}\uFF09`}function mr(e,t=16){if(e.length===0)return null;let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i,NEGATIVE_INFINITY:s}=Number;for(let o of e)if(o.kind==="rect")n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+o.width),s=Math.max(s,o.y+o.height);else if(o.kind==="arrow")n=Math.min(n,o.x1,o.x2),r=Math.min(r,o.y1,o.y2),i=Math.max(i,o.x1,o.x2),s=Math.max(s,o.y1,o.y2);else{let a=le(o.text,o.fontSize);n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+a.width),s=Math.max(s,o.y+a.height)}return{x:n-t,y:r-t,width:Math.max(8,i-n+t*2),height:Math.max(8,s-r+t*2)}}function fr(e,t,n){return e.map((r)=>{if(r.kind==="rect")return{...r,x:r.x+t,y:r.y+n};if(r.kind==="arrow")return{...r,x1:r.x1+t,y1:r.y1+n,x2:r.x2+t,y2:r.y2+n};return{...r,x:r.x+t,y:r.y+n,fontSize:r.fontSize}})}function yr(e,t){let n=Math.max(0,Math.min(e.x,t.width)),r=Math.max(0,Math.min(e.y,t.height)),i=Math.min(e.width,t.width-n),s=Math.min(e.height,t.height-r);if(i<8||s<8)return null;return{x:n,y:r,width:i,height:s}}var Z={blocker:0,high:1,medium:2,low:3};function T(e){return e.status==="open"||e.status==="processing"}function D(e){return[...e].sort((t,n)=>Z[t.priority]-Z[n.priority]||t.createdAt.localeCompare(n.createdAt))}function hr(e){return D(e.filter(T))}var pe=["open","processing","done","verified","ignored"],ge=["bug","style","copywriting","feature","interaction","data","other"],X=["low","medium","high","blocker"],me=["testid","id","aria","class","text","path"],fe=["light","dark","unknown"],ye=["react","vue","angular","svelte","nextjs","nuxt","unknown"],be=["target-location","screenshot","context-bundle","dom-snapshot","style-snapshot"],he=["inline","exported-file","url","none"];function m(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function C(e,t){return typeof e==="string"&&t.includes(e)}function x(e){return typeof e==="number"&&Number.isFinite(e)}function A(e){return x(e)&&e>0}function O(e){return Array.isArray(e)&&e.every((t)=>typeof t==="string")}function ee(e){return m(e)&&Object.values(e).every((t)=>typeof t==="string")}function d(e){return e===void 0||typeof e==="string"}function te(e){if(!m(e)||!x(e.x)||!x(e.y)||!A(e.width)||!A(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function _(e){if(!m(e)||!A(e.width)||!A(e.height))return;return{width:e.width,height:e.height}}function M(e){if(!m(e)||!x(e.x)||!x(e.y))return;return{x:e.x,y:e.y}}function Q(e){if(!m(e)||typeof e.fileName!=="string"||!A(e.lineNumber))return;if(e.columnNumber!==void 0&&(!x(e.columnNumber)||e.columnNumber<0))return;if(!d(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function Ce(e){let t=te(e.boundingBox);if(typeof e.tagName!=="string"||!e.tagName||typeof e.cssSelector!=="string"||!e.cssSelector||typeof e.xpath!=="string"||!e.xpath||!ee(e.attributes)||!t||!O(e.domPath))return;if(!d(e.textContent)||e.breadcrumb!==void 0&&!O(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!C(e.selectorStrategy,me))return;if(!d(e.region))return;let n;if(e.accessibility!==void 0){if(!m(e.accessibility)||!d(e.accessibility.role)||!d(e.accessibility.name)||!d(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let r=e.sourceLocation===void 0?void 0:Q(e.sourceLocation);if(e.sourceLocation!==void 0&&!r)return;let i;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let s=e.sourceStack.map(Q);if(s.some((o)=>!o))return;i=s.filter((o)=>Boolean(o))}return{kind:"element",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...r?{sourceLocation:r}:{},...i?{sourceStack:i}:{}}}function xe(e){let t=te(e.rect),n=_(e.viewport),r=M(e.scroll);if(!t||t.width<8||t.height<8||!n||!r||!A(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!O(e.breadcrumb))return;let i;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;i=[];for(let o of e.topLevelElements){if(!m(o)||typeof o.tagName!=="string"||!o.tagName||!d(o.text)||!d(o.role))return;i.push({tagName:o.tagName,...o.text===void 0?{}:{text:o.text},...o.role===void 0?{}:{role:o.role}})}}let s=e.marks===void 0?void 0:J(e.marks);if(e.marks!==void 0&&!s)return;return{kind:"region",rect:t,viewport:n,scroll:r,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{topLevelElements:i}:{},...s?.length?{marks:s}:{}}}function ke(e){if(!m(e))return{ok:!1,reason:"target is not an object",raw:e};if(e.kind==="region"){let t=xe(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid region target",raw:e}}if(e.kind==="element"||e.kind===void 0){let t=Ce(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid element target",raw:e}}return{ok:!1,reason:`unknown target kind: ${String(e.kind)}`,raw:e}}function Re(e){if(!m(e))return;let t=_(e.viewport),n=M(e.scroll);if(!t||!n||!A(e.devicePixelRatio)||!m(e.center)||!x(e.center.x)||!x(e.center.y)||typeof e.visible!=="boolean"||!d(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function ne(e){if(!m(e))return;let{url:t,origin:n,path:r,title:i,capturedAt:s,query:o,hash:a,referrer:l,language:u,userAgent:g,uiState:f}=e,c=_(e.viewport),y=M(e.scroll);if(!c||!m(e.viewport)||!A(e.viewport.devicePixelRatio)||!y)return;if(typeof t!=="string"||!t||typeof n!=="string"||!n||typeof r!=="string"||!r||typeof i!=="string"||typeof s!=="string"||!s)return;if(!d(o)||!d(a)||!d(l)||!d(u)||!d(g)||!d(f))return;if(e.theme!==void 0&&!C(e.theme,fe))return;if(e.framework!==void 0&&!C(e.framework,ye))return;return{url:t,origin:n,path:r,title:i,viewport:{...c,devicePixelRatio:e.viewport.devicePixelRatio},scroll:y,capturedAt:s,...o===void 0?{}:{query:o},...a===void 0?{}:{hash:a},...l===void 0?{}:{referrer:l},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...u===void 0?{}:{language:u},...g===void 0?{}:{userAgent:g},...f===void 0?{}:{uiState:f}}}function Ae(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!m(n)||!C(n.kind,["style","text"])||typeof n.label!=="string"||!d(n.property)||typeof n.before!=="string"||typeof n.after!=="string")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Ie(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(!m(n)||!C(n.kind,be)||!C(n.availability,he)||typeof n.label!=="string"||!n.label||!d(n.annotationId)||!d(n.reference))return;if(n.availability!=="none"&&!n.reference?.trim())return;t.push({kind:n.kind,availability:n.availability,label:n.label,...n.annotationId===void 0?{}:{annotationId:n.annotationId},...n.reference===void 0?{}:{reference:n.reference}})}return t}function F(e){if(!m(e))return{ok:!1,reason:"annotation is not an object",raw:e};let{id:t,pageUrl:n,comment:r,createdAt:i,updatedAt:s}=e;if(!C(e.status,pe))return{ok:!1,reason:"invalid status",raw:e};if(!C(e.type,ge))return{ok:!1,reason:"invalid type",raw:e};if(!C(e.priority,X))return{ok:!1,reason:"invalid priority",raw:e};if(typeof t!=="string"||!t)return{ok:!1,reason:"invalid id",raw:e};if(typeof n!=="string"||!n)return{ok:!1,reason:"invalid pageUrl",raw:e};if(typeof r!=="string"||!r)return{ok:!1,reason:"invalid comment",raw:e};if(typeof i!=="string"||!i)return{ok:!1,reason:"invalid createdAt",raw:e};if(typeof s!=="string"||!s)return{ok:!1,reason:"invalid updatedAt",raw:e};if(!d(e.expectedResult)||!d(e.preserve)||!d(e.screenshot))return{ok:!1,reason:"invalid optional annotation text",raw:e};if(!ee(e.styleSummary))return{ok:!1,reason:"invalid styleSummary",raw:e};let o=Re(e.geometry);if(!o)return{ok:!1,reason:"invalid geometry",raw:e};let a=ne(e.pageContext);if(!a)return{ok:!1,reason:"invalid pageContext",raw:e};let l=Ae(e.edits);if(!l)return{ok:!1,reason:"invalid edits",raw:e};let u=ke(e.target);if(!u.ok)return u;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:r,target:u.value,styleSummary:{...e.styleSummary},geometry:o,pageContext:a,createdAt:i,updatedAt:s,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...l.length?{edits:l}:{}}}}function Pe(e){let t=[],n=[];return e.forEach((r,i)=>{let s=F(r);if(s.ok)t.push(s.value);else n.push({index:i,reason:s.reason,raw:s.raw})}),{annotations:D(t),failures:n}}function Rr(e){if(!m(e)||!Array.isArray(e.annotations))return{ok:!1,reason:"context annotations are missing",raw:e};if(e.version!=="1.0"&&e.version!=="2.0")return{ok:!1,reason:`unsupported context version: ${String(e.version)}`,raw:e};let t=Pe(e.annotations),[n]=t.failures;if(n)return{ok:!1,reason:`invalid annotation at index ${n.index}`,raw:e};let r=e.version==="2.0";if(r){if(e.schema!=="uibot/web-annotation-context"||typeof e.contextId!=="string"||!e.contextId||typeof e.createdAt!=="string"||!e.createdAt||!C(e.scope,["active","all"])||!m(e.summary)||!x(e.summary.totalAnnotations)||e.summary.totalAnnotations<0||!x(e.summary.activeAnnotations)||e.summary.activeAnnotations<0||!x(e.summary.includedAnnotations)||e.summary.includedAnnotations<0||e.summary.topPriority!==void 0&&!C(e.summary.topPriority,X))return{ok:!1,reason:"invalid v2 context metadata",raw:e}}let i=r?Ie(e.evidence):[];if(!i)return{ok:!1,reason:"invalid context evidence",raw:e};let s=r?e.scope:"all",o=t.annotations,a=s==="active"?o.filter(T):o,l=e.page===void 0?void 0:ne(e.page);if(e.page!==void 0&&!l)return{ok:!1,reason:"invalid context page",raw:e};return{ok:!0,value:{schema:"uibot/web-annotation-context",version:"2.0",contextId:typeof e.contextId==="string"?e.contextId:`ctx_${Date.now()}`,createdAt:typeof e.createdAt==="string"?e.createdAt:new Date().toISOString(),scope:s,...l?{page:l}:{},summary:{totalAnnotations:o.length,activeAnnotations:o.filter(T).length,includedAnnotations:a.length,topPriority:D(a)[0]?.priority},evidence:i,annotations:a}}}function Se(e){return typeof e==="string"&&e.length<=q&&/^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function re(e){if(!Array.isArray(e)||e.length>j||!v({items:e}))return null;let t=[],n=0,r=new Set;for(let i of e){let s=F(i);if(!s.ok)return null;let o=s.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(o.id)||r.has(o.id)||!o.comment.trim()||o.comment.length>4000)return null;if(r.add(o.id),o.target.kind==="element"&&(o.target.cssSelector.length>2000||o.target.xpath.length>2000||(o.target.textContent?.length??0)>1000))return null;if(o.screenshot!==void 0&&(!Se(o.screenshot)||++n>U))return null;if((o.edits?.length??0)>20||o.edits?.some((a)=>a.before.length>4000||a.after.length>4000))return null;t.push(o)}try{if(t.length)W(t.map(K))}catch{return null}return t}function Nr(e){let t=e.ownerWindow??window,n=e.nonce??crypto.randomUUID(),r={enabled:!1,locked:!1,locale:"zh",items:[],theme:I(e.theme)},i=!1,s=!1,o=!1,a,l=(p)=>{if(o===!p)return;o=!p,e.onResponsiveChange?.(p)},u=()=>{if(a!==void 0)t.clearTimeout(a);if(a=void 0,!r.enabled||s||i){if(!r.enabled||s)l(!0);return}a=t.setTimeout(()=>{if(a=void 0,!s&&r.enabled&&!i)l(!1)},e.handshakeTimeoutMs??2500)},g=(p)=>{if(!i)e.iframe.contentWindow?.postMessage({...p,source:B,nonce:n},"*")},f=()=>g({action:"sync",...r}),c=(p)=>{if(i||p.source!==e.iframe.contentWindow||!v(p.data))return;let k=p.data;if(k.source!==V||k.nonce!==n)return;if(k.action==="ready"){s=!0,u();return}if(k.action==="closed"){e.onClose();return}if(k.action!=="snapshot"||r.locked||!r.enabled)return;let L=re(k.items);if(L)e.onChange(L)};t.addEventListener("message",c);let y=()=>{if(s=!1,r.enabled||r.items.length)f();u()};e.iframe.addEventListener("load",y);let S=t.setInterval(()=>{if(!s&&r.enabled)f()},400);return{update(p){let k=r.enabled;if(r={...r,...p,theme:Object.hasOwn(p,"theme")?I(p.theme):r.theme??{}},f(),k!==r.enabled)u()},reveal(p){if(r.items.some((k)=>k.id===p))g({action:"reveal",id:p})},dispose(){if(i)return;if(g({action:"sync",enabled:!1,locked:!0,items:[],locale:r.locale}),i=!0,t.clearInterval(S),a!==void 0)t.clearTimeout(a);t.removeEventListener("message",c),e.iframe.removeEventListener("load",y)}}}var ve={primaryContrast:["--primary-foreground","#fafafa"],surface:["--card","#ffffff"],foreground:["--card-foreground","#18181b"],popover:["--popover","#ffffff"],popoverContrast:["--popover-foreground","#18181b"],border:["--border","#e4e4e7"],muted:["--muted-foreground","#71717a"],field:["--muted","#f4f4f5"],hover:["--accent","#f4f4f5"],focus:["--ring","#a1a1aa"],danger:["--destructive","#dc2626"]},N={accent:"#18181b",contrast:"#fafafa",selected:"#3f3f46",outline:"rgba(255, 255, 255, 0.6)"};function we(e){let t=e.ownerDocument.defaultView?.getComputedStyle(e),n=(i)=>{let[s,o]=ve[i],a=t?.getPropertyValue(s).trim()??"";return I({"--pa-accent":a})["--pa-accent"]??o},r=N.accent;return I({"--pa-accent":r,"--pa-accent-contrast":N.contrast,"--pa-accent-soft":`color-mix(in srgb, ${r} 10%, transparent)`,"--pa-accent-halo":`color-mix(in srgb, ${r} 45%, transparent)`,"--pa-surface":n("surface"),"--pa-surface-contrast":n("foreground"),"--pa-popover":n("popover"),"--pa-popover-contrast":n("popoverContrast"),"--pa-border":n("border"),"--pa-muted":n("muted"),"--pa-field":n("field"),"--pa-hover":n("hover"),"--pa-selected":N.selected,"--pa-focus":n("focus"),"--pa-outline":N.outline,"--pa-shadow":"#00000033","--pa-checker":n("muted"),"--pa-danger":n("danger"),"--pa-danger-contrast":n("primaryContrast"),"--pa-success":"#15803d","--pa-success-contrast":"#ffffff","--pa-color-default":n("foreground")})}function Mr(e,t){let n=e.ownerDocument.defaultView;if(!n)return()=>{};let r=()=>t(we(e)),i=new n.MutationObserver(r);i.observe(e,{attributes:!0,attributeFilter:["class","style"]});let s=n.matchMedia("(prefers-color-scheme: dark)");return s.addEventListener("change",r),()=>{i.disconnect(),s.removeEventListener("change",r)}}export{B as ANNOTATION_HOST_SOURCE,j as ANNOTATION_MAX_ITEMS,Ee as ANNOTATION_MAX_MESSAGE_BYTES,U as ANNOTATION_MAX_SCREENSHOTS,V as ANNOTATION_PAGE_SOURCE,q as ANNOTATION_SCREENSHOT_MAX_BYTES,De as ANNOTATION_THEME_MAX_BYTES,z as ANNOTATION_THEME_TOKENS,Ne as applyAnnotationTheme,v as boundedMessage,Nr as createAnnotationController,w as isAnnotationThemeColor,Mr as observeStudioAnnotationTheme,re as parseAnnotationItems,we as resolveStudioAnnotationTheme,Se as validScreenshot,I as validateAnnotationTheme};
2
+ var B="uibot.annotation.host.v1",V="uibot.annotation.page.v1",Te=1048576,j=20,q=262144,U=2;function v(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var z=["--pa-accent","--pa-accent-soft","--pa-outline","--pa-accent-contrast","--pa-surface","--pa-surface-contrast","--pa-shadow","--pa-muted","--pa-hover","--pa-border","--pa-popover-contrast","--pa-popover","--pa-focus","--pa-selected","--pa-accent-halo","--pa-field","--pa-checker","--pa-success","--pa-success-contrast","--pa-danger","--pa-danger-contrast","--pa-color-default"],Ne=8192;function w(e){if(typeof e!=="string"||e.length>256||!e.trim())return!1;if(/[;{}\\<>!@'"]/.test(e)||[...e].some((o)=>o.charCodeAt(0)<32)||/url\s*\(|var\s*\(|\/\*|\*\//i.test(e))return!1;let t=e.trim();if(/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(t))return!0;if(new Set("aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen".split(" ")).has(t.toLowerCase()))return!0;let r=t.match(/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\(([^()]+)\)$/i);if(r){let o=(r[1]??"").toLowerCase(),a=(r[2]??"").trim(),l=a.includes(",");if(l&&(!/^(rgb|rgba|hsl|hsla)$/.test(o)||a.includes("/")))return!1;let u=a.split("/");if(u.length>2)return!1;let g=l?a.split(",").map((y)=>y.trim()):(u[0]??"").trim().split(/\s+/),f=l?g[3]:u[1]?.trim();if(g.length!==3&&!(l&&g.length===4))return!1;let c=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?%?$/i;if(f!==void 0&&!c.test(f)&&!(f==="none"&&!l))return!1;return g.slice(0,3).every((y,S)=>{if(y==="none")return!l;let p=/^(hsl|hsla|hwb)$/.test(o)?S===0:/^(lch|oklch)$/.test(o)&&S===2;return c.test(y)||p&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(deg|rad|grad|turn)$/i.test(y)})}let i=t.match(/^color\((srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|xyz|xyz-d50|xyz-d65) ([^()]+)\)$/i);if(i)return w(`rgb(${i[2]})`);let s=t.match(/^color-mix\(in srgb, (.+) (\d+(?:\.\d+)?)%, (.+)\)$/i);return!!s&&Number(s[2])<=100&&w(s[1])&&w(s[3])}function I(e){if(!e||typeof e!=="object"||Array.isArray(e))return{};try{if(new TextEncoder().encode(JSON.stringify(e)).length>8192)return{}}catch{return{}}let t={};for(let n of z){let r=Object.hasOwn(e,n)?e[n]:void 0;if(w(r))t[n]=r.trim()}return t}function Oe(e,t){let n=I(t);for(let r of z){let i=n[r];if(i===void 0)e.style.removeProperty(r);else e.style.setProperty(r,i)}}var se={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},vt=Array.from(new Set(Object.values(se).flat()));var Tt=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var ae=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],Ot=[...ae,"radius","font-display","font-body","font-mono"];var R={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function E(e){if(!e||typeof e!=="object"||Array.isArray(e))throw Error("Invalid annotation object");return e}function P(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error("Unknown annotation field")}function b(e,t,n=!1){if(typeof e!=="string"||!n&&!e.trim()||e.length>t||Array.from(e).some((r)=>{let i=r.charCodeAt(0);return i===127||i<32&&i!==9&&i!==10&&i!==13}))throw Error("Invalid annotation text");return e}function H(e){let t=E(e);P(t,["x","y","width","height"]);for(let n of["x","y","width","height"])if(typeof t[n]!=="number"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error("Invalid annotation coordinates");if(t.width<0||t.height<0)throw Error("Invalid annotation dimensions");return{x:t.x,y:t.y,width:t.width,height:t.height}}function W(e){if(!Array.isArray(e)||!e.length||e.length>R.count)throw Error("Expected 1 to 20 annotations");if(new TextEncoder().encode(JSON.stringify(e)).length>R.messageBytes)throw Error("Annotations exceed the message budget");let t=0,n=new Set;return e.map((r)=>{let i=E(r);P(i,["id","comment","target","type","priority","edits","screenshot"]);let s=b(i.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(s)||n.has(s))throw Error("Invalid or duplicate annotation ID");n.add(s);let o=b(i.comment,R.comment).trim();if(!["bug","style","copywriting","feature","interaction","data","other"].includes(i.type)||!["low","medium","high","blocker"].includes(i.priority))throw Error("Invalid annotation classification");let a=E(i.target),l;if(a.kind==="element"){P(a,["kind","cssSelector","xpath","tagName","textContent","boundingBox","uibotId"]);let f=b(a.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(f))throw Error("Invalid annotation tag");let c=a.uibotId===void 0?void 0:b(a.uibotId,200);if(c!==void 0&&!/^[\w:.-]+$/.test(c))throw Error("Invalid annotation element ID");l={kind:"element",cssSelector:b(a.cssSelector,R.selector),xpath:b(a.xpath,R.selector,!0),tagName:f,boundingBox:H(a.boundingBox),...a.textContent===void 0?{}:{textContent:b(a.textContent,1000,!0)},...c===void 0?{}:{uibotId:c}}}else if(a.kind==="region")P(a,["kind","rect"]),l={kind:"region",rect:H(a.rect)};else throw Error("Invalid annotation target");let u;if(i.edits!==void 0){if(!Array.isArray(i.edits)||i.edits.length>R.edits)throw Error("Invalid annotation edits");u=i.edits.map((f)=>{let c=E(f);if(P(c,["kind","label","property","before","after"]),c.kind!=="style"&&c.kind!=="text")throw Error("Invalid annotation edit kind");let y=c.property===void 0?void 0:b(c.property,100);if(y!==void 0&&!/^[-a-zA-Z][\w-]*$/.test(y))throw Error("Invalid annotation style property");return{kind:c.kind,label:b(c.label,200),before:b(c.before,4000,!0),after:b(c.after,4000,!0),...y===void 0?{}:{property:y}}})}let g;if(i.screenshot!==void 0){if(g=b(i.screenshot,R.screenshotBytes),!/^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(g)||++t>R.screenshots)throw Error("Invalid annotation screenshot")}return{id:s,comment:o,type:i.type,priority:i.priority,target:l,...u?{edits:u}:{},...g?{screenshot:g}:{}}})}function lr(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,r)=>t[n.priority]-t[r.priority]||n.createdAt.localeCompare(r.createdAt))}function cr(e,t){if(e.target.kind==="region")return`${t==="zh"?"\u533A\u57DF":"Region"} ${Math.round(e.target.rect.width)}\xD7${Math.round(e.target.rect.height)}`;return`${e.target.tagName}\u300C${(e.target.textContent??e.target.cssSelector).slice(0,48)}\u300D`}function K(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind==="region"?{kind:"region",rect:t.rect}:{kind:"element",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes["data-uibot-id"]?{uibotId:t.attributes["data-uibot-id"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}var Y=[{id:"red",value:"#ef4444",label:"\u7EA2"},{id:"orange",value:"#f97316",label:"\u6A59"},{id:"yellow",value:"#eab308",label:"\u9EC4"},{id:"green",value:"#22c55e",label:"\u7EFF"},{id:"blue",value:"#3b82f6",label:"\u84DD"},{id:"white",value:"#f8fafc",label:"\u767D"}],ur=12,pr=48,gr=4,mr=16;function G(e){let t=Math.round(e/4)*4;return Math.min(48,Math.max(12,t))}function ce(e,t){let n=G(t),r=Math.max(1,[...e].length);return{width:Math.max(n,r*n),height:Math.ceil(n*1.35)}}var de=new Set(Y.map((e)=>e.value));function ue(e){return de.has(e)}function fr(){return Y[0].value}function h(e){return typeof e==="number"&&Number.isFinite(e)}function pe(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e;if(typeof t.color!=="string"||!ue(t.color))return null;if(t.kind==="rect"){if(!h(t.x)||!h(t.y)||!h(t.width)||!h(t.height))return null;if(t.width<8||t.height<8)return null;return{kind:"rect",color:t.color,x:t.x,y:t.y,width:t.width,height:t.height}}if(t.kind==="arrow"){if(!h(t.x1)||!h(t.y1)||!h(t.x2)||!h(t.y2))return null;return{kind:"arrow",color:t.color,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}if(t.kind==="text"){if(!h(t.x)||!h(t.y)||typeof t.text!=="string")return null;let n=t.text.trim();if(!n)return null;let r=t.fontSize===void 0?16:h(t.fontSize)?G(t.fontSize):null;if(r==null)return null;return{kind:"text",color:t.color,x:t.x,y:t.y,text:n,fontSize:r}}return null}function J(e){if(e===void 0)return;if(!Array.isArray(e))return;let t=[];for(let n of e){let r=pe(n);if(!r)return;t.push(r)}return t}function yr(e){if(e.length===0)return"\u533A\u57DF\u6807\u6CE8";let t=e.filter((s)=>s.kind==="rect").length,n=e.filter((s)=>s.kind==="arrow").length,r=e.filter((s)=>s.kind==="text"),i=[];if(t)i.push(`${t} \u4E2A\u6846`);if(n)i.push(`${n} \u4E2A\u7BAD\u5934`);if(r.length){let s=r.map((o)=>o.text.trim()).filter(Boolean).slice(0,3).map((o)=>`\u300C${o.length>16?`${o.slice(0,16)}\u2026`:o}\u300D`);i.push(s.length?`\u6587\u672C ${s.join(" ")}`:`${r.length} \u5904\u6587\u672C`)}return`\u533A\u57DF\u6807\u6CE8\uFF08${i.join("\uFF0C")}\uFF09`}function br(e,t=16){if(e.length===0)return null;let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i,NEGATIVE_INFINITY:s}=Number;for(let o of e)if(o.kind==="rect")n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+o.width),s=Math.max(s,o.y+o.height);else if(o.kind==="arrow")n=Math.min(n,o.x1,o.x2),r=Math.min(r,o.y1,o.y2),i=Math.max(i,o.x1,o.x2),s=Math.max(s,o.y1,o.y2);else{let a=ce(o.text,o.fontSize);n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+a.width),s=Math.max(s,o.y+a.height)}return{x:n-t,y:r-t,width:Math.max(8,i-n+t*2),height:Math.max(8,s-r+t*2)}}function hr(e,t,n){return e.map((r)=>{if(r.kind==="rect")return{...r,x:r.x+t,y:r.y+n};if(r.kind==="arrow")return{...r,x1:r.x1+t,y1:r.y1+n,x2:r.x2+t,y2:r.y2+n};return{...r,x:r.x+t,y:r.y+n,fontSize:r.fontSize}})}function Cr(e,t){let n=Math.max(0,Math.min(e.x,t.width)),r=Math.max(0,Math.min(e.y,t.height)),i=Math.min(e.width,t.width-n),s=Math.min(e.height,t.height-r);if(i<8||s<8)return null;return{x:n,y:r,width:i,height:s}}var Z={blocker:0,high:1,medium:2,low:3};function T(e){return e.status==="open"||e.status==="processing"}function D(e){return[...e].sort((t,n)=>Z[t.priority]-Z[n.priority]||t.createdAt.localeCompare(n.createdAt))}function kr(e){return D(e.filter(T))}var ge=["open","processing","done","verified","ignored"],me=["bug","style","copywriting","feature","interaction","data","other"],X=["low","medium","high","blocker"],fe=["testid","id","aria","class","text","path"],ye=["light","dark","unknown"],be=["react","vue","angular","svelte","nextjs","nuxt","unknown"],he=["target-location","screenshot","context-bundle","dom-snapshot","style-snapshot"],Ce=["inline","exported-file","url","none"];function m(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function C(e,t){return typeof e==="string"&&t.includes(e)}function x(e){return typeof e==="number"&&Number.isFinite(e)}function A(e){return x(e)&&e>0}function O(e){return Array.isArray(e)&&e.every((t)=>typeof t==="string")}function ee(e){return m(e)&&Object.values(e).every((t)=>typeof t==="string")}function d(e){return e===void 0||typeof e==="string"}function te(e){if(!m(e)||!x(e.x)||!x(e.y)||!A(e.width)||!A(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function _(e){if(!m(e)||!A(e.width)||!A(e.height))return;return{width:e.width,height:e.height}}function M(e){if(!m(e)||!x(e.x)||!x(e.y))return;return{x:e.x,y:e.y}}function Q(e){if(!m(e)||typeof e.fileName!=="string"||!A(e.lineNumber))return;if(e.columnNumber!==void 0&&(!x(e.columnNumber)||e.columnNumber<0))return;if(!d(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function xe(e){let t=te(e.boundingBox);if(typeof e.tagName!=="string"||!e.tagName||typeof e.cssSelector!=="string"||!e.cssSelector||typeof e.xpath!=="string"||!e.xpath||!ee(e.attributes)||!t||!O(e.domPath))return;if(!d(e.textContent)||e.breadcrumb!==void 0&&!O(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!C(e.selectorStrategy,fe))return;if(!d(e.region))return;let n;if(e.accessibility!==void 0){if(!m(e.accessibility)||!d(e.accessibility.role)||!d(e.accessibility.name)||!d(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let r=e.sourceLocation===void 0?void 0:Q(e.sourceLocation);if(e.sourceLocation!==void 0&&!r)return;let i;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let s=e.sourceStack.map(Q);if(s.some((o)=>!o))return;i=s.filter((o)=>Boolean(o))}return{kind:"element",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...r?{sourceLocation:r}:{},...i?{sourceStack:i}:{}}}function ke(e){let t=te(e.rect),n=_(e.viewport),r=M(e.scroll);if(!t||t.width<8||t.height<8||!n||!r||!A(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!O(e.breadcrumb))return;let i;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;i=[];for(let o of e.topLevelElements){if(!m(o)||typeof o.tagName!=="string"||!o.tagName||!d(o.text)||!d(o.role))return;i.push({tagName:o.tagName,...o.text===void 0?{}:{text:o.text},...o.role===void 0?{}:{role:o.role}})}}let s=e.marks===void 0?void 0:J(e.marks);if(e.marks!==void 0&&!s)return;return{kind:"region",rect:t,viewport:n,scroll:r,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{topLevelElements:i}:{},...s?.length?{marks:s}:{}}}function Re(e){if(!m(e))return{ok:!1,reason:"target is not an object",raw:e};if(e.kind==="region"){let t=ke(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid region target",raw:e}}if(e.kind==="element"||e.kind===void 0){let t=xe(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid element target",raw:e}}return{ok:!1,reason:`unknown target kind: ${String(e.kind)}`,raw:e}}function Ae(e){if(!m(e))return;let t=_(e.viewport),n=M(e.scroll);if(!t||!n||!A(e.devicePixelRatio)||!m(e.center)||!x(e.center.x)||!x(e.center.y)||typeof e.visible!=="boolean"||!d(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function ne(e){if(!m(e))return;let{url:t,origin:n,path:r,title:i,capturedAt:s,query:o,hash:a,referrer:l,language:u,userAgent:g,uiState:f}=e,c=_(e.viewport),y=M(e.scroll);if(!c||!m(e.viewport)||!A(e.viewport.devicePixelRatio)||!y)return;if(typeof t!=="string"||!t||typeof n!=="string"||!n||typeof r!=="string"||!r||typeof i!=="string"||typeof s!=="string"||!s)return;if(!d(o)||!d(a)||!d(l)||!d(u)||!d(g)||!d(f))return;if(e.theme!==void 0&&!C(e.theme,ye))return;if(e.framework!==void 0&&!C(e.framework,be))return;return{url:t,origin:n,path:r,title:i,viewport:{...c,devicePixelRatio:e.viewport.devicePixelRatio},scroll:y,capturedAt:s,...o===void 0?{}:{query:o},...a===void 0?{}:{hash:a},...l===void 0?{}:{referrer:l},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...u===void 0?{}:{language:u},...g===void 0?{}:{userAgent:g},...f===void 0?{}:{uiState:f}}}function Ie(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!m(n)||!C(n.kind,["style","text"])||typeof n.label!=="string"||!d(n.property)||typeof n.before!=="string"||typeof n.after!=="string")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Pe(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(!m(n)||!C(n.kind,he)||!C(n.availability,Ce)||typeof n.label!=="string"||!n.label||!d(n.annotationId)||!d(n.reference))return;if(n.availability!=="none"&&!n.reference?.trim())return;t.push({kind:n.kind,availability:n.availability,label:n.label,...n.annotationId===void 0?{}:{annotationId:n.annotationId},...n.reference===void 0?{}:{reference:n.reference}})}return t}function F(e){if(!m(e))return{ok:!1,reason:"annotation is not an object",raw:e};let{id:t,pageUrl:n,comment:r,createdAt:i,updatedAt:s}=e;if(!C(e.status,ge))return{ok:!1,reason:"invalid status",raw:e};if(!C(e.type,me))return{ok:!1,reason:"invalid type",raw:e};if(!C(e.priority,X))return{ok:!1,reason:"invalid priority",raw:e};if(typeof t!=="string"||!t)return{ok:!1,reason:"invalid id",raw:e};if(typeof n!=="string"||!n)return{ok:!1,reason:"invalid pageUrl",raw:e};if(typeof r!=="string"||!r)return{ok:!1,reason:"invalid comment",raw:e};if(typeof i!=="string"||!i)return{ok:!1,reason:"invalid createdAt",raw:e};if(typeof s!=="string"||!s)return{ok:!1,reason:"invalid updatedAt",raw:e};if(!d(e.expectedResult)||!d(e.preserve)||!d(e.screenshot))return{ok:!1,reason:"invalid optional annotation text",raw:e};if(!ee(e.styleSummary))return{ok:!1,reason:"invalid styleSummary",raw:e};let o=Ae(e.geometry);if(!o)return{ok:!1,reason:"invalid geometry",raw:e};let a=ne(e.pageContext);if(!a)return{ok:!1,reason:"invalid pageContext",raw:e};let l=Ie(e.edits);if(!l)return{ok:!1,reason:"invalid edits",raw:e};let u=Re(e.target);if(!u.ok)return u;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:r,target:u.value,styleSummary:{...e.styleSummary},geometry:o,pageContext:a,createdAt:i,updatedAt:s,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...l.length?{edits:l}:{}}}}function Se(e){let t=[],n=[];return e.forEach((r,i)=>{let s=F(r);if(s.ok)t.push(s.value);else n.push({index:i,reason:s.reason,raw:s.raw})}),{annotations:D(t),failures:n}}function Pr(e){if(!m(e)||!Array.isArray(e.annotations))return{ok:!1,reason:"context annotations are missing",raw:e};if(e.version!=="1.0"&&e.version!=="2.0")return{ok:!1,reason:`unsupported context version: ${String(e.version)}`,raw:e};let t=Se(e.annotations),[n]=t.failures;if(n)return{ok:!1,reason:`invalid annotation at index ${n.index}`,raw:e};let r=e.version==="2.0";if(r){if(e.schema!=="uibot/web-annotation-context"||typeof e.contextId!=="string"||!e.contextId||typeof e.createdAt!=="string"||!e.createdAt||!C(e.scope,["active","all"])||!m(e.summary)||!x(e.summary.totalAnnotations)||e.summary.totalAnnotations<0||!x(e.summary.activeAnnotations)||e.summary.activeAnnotations<0||!x(e.summary.includedAnnotations)||e.summary.includedAnnotations<0||e.summary.topPriority!==void 0&&!C(e.summary.topPriority,X))return{ok:!1,reason:"invalid v2 context metadata",raw:e}}let i=r?Pe(e.evidence):[];if(!i)return{ok:!1,reason:"invalid context evidence",raw:e};let s=r?e.scope:"all",o=t.annotations,a=s==="active"?o.filter(T):o,l=e.page===void 0?void 0:ne(e.page);if(e.page!==void 0&&!l)return{ok:!1,reason:"invalid context page",raw:e};return{ok:!0,value:{schema:"uibot/web-annotation-context",version:"2.0",contextId:typeof e.contextId==="string"?e.contextId:`ctx_${Date.now()}`,createdAt:typeof e.createdAt==="string"?e.createdAt:new Date().toISOString(),scope:s,...l?{page:l}:{},summary:{totalAnnotations:o.length,activeAnnotations:o.filter(T).length,includedAnnotations:a.length,topPriority:D(a)[0]?.priority},evidence:i,annotations:a}}}function ve(e){return typeof e==="string"&&e.length<=q&&/^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function re(e){if(!Array.isArray(e)||e.length>j||!v({items:e}))return null;let t=[],n=0,r=new Set;for(let i of e){let s=F(i);if(!s.ok)return null;let o=s.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(o.id)||r.has(o.id)||!o.comment.trim()||o.comment.length>4000)return null;if(r.add(o.id),o.target.kind==="element"&&(o.target.cssSelector.length>2000||o.target.xpath.length>2000||(o.target.textContent?.length??0)>1000))return null;if(o.screenshot!==void 0&&(!ve(o.screenshot)||++n>U))return null;if((o.edits?.length??0)>20||o.edits?.some((a)=>a.before.length>4000||a.after.length>4000))return null;t.push(o)}try{if(t.length)W(t.map(K))}catch{return null}return t}function Mr(e){let t=e.ownerWindow??window,n=e.nonce??crypto.randomUUID(),r={enabled:!1,locked:!1,locale:"zh",items:[],theme:I(e.theme)},i=!1,s=!1,o=!1,a,l=(p)=>{if(o===!p)return;o=!p,e.onResponsiveChange?.(p)},u=()=>{if(a!==void 0)t.clearTimeout(a);if(a=void 0,!r.enabled||s||i){if(!r.enabled||s)l(!0);return}a=t.setTimeout(()=>{if(a=void 0,!s&&r.enabled&&!i)l(!1)},e.handshakeTimeoutMs??2500)},g=(p)=>{if(!i)e.iframe.contentWindow?.postMessage({...p,source:B,nonce:n},"*")},f=()=>g({action:"sync",...r}),c=(p)=>{if(i||p.source!==e.iframe.contentWindow||!v(p.data))return;let k=p.data;if(k.source!==V||k.nonce!==n)return;if(k.action==="ready"){s=!0,u();return}if(k.action==="closed"){e.onClose();return}if(k.action!=="snapshot"||r.locked||!r.enabled)return;let L=re(k.items);if(L)e.onChange(L)};t.addEventListener("message",c);let y=()=>{if(s=!1,r.enabled||r.items.length)f();u()};e.iframe.addEventListener("load",y);let S=t.setInterval(()=>{if(!s&&r.enabled)f()},400);return{update(p){let k=r.enabled;if(r={...r,...p,theme:Object.hasOwn(p,"theme")?I(p.theme):r.theme??{}},f(),k!==r.enabled)u()},reveal(p){if(r.items.some((k)=>k.id===p))g({action:"reveal",id:p})},dispose(){if(i)return;if(g({action:"sync",enabled:!1,locked:!0,items:[],locale:r.locale}),i=!0,t.clearInterval(S),a!==void 0)t.clearTimeout(a);t.removeEventListener("message",c),e.iframe.removeEventListener("load",y)}}}var we={primaryContrast:["--primary-foreground","#fafafa"],surface:["--card","#ffffff"],foreground:["--card-foreground","#18181b"],popover:["--popover","#ffffff"],popoverContrast:["--popover-foreground","#18181b"],border:["--border","#e4e4e7"],muted:["--muted-foreground","#71717a"],field:["--muted","#f4f4f5"],hover:["--accent","#f4f4f5"],focus:["--ring","#a1a1aa"],danger:["--destructive","#dc2626"]},N={accent:"#18181b",contrast:"#fafafa",selected:"#3f3f46",outline:"rgba(255, 255, 255, 0.6)"};function Ee(e){let t=e.ownerDocument.defaultView?.getComputedStyle(e),n=(i)=>{let[s,o]=we[i],a=t?.getPropertyValue(s).trim()??"";return I({"--pa-accent":a})["--pa-accent"]??o},r=N.accent;return I({"--pa-accent":r,"--pa-accent-contrast":N.contrast,"--pa-accent-soft":`color-mix(in srgb, ${r} 10%, transparent)`,"--pa-accent-halo":`color-mix(in srgb, ${r} 45%, transparent)`,"--pa-surface":n("surface"),"--pa-surface-contrast":n("foreground"),"--pa-popover":n("popover"),"--pa-popover-contrast":n("popoverContrast"),"--pa-border":n("border"),"--pa-muted":n("muted"),"--pa-field":n("field"),"--pa-hover":n("hover"),"--pa-selected":N.selected,"--pa-focus":n("focus"),"--pa-outline":N.outline,"--pa-shadow":"#00000033","--pa-checker":n("muted"),"--pa-danger":n("danger"),"--pa-danger-contrast":n("primaryContrast"),"--pa-success":"#15803d","--pa-success-contrast":"#ffffff","--pa-color-default":n("foreground")})}function Br(e,t){let n=e.ownerDocument.defaultView;if(!n)return()=>{};let r=()=>t(Ee(e)),i=new n.MutationObserver(r);i.observe(e,{attributes:!0,attributeFilter:["class","style"]});let s=n.matchMedia("(prefers-color-scheme: dark)");return s.addEventListener("change",r),()=>{i.disconnect(),s.removeEventListener("change",r)}}export{B as ANNOTATION_HOST_SOURCE,j as ANNOTATION_MAX_ITEMS,Te as ANNOTATION_MAX_MESSAGE_BYTES,U as ANNOTATION_MAX_SCREENSHOTS,V as ANNOTATION_PAGE_SOURCE,q as ANNOTATION_SCREENSHOT_MAX_BYTES,Ne as ANNOTATION_THEME_MAX_BYTES,z as ANNOTATION_THEME_TOKENS,Oe as applyAnnotationTheme,v as boundedMessage,Mr as createAnnotationController,w as isAnnotationThemeColor,Br as observeStudioAnnotationTheme,re as parseAnnotationItems,Ee as resolveStudioAnnotationTheme,ve as validScreenshot,I as validateAnnotationTheme};
package/dist/runtime.js CHANGED
@@ -342,5 +342,5 @@ ${r}`:r}var pn={blocker:0,high:1,medium:2,low:3};function ot(e){return e.status=
342
342
  @media (prefers-reduced-motion: reduce){
343
343
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}
344
344
  }
345
- \`;function Et(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 16 16"),t.setAttribute("width","14"),t.setAttribute("height","14"),t.setAttribute("aria-hidden","true"),e(t),t}function Cr(){return Et((e)=>{for(let[t,n]of[[5.5,3],[10.5,3],[5.5,8],[10.5,8],[5.5,13],[10.5,13]]){let i=document.createElementNS("http://www.w3.org/2000/svg","circle");i.setAttribute("cx",String(t)),i.setAttribute("cy",String(n)),i.setAttribute("r","1.15"),i.setAttribute("fill","currentColor"),e.appendChild(i)}})}function Cn(){return Et((e)=>{let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d","M4 4l8 8M12 4l-8 8"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linecap","round"),e.appendChild(t)})}function kn(e,t){let n=e.annotationRegionV2!==!1,i="__uibotAnnotatorActive",a=window;if(a.__uibotAnnotatorActive)return;a.__uibotAnnotatorActive=!0;let c=hn(t.recordPerformance?.bind(t)),s=()=>{return},u=document.createElement("div");u.id="__uibot-annotator-host",u.style.cssText="position:fixed;inset:0;z-index:2147483646;pointer-events:none;color-scheme:dark;",at(u,e.theme);let b=u.attachShadow({mode:"open"});(document.documentElement||document.body).appendChild(u);let C=document.createElement("style");C.textContent=xn,b.appendChild(C);let A=document.createElement("div");b.appendChild(A);let I=document.createElement("div");I.className="hl",I.style.display="none";let k=document.createElement("div");k.className="tag",k.style.display="none";let T=document.createElement("div");T.className="selbox",T.style.display="none";let R=document.createElement("div");R.className="pin active",R.style.display="none";let O=document.createElement("button");O.type="button",O.className="sel-clear",O.style.display="none",O.setAttribute("aria-label","\u53D6\u6D88\u9009\u62E9"),O.title="\u53D6\u6D88\u9009\u62E9",O.appendChild(Cn()),O.addEventListener("click",(r)=>{r.preventDefault(),r.stopPropagation(),Ct(!0)});let F=document.createElement("div");F.className="region-box";let Y=document.createElement("span");Y.className="region-size",F.appendChild(Y);let v=document.createElement("div");v.className="sr-live",v.setAttribute("aria-live","polite"),A.append(I,k,T,R,O,F,v);let E=null;function M(r,o){E=r,R.textContent=String(o),N()}function S(){E=null,T.style.display="none",R.style.display="none",O.style.display="none"}function N(){if(!E)return;let r=E.getBoundingClientRect();T.style.display="block",T.style.left=\`\${r.left-1}px\`,T.style.top=\`\${r.top-1}px\`,T.style.width=\`\${r.width+2}px\`,T.style.height=\`\${r.height+2}px\`,R.style.display="flex",R.style.left=\`\${Math.max(2,r.left-6)}px\`,R.style.top=\`\${Math.max(2,r.top-6)}px\`,O.style.display="flex",O.style.left=\`\${Math.min(window.innerWidth-26,Math.max(2,r.right-6))}px\`,O.style.top=\`\${Math.max(2,r.top-16)}px\`}let D=document.createElement("div");D.className="bar";let H=document.createElement("button");H.type="button",H.className="grip",H.setAttribute("aria-label","\u62D6\u52A8\u5DE5\u5177\u680F"),H.title="\u62D6\u52A8",H.appendChild(Cr());let G=document.createElement("div");G.className="seg";let ae=document.createElement("button");ae.type="button",ae.dataset.tool="element",ae.textContent="\u5143\u7D20",ae.className="on";let K=document.createElement("button");K.type="button",K.dataset.tool="region",K.textContent="\u533A\u57DF",K.disabled=!n,K.title=n?"\u6846\u9009\u533A\u57DF":"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED";let Q=document.createElement("button");Q.type="button",Q.dataset.tool="adjust",Q.textContent="\u8C03\u6574",G.append(ae,K,Q);let se=document.createElement("button");se.type="button",se.className="exit",se.setAttribute("aria-label","\u9000\u51FA"),se.title="\u9000\u51FA",se.appendChild(Cn()),D.append(H,G,se),A.appendChild(D);let ge=It(D,H),le={current:()=>{return}},m=yn(A,{onSave:(r)=>le.current(r)}),h="element",x="hovering",j=null,w=null,oe=null,X=!1,_e=null,ye=null;function ft(){if(_e&&ye!=null)try{_e.releasePointerCapture?.(ye)}catch{}_e=null,ye=null}function Vt(){ft(),oe=null,X=!1,w=null,F.style.display="none"}function Re(r){if(r==="region"&&!n)return;if(r===h)return;Ct(!0),h=r,ae.classList.toggle("on",h==="element"),K.classList.toggle("on",h==="region"),Q.classList.toggle("on",h==="adjust"),ht(),F.style.display="none",w=null,oe=null,X=!1,ft(),m.setActive(h==="region")}ae.addEventListener("click",()=>Re("element")),K.addEventListener("click",()=>Re("region")),Q.addEventListener("click",()=>Re("adjust"));function he(r,o,l){return Math.min(l,Math.max(o,r))}function zr(r,o){let l=he(r.x,0,window.innerWidth),d=he(r.y,0,window.innerHeight),f=he(o.x,0,window.innerWidth),g=he(o.y,0,window.innerHeight),p={x:Math.min(l,f),y:Math.min(d,g),width:Math.abs(f-l),height:Math.abs(g-d)};return p.width>=8&&p.height>=8?p:null}function yt(r){F.style.display="block",F.style.left=\`\${r.x}px\`,F.style.top=\`\${r.y}px\`,F.style.width=\`\${r.width}px\`,F.style.height=\`\${r.height}px\`,Y.textContent=\`\${Math.round(r.width)} \xD7 \${Math.round(r.height)}\`,v.textContent=\`\u533A\u57DF x \${Math.round(r.x)}\uFF0Cy \${Math.round(r.y)}\uFF0C\u5BBD \${Math.round(r.width)}\uFF0C\u9AD8 \${Math.round(r.height)}\`}function Bn(r){let o=[[r.x+r.width/2,r.y+r.height/2],[r.x+1,r.y+1],[r.x+r.width-1,r.y+r.height-1]],l=[];return o.forEach(([d,f])=>{let g=document.elementFromPoint(d,f);if(!g||nt(g)||l.some((p)=>p.tagName===g.tagName.toLowerCase()))return;l.push({tagName:g.tagName.toLowerCase(),...fe(g.textContent||"",60)?{text:fe(g.textContent||"",60)}:{},...g.getAttribute("role")?{role:g.getAttribute("role")}:{}})}),l}function jt(r,o=[]){let l={x:Math.round(r.x+window.scrollX),y:Math.round(r.y+window.scrollY),width:Math.round(r.width),height:Math.round(r.height)},d={width:window.innerWidth,height:window.innerHeight},f={x:window.scrollX,y:window.scrollY},g=mn(o,window.scrollX,window.scrollY);return{comment:"",type:"other",priority:"medium",target:{kind:"region",rect:l,viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,topLevelElements:Bn(r),...g.length?{marks:g}:{}},styleSummary:{},geometry:{viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2)},visible:!0},pageContext:At()}}function zt(r){let o=r.getBoundingClientRect();I.style.display="block",I.style.left=\`\${o.left}px\`,I.style.top=\`\${o.top}px\`,I.style.width=\`\${o.width}px\`,I.style.height=\`\${o.height}px\`;let l=Array.from(r.classList).slice(0,2).join(".");k.textContent=\`\${r.tagName.toLowerCase()}\${l?"."+l:""} \xB7 \${Math.round(o.width)}\xD7\${Math.round(o.height)}\`,k.style.display="block";let d=o.top>22?o.top-20:o.bottom+4;k.style.left=\`\${Math.max(2,o.left)}px\`,k.style.top=\`\${d}px\`}function ht(){I.style.display="none",k.style.display="none"}function Le(r){let o=document.createElement("div");o.className="toast",o.style.background="var(--pa-success, #15803d)",o.style.color="var(--pa-success-contrast, #fff)",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1600)}let qt={blocker:0,high:1,medium:2,low:3},Se=[];function Vn(r){let o=r.getBoundingClientRect(),l=document.createElement("div");l.className="flash",l.style.left=\`\${o.left-2}px\`,l.style.top=\`\${o.top-2}px\`,l.style.width=\`\${o.width+4}px\`,l.style.height=\`\${o.height+4}px\`,A.appendChild(l),setTimeout(()=>l.remove(),1300)}function bt(r,o){let l=r.kind==="element"?document.querySelector(r.cssSelector):null;if(r.kind==="element"&&!l){o.style.display="none";return}let d=l?.getBoundingClientRect()??{left:r.kind==="region"?r.rect.x-window.scrollX:0,top:r.kind==="region"?r.rect.y-window.scrollY:0,width:r.kind==="region"?r.rect.width:0,height:r.kind==="region"?r.rect.height:0};if(d.width===0&&d.height===0){o.style.display="none";return}o.style.display="flex",o.style.left=\`\${Math.max(2,d.left-6)}px\`,o.style.top=\`\${Math.max(2,d.top-6)}px\`}function $t(){for(let r of Se)r.pinEl.remove();Se=[]}function jn(r){$t(),r.filter((l)=>l.status==="open"||l.status==="processing").sort((l,d)=>(qt[l.priority]??9)-(qt[d.priority]??9)||(l.createdAt||"").localeCompare(d.createdAt||"")).forEach((l,d)=>{if(!l.target||l.target.kind==="element"&&!l.target.cssSelector)return;let f=document.createElement("div");f.className="pin marker",f.textContent=String(d+1),f.title=l.comment||"",f.addEventListener("click",(g)=>{g.stopPropagation();let p=l.target.kind==="element"?document.querySelector(l.target.cssSelector):null;if(p)p.scrollIntoView({block:"center"}),Vn(p),Le(l.comment?\`#\${d+1} \${l.comment}\`:\`#\${d+1}\`),bt(l.target,f);else if(l.target.kind==="region")window.scrollTo({top:Math.max(0,l.target.rect.y-window.innerHeight/2),left:l.target.rect.x}),yt({x:l.target.rect.x-window.scrollX,y:l.target.rect.y-window.scrollY,width:l.target.rect.width,height:l.target.rect.height}),setTimeout(()=>{if(!w)F.style.display="none"},1300),Le(l.comment?\`#\${d+1} \${l.comment}\`:\`#\${d+1}\`);else ee(\`#\${d+1} \u5143\u7D20\u672A\u627E\u5230\uFF08\u9875\u9762\u53EF\u80FD\u5DF2\u53D8\u5316\uFF09\`)}),A.appendChild(f),Se.push({target:l.target,pinEl:f}),bt(l.target,f)})}async function Fe(){let r=c.start("markers_loaded");try{let o=await t.sendMessage({action:U.list,pageUrl:location.href});if(o&&o.success&&Array.isArray(o.data))jn(o.data),r("success");else r("failure")}catch{r("failure")}}let be=[];function zn(r,o,l){let d=o,f=document.createElement("div");f.className="dd";let g=document.createElement("button");g.type="button",g.className="dd-btn";let p=document.createElement("span");p.className="v";let y=document.createElement("span");y.className="chev",y.textContent="\u25BE",g.append(p,y);let P=document.createElement("div");P.className="dd-menu",P.style.display="none";function z(){let V=r.find((B)=>B.value===d);if(p.textContent="",V?.color){let B=document.createElement("span");B.className="swatch",B.style.background=V.color,p.appendChild(B)}p.appendChild(document.createTextNode(V?.label??"")),Array.from(P.children).forEach((B,ne)=>{B.classList.toggle("sel",r[ne].value===d)})}function L(){P.style.display="none",g.classList.remove("open")}function de(){for(let V of be)V();P.style.display="block",g.classList.add("open")}return be.push(L),r.forEach((V)=>{let B=document.createElement("button");if(B.type="button",B.className="dd-item",V.color){let ne=document.createElement("span");ne.className="swatch",ne.style.background=V.color,B.appendChild(ne)}B.appendChild(document.createTextNode(V.label)),B.addEventListener("click",(ne)=>{ne.stopPropagation(),d=V.value,z(),L(),l?.(d)}),P.appendChild(B)}),g.addEventListener("click",(V)=>{V.stopPropagation(),P.style.display==="none"?de():L()}),f.append(g,P),z(),{el:f,get:()=>d,set:(V)=>{d=V,z()},close:L}}let qn=[{value:"style",label:"\u6837\u5F0F\u95EE\u9898"},{value:"copywriting",label:"\u6587\u6848\u4FEE\u6539"},{value:"bug",label:"Bug"},{value:"feature",label:"\u529F\u80FD\u5EFA\u8BAE"},{value:"interaction",label:"\u4EA4\u4E92\u95EE\u9898"},{value:"data",label:"\u6570\u636E\u95EE\u9898"},{value:"other",label:"\u5176\u4ED6"}],$n=[{value:"low",label:"\u4F4E",color:"var(--pa-muted, #737373)"},{value:"medium",label:"\u4E2D",color:"var(--pa-surface-contrast, #17171a)"},{value:"high",label:"\u9AD8",color:"var(--pa-accent, #7c2d34)"},{value:"blocker",label:"\u963B\u585E",color:"var(--pa-danger, #5c151c)"}],W=null,Z=null,Be=null,Ve=null,je=null,ze=null,ce=null;function Ut(r){let o=document.createElement("button");return o.type="button",o.className="ok",o.dataset.icon="confirm",o.textContent="\u2713",o.title=r,o.setAttribute("aria-label",r),o}function Pe(r,o){if(!r)return;r.textContent=o?"\u2026":"\u2713",r.toggleAttribute("aria-busy",o),r.disabled=o}function Ht(r){for(let o of["data-component","data-uibot-component","data-testid"]){let l=r.getAttribute(o)?.trim();if(l)return l.slice(0,48)}return r.tagName.toLowerCase()}function Un(){return Et((r)=>{let o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M10 3L5 8l5 5"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","1.8"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),r.appendChild(o)})}function Wt(r,o){let l=document.createElement("div");l.className="ehead";let d=document.createElement("button");d.type="button",d.className="back",d.setAttribute("aria-label","\u53D6\u6D88\u9009\u62E9"),d.title="\u53D6\u6D88\u9009\u62E9",d.appendChild(Un()),d.addEventListener("click",(g)=>{g.preventDefault(),g.stopPropagation(),o()});let f=document.createElement("span");return f.className="name",f.textContent=r,f.title=r,l.append(d,f),l}function Ze(){W?.remove(),W=null,Z=Be=Ve=ce=null,je=ze=null,be.length=0,S(),F.style.display="none",x="hovering",j=null,w=null,X=!1}function Kt(r,o){if(o&&!n)return;if(x="editing",j=r,w=o??null,ht(),r)M(r,Se.length+1);else S();if(o)yt(o);let l=r?.getBoundingClientRect(),d=l?{left:l.left,top:l.top,right:l.right,bottom:l.bottom}:o?{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height}:{left:8,top:80,right:8,bottom:80};be.length=0,W=document.createElement("div"),W.className="epanel",W.setAttribute("role","dialog"),W.setAttribute("aria-modal","true"),W.setAttribute("aria-label",o?"\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8":"\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8"),W.addEventListener("click",()=>{for(let _ of be)_()});let f=Wt(o?\`\u533A\u57DF \${Math.round(o.width)}\xD7\${Math.round(o.height)}\`:Ht(r),Ze),g=document.createElement("div");g.className="etop",Z=document.createElement("textarea"),Z.rows=3,Z.placeholder="\u54EA\u91CC\u4E0D\u5BF9\uFF1F\u8BF4\u660E\u671F\u671B\u5373\u53EF\uFF0C\u4F8B\u5982\uFF1A\u79FB\u52A8\u7AEF\u6309\u94AE\u6587\u5B57\u6362\u884C\uFF1B\u80FD\u653E\u4E0B\u65F6\u4FDD\u6301\u5355\u884C\uFF0C\u4E14\u5361\u7247\u9AD8\u5EA6\u4E0D\u53D8\u3002",Z.addEventListener("input",()=>{if(Z.style.height="auto",Z.style.height=\`\${Math.min(Math.max(Z.scrollHeight,72),144)}px\`,ce)ce.disabled=!Z.value.trim()}),g.append(Z);let p=document.createElement("button");p.type="button",p.dataset.action="more",p.className="quick-more",p.textContent="\u66F4\u591A\u8BBE\u7F6E \u25BE",p.setAttribute("aria-expanded","false");let y=document.createElement("div");y.className="advanced",y.id="__uibot-annotation-advanced",y.hidden=!0,p.setAttribute("aria-controls",y.id);let P=(_,me)=>{let xe=document.createElement("label");xe.className="erow";let Te=document.createElement("span");Te.className="lb",Te.textContent=_;let Ne=document.createElement("div");return Ne.className="ctl",Ne.append(me),xe.append(Te,Ne),xe};Be=document.createElement("textarea"),Be.placeholder="\u4F8B\u5982\uFF1A\u5BBD\u5EA6\u8DB3\u591F\u65F6\u4FDD\u6301\u5355\u884C",Ve=document.createElement("textarea"),Ve.placeholder="\u4F8B\u5982\uFF1A\u5361\u7247\u9AD8\u5EA6\u548C\u70B9\u51FB\u884C\u4E3A\u4E0D\u53D8",je=document.createElement("select");for(let _ of qn)je.add(new Option(_.label,_.value,!1,_.value==="other"));ze=document.createElement("select");for(let _ of $n)ze.add(new Option(_.label,_.value,!1,_.value==="medium"));y.append(P("\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09",Be),P("\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09",Ve),P("\u7C7B\u578B",je),P("\u4F18\u5148\u7EA7",ze)),p.addEventListener("click",(_)=>{_.stopPropagation(),y.hidden=!y.hidden,p.textContent=y.hidden?"\u66F4\u591A\u8BBE\u7F6E \u25BE":"\u6536\u8D77\u8BBE\u7F6E \u25B4",p.setAttribute("aria-expanded",String(!y.hidden))});let z=document.createElement("div");z.className="ebar";let L=document.createElement("button");L.type="button",L.className="cancel",L.textContent="\u53D6\u6D88",L.addEventListener("click",Ze),ce=Ut("\u4FDD\u5B58\u6807\u6CE8"),ce.dataset.action="save",ce.disabled=!0,ce.addEventListener("click",()=>void Yt()),z.append(L,ce),W.append(f,g,p,y,z),W.addEventListener("keydown",(_)=>{if(_.key==="Enter"&&(_.ctrlKey||_.metaKey)){if(_.preventDefault(),!ce?.disabled)Yt();return}if(_.key!=="Tab")return;let me=[...W.querySelectorAll("button:not([disabled]),textarea:not([disabled]),select:not([disabled]),input:not([disabled])")].filter((er)=>!er.closest("[hidden]"));if(!me.length)return;let xe=me[0],Te=me[me.length-1],Ne=b.activeElement;if(_.shiftKey&&Ne===xe)_.preventDefault(),Te.focus();else if(!_.shiftKey&&Ne===Te)_.preventDefault(),xe.focus()}),A.appendChild(W);let de=360,V=d.left,B=d.bottom+10;if(V+de>window.innerWidth-8)V=window.innerWidth-de-8;if(V<8)V=8;let ne=W.offsetHeight||300;if(B+ne>window.innerHeight-8)B=Math.max(8,d.top-ne-10);W.style.left=\`\${V}px\`,W.style.top=\`\${B}px\`,Z.focus()}async function Yt(){if(!j&&!w||!Z)return;if(w&&!n){ee("\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8");return}let r=Z.value.trim();if(!r){ee("\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9"),Z.focus();return}let o=w?jt(w):wt(j);o.comment=r,o.type=je?.value??"other",o.priority=ze?.value??"medium";let l=Be?.value.trim();if(l)o.expectedResult=l;let d=Ve?.value.trim();if(d)o.preserve=d;u.style.visibility="hidden";let f=ce;Pe(f,!0);let g=c.start("save_durable");try{let p=await t.sendMessage({action:U.save,data:o});if(u.style.visibility="visible",p&&p.success){g("success"),Ze(),Fe(),Le("\u5DF2\u4FDD\u5B58");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:o}).catch(()=>{})}else g("failure"),console.error("[uibot annotation] save rejected:",p),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),Pe(f,!1)}catch(p){g("failure"),u.style.visibility="visible",console.error("[uibot annotation] save threw:",p);let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),Pe(f,!1)}}async function Hn(r){if(!n){ee("\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8");return}let o=Ke(r.marks,0),l=o?Pt(o,{width:window.innerWidth,height:window.innerHeight}):null;if(!l){ee("\u8BF7\u5148\u6846\u9009\u533A\u57DF\u6216\u6DFB\u52A0\u7BAD\u5934/\u6587\u672C");return}let d=r.comment.trim()||gn(r.marks),f=jt(l,r.marks);f.comment=d,m.setBusy(!0),u.classList.add("capturing"),m.setCapturing(!0);let g=c.start("save_durable");try{let p=await t.sendMessage({action:U.save,data:f});if(p&&p.success){g("success");let y=p.data?.id,P=Pt(Ke(r.marks,16)??l,{width:window.innerWidth,height:window.innerHeight}),z=!0;if(y&&P&&t.captureRegion)await new Promise((L)=>{requestAnimationFrame(()=>requestAnimationFrame(()=>L()))}),z=await t.captureRegion({id:y,...P}).catch(()=>!1);if(m.clear(),m.setBusy(!1),Fe(),z)Le("\u5DF2\u4FDD\u5B58");else ee("\u6807\u6CE8\u5DF2\u4FDD\u5B58\uFF0C\u622A\u56FE\u672A\u5B8C\u6210");if(y)t.sendMessage({action:U.enrich,annotationId:y,data:f}).catch(()=>{})}else g("failure"),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),m.setBusy(!1)}catch(p){g("failure");let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),m.setBusy(!1)}finally{u.classList.remove("capturing"),m.setCapturing(!1)}}le.current=(r)=>{Hn(r)};function ee(r){let o=document.createElement("div");o.className="toast",o.style.background="var(--pa-danger, #b91c1c)",o.style.color="var(--pa-danger-contrast, #fff)",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1800)}let te=null,Je=null,Ae=null,qe=null,Qe=[],$e=[];function Gt(r){let o=r.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);if(!o){let d=document.createElement("span");if(d.style.color=r,!d.style.color)d.style.color="var(--pa-color-default, #000000)";b.appendChild(d);let f=getComputedStyle(d).color;d.remove();let g=document.createElement("canvas").getContext("2d");if(!g)return"#000000";if(g.fillStyle=f,/^#[0-9a-f]{6}$/i.test(g.fillStyle))return g.fillStyle;g.fillRect(0,0,1,1);let p=g.getImageData(0,0,1,1).data;return\`#\${[p[0],p[1],p[2]].map((y)=>(y??0).toString(16).padStart(2,"0")).join("")}\`}let l=(d)=>Math.max(0,Math.min(255,Number.parseInt(d,10))).toString(16).padStart(2,"0");return\`#\${l(o[1])}\${l(o[2])}\${l(o[3])}\`}function et(r,o){let l=r.style.getPropertyValue(o),d=()=>{if(l)r.style.setProperty(o,l);else r.style.removeProperty(o)};return $e.push(d),{revert:d,apply:(f)=>{r.style.setProperty(o,f)}}}function Ue(r){let o=document.createElement("div");o.className="prow",o.dataset.filter=r.filter.toLowerCase();let l=document.createElement("input");l.type="checkbox",l.setAttribute("aria-label",\`\u9009\u62E9 \${r.name}\`);let d=document.createElement("span");d.className="pname",d.textContent=r.name,d.title=r.name;let f=()=>{l.checked=!0,r.apply()};return l.addEventListener("change",()=>{if(l.checked){if(r.read()!==r.before)r.apply()}else r.revert(),r.reset()}),r.control.addEventListener("input",()=>{f()}),r.onReady?.(f),o.append(l,d,r.control),Qe.push({kind:r.kind,label:r.name,before:r.before,read:r.read,selected:()=>l.checked,...r.property===void 0?{}:{property:r.property}}),o}function xt(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement("div");f.className="efield";let g=document.createElement("label");g.className="sw";let p=document.createElement("i");p.style.background=l||"transparent",g.appendChild(p);let y=document.createElement("input");y.value=l,y.setAttribute("aria-label",o);let P=document.createElement("input");P.type="color",P.value=Gt(l||"#000000"),P.className="color-hit",P.setAttribute("aria-label",\`\u9009\u62E9\${o}\`);let z=(L)=>{p.style.background=L||"transparent"};return P.addEventListener("input",()=>{y.value=P.value,z(P.value)}),y.addEventListener("input",()=>{z(y.value)}),g.appendChild(P),f.append(g,y),Ue({name:o,filter:o,control:f,kind:"style",property:o,before:l,read:()=>y.value.trim(),reset:()=>{y.value=l,z(l),P.value=Gt(l||"#000000")},apply:()=>d.apply(y.value.trim()),revert:d.revert})}function Ie(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement("div");f.className="efield";let g=document.createElement("input");return g.value=l,g.setAttribute("aria-label",o),f.appendChild(g),Ue({name:o,filter:o,control:f,kind:"style",property:o,before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>d.apply(g.value.trim()),revert:d.revert})}function Ee(r,o,l){let d=getComputedStyle(r).getPropertyValue(o).trim(),f=et(r,o),g=[...l];if(d&&!g.includes(d))g.unshift(d);let p=g.includes(d)?d:g[0]??"",y=p,P=()=>{},z=zn(g.map((L)=>({value:L,label:L})),p,(L)=>{y=L,P()});return Ue({name:o,filter:o,control:z.el,kind:"style",property:o,before:d,read:()=>y,reset:()=>{y=p,z.set(p)},apply:()=>f.apply(y),revert:f.revert,onReady:(L)=>{P=L}})}function Wn(r){let o=["top","right","bottom","left"],l=o.map((p)=>getComputedStyle(r).getPropertyValue(\`margin-\${p}\`).trim()),d=o.map((p)=>et(r,\`margin-\${p}\`)),f=o.map((p,y)=>{let P=document.createElement("input");return P.value=l[y]??"",P.setAttribute("aria-label",\`margin-\${p}\`),P}),g=document.createElement("div");return g.className="mbox",g.append(...f),Ue({name:"margin",filter:"margin",control:g,kind:"style",property:"margin",before:l.join(" "),read:()=>f.map((p)=>p.value.trim()).join(" "),reset:()=>{f.forEach((p,y)=>{p.value=l[y]??""})},apply:()=>{for(let[p,y]of f.entries())d[p]?.apply(y.value.trim())},revert:()=>{for(let p of d)p.revert()}})}function Kn(r){if(r.children.length>0||!(r.textContent||"").trim())return null;let o=r.textContent||"",l=o.replace(/\\s+/g," ").trim(),d=()=>{r.textContent=o};$e.push(d);let f=document.createElement("div");f.className="efield";let g=document.createElement("input");return g.value=l,g.setAttribute("aria-label","\u6587\u6848"),f.appendChild(g),Ue({name:"\u6587\u6848",filter:"\u6587\u6848 text",control:f,kind:"text",before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>{r.textContent=g.value},revert:d})}let He=()=>{return};function tt(r){if(r)$e.forEach((o)=>{try{o()}catch{}});$e.length=0,Qe=[],He(),He=()=>{return},te?.remove(),te=null,Je=null,Ae=qe=null,be.length=0,S(),x="hovering",j=null}function Ct(r){if(W)Ze();if(te)tt(r)}function Yn(r){x="editing",j=r,Je=r,ht(),M(r,Se.length+1),Qe=[],$e.length=0,be.length=0;let o=r.getBoundingClientRect();te=document.createElement("div"),te.className="epanel",te.addEventListener("click",()=>{for(let _ of be)_()});let l=Wt(Ht(r),()=>tt(!0)),d=document.createElement("span");d.className="grip",d.textContent="\u283F",d.setAttribute("aria-hidden","true"),l.appendChild(d);let f=document.createElement("label");f.className="prop-filter";let g=document.createElement("input");g.placeholder="\u7B5B\u9009\u5C5E\u6027",g.setAttribute("aria-label","\u7B5B\u9009\u5C5E\u6027"),f.appendChild(g);let p=document.createElement("div");p.className="einstruct",Ae=document.createElement("input"),Ae.placeholder="\u7528\u4E00\u53E5\u8BDD\u63CF\u8FF0\u60F3\u8981\u7684\u4FEE\u6539\uFF08\u53EF\u9009\uFF09",Ae.setAttribute("aria-label","\u4FEE\u6539\u8BF4\u660E"),p.appendChild(Ae);let y=document.createElement("div");y.className="erows";let P=[xt(r,"background-color"),xt(r,"border-color"),Ie(r,"border-width"),Ee(r,"border-style",["none","solid","dashed","dotted","double"]),Ie(r,"border-radius"),Ie(r,"opacity"),Wn(r),Ie(r,"padding"),Ie(r,"gap"),Ee(r,"display",["block","flex","inline-flex","grid","inline-block","inline","none"]),Ee(r,"flex-direction",["row","column","row-reverse","column-reverse"]),Ee(r,"flex-wrap",["nowrap","wrap","wrap-reverse"]),Ee(r,"justify-content",["flex-start","center","flex-end","space-between","space-around","space-evenly"]),xt(r,"color"),Ie(r,"font-size"),Ee(r,"font-weight",["300","400","500","600","700"])],z=Kn(r);if(z)P.push(z);y.append(...P),g.addEventListener("input",()=>{let _=g.value.trim().toLowerCase();for(let me of y.querySelectorAll(".prow")){let xe=me.dataset.filter??"";me.hidden=_.length>0&&!xe.includes(_)}});let L=document.createElement("div");L.className="ebar";let de=document.createElement("button");de.type="button",de.className="cancel",de.textContent="\u53D6\u6D88",de.addEventListener("click",()=>tt(!0)),qe=Ut("\u4FDD\u5B58\u4FEE\u6539"),qe.addEventListener("click",()=>void Xn()),L.append(de,qe),te.append(l,f,p,y,L),A.appendChild(te),He(),He=It(te,d);let V=360,B=o.right+12;if(B+V>window.innerWidth-8)B=Math.max(8,o.left-V-12);if(B<8)B=8;let ne=Math.max(8,Math.min(o.top,window.innerHeight-(te.offsetHeight||360)-8));te.style.left=\`\${B}px\`,te.style.top=\`\${ne}px\`,Ae.focus()}function Gn(r){return r.map((o)=>\`\${o.label} \${fe(o.before,24)}\u2192\${fe(o.after,24)}\`).join("\uFF1B")}async function Xn(){if(!Je)return;let r=Je,o=[];for(let p of Qe){if(!p.selected())continue;let y=p.read();if(y!==p.before)o.push({kind:p.kind,label:p.label,...p.property===void 0?{}:{property:p.property},before:p.before,after:y})}let l=Ae?.value.trim()||"";if(o.length===0&&!l){ee("\u672A\u505A\u4EFB\u4F55\u4FEE\u6539");return}let d=wt(r);d.type="style",d.edits=o;let f=Gn(o);if(d.comment=l||(f?\`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A\${f}\`:"\u53EF\u89C6\u5316\u4FEE\u6539"),l&&f)d.expectedResult=f;u.style.visibility="hidden";let g=qe;Pe(g,!0);try{let p=await t.sendMessage({action:U.save,data:d});if(u.style.visibility="visible",p&&p.success){tt(!1),Fe(),Le("\u5DF2\u4FDD\u5B58");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:d}).catch(()=>{})}else console.error("[uibot annotation] edit save rejected:",p),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),Pe(g,!1)}catch(p){u.style.visibility="visible";let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),Pe(g,!1)}}function nt(r){if(!(r instanceof Node))return!1;if(u.contains(r))return!0;let o=r.getRootNode();return o instanceof ShadowRoot&&o.host===u}function Xt(r){if(x!=="hovering"||h==="region")return;let o=r.target;if(!o||nt(o)||o===u)return;j=o,zt(o)}function Zt(r){if(nt(r.target))return;let o=r.target;if(!o)return;if(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation?.(),x==="hovering"){if(h==="adjust")Yn(o);else if(h==="element")Kt(o)}}function Zn(){let r=b.activeElement;return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLElement&&r.isContentEditable}function Jt(r){if(Zn()||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLElement&&r.target.isContentEditable)return;if(x==="hovering"&&!X){if(r.key.toLowerCase()==="e")Re("element");if(n&&r.key.toLowerCase()==="r")Re("region");if(r.key.toLowerCase()==="a")Re("adjust")}if(n&&h==="region"&&X&&w&&x==="hovering"){if(r.key==="Enter"){r.preventDefault(),X=!1,Kt(null,w);return}if(r.key.startsWith("Arrow")){r.preventDefault();let l=r.shiftKey?10:1,d=r.key.replace("Arrow","").toLowerCase();if(r.altKey){let f=d==="left"?-l:d==="right"?l:0,g=d==="up"?-l:d==="down"?l:0;w={...w,width:he(w.width+f,8,window.innerWidth-w.x),height:he(w.height+g,8,window.innerHeight-w.y)}}else{let f=d==="left"?-l:d==="right"?l:0,g=d==="up"?-l:d==="down"?l:0;w={...w,x:he(w.x+f,0,window.innerWidth-w.width),y:he(w.y+g,0,window.innerHeight-w.height)}}yt(w);return}}if(r.key!=="Escape")return;if(m.isActive()&&(m.getMarks().length>0||oe||X)){m.clear(),Vt();return}if(oe||X){oe=null,X=!1,w=null,F.style.display="none";return}if(x==="editing")Ct(!0);else ot(!0)}function Qt(r){if(!n||h!=="region"||x!=="hovering"||nt(r.target))return;let o=r;if(!m.handlePointerDown(o))return;o.preventDefault(),o.stopPropagation(),_e=o.target instanceof Element?o.target:null,ye=o.pointerId;try{_e?.setPointerCapture?.(o.pointerId)}catch{}oe={x:o.clientX,y:o.clientY},w=null,X=!1}function en(r){if(!n||h!=="region"||x!=="hovering")return;let o=r;if(!m.handlePointerMove(o))return;o.preventDefault()}function tn(r){if(!n||h!=="region"||x!=="hovering")return;let o=r;if(o.button!==0||ye!=null&&o.pointerId!==ye)return;if(m.handlePointerUp(o))o.preventDefault(),o.stopPropagation();ft(),oe=null,F.style.display="none"}function nn(){m.handlePointerCancel(),Vt()}function rn(r){let o=r;if(ye!=null&&o.pointerId!==ye)return;nn()}K.addEventListener("keydown",(r)=>{if(!n||r.key!=="Enter"||h!=="region")return;r.preventDefault(),r.stopPropagation();let o=Math.min(160,window.innerWidth),l=Math.min(96,window.innerHeight);w={x:Math.round((window.innerWidth-o)/2),y:Math.round((window.innerHeight-l)/2),width:o,height:l},X=!1,m.addRect(w),F.style.display="none"});function rt(){if(oe)nn();if(x==="hovering"&&j)zt(j);if(E)N();for(let r of Se)bt(r.target,r.pinEl)}document.addEventListener("mousemove",Xt,!0),document.addEventListener("click",Zt,!0),document.addEventListener("keydown",Jt,!0),document.addEventListener("pointerdown",Qt,!0),document.addEventListener("pointermove",en,!0),document.addEventListener("pointerup",tn,!0),document.addEventListener("pointercancel",rn,!0),window.addEventListener("scroll",rt,!0),window.addEventListener("resize",rt,!0),se.addEventListener("click",()=>ot(!0));function ot(r){let o=c.start("overlay_exit");if(s(),ge(),He(),m.detach(),document.removeEventListener("mousemove",Xt,!0),document.removeEventListener("click",Zt,!0),document.removeEventListener("keydown",Jt,!0),document.removeEventListener("pointerdown",Qt,!0),document.removeEventListener("pointermove",en,!0),document.removeEventListener("pointerup",tn,!0),document.removeEventListener("pointercancel",rn,!0),window.removeEventListener("scroll",rt,!0),window.removeEventListener("resize",rt,!0),Qn(),$t(),u.remove(),delete a.__uibotAnnotatorActive,delete a.__uibotAnnotatorTeardown,o("success"),r)try{t.sendMessage({action:U.closed}).catch(()=>{}),a.__uibotAnnotationClosed?.()}catch{}}function Jn(r){if(r.action===U.teardown)ot(!1);else if(r.action===U.changed)Fe()}let Qn=t.subscribe(Jn);a.__uibotAnnotatorTeardown=()=>ot(!1),c.markFromStart("overlay_ready"),s=bn(()=>{Fe()})}var kr=["open","processing","done","verified","ignored"],vr=["bug","style","copywriting","feature","interaction","data","other"],Ar=["low","medium","high","blocker"],wr=["testid","id","aria","class","text","path"],Rr=["light","dark","unknown"],Sr=["react","vue","angular","svelte","nextjs","nuxt","unknown"];function J(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function we(e,t){return typeof e==="string"&&t.includes(e)}function Ce(e){return typeof e==="number"&&Number.isFinite(e)}function ke(e){return Ce(e)&&e>0}function Tt(e){return Array.isArray(e)&&e.every((t)=>typeof t==="string")}function An(e){return J(e)&&Object.values(e).every((t)=>typeof t==="string")}function q(e){return e===void 0||typeof e==="string"}function wn(e){if(!J(e)||!Ce(e.x)||!Ce(e.y)||!ke(e.width)||!ke(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function Nt(e){if(!J(e)||!ke(e.width)||!ke(e.height))return;return{width:e.width,height:e.height}}function Mt(e){if(!J(e)||!Ce(e.x)||!Ce(e.y))return;return{x:e.x,y:e.y}}function vn(e){if(!J(e)||typeof e.fileName!=="string"||!ke(e.lineNumber))return;if(e.columnNumber!==void 0&&(!Ce(e.columnNumber)||e.columnNumber<0))return;if(!q(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function Pr(e){let t=wn(e.boundingBox);if(typeof e.tagName!=="string"||!e.tagName||typeof e.cssSelector!=="string"||!e.cssSelector||typeof e.xpath!=="string"||!e.xpath||!An(e.attributes)||!t||!Tt(e.domPath))return;if(!q(e.textContent)||e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!we(e.selectorStrategy,wr))return;if(!q(e.region))return;let n;if(e.accessibility!==void 0){if(!J(e.accessibility)||!q(e.accessibility.role)||!q(e.accessibility.name)||!q(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let i=e.sourceLocation===void 0?void 0:vn(e.sourceLocation);if(e.sourceLocation!==void 0&&!i)return;let a;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let c=e.sourceStack.map(vn);if(c.some((s)=>!s))return;a=c.filter((s)=>Boolean(s))}return{kind:"element",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{sourceLocation:i}:{},...a?{sourceStack:a}:{}}}function Ir(e){let t=wn(e.rect),n=Nt(e.viewport),i=Mt(e.scroll);if(!t||t.width<8||t.height<8||!n||!i||!ke(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;let a;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;a=[];for(let s of e.topLevelElements){if(!J(s)||typeof s.tagName!=="string"||!s.tagName||!q(s.text)||!q(s.role))return;a.push({tagName:s.tagName,...s.text===void 0?{}:{text:s.text},...s.role===void 0?{}:{role:s.role}})}}let c=e.marks===void 0?void 0:pn(e.marks);if(e.marks!==void 0&&!c)return;return{kind:"region",rect:t,viewport:n,scroll:i,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...a?{topLevelElements:a}:{},...c?.length?{marks:c}:{}}}function Er(e){if(!J(e))return{ok:!1,reason:"target is not an object",raw:e};if(e.kind==="region"){let t=Ir(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid region target",raw:e}}if(e.kind==="element"||e.kind===void 0){let t=Pr(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid element target",raw:e}}return{ok:!1,reason:\`unknown target kind: \${String(e.kind)}\`,raw:e}}function Tr(e){if(!J(e))return;let t=Nt(e.viewport),n=Mt(e.scroll);if(!t||!n||!ke(e.devicePixelRatio)||!J(e.center)||!Ce(e.center.x)||!Ce(e.center.y)||typeof e.visible!=="boolean"||!q(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function Nr(e){if(!J(e))return;let{url:t,origin:n,path:i,title:a,capturedAt:c,query:s,hash:u,referrer:b,language:C,userAgent:A,uiState:I}=e,k=Nt(e.viewport),T=Mt(e.scroll);if(!k||!J(e.viewport)||!ke(e.viewport.devicePixelRatio)||!T)return;if(typeof t!=="string"||!t||typeof n!=="string"||!n||typeof i!=="string"||!i||typeof a!=="string"||typeof c!=="string"||!c)return;if(!q(s)||!q(u)||!q(b)||!q(C)||!q(A)||!q(I))return;if(e.theme!==void 0&&!we(e.theme,Rr))return;if(e.framework!==void 0&&!we(e.framework,Sr))return;return{url:t,origin:n,path:i,title:a,viewport:{...k,devicePixelRatio:e.viewport.devicePixelRatio},scroll:T,capturedAt:c,...s===void 0?{}:{query:s},...u===void 0?{}:{hash:u},...b===void 0?{}:{referrer:b},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...C===void 0?{}:{language:C},...A===void 0?{}:{userAgent:A},...I===void 0?{}:{uiState:I}}}function Mr(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!J(n)||!we(n.kind,["style","text"])||typeof n.label!=="string"||!q(n.property)||typeof n.before!=="string"||typeof n.after!=="string")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Ye(e){if(!J(e))return{ok:!1,reason:"annotation is not an object",raw:e};let{id:t,pageUrl:n,comment:i,createdAt:a,updatedAt:c}=e;if(!we(e.status,kr))return{ok:!1,reason:"invalid status",raw:e};if(!we(e.type,vr))return{ok:!1,reason:"invalid type",raw:e};if(!we(e.priority,Ar))return{ok:!1,reason:"invalid priority",raw:e};if(typeof t!=="string"||!t)return{ok:!1,reason:"invalid id",raw:e};if(typeof n!=="string"||!n)return{ok:!1,reason:"invalid pageUrl",raw:e};if(typeof i!=="string"||!i)return{ok:!1,reason:"invalid comment",raw:e};if(typeof a!=="string"||!a)return{ok:!1,reason:"invalid createdAt",raw:e};if(typeof c!=="string"||!c)return{ok:!1,reason:"invalid updatedAt",raw:e};if(!q(e.expectedResult)||!q(e.preserve)||!q(e.screenshot))return{ok:!1,reason:"invalid optional annotation text",raw:e};if(!An(e.styleSummary))return{ok:!1,reason:"invalid styleSummary",raw:e};let s=Tr(e.geometry);if(!s)return{ok:!1,reason:"invalid geometry",raw:e};let u=Nr(e.pageContext);if(!u)return{ok:!1,reason:"invalid pageContext",raw:e};let b=Mr(e.edits);if(!b)return{ok:!1,reason:"invalid edits",raw:e};let C=Er(e.target);if(!C.ok)return C;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:i,target:C.value,styleSummary:{...e.styleSummary},geometry:s,pageContext:u,createdAt:a,updatedAt:c,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...b.length?{edits:b}:{}}}}function Rn(e){return new Date(e()).toISOString()}function Dr(e,t){return\`ann_\${e().toString(36)}_\${Math.floor(t()*1e9).toString(36)}\`}function Sn(e={}){let t=e.now??Date.now,n=e.random??Math.random,i=new Map;return{list(a){let c=Me(a);return[...i.values()].filter((s)=>Me(s.pageUrl)===c)},listAll(){return[...i.values()]},save(a,c){let s=Rn(t),u={...a,id:Dr(t,n),pageUrl:Me(c??a.pageContext.url),status:"open",createdAt:s,updatedAt:s},b=Ye(u);if(!b.ok)throw Error(\`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A\${b.reason}\`);return i.set(b.value.id,b.value),b.value},update(a,c){let s=i.get(a);if(!s)return null;let u={...s,...c,id:s.id,updatedAt:Rn(t)},b=Ye(u);if(!b.ok)throw Error(\`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A\${b.reason}\`);return i.set(a,b.value),b.value},remove(a){return i.delete(a)},clear(a){let c=Me(a),s=0;for(let[u,b]of i)if(Me(b.pageUrl)===c)i.delete(u),s+=1;return s},clearAll(){let a=i.size;return i.clear(),a}}}var Pn="uibot.annotation.host.v1",lt="uibot.annotation.page.v1";var In=20,En=262144,Tn=2;function ct(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var Lr={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},ui=Array.from(new Set(Object.values(Lr).flat()));var mi=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var Fr=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],hi=[...Fr,"radius","font-display","font-body","font-mono"];var ve={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function dt(e){if(!e||typeof e!=="object"||Array.isArray(e))throw Error("Invalid annotation object");return e}function Ge(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error("Unknown annotation field")}function re(e,t,n=!1){if(typeof e!=="string"||!n&&!e.trim()||e.length>t||Array.from(e).some((i)=>{let a=i.charCodeAt(0);return a===127||a<32&&a!==9&&a!==10&&a!==13}))throw Error("Invalid annotation text");return e}function Nn(e){let t=dt(e);Ge(t,["x","y","width","height"]);for(let n of["x","y","width","height"])if(typeof t[n]!=="number"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error("Invalid annotation coordinates");if(t.width<0||t.height<0)throw Error("Invalid annotation dimensions");return{x:t.x,y:t.y,width:t.width,height:t.height}}function Mn(e){if(!Array.isArray(e)||!e.length||e.length>ve.count)throw Error("Expected 1 to 20 annotations");if(new TextEncoder().encode(JSON.stringify(e)).length>ve.messageBytes)throw Error("Annotations exceed the message budget");let t=0,n=new Set;return e.map((i)=>{let a=dt(i);Ge(a,["id","comment","target","type","priority","edits","screenshot"]);let c=re(a.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(c)||n.has(c))throw Error("Invalid or duplicate annotation ID");n.add(c);let s=re(a.comment,ve.comment).trim();if(!["bug","style","copywriting","feature","interaction","data","other"].includes(a.type)||!["low","medium","high","blocker"].includes(a.priority))throw Error("Invalid annotation classification");let u=dt(a.target),b;if(u.kind==="element"){Ge(u,["kind","cssSelector","xpath","tagName","textContent","boundingBox","uibotId"]);let I=re(u.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(I))throw Error("Invalid annotation tag");let k=u.uibotId===void 0?void 0:re(u.uibotId,200);if(k!==void 0&&!/^[\\w:.-]+$/.test(k))throw Error("Invalid annotation element ID");b={kind:"element",cssSelector:re(u.cssSelector,ve.selector),xpath:re(u.xpath,ve.selector,!0),tagName:I,boundingBox:Nn(u.boundingBox),...u.textContent===void 0?{}:{textContent:re(u.textContent,1000,!0)},...k===void 0?{}:{uibotId:k}}}else if(u.kind==="region")Ge(u,["kind","rect"]),b={kind:"region",rect:Nn(u.rect)};else throw Error("Invalid annotation target");let C;if(a.edits!==void 0){if(!Array.isArray(a.edits)||a.edits.length>ve.edits)throw Error("Invalid annotation edits");C=a.edits.map((I)=>{let k=dt(I);if(Ge(k,["kind","label","property","before","after"]),k.kind!=="style"&&k.kind!=="text")throw Error("Invalid annotation edit kind");let T=k.property===void 0?void 0:re(k.property,100);if(T!==void 0&&!/^[-a-zA-Z][\\w-]*$/.test(T))throw Error("Invalid annotation style property");return{kind:k.kind,label:re(k.label,200),before:re(k.before,4000,!0),after:re(k.after,4000,!0),...T===void 0?{}:{property:T}}})}let A;if(a.screenshot!==void 0){if(A=re(a.screenshot,ve.screenshotBytes),!/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(A)||++t>ve.screenshots)throw Error("Invalid annotation screenshot")}return{id:c,comment:s,type:a.type,priority:a.priority,target:b,...C?{edits:C}:{},...A?{screenshot:A}:{}}})}function Dn(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,i)=>t[n.priority]-t[i.priority]||n.createdAt.localeCompare(i.createdAt))}function On(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind==="region"?{kind:"region",rect:t.rect}:{kind:"element",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes["data-uibot-id"]?{uibotId:t.attributes["data-uibot-id"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}function Br(e){return typeof e==="string"&&e.length<=En&&/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function Dt(e){if(!Array.isArray(e)||e.length>In||!ct({items:e}))return null;let t=[],n=0,i=new Set;for(let a of e){let c=Ye(a);if(!c.ok)return null;let s=c.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||i.has(s.id)||!s.comment.trim()||s.comment.length>4000)return null;if(i.add(s.id),s.target.kind==="element"&&(s.target.cssSelector.length>2000||s.target.xpath.length>2000||(s.target.textContent?.length??0)>1000))return null;if(s.screenshot!==void 0&&(!Br(s.screenshot)||++n>Tn))return null;if((s.edits?.length??0)>20||s.edits?.some((u)=>u.before.length>4000||u.after.length>4000))return null;t.push(s)}try{if(t.length)Mn(t.map(On))}catch{return null}return t}var ut={\u5143\u7D20:"Element",\u533A\u57DF:"Region",\u8C03\u6574:"Quick edit",\u9000\u51FA:"Exit",\u53D6\u6D88:"Cancel",\u4FDD\u5B58\u6807\u6CE8:"Save annotation",\u5DF2\u4FDD\u5B58:"Saved","\u66F4\u591A\u8BBE\u7F6E \u25BE":"More settings \u25BE","\u6536\u8D77\u8BBE\u7F6E \u25B4":"Less settings \u25B4","\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09":"Expected result (optional)","\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09":"Preserve (optional)",\u7C7B\u578B:"Type",\u4F18\u5148\u7EA7:"Priority",\u6837\u5F0F\u95EE\u9898:"Style",\u6587\u6848\u4FEE\u6539:"Copy",\u529F\u80FD\u5EFA\u8BAE:"Feature",\u4EA4\u4E92\u95EE\u9898:"Interaction",\u6570\u636E\u95EE\u9898:"Data",\u5176\u4ED6:"Other",\u4F4E:"Low",\u4E2D:"Medium",\u9AD8:"High",\u963B\u585E:"Blocker",\u62D6\u52A8\u5DE5\u5177\u680F:"Move toolbar",\u62D6\u52A8:"Move",\u6846\u9009\u533A\u57DF:"Select region",\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8:"New region annotation",\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8:"New element annotation",\u6587\u5B57:"Text",\u6587\u5B57\u5185\u5BB9:"Text content",\u5B57\u53F7:"Font size",\u989C\u8272:"Color",\u80CC\u666F:"Background",\u80CC\u666F\u8272:"Background color",\u5B57\u4F53:"Font",\u5B57\u91CD:"Weight",\u5706\u89D2:"Radius",\u95F4\u8DDD:"Spacing",\u4FDD\u5B58\u4FEE\u6539:"Save changes",\u53EF\u89C6\u5316\u4FEE\u6539:"Visual changes",\u6587\u6848:"Text",\u6587\u5B57\u989C\u8272:"Text color",\u4E0D\u900F\u660E\u5EA6:"Opacity",\u5185\u8FB9\u8DDD:"Padding","\u7EC6 300":"Light 300","\u5E38\u89C4 400":"Regular 400","\u4E2D 500":"Medium 500","\u534A\u7C97 600":"Semibold 600","\u7C97 700":"Bold 700",\u6846\u9009:"Rectangle",\u7BAD\u5934:"Arrow",\u6587\u672C:"Label",\u589E\u5927\u5B57\u53F7:"Increase font size",\u51CF\u5C0F\u5B57\u53F7:"Decrease font size",\u533A\u57DF\u6807\u6CE8\u8BF4\u660E:"Region comment",\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8:"Save region annotation",\u5FEB\u901F\u7F16\u8F91:"Quick edit",\u7F16\u8F91\u6807\u6CE8:"Edit annotation",\u6279\u6CE8\u989C\u8272:"Annotation color",\u7EA2:"Red",\u6A59:"Orange",\u9EC4:"Yellow",\u7EFF:"Green",\u84DD:"Blue",\u767D:"White","\u8BF4\u660E\uFF08\u53EF\u9009\uFF09":"Comment (optional)",\u672A\u505A\u4EFB\u4F55\u4FEE\u6539:"No changes yet",\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9:"Add a comment first",\u6807\u6CE8\u6570\u636E\u65E0\u6548:"Invalid annotation","\u4FDD\u5B58\u5931\u8D25\uFF1Aannotation-limit":"Annotation limit reached; shorten or remove a note","\u4FDD\u5B58\u5931\u8D25\uFF1Ainvalid-annotation":"Could not save this annotation"};function Ot(e){let t=document.getElementById("__uibot-annotator-host")?.shadowRoot,n=e.target,i=null;try{if(n.kind==="element")i=document.querySelector(n.cssSelector)}catch{}if(i?.scrollIntoView({block:"center",behavior:"instant"}),i){let a=i.getBoundingClientRect(),c=document.createElement("div");c.className="flash",c.style.cssText=\`position:fixed;pointer-events:none;left:\${a.left}px;top:\${a.top}px;width:\${a.width}px;height:\${a.height}px;border:2px solid var(--pa-focus, #2563eb)\`,t?.append(c),setTimeout(()=>c.remove(),1300)}else if(n.kind==="region")window.scrollTo({top:Math.max(0,n.rect.y-window.innerHeight/2),behavior:"instant"});if(!i&&n.kind==="region"){let a=document.createElement("div");a.className="flash",a.style.cssText=\`position:fixed;pointer-events:none;left:\${n.rect.x-window.scrollX}px;top:\${n.rect.y-window.scrollY}px;width:\${n.rect.width}px;height:\${n.rect.height}px;border:2px solid var(--pa-focus, #2563eb)\`,t?.append(a),setTimeout(()=>a.remove(),1300)}}function _n(e){let t=document.getElementById("__uibot-annotator-host"),n=t?.shadowRoot;if(!n)return()=>{};let i=null,a=null,c=!1,s=0,u=new Map,b=e.locale==="zh",C=document.createElement("style");C.textContent="@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}} .pin.marker{cursor:pointer}.uibot-note{position:fixed;left:12px;top:60px;max-width:calc(100vw - 24px);padding:16px;background:var(--pa-popover, white);color:var(--pa-popover-contrast, #18181b);border:1px solid var(--pa-border, #d4d4d8);border-radius:12px;pointer-events:auto;box-shadow:0 12px 32px var(--pa-shadow, #0002)}.uibot-note textarea{display:block;min-width:240px;max-width:100%;margin:8px 0;padding:8px;color:var(--pa-surface-contrast, #18181b);background:var(--pa-field, #fafafa)}.uibot-note button{margin-right:12px;cursor:pointer}.pin.marker:focus-visible{outline:3px solid var(--pa-focus, #2563eb)}",n.append(C);function A(){i?.focus({preventScroll:!0})}function I(v){Ot(v),a?.remove(),a=document.createElement("section"),a.className="uibot-note",a.setAttribute("role","dialog"),a.setAttribute("aria-label",b?"\u7F16\u8F91\u6807\u6CE8":"Edit annotation");let E=document.createElement("textarea");E.value=v.comment,E.maxLength=4000,E.setAttribute("aria-label",b?"\u6279\u6CE8":"Comment");let M=document.createElement("button");M.textContent=b?"\u4FDD\u5B58":"Save";let S=document.createElement("button");S.textContent=b?"\u53D6\u6D88":"Cancel";let N=()=>{a?.remove(),a=null,A()};M.onclick=()=>{if(!E.value.trim())return;e.update(v.id,E.value.trim()),N()},S.onclick=N,a.onkeydown=(D)=>{if(D.key==="Escape")D.stopPropagation(),N();if(D.key==="Enter"&&!D.shiftKey&&!D.isComposing)D.preventDefault(),M.click();if(D.key==="Tab"){let G=[E,M,S].indexOf(n?.activeElement);if(D.shiftKey&&G===0)D.preventDefault(),S.focus();else if(!D.shiftKey&&G===2)D.preventDefault(),E.focus()}},a.append(E,M,S),n?.append(a),E.focus()}function k(){n?.querySelectorAll(".epanel").forEach((S)=>{if(S.setAttribute("role","dialog"),!S.hasAttribute("aria-label"))S.setAttribute("aria-label",b?"\u5FEB\u901F\u7F16\u8F91":"Quick edit")});let v=n?.querySelectorAll(".mark-svg > *").length??0;if(v>s&&!n?.querySelector(".mark-dock[hidden]"))n?.querySelector(".mark-comment")?.focus();s=v;let E=Dn(e.items());if(n?.querySelectorAll(".pin.marker").forEach((S,N)=>{let D=E[N];if(!D)return;S.dataset.annotationId=D.id,S.tabIndex=0,S.setAttribute("role","button"),S.setAttribute("aria-label",\`\${N+1} \xB7 \${D.comment}\`)}),n?.querySelectorAll("textarea").forEach((S)=>{S.maxLength=4000}),!b&&n){let S=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(let N=S.nextNode();N;N=S.nextNode()){let D=ut[N.textContent??""];if(D)N.textContent=D}n.querySelectorAll("[aria-label],[title],[placeholder]").forEach((N)=>{if(N.matches(".pin.marker"))return;for(let D of["aria-label","title","placeholder"]){let H=N.getAttribute(D);if(!H)continue;let G=ut[H]??(D==="placeholder"&&/[\\u3400-\\u9fff]/.test(H)?"Describe the change\u2026":H);if(G!==H)N.setAttribute(D,G)}})}let M=!!n?.querySelector(".epanel,.uibot-note");if(c&&!M)A();c=M}let T=new MutationObserver(k);T.observe(n,{childList:!0,subtree:!0});function R(v){let E=v.composedPath()[0];if(!(E instanceof Element))return;let M=E.closest(".pin.marker");if(M){let S=e.items().find((N)=>N.id===M.dataset.annotationId);if(S)v.preventDefault(),v.stopImmediatePropagation(),i=M,I(S)}}function O(v){let E=n?.activeElement;if(v.key==="Escape"&&E&&!a){let M=n?.querySelector(".epanel .cancel, .edit-panel .cancel, .quick-panel .cancel");if(M){v.preventDefault(),v.stopImmediatePropagation(),M.click(),A();return}}if(v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(E instanceof HTMLTextAreaElement||E instanceof HTMLInputElement)&&!a){let M=E.closest("[role=dialog],.mark-dock")?.querySelector("[data-action=save],button.ok,.mark-save");if(M&&!M.disabled)v.preventDefault(),v.stopImmediatePropagation(),M.click()}if(E instanceof HTMLElement&&E.matches(".pin.marker")&&(v.key==="Enter"||v.key===" "))v.preventDefault(),E.click()}let F=(v)=>{if(v.target instanceof HTMLElement&&v.target!==t){if(i=v.target,!i.hasAttribute("tabindex"))u.set(i,null),i.setAttribute("tabindex","-1")}},Y=(v)=>{v.preventDefault(),v.stopImmediatePropagation()};return window.addEventListener("click",F,!0),window.addEventListener("submit",Y,!0),n.addEventListener("click",R,!0),n.addEventListener("keydown",O,!0),k(),()=>{T.disconnect(),a?.remove(),C.remove();for(let[v,E]of u)if(E===null)v.removeAttribute("tabindex");window.removeEventListener("click",F,!0),window.removeEventListener("submit",Y,!0),n.removeEventListener("click",R,!0),n.removeEventListener("keydown",O,!0)}}var pt=document.currentScript?.getAttribute("data-uibot-annotation")==="shell",De="",_t=null,pe=[],Xe=!1,Lt=!1,Bt="zh",Ft,gt=new Set,Oe=(e)=>window.parent.postMessage({...e,source:lt,nonce:De},"*"),Ln=()=>{for(let e of gt)e({action:U.changed})},Fn=()=>{Ln(),Oe({action:"snapshot",items:pe})};function mt(){for(let e of[...gt])e({action:U.teardown});Ft?.(),Ft=void 0,Xe=!1,delete window.__uibotAnnotationActive}async function Vr(e){if(e.action===U.list)return{success:!0,data:pe};if(e.action===U.closed)return mt(),Oe({action:"closed"}),{success:!0};if(e.action===U.enrich)return{success:!0};if(e.action!==U.save||Lt)return{success:!1,error:"locked"};try{let t=Sn(),n=e.data;if(Bt==="en"&&n.edits?.length){let s=n.edits.map((u)=>\`\${u.label} \${fe(u.before,24)}\u2192\${fe(u.after,24)}\`).join("\uFF1B");if(n.edits=n.edits.map((u)=>({...u,label:ut[u.label]??u.label})),n.comment===\`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A\${s}\`)n.comment=\`Visual changes: \${n.edits.map((u)=>\`\${u.label} \${u.before} \u2192 \${u.after}\`).join("; ")}\`}let i=t.save(n),a=i.target.kind==="element"&&i.edits?.length?pe.find((s)=>s.target.kind==="element"&&i.target.kind==="element"&&s.target.cssSelector===i.target.cssSelector):void 0;if(a)i={...i,id:a.id,createdAt:a.createdAt,target:a.target,comment:\`\${a.comment}
346
- \${i.comment}\`,edits:[...a.edits??[],...i.edits??[]]};let c=Dt([...pe.filter((s)=>s.id!==i.id),i]);if(!c)return{success:!1,error:"annotation-limit"};if(pe=c,Fn(),i.target.kind==="region")setTimeout(()=>document.getElementById("__uibot-annotator-host")?.shadowRoot?.querySelector('[data-tool="element"]')?.click(),0);return{success:!0,data:i}}catch{return{success:!1,error:"invalid-annotation"}}}function jr(e){if(Xe)return;Xe=!0,Bt=e,window.__uibotAnnotationActive=!0,kn({annotationRegionV2:!0},{sendMessage:Vr,subscribe(t){return gt.add(t),()=>{gt.delete(t)}}}),Ft=_n({locale:e,items:()=>pe,update(t,n){pe=pe.map((i)=>i.id===t?{...i,comment:n}:i),Fn()},close(){mt(),Oe({action:"closed"})}})}window.addEventListener("message",(e)=>{if(!ct(e.data))return;let t=e.data;if(pt&&e.source!==window.parent){let n=[...document.querySelectorAll("iframe.pg-frame")].find((i)=>i.contentWindow===e.source);if(!n||t.source!==lt)return;if(t.action==="boot"&&_t){n.contentWindow?.postMessage(_t,"*");return}if(t.nonce===De)Oe({...t,source:lt});return}if(e.source!==window.parent||t.source!==Pn||typeof t.nonce!=="string"||!/^[a-zA-Z0-9-]{16,100}$/.test(t.nonce))return;if(De&&t.nonce!==De)return;if(t.action!=="sync"&&t.action!=="reveal")return;if(t.action==="sync"){let n=Dt(t.items);if(!n||typeof t.enabled!=="boolean"||typeof t.locked!=="boolean"||t.locale!=="zh"&&t.locale!=="en")return;let i=kt(t.theme);if(t.theme=i,De=t.nonce,pt){_t=t;for(let a of document.querySelectorAll("iframe.pg-frame"))a.contentWindow?.postMessage(t,"*");return}if(pe=n,Lt=t.locked,!t.enabled||Lt)mt();else{if(Xe&&Bt!==t.locale)mt();jr(t.locale);let a=document.getElementById("__uibot-annotator-host");if(a)at(a,i);Ln()}Oe({action:"ready"})}else if(t.nonce===De){if(pt)for(let n of document.querySelectorAll("iframe.pg-frame"))n.contentWindow?.postMessage(t,"*");else if(Xe&&typeof t.id==="string"){let n=pe.find((i)=>i.id===t.id);if(n)Ot(n)}}});if(!pt)Oe({action:"boot"});})();`;export{O as ANNOTATION_ACTIONS,mt as ANNOTATION_CAPTURE_MARK,tr as ANNOTATION_PERFORMANCE_STAGES,Dr as ANNOTATION_THEME_MAX_BYTES,Qt as ANNOTATION_THEME_TOKENS,_r as ANNOTATOR_IIFE,en as applyAnnotationTheme,rt as attachOverlayDrag,xt as attachRegionMarkup,nt as buildElementAnnotationDraft,on as clampOverlayPosition,tt as collectPageContext,vt as createAnnotationPerformanceTracker,Rr as createInPageAnnotationHost,On as isAnnotationRuntimeControlMessage,et as isAnnotationThemeColor,fe as normalizePageUrl,Pr as readFiberSourceProbe,wt as scheduleAnnotationIdleTask,ke as shortText,ir as startAnnotationRuntime,qn as validateAnnotationTheme};
345
+ \`;function Et(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 16 16"),t.setAttribute("width","14"),t.setAttribute("height","14"),t.setAttribute("aria-hidden","true"),e(t),t}function Cr(){return Et((e)=>{for(let[t,n]of[[5.5,3],[10.5,3],[5.5,8],[10.5,8],[5.5,13],[10.5,13]]){let i=document.createElementNS("http://www.w3.org/2000/svg","circle");i.setAttribute("cx",String(t)),i.setAttribute("cy",String(n)),i.setAttribute("r","1.15"),i.setAttribute("fill","currentColor"),e.appendChild(i)}})}function Cn(){return Et((e)=>{let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d","M4 4l8 8M12 4l-8 8"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linecap","round"),e.appendChild(t)})}function kn(e,t){let n=e.annotationRegionV2!==!1,i="__uibotAnnotatorActive",a=window;if(a.__uibotAnnotatorActive)return;a.__uibotAnnotatorActive=!0;let c=hn(t.recordPerformance?.bind(t)),s=()=>{return},u=document.createElement("div");u.id="__uibot-annotator-host",u.style.cssText="position:fixed;inset:0;z-index:2147483646;pointer-events:none;color-scheme:dark;",at(u,e.theme);let b=u.attachShadow({mode:"open"});(document.documentElement||document.body).appendChild(u);let C=document.createElement("style");C.textContent=xn,b.appendChild(C);let A=document.createElement("div");b.appendChild(A);let I=document.createElement("div");I.className="hl",I.style.display="none";let k=document.createElement("div");k.className="tag",k.style.display="none";let T=document.createElement("div");T.className="selbox",T.style.display="none";let R=document.createElement("div");R.className="pin active",R.style.display="none";let O=document.createElement("button");O.type="button",O.className="sel-clear",O.style.display="none",O.setAttribute("aria-label","\u53D6\u6D88\u9009\u62E9"),O.title="\u53D6\u6D88\u9009\u62E9",O.appendChild(Cn()),O.addEventListener("click",(r)=>{r.preventDefault(),r.stopPropagation(),Ct(!0)});let F=document.createElement("div");F.className="region-box";let Y=document.createElement("span");Y.className="region-size",F.appendChild(Y);let v=document.createElement("div");v.className="sr-live",v.setAttribute("aria-live","polite"),A.append(I,k,T,R,O,F,v);let E=null;function M(r,o){E=r,R.textContent=String(o),N()}function S(){E=null,T.style.display="none",R.style.display="none",O.style.display="none"}function N(){if(!E)return;let r=E.getBoundingClientRect();T.style.display="block",T.style.left=\`\${r.left-1}px\`,T.style.top=\`\${r.top-1}px\`,T.style.width=\`\${r.width+2}px\`,T.style.height=\`\${r.height+2}px\`,R.style.display="flex",R.style.left=\`\${Math.max(2,r.left-6)}px\`,R.style.top=\`\${Math.max(2,r.top-6)}px\`,O.style.display="flex",O.style.left=\`\${Math.min(window.innerWidth-26,Math.max(2,r.right-6))}px\`,O.style.top=\`\${Math.max(2,r.top-16)}px\`}let D=document.createElement("div");D.className="bar";let H=document.createElement("button");H.type="button",H.className="grip",H.setAttribute("aria-label","\u62D6\u52A8\u5DE5\u5177\u680F"),H.title="\u62D6\u52A8",H.appendChild(Cr());let G=document.createElement("div");G.className="seg";let ae=document.createElement("button");ae.type="button",ae.dataset.tool="element",ae.textContent="\u5143\u7D20",ae.className="on";let K=document.createElement("button");K.type="button",K.dataset.tool="region",K.textContent="\u533A\u57DF",K.disabled=!n,K.title=n?"\u6846\u9009\u533A\u57DF":"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED";let Q=document.createElement("button");Q.type="button",Q.dataset.tool="adjust",Q.textContent="\u8C03\u6574",G.append(ae,K,Q);let se=document.createElement("button");se.type="button",se.className="exit",se.setAttribute("aria-label","\u9000\u51FA"),se.title="\u9000\u51FA",se.appendChild(Cn()),D.append(H,G,se),A.appendChild(D);let ge=It(D,H),le={current:()=>{return}},m=yn(A,{onSave:(r)=>le.current(r)}),h="element",x="hovering",j=null,w=null,oe=null,X=!1,_e=null,ye=null;function ft(){if(_e&&ye!=null)try{_e.releasePointerCapture?.(ye)}catch{}_e=null,ye=null}function Vt(){ft(),oe=null,X=!1,w=null,F.style.display="none"}function Re(r){if(r==="region"&&!n)return;if(r===h)return;Ct(!0),h=r,ae.classList.toggle("on",h==="element"),K.classList.toggle("on",h==="region"),Q.classList.toggle("on",h==="adjust"),ht(),F.style.display="none",w=null,oe=null,X=!1,ft(),m.setActive(h==="region")}ae.addEventListener("click",()=>Re("element")),K.addEventListener("click",()=>Re("region")),Q.addEventListener("click",()=>Re("adjust"));function he(r,o,l){return Math.min(l,Math.max(o,r))}function zr(r,o){let l=he(r.x,0,window.innerWidth),d=he(r.y,0,window.innerHeight),f=he(o.x,0,window.innerWidth),g=he(o.y,0,window.innerHeight),p={x:Math.min(l,f),y:Math.min(d,g),width:Math.abs(f-l),height:Math.abs(g-d)};return p.width>=8&&p.height>=8?p:null}function yt(r){F.style.display="block",F.style.left=\`\${r.x}px\`,F.style.top=\`\${r.y}px\`,F.style.width=\`\${r.width}px\`,F.style.height=\`\${r.height}px\`,Y.textContent=\`\${Math.round(r.width)} \xD7 \${Math.round(r.height)}\`,v.textContent=\`\u533A\u57DF x \${Math.round(r.x)}\uFF0Cy \${Math.round(r.y)}\uFF0C\u5BBD \${Math.round(r.width)}\uFF0C\u9AD8 \${Math.round(r.height)}\`}function Bn(r){let o=[[r.x+r.width/2,r.y+r.height/2],[r.x+1,r.y+1],[r.x+r.width-1,r.y+r.height-1]],l=[];return o.forEach(([d,f])=>{let g=document.elementFromPoint(d,f);if(!g||nt(g)||l.some((p)=>p.tagName===g.tagName.toLowerCase()))return;l.push({tagName:g.tagName.toLowerCase(),...fe(g.textContent||"",60)?{text:fe(g.textContent||"",60)}:{},...g.getAttribute("role")?{role:g.getAttribute("role")}:{}})}),l}function jt(r,o=[]){let l={x:Math.round(r.x+window.scrollX),y:Math.round(r.y+window.scrollY),width:Math.round(r.width),height:Math.round(r.height)},d={width:window.innerWidth,height:window.innerHeight},f={x:window.scrollX,y:window.scrollY},g=mn(o,window.scrollX,window.scrollY);return{comment:"",type:"other",priority:"medium",target:{kind:"region",rect:l,viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,topLevelElements:Bn(r),...g.length?{marks:g}:{}},styleSummary:{},geometry:{viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2)},visible:!0},pageContext:At()}}function qt(r){let o=r.getBoundingClientRect();I.style.display="block",I.style.left=\`\${o.left}px\`,I.style.top=\`\${o.top}px\`,I.style.width=\`\${o.width}px\`,I.style.height=\`\${o.height}px\`;let l=Array.from(r.classList).slice(0,2).join(".");k.textContent=\`\${r.tagName.toLowerCase()}\${l?"."+l:""} \xB7 \${Math.round(o.width)}\xD7\${Math.round(o.height)}\`,k.style.display="block";let d=o.top>22?o.top-20:o.bottom+4;k.style.left=\`\${Math.max(2,o.left)}px\`,k.style.top=\`\${d}px\`}function ht(){I.style.display="none",k.style.display="none"}function Le(r){let o=document.createElement("div");o.className="toast",o.style.background="var(--pa-success, #15803d)",o.style.color="var(--pa-success-contrast, #fff)",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1600)}let zt={blocker:0,high:1,medium:2,low:3},Se=[];function Vn(r){let o=r.getBoundingClientRect(),l=document.createElement("div");l.className="flash",l.style.left=\`\${o.left-2}px\`,l.style.top=\`\${o.top-2}px\`,l.style.width=\`\${o.width+4}px\`,l.style.height=\`\${o.height+4}px\`,A.appendChild(l),setTimeout(()=>l.remove(),1300)}function bt(r,o){let l=r.kind==="element"?document.querySelector(r.cssSelector):null;if(r.kind==="element"&&!l){o.style.display="none";return}let d=l?.getBoundingClientRect()??{left:r.kind==="region"?r.rect.x-window.scrollX:0,top:r.kind==="region"?r.rect.y-window.scrollY:0,width:r.kind==="region"?r.rect.width:0,height:r.kind==="region"?r.rect.height:0};if(d.width===0&&d.height===0){o.style.display="none";return}o.style.display="flex",o.style.left=\`\${Math.max(2,d.left-6)}px\`,o.style.top=\`\${Math.max(2,d.top-6)}px\`}function $t(){for(let r of Se)r.pinEl.remove();Se=[]}function jn(r){$t(),r.filter((l)=>l.status==="open"||l.status==="processing").sort((l,d)=>(zt[l.priority]??9)-(zt[d.priority]??9)||(l.createdAt||"").localeCompare(d.createdAt||"")).forEach((l,d)=>{if(!l.target||l.target.kind==="element"&&!l.target.cssSelector)return;let f=document.createElement("div");f.className="pin marker",f.textContent=String(d+1),f.title=l.comment||"",f.addEventListener("click",(g)=>{g.stopPropagation();let p=l.target.kind==="element"?document.querySelector(l.target.cssSelector):null;if(p)p.scrollIntoView({block:"center"}),Vn(p),Le(l.comment?\`#\${d+1} \${l.comment}\`:\`#\${d+1}\`),bt(l.target,f);else if(l.target.kind==="region")window.scrollTo({top:Math.max(0,l.target.rect.y-window.innerHeight/2),left:l.target.rect.x}),yt({x:l.target.rect.x-window.scrollX,y:l.target.rect.y-window.scrollY,width:l.target.rect.width,height:l.target.rect.height}),setTimeout(()=>{if(!w)F.style.display="none"},1300),Le(l.comment?\`#\${d+1} \${l.comment}\`:\`#\${d+1}\`);else ee(\`#\${d+1} \u5143\u7D20\u672A\u627E\u5230\uFF08\u9875\u9762\u53EF\u80FD\u5DF2\u53D8\u5316\uFF09\`)}),A.appendChild(f),Se.push({target:l.target,pinEl:f}),bt(l.target,f)})}async function Fe(){let r=c.start("markers_loaded");try{let o=await t.sendMessage({action:U.list,pageUrl:location.href});if(o&&o.success&&Array.isArray(o.data))jn(o.data),r("success");else r("failure")}catch{r("failure")}}let be=[];function qn(r,o,l){let d=o,f=document.createElement("div");f.className="dd";let g=document.createElement("button");g.type="button",g.className="dd-btn";let p=document.createElement("span");p.className="v";let y=document.createElement("span");y.className="chev",y.textContent="\u25BE",g.append(p,y);let P=document.createElement("div");P.className="dd-menu",P.style.display="none";function q(){let V=r.find((B)=>B.value===d);if(p.textContent="",V?.color){let B=document.createElement("span");B.className="swatch",B.style.background=V.color,p.appendChild(B)}p.appendChild(document.createTextNode(V?.label??"")),Array.from(P.children).forEach((B,ne)=>{B.classList.toggle("sel",r[ne].value===d)})}function L(){P.style.display="none",g.classList.remove("open")}function de(){for(let V of be)V();P.style.display="block",g.classList.add("open")}return be.push(L),r.forEach((V)=>{let B=document.createElement("button");if(B.type="button",B.className="dd-item",V.color){let ne=document.createElement("span");ne.className="swatch",ne.style.background=V.color,B.appendChild(ne)}B.appendChild(document.createTextNode(V.label)),B.addEventListener("click",(ne)=>{ne.stopPropagation(),d=V.value,q(),L(),l?.(d)}),P.appendChild(B)}),g.addEventListener("click",(V)=>{V.stopPropagation(),P.style.display==="none"?de():L()}),f.append(g,P),q(),{el:f,get:()=>d,set:(V)=>{d=V,q()},close:L}}let zn=[{value:"style",label:"\u6837\u5F0F\u95EE\u9898"},{value:"copywriting",label:"\u6587\u6848\u4FEE\u6539"},{value:"bug",label:"Bug"},{value:"feature",label:"\u529F\u80FD\u5EFA\u8BAE"},{value:"interaction",label:"\u4EA4\u4E92\u95EE\u9898"},{value:"data",label:"\u6570\u636E\u95EE\u9898"},{value:"other",label:"\u5176\u4ED6"}],$n=[{value:"low",label:"\u4F4E",color:"var(--pa-muted, #737373)"},{value:"medium",label:"\u4E2D",color:"var(--pa-surface-contrast, #17171a)"},{value:"high",label:"\u9AD8",color:"var(--pa-accent, #7c2d34)"},{value:"blocker",label:"\u963B\u585E",color:"var(--pa-danger, #5c151c)"}],W=null,Z=null,Be=null,Ve=null,je=null,qe=null,ce=null;function Ut(r){let o=document.createElement("button");return o.type="button",o.className="ok",o.dataset.icon="confirm",o.textContent="\u2713",o.title=r,o.setAttribute("aria-label",r),o}function Pe(r,o){if(!r)return;r.textContent=o?"\u2026":"\u2713",r.toggleAttribute("aria-busy",o),r.disabled=o}function Ht(r){for(let o of["data-component","data-uibot-component","data-testid"]){let l=r.getAttribute(o)?.trim();if(l)return l.slice(0,48)}return r.tagName.toLowerCase()}function Un(){return Et((r)=>{let o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M10 3L5 8l5 5"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","1.8"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),r.appendChild(o)})}function Wt(r,o){let l=document.createElement("div");l.className="ehead";let d=document.createElement("button");d.type="button",d.className="back",d.setAttribute("aria-label","\u53D6\u6D88\u9009\u62E9"),d.title="\u53D6\u6D88\u9009\u62E9",d.appendChild(Un()),d.addEventListener("click",(g)=>{g.preventDefault(),g.stopPropagation(),o()});let f=document.createElement("span");return f.className="name",f.textContent=r,f.title=r,l.append(d,f),l}function Ze(){W?.remove(),W=null,Z=Be=Ve=ce=null,je=qe=null,be.length=0,S(),F.style.display="none",x="hovering",j=null,w=null,X=!1}function Kt(r,o){if(o&&!n)return;if(x="editing",j=r,w=o??null,ht(),r)M(r,Se.length+1);else S();if(o)yt(o);let l=r?.getBoundingClientRect(),d=l?{left:l.left,top:l.top,right:l.right,bottom:l.bottom}:o?{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height}:{left:8,top:80,right:8,bottom:80};be.length=0,W=document.createElement("div"),W.className="epanel",W.setAttribute("role","dialog"),W.setAttribute("aria-modal","true"),W.setAttribute("aria-label",o?"\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8":"\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8"),W.addEventListener("click",()=>{for(let _ of be)_()});let f=Wt(o?\`\u533A\u57DF \${Math.round(o.width)}\xD7\${Math.round(o.height)}\`:Ht(r),Ze),g=document.createElement("div");g.className="etop",Z=document.createElement("textarea"),Z.rows=3,Z.placeholder="\u54EA\u91CC\u4E0D\u5BF9\uFF1F\u8BF4\u660E\u671F\u671B\u5373\u53EF\uFF0C\u4F8B\u5982\uFF1A\u79FB\u52A8\u7AEF\u6309\u94AE\u6587\u5B57\u6362\u884C\uFF1B\u80FD\u653E\u4E0B\u65F6\u4FDD\u6301\u5355\u884C\uFF0C\u4E14\u5361\u7247\u9AD8\u5EA6\u4E0D\u53D8\u3002",Z.addEventListener("input",()=>{if(Z.style.height="auto",Z.style.height=\`\${Math.min(Math.max(Z.scrollHeight,72),144)}px\`,ce)ce.disabled=!Z.value.trim()}),g.append(Z);let p=document.createElement("button");p.type="button",p.dataset.action="more",p.className="quick-more",p.textContent="\u66F4\u591A\u8BBE\u7F6E \u25BE",p.setAttribute("aria-expanded","false");let y=document.createElement("div");y.className="advanced",y.id="__uibot-annotation-advanced",y.hidden=!0,p.setAttribute("aria-controls",y.id);let P=(_,me)=>{let xe=document.createElement("label");xe.className="erow";let Te=document.createElement("span");Te.className="lb",Te.textContent=_;let Ne=document.createElement("div");return Ne.className="ctl",Ne.append(me),xe.append(Te,Ne),xe};Be=document.createElement("textarea"),Be.placeholder="\u4F8B\u5982\uFF1A\u5BBD\u5EA6\u8DB3\u591F\u65F6\u4FDD\u6301\u5355\u884C",Ve=document.createElement("textarea"),Ve.placeholder="\u4F8B\u5982\uFF1A\u5361\u7247\u9AD8\u5EA6\u548C\u70B9\u51FB\u884C\u4E3A\u4E0D\u53D8",je=document.createElement("select");for(let _ of zn)je.add(new Option(_.label,_.value,!1,_.value==="other"));qe=document.createElement("select");for(let _ of $n)qe.add(new Option(_.label,_.value,!1,_.value==="medium"));y.append(P("\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09",Be),P("\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09",Ve),P("\u7C7B\u578B",je),P("\u4F18\u5148\u7EA7",qe)),p.addEventListener("click",(_)=>{_.stopPropagation(),y.hidden=!y.hidden,p.textContent=y.hidden?"\u66F4\u591A\u8BBE\u7F6E \u25BE":"\u6536\u8D77\u8BBE\u7F6E \u25B4",p.setAttribute("aria-expanded",String(!y.hidden))});let q=document.createElement("div");q.className="ebar";let L=document.createElement("button");L.type="button",L.className="cancel",L.textContent="\u53D6\u6D88",L.addEventListener("click",Ze),ce=Ut("\u4FDD\u5B58\u6807\u6CE8"),ce.dataset.action="save",ce.disabled=!0,ce.addEventListener("click",()=>void Yt()),q.append(L,ce),W.append(f,g,p,y,q),W.addEventListener("keydown",(_)=>{if(_.key==="Enter"&&(_.ctrlKey||_.metaKey)){if(_.preventDefault(),!ce?.disabled)Yt();return}if(_.key!=="Tab")return;let me=[...W.querySelectorAll("button:not([disabled]),textarea:not([disabled]),select:not([disabled]),input:not([disabled])")].filter((er)=>!er.closest("[hidden]"));if(!me.length)return;let xe=me[0],Te=me[me.length-1],Ne=b.activeElement;if(_.shiftKey&&Ne===xe)_.preventDefault(),Te.focus();else if(!_.shiftKey&&Ne===Te)_.preventDefault(),xe.focus()}),A.appendChild(W);let de=360,V=d.left,B=d.bottom+10;if(V+de>window.innerWidth-8)V=window.innerWidth-de-8;if(V<8)V=8;let ne=W.offsetHeight||300;if(B+ne>window.innerHeight-8)B=Math.max(8,d.top-ne-10);W.style.left=\`\${V}px\`,W.style.top=\`\${B}px\`,Z.focus()}async function Yt(){if(!j&&!w||!Z)return;if(w&&!n){ee("\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8");return}let r=Z.value.trim();if(!r){ee("\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9"),Z.focus();return}let o=w?jt(w):wt(j);o.comment=r,o.type=je?.value??"other",o.priority=qe?.value??"medium";let l=Be?.value.trim();if(l)o.expectedResult=l;let d=Ve?.value.trim();if(d)o.preserve=d;u.style.visibility="hidden";let f=ce;Pe(f,!0);let g=c.start("save_durable");try{let p=await t.sendMessage({action:U.save,data:o});if(u.style.visibility="visible",p&&p.success){g("success"),Ze(),Fe(),Le("\u5DF2\u4FDD\u5B58");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:o}).catch(()=>{})}else g("failure"),console.error("[uibot annotation] save rejected:",p),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),Pe(f,!1)}catch(p){g("failure"),u.style.visibility="visible",console.error("[uibot annotation] save threw:",p);let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),Pe(f,!1)}}async function Hn(r){if(!n){ee("\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8");return}let o=Ke(r.marks,0),l=o?Pt(o,{width:window.innerWidth,height:window.innerHeight}):null;if(!l){ee("\u8BF7\u5148\u6846\u9009\u533A\u57DF\u6216\u6DFB\u52A0\u7BAD\u5934/\u6587\u672C");return}let d=r.comment.trim()||gn(r.marks),f=jt(l,r.marks);f.comment=d,m.setBusy(!0),u.classList.add("capturing"),m.setCapturing(!0);let g=c.start("save_durable");try{let p=await t.sendMessage({action:U.save,data:f});if(p&&p.success){g("success");let y=p.data?.id,P=Pt(Ke(r.marks,16)??l,{width:window.innerWidth,height:window.innerHeight}),q=!0;if(y&&P&&t.captureRegion)await new Promise((L)=>{requestAnimationFrame(()=>requestAnimationFrame(()=>L()))}),q=await t.captureRegion({id:y,...P}).catch(()=>!1);if(m.clear(),m.setBusy(!1),Fe(),q)Le("\u5DF2\u4FDD\u5B58");else ee("\u6807\u6CE8\u5DF2\u4FDD\u5B58\uFF0C\u622A\u56FE\u672A\u5B8C\u6210");if(y)t.sendMessage({action:U.enrich,annotationId:y,data:f}).catch(()=>{})}else g("failure"),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),m.setBusy(!1)}catch(p){g("failure");let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),m.setBusy(!1)}finally{u.classList.remove("capturing"),m.setCapturing(!1)}}le.current=(r)=>{Hn(r)};function ee(r){let o=document.createElement("div");o.className="toast",o.style.background="var(--pa-danger, #b91c1c)",o.style.color="var(--pa-danger-contrast, #fff)",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1800)}let te=null,Je=null,Ae=null,ze=null,Qe=[],$e=[];function Gt(r){let o=r.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);if(!o){let d=document.createElement("span");if(d.style.color=r,!d.style.color)d.style.color="var(--pa-color-default, #000000)";b.appendChild(d);let f=getComputedStyle(d).color;d.remove();let g=document.createElement("canvas").getContext("2d");if(!g)return"#000000";if(g.fillStyle=f,/^#[0-9a-f]{6}$/i.test(g.fillStyle))return g.fillStyle;g.fillRect(0,0,1,1);let p=g.getImageData(0,0,1,1).data;return\`#\${[p[0],p[1],p[2]].map((y)=>(y??0).toString(16).padStart(2,"0")).join("")}\`}let l=(d)=>Math.max(0,Math.min(255,Number.parseInt(d,10))).toString(16).padStart(2,"0");return\`#\${l(o[1])}\${l(o[2])}\${l(o[3])}\`}function et(r,o){let l=r.style.getPropertyValue(o),d=()=>{if(l)r.style.setProperty(o,l);else r.style.removeProperty(o)};return $e.push(d),{revert:d,apply:(f)=>{r.style.setProperty(o,f)}}}function Ue(r){let o=document.createElement("div");o.className="prow",o.dataset.filter=r.filter.toLowerCase();let l=document.createElement("input");l.type="checkbox",l.setAttribute("aria-label",\`\u9009\u62E9 \${r.name}\`);let d=document.createElement("span");d.className="pname",d.textContent=r.name,d.title=r.name;let f=()=>{l.checked=!0,r.apply()};return l.addEventListener("change",()=>{if(l.checked){if(r.read()!==r.before)r.apply()}else r.revert(),r.reset()}),r.control.addEventListener("input",()=>{f()}),r.onReady?.(f),o.append(l,d,r.control),Qe.push({kind:r.kind,label:r.name,before:r.before,read:r.read,selected:()=>l.checked,...r.property===void 0?{}:{property:r.property}}),o}function xt(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement("div");f.className="efield";let g=document.createElement("label");g.className="sw";let p=document.createElement("i");p.style.background=l||"transparent",g.appendChild(p);let y=document.createElement("input");y.value=l,y.setAttribute("aria-label",o);let P=document.createElement("input");P.type="color",P.value=Gt(l||"#000000"),P.className="color-hit",P.setAttribute("aria-label",\`\u9009\u62E9\${o}\`);let q=(L)=>{p.style.background=L||"transparent"};return P.addEventListener("input",()=>{y.value=P.value,q(P.value)}),y.addEventListener("input",()=>{q(y.value)}),g.appendChild(P),f.append(g,y),Ue({name:o,filter:o,control:f,kind:"style",property:o,before:l,read:()=>y.value.trim(),reset:()=>{y.value=l,q(l),P.value=Gt(l||"#000000")},apply:()=>d.apply(y.value.trim()),revert:d.revert})}function Ie(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement("div");f.className="efield";let g=document.createElement("input");return g.value=l,g.setAttribute("aria-label",o),f.appendChild(g),Ue({name:o,filter:o,control:f,kind:"style",property:o,before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>d.apply(g.value.trim()),revert:d.revert})}function Ee(r,o,l){let d=getComputedStyle(r).getPropertyValue(o).trim(),f=et(r,o),g=[...l];if(d&&!g.includes(d))g.unshift(d);let p=g.includes(d)?d:g[0]??"",y=p,P=()=>{},q=qn(g.map((L)=>({value:L,label:L})),p,(L)=>{y=L,P()});return Ue({name:o,filter:o,control:q.el,kind:"style",property:o,before:d,read:()=>y,reset:()=>{y=p,q.set(p)},apply:()=>f.apply(y),revert:f.revert,onReady:(L)=>{P=L}})}function Wn(r){let o=["top","right","bottom","left"],l=o.map((p)=>getComputedStyle(r).getPropertyValue(\`margin-\${p}\`).trim()),d=o.map((p)=>et(r,\`margin-\${p}\`)),f=o.map((p,y)=>{let P=document.createElement("input");return P.value=l[y]??"",P.setAttribute("aria-label",\`margin-\${p}\`),P}),g=document.createElement("div");return g.className="mbox",g.append(...f),Ue({name:"margin",filter:"margin",control:g,kind:"style",property:"margin",before:l.join(" "),read:()=>f.map((p)=>p.value.trim()).join(" "),reset:()=>{f.forEach((p,y)=>{p.value=l[y]??""})},apply:()=>{for(let[p,y]of f.entries())d[p]?.apply(y.value.trim())},revert:()=>{for(let p of d)p.revert()}})}function Kn(r){if(r.children.length>0||!(r.textContent||"").trim())return null;let o=r.textContent||"",l=o.replace(/\\s+/g," ").trim(),d=()=>{r.textContent=o};$e.push(d);let f=document.createElement("div");f.className="efield";let g=document.createElement("input");return g.value=l,g.setAttribute("aria-label","\u6587\u6848"),f.appendChild(g),Ue({name:"\u6587\u6848",filter:"\u6587\u6848 text",control:f,kind:"text",before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>{r.textContent=g.value},revert:d})}let He=()=>{return};function tt(r){if(r)$e.forEach((o)=>{try{o()}catch{}});$e.length=0,Qe=[],He(),He=()=>{return},te?.remove(),te=null,Je=null,Ae=ze=null,be.length=0,S(),x="hovering",j=null}function Ct(r){if(W)Ze();if(te)tt(r)}function Yn(r){x="editing",j=r,Je=r,ht(),M(r,Se.length+1),Qe=[],$e.length=0,be.length=0;let o=r.getBoundingClientRect();te=document.createElement("div"),te.className="epanel",te.addEventListener("click",()=>{for(let _ of be)_()});let l=Wt(Ht(r),()=>tt(!0)),d=document.createElement("span");d.className="grip",d.textContent="\u283F",d.setAttribute("aria-hidden","true"),l.appendChild(d);let f=document.createElement("label");f.className="prop-filter";let g=document.createElement("input");g.placeholder="\u7B5B\u9009\u5C5E\u6027",g.setAttribute("aria-label","\u7B5B\u9009\u5C5E\u6027"),f.appendChild(g);let p=document.createElement("div");p.className="einstruct",Ae=document.createElement("input"),Ae.placeholder="\u7528\u4E00\u53E5\u8BDD\u63CF\u8FF0\u60F3\u8981\u7684\u4FEE\u6539\uFF08\u53EF\u9009\uFF09",Ae.setAttribute("aria-label","\u4FEE\u6539\u8BF4\u660E"),p.appendChild(Ae);let y=document.createElement("div");y.className="erows";let P=[xt(r,"background-color"),xt(r,"border-color"),Ie(r,"border-width"),Ee(r,"border-style",["none","solid","dashed","dotted","double"]),Ie(r,"border-radius"),Ie(r,"opacity"),Wn(r),Ie(r,"padding"),Ie(r,"gap"),Ee(r,"display",["block","flex","inline-flex","grid","inline-block","inline","none"]),Ee(r,"flex-direction",["row","column","row-reverse","column-reverse"]),Ee(r,"flex-wrap",["nowrap","wrap","wrap-reverse"]),Ee(r,"justify-content",["flex-start","center","flex-end","space-between","space-around","space-evenly"]),xt(r,"color"),Ie(r,"font-size"),Ee(r,"font-weight",["300","400","500","600","700"])],q=Kn(r);if(q)P.push(q);y.append(...P),g.addEventListener("input",()=>{let _=g.value.trim().toLowerCase();for(let me of y.querySelectorAll(".prow")){let xe=me.dataset.filter??"";me.hidden=_.length>0&&!xe.includes(_)}});let L=document.createElement("div");L.className="ebar";let de=document.createElement("button");de.type="button",de.className="cancel",de.textContent="\u53D6\u6D88",de.addEventListener("click",()=>tt(!0)),ze=Ut("\u4FDD\u5B58\u4FEE\u6539"),ze.addEventListener("click",()=>void Xn()),L.append(de,ze),te.append(l,f,p,y,L),A.appendChild(te),He(),He=It(te,d);let V=360,B=o.right+12;if(B+V>window.innerWidth-8)B=Math.max(8,o.left-V-12);if(B<8)B=8;let ne=Math.max(8,Math.min(o.top,window.innerHeight-(te.offsetHeight||360)-8));te.style.left=\`\${B}px\`,te.style.top=\`\${ne}px\`,Ae.focus()}function Gn(r){return r.map((o)=>\`\${o.label} \${fe(o.before,24)}\u2192\${fe(o.after,24)}\`).join("\uFF1B")}async function Xn(){if(!Je)return;let r=Je,o=[];for(let p of Qe){if(!p.selected())continue;let y=p.read();if(y!==p.before)o.push({kind:p.kind,label:p.label,...p.property===void 0?{}:{property:p.property},before:p.before,after:y})}let l=Ae?.value.trim()||"";if(o.length===0&&!l){ee("\u672A\u505A\u4EFB\u4F55\u4FEE\u6539");return}let d=wt(r);d.type="style",d.edits=o;let f=Gn(o);if(d.comment=l||(f?\`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A\${f}\`:"\u53EF\u89C6\u5316\u4FEE\u6539"),l&&f)d.expectedResult=f;u.style.visibility="hidden";let g=ze;Pe(g,!0);try{let p=await t.sendMessage({action:U.save,data:d});if(u.style.visibility="visible",p&&p.success){tt(!1),Fe(),Le("\u5DF2\u4FDD\u5B58");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:d}).catch(()=>{})}else console.error("[uibot annotation] edit save rejected:",p),ee(p?.error?\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${p.error}\`:"\u4FDD\u5B58\u5931\u8D25"),Pe(g,!1)}catch(p){u.style.visibility="visible";let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5":\`\u4FDD\u5B58\u5931\u8D25\uFF1A\${y}\`),Pe(g,!1)}}function nt(r){if(!(r instanceof Node))return!1;if(u.contains(r))return!0;let o=r.getRootNode();return o instanceof ShadowRoot&&o.host===u}function Xt(r){if(x!=="hovering"||h==="region")return;let o=r.target;if(!o||nt(o)||o===u)return;j=o,qt(o)}function Zt(r){if(nt(r.target))return;let o=r.target;if(!o)return;if(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation?.(),x==="hovering"){if(h==="adjust")Yn(o);else if(h==="element")Kt(o)}}function Zn(){let r=b.activeElement;return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLElement&&r.isContentEditable}function Jt(r){if(Zn()||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLElement&&r.target.isContentEditable)return;if(x==="hovering"&&!X){if(r.key.toLowerCase()==="e")Re("element");if(n&&r.key.toLowerCase()==="r")Re("region");if(r.key.toLowerCase()==="a")Re("adjust")}if(n&&h==="region"&&X&&w&&x==="hovering"){if(r.key==="Enter"){r.preventDefault(),X=!1,Kt(null,w);return}if(r.key.startsWith("Arrow")){r.preventDefault();let l=r.shiftKey?10:1,d=r.key.replace("Arrow","").toLowerCase();if(r.altKey){let f=d==="left"?-l:d==="right"?l:0,g=d==="up"?-l:d==="down"?l:0;w={...w,width:he(w.width+f,8,window.innerWidth-w.x),height:he(w.height+g,8,window.innerHeight-w.y)}}else{let f=d==="left"?-l:d==="right"?l:0,g=d==="up"?-l:d==="down"?l:0;w={...w,x:he(w.x+f,0,window.innerWidth-w.width),y:he(w.y+g,0,window.innerHeight-w.height)}}yt(w);return}}if(r.key!=="Escape")return;if(m.isActive()&&(m.getMarks().length>0||oe||X)){m.clear(),Vt();return}if(oe||X){oe=null,X=!1,w=null,F.style.display="none";return}if(x==="editing")Ct(!0);else ot(!0)}function Qt(r){if(!n||h!=="region"||x!=="hovering"||nt(r.target))return;let o=r;if(!m.handlePointerDown(o))return;o.preventDefault(),o.stopPropagation(),_e=o.target instanceof Element?o.target:null,ye=o.pointerId;try{_e?.setPointerCapture?.(o.pointerId)}catch{}oe={x:o.clientX,y:o.clientY},w=null,X=!1}function en(r){if(!n||h!=="region"||x!=="hovering")return;let o=r;if(!m.handlePointerMove(o))return;o.preventDefault()}function tn(r){if(!n||h!=="region"||x!=="hovering")return;let o=r;if(o.button!==0||ye!=null&&o.pointerId!==ye)return;if(m.handlePointerUp(o))o.preventDefault(),o.stopPropagation();ft(),oe=null,F.style.display="none"}function nn(){m.handlePointerCancel(),Vt()}function rn(r){let o=r;if(ye!=null&&o.pointerId!==ye)return;nn()}K.addEventListener("keydown",(r)=>{if(!n||r.key!=="Enter"||h!=="region")return;r.preventDefault(),r.stopPropagation();let o=Math.min(160,window.innerWidth),l=Math.min(96,window.innerHeight);w={x:Math.round((window.innerWidth-o)/2),y:Math.round((window.innerHeight-l)/2),width:o,height:l},X=!1,m.addRect(w),F.style.display="none"});function rt(){if(oe)nn();if(x==="hovering"&&j)qt(j);if(E)N();for(let r of Se)bt(r.target,r.pinEl)}document.addEventListener("mousemove",Xt,!0),document.addEventListener("click",Zt,!0),document.addEventListener("keydown",Jt,!0),document.addEventListener("pointerdown",Qt,!0),document.addEventListener("pointermove",en,!0),document.addEventListener("pointerup",tn,!0),document.addEventListener("pointercancel",rn,!0),window.addEventListener("scroll",rt,!0),window.addEventListener("resize",rt,!0),se.addEventListener("click",()=>ot(!0));function ot(r){let o=c.start("overlay_exit");if(s(),ge(),He(),m.detach(),document.removeEventListener("mousemove",Xt,!0),document.removeEventListener("click",Zt,!0),document.removeEventListener("keydown",Jt,!0),document.removeEventListener("pointerdown",Qt,!0),document.removeEventListener("pointermove",en,!0),document.removeEventListener("pointerup",tn,!0),document.removeEventListener("pointercancel",rn,!0),window.removeEventListener("scroll",rt,!0),window.removeEventListener("resize",rt,!0),Qn(),$t(),u.remove(),delete a.__uibotAnnotatorActive,delete a.__uibotAnnotatorTeardown,o("success"),r)try{t.sendMessage({action:U.closed}).catch(()=>{}),a.__uibotAnnotationClosed?.()}catch{}}function Jn(r){if(r.action===U.teardown)ot(!1);else if(r.action===U.changed)Fe()}let Qn=t.subscribe(Jn);a.__uibotAnnotatorTeardown=()=>ot(!1),c.markFromStart("overlay_ready"),s=bn(()=>{Fe()})}var kr=["open","processing","done","verified","ignored"],vr=["bug","style","copywriting","feature","interaction","data","other"],Ar=["low","medium","high","blocker"],wr=["testid","id","aria","class","text","path"],Rr=["light","dark","unknown"],Sr=["react","vue","angular","svelte","nextjs","nuxt","unknown"];function J(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function we(e,t){return typeof e==="string"&&t.includes(e)}function Ce(e){return typeof e==="number"&&Number.isFinite(e)}function ke(e){return Ce(e)&&e>0}function Tt(e){return Array.isArray(e)&&e.every((t)=>typeof t==="string")}function An(e){return J(e)&&Object.values(e).every((t)=>typeof t==="string")}function z(e){return e===void 0||typeof e==="string"}function wn(e){if(!J(e)||!Ce(e.x)||!Ce(e.y)||!ke(e.width)||!ke(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function Nt(e){if(!J(e)||!ke(e.width)||!ke(e.height))return;return{width:e.width,height:e.height}}function Mt(e){if(!J(e)||!Ce(e.x)||!Ce(e.y))return;return{x:e.x,y:e.y}}function vn(e){if(!J(e)||typeof e.fileName!=="string"||!ke(e.lineNumber))return;if(e.columnNumber!==void 0&&(!Ce(e.columnNumber)||e.columnNumber<0))return;if(!z(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function Pr(e){let t=wn(e.boundingBox);if(typeof e.tagName!=="string"||!e.tagName||typeof e.cssSelector!=="string"||!e.cssSelector||typeof e.xpath!=="string"||!e.xpath||!An(e.attributes)||!t||!Tt(e.domPath))return;if(!z(e.textContent)||e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!we(e.selectorStrategy,wr))return;if(!z(e.region))return;let n;if(e.accessibility!==void 0){if(!J(e.accessibility)||!z(e.accessibility.role)||!z(e.accessibility.name)||!z(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let i=e.sourceLocation===void 0?void 0:vn(e.sourceLocation);if(e.sourceLocation!==void 0&&!i)return;let a;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let c=e.sourceStack.map(vn);if(c.some((s)=>!s))return;a=c.filter((s)=>Boolean(s))}return{kind:"element",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{sourceLocation:i}:{},...a?{sourceStack:a}:{}}}function Ir(e){let t=wn(e.rect),n=Nt(e.viewport),i=Mt(e.scroll);if(!t||t.width<8||t.height<8||!n||!i||!ke(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;let a;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;a=[];for(let s of e.topLevelElements){if(!J(s)||typeof s.tagName!=="string"||!s.tagName||!z(s.text)||!z(s.role))return;a.push({tagName:s.tagName,...s.text===void 0?{}:{text:s.text},...s.role===void 0?{}:{role:s.role}})}}let c=e.marks===void 0?void 0:pn(e.marks);if(e.marks!==void 0&&!c)return;return{kind:"region",rect:t,viewport:n,scroll:i,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...a?{topLevelElements:a}:{},...c?.length?{marks:c}:{}}}function Er(e){if(!J(e))return{ok:!1,reason:"target is not an object",raw:e};if(e.kind==="region"){let t=Ir(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid region target",raw:e}}if(e.kind==="element"||e.kind===void 0){let t=Pr(e);return t?{ok:!0,value:t}:{ok:!1,reason:"invalid element target",raw:e}}return{ok:!1,reason:\`unknown target kind: \${String(e.kind)}\`,raw:e}}function Tr(e){if(!J(e))return;let t=Nt(e.viewport),n=Mt(e.scroll);if(!t||!n||!ke(e.devicePixelRatio)||!J(e.center)||!Ce(e.center.x)||!Ce(e.center.y)||typeof e.visible!=="boolean"||!z(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function Nr(e){if(!J(e))return;let{url:t,origin:n,path:i,title:a,capturedAt:c,query:s,hash:u,referrer:b,language:C,userAgent:A,uiState:I}=e,k=Nt(e.viewport),T=Mt(e.scroll);if(!k||!J(e.viewport)||!ke(e.viewport.devicePixelRatio)||!T)return;if(typeof t!=="string"||!t||typeof n!=="string"||!n||typeof i!=="string"||!i||typeof a!=="string"||typeof c!=="string"||!c)return;if(!z(s)||!z(u)||!z(b)||!z(C)||!z(A)||!z(I))return;if(e.theme!==void 0&&!we(e.theme,Rr))return;if(e.framework!==void 0&&!we(e.framework,Sr))return;return{url:t,origin:n,path:i,title:a,viewport:{...k,devicePixelRatio:e.viewport.devicePixelRatio},scroll:T,capturedAt:c,...s===void 0?{}:{query:s},...u===void 0?{}:{hash:u},...b===void 0?{}:{referrer:b},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...C===void 0?{}:{language:C},...A===void 0?{}:{userAgent:A},...I===void 0?{}:{uiState:I}}}function Mr(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!J(n)||!we(n.kind,["style","text"])||typeof n.label!=="string"||!z(n.property)||typeof n.before!=="string"||typeof n.after!=="string")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Ye(e){if(!J(e))return{ok:!1,reason:"annotation is not an object",raw:e};let{id:t,pageUrl:n,comment:i,createdAt:a,updatedAt:c}=e;if(!we(e.status,kr))return{ok:!1,reason:"invalid status",raw:e};if(!we(e.type,vr))return{ok:!1,reason:"invalid type",raw:e};if(!we(e.priority,Ar))return{ok:!1,reason:"invalid priority",raw:e};if(typeof t!=="string"||!t)return{ok:!1,reason:"invalid id",raw:e};if(typeof n!=="string"||!n)return{ok:!1,reason:"invalid pageUrl",raw:e};if(typeof i!=="string"||!i)return{ok:!1,reason:"invalid comment",raw:e};if(typeof a!=="string"||!a)return{ok:!1,reason:"invalid createdAt",raw:e};if(typeof c!=="string"||!c)return{ok:!1,reason:"invalid updatedAt",raw:e};if(!z(e.expectedResult)||!z(e.preserve)||!z(e.screenshot))return{ok:!1,reason:"invalid optional annotation text",raw:e};if(!An(e.styleSummary))return{ok:!1,reason:"invalid styleSummary",raw:e};let s=Tr(e.geometry);if(!s)return{ok:!1,reason:"invalid geometry",raw:e};let u=Nr(e.pageContext);if(!u)return{ok:!1,reason:"invalid pageContext",raw:e};let b=Mr(e.edits);if(!b)return{ok:!1,reason:"invalid edits",raw:e};let C=Er(e.target);if(!C.ok)return C;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:i,target:C.value,styleSummary:{...e.styleSummary},geometry:s,pageContext:u,createdAt:a,updatedAt:c,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...b.length?{edits:b}:{}}}}function Rn(e){return new Date(e()).toISOString()}function Dr(e,t){return\`ann_\${e().toString(36)}_\${Math.floor(t()*1e9).toString(36)}\`}function Sn(e={}){let t=e.now??Date.now,n=e.random??Math.random,i=new Map;return{list(a){let c=Me(a);return[...i.values()].filter((s)=>Me(s.pageUrl)===c)},listAll(){return[...i.values()]},save(a,c){let s=Rn(t),u={...a,id:Dr(t,n),pageUrl:Me(c??a.pageContext.url),status:"open",createdAt:s,updatedAt:s},b=Ye(u);if(!b.ok)throw Error(\`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A\${b.reason}\`);return i.set(b.value.id,b.value),b.value},update(a,c){let s=i.get(a);if(!s)return null;let u={...s,...c,id:s.id,updatedAt:Rn(t)},b=Ye(u);if(!b.ok)throw Error(\`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A\${b.reason}\`);return i.set(a,b.value),b.value},remove(a){return i.delete(a)},clear(a){let c=Me(a),s=0;for(let[u,b]of i)if(Me(b.pageUrl)===c)i.delete(u),s+=1;return s},clearAll(){let a=i.size;return i.clear(),a}}}var Pn="uibot.annotation.host.v1",lt="uibot.annotation.page.v1";var In=20,En=262144,Tn=2;function ct(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var Lr={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},pi=Array.from(new Set(Object.values(Lr).flat()));var fi=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var Fr=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],bi=[...Fr,"radius","font-display","font-body","font-mono"];var ve={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function dt(e){if(!e||typeof e!=="object"||Array.isArray(e))throw Error("Invalid annotation object");return e}function Ge(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error("Unknown annotation field")}function re(e,t,n=!1){if(typeof e!=="string"||!n&&!e.trim()||e.length>t||Array.from(e).some((i)=>{let a=i.charCodeAt(0);return a===127||a<32&&a!==9&&a!==10&&a!==13}))throw Error("Invalid annotation text");return e}function Nn(e){let t=dt(e);Ge(t,["x","y","width","height"]);for(let n of["x","y","width","height"])if(typeof t[n]!=="number"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error("Invalid annotation coordinates");if(t.width<0||t.height<0)throw Error("Invalid annotation dimensions");return{x:t.x,y:t.y,width:t.width,height:t.height}}function Mn(e){if(!Array.isArray(e)||!e.length||e.length>ve.count)throw Error("Expected 1 to 20 annotations");if(new TextEncoder().encode(JSON.stringify(e)).length>ve.messageBytes)throw Error("Annotations exceed the message budget");let t=0,n=new Set;return e.map((i)=>{let a=dt(i);Ge(a,["id","comment","target","type","priority","edits","screenshot"]);let c=re(a.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(c)||n.has(c))throw Error("Invalid or duplicate annotation ID");n.add(c);let s=re(a.comment,ve.comment).trim();if(!["bug","style","copywriting","feature","interaction","data","other"].includes(a.type)||!["low","medium","high","blocker"].includes(a.priority))throw Error("Invalid annotation classification");let u=dt(a.target),b;if(u.kind==="element"){Ge(u,["kind","cssSelector","xpath","tagName","textContent","boundingBox","uibotId"]);let I=re(u.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(I))throw Error("Invalid annotation tag");let k=u.uibotId===void 0?void 0:re(u.uibotId,200);if(k!==void 0&&!/^[\\w:.-]+$/.test(k))throw Error("Invalid annotation element ID");b={kind:"element",cssSelector:re(u.cssSelector,ve.selector),xpath:re(u.xpath,ve.selector,!0),tagName:I,boundingBox:Nn(u.boundingBox),...u.textContent===void 0?{}:{textContent:re(u.textContent,1000,!0)},...k===void 0?{}:{uibotId:k}}}else if(u.kind==="region")Ge(u,["kind","rect"]),b={kind:"region",rect:Nn(u.rect)};else throw Error("Invalid annotation target");let C;if(a.edits!==void 0){if(!Array.isArray(a.edits)||a.edits.length>ve.edits)throw Error("Invalid annotation edits");C=a.edits.map((I)=>{let k=dt(I);if(Ge(k,["kind","label","property","before","after"]),k.kind!=="style"&&k.kind!=="text")throw Error("Invalid annotation edit kind");let T=k.property===void 0?void 0:re(k.property,100);if(T!==void 0&&!/^[-a-zA-Z][\\w-]*$/.test(T))throw Error("Invalid annotation style property");return{kind:k.kind,label:re(k.label,200),before:re(k.before,4000,!0),after:re(k.after,4000,!0),...T===void 0?{}:{property:T}}})}let A;if(a.screenshot!==void 0){if(A=re(a.screenshot,ve.screenshotBytes),!/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(A)||++t>ve.screenshots)throw Error("Invalid annotation screenshot")}return{id:c,comment:s,type:a.type,priority:a.priority,target:b,...C?{edits:C}:{},...A?{screenshot:A}:{}}})}function Dn(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,i)=>t[n.priority]-t[i.priority]||n.createdAt.localeCompare(i.createdAt))}function On(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind==="region"?{kind:"region",rect:t.rect}:{kind:"element",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes["data-uibot-id"]?{uibotId:t.attributes["data-uibot-id"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}function Vr(e){return typeof e==="string"&&e.length<=En&&/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function Dt(e){if(!Array.isArray(e)||e.length>In||!ct({items:e}))return null;let t=[],n=0,i=new Set;for(let a of e){let c=Ye(a);if(!c.ok)return null;let s=c.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||i.has(s.id)||!s.comment.trim()||s.comment.length>4000)return null;if(i.add(s.id),s.target.kind==="element"&&(s.target.cssSelector.length>2000||s.target.xpath.length>2000||(s.target.textContent?.length??0)>1000))return null;if(s.screenshot!==void 0&&(!Vr(s.screenshot)||++n>Tn))return null;if((s.edits?.length??0)>20||s.edits?.some((u)=>u.before.length>4000||u.after.length>4000))return null;t.push(s)}try{if(t.length)Mn(t.map(On))}catch{return null}return t}var ut={\u5143\u7D20:"Element",\u533A\u57DF:"Region",\u8C03\u6574:"Quick edit",\u9000\u51FA:"Exit",\u53D6\u6D88:"Cancel",\u4FDD\u5B58\u6807\u6CE8:"Save annotation",\u5DF2\u4FDD\u5B58:"Saved","\u66F4\u591A\u8BBE\u7F6E \u25BE":"More settings \u25BE","\u6536\u8D77\u8BBE\u7F6E \u25B4":"Less settings \u25B4","\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09":"Expected result (optional)","\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09":"Preserve (optional)",\u7C7B\u578B:"Type",\u4F18\u5148\u7EA7:"Priority",\u6837\u5F0F\u95EE\u9898:"Style",\u6587\u6848\u4FEE\u6539:"Copy",\u529F\u80FD\u5EFA\u8BAE:"Feature",\u4EA4\u4E92\u95EE\u9898:"Interaction",\u6570\u636E\u95EE\u9898:"Data",\u5176\u4ED6:"Other",\u4F4E:"Low",\u4E2D:"Medium",\u9AD8:"High",\u963B\u585E:"Blocker",\u62D6\u52A8\u5DE5\u5177\u680F:"Move toolbar",\u62D6\u52A8:"Move",\u6846\u9009\u533A\u57DF:"Select region",\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8:"New region annotation",\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8:"New element annotation",\u6587\u5B57:"Text",\u6587\u5B57\u5185\u5BB9:"Text content",\u5B57\u53F7:"Font size",\u989C\u8272:"Color",\u80CC\u666F:"Background",\u80CC\u666F\u8272:"Background color",\u5B57\u4F53:"Font",\u5B57\u91CD:"Weight",\u5706\u89D2:"Radius",\u95F4\u8DDD:"Spacing",\u4FDD\u5B58\u4FEE\u6539:"Save changes",\u53EF\u89C6\u5316\u4FEE\u6539:"Visual changes",\u6587\u6848:"Text",\u6587\u5B57\u989C\u8272:"Text color",\u4E0D\u900F\u660E\u5EA6:"Opacity",\u5185\u8FB9\u8DDD:"Padding","\u7EC6 300":"Light 300","\u5E38\u89C4 400":"Regular 400","\u4E2D 500":"Medium 500","\u534A\u7C97 600":"Semibold 600","\u7C97 700":"Bold 700",\u6846\u9009:"Rectangle",\u7BAD\u5934:"Arrow",\u6587\u672C:"Label",\u589E\u5927\u5B57\u53F7:"Increase font size",\u51CF\u5C0F\u5B57\u53F7:"Decrease font size",\u533A\u57DF\u6807\u6CE8\u8BF4\u660E:"Region comment",\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8:"Save region annotation",\u5FEB\u901F\u7F16\u8F91:"Quick edit",\u7F16\u8F91\u6807\u6CE8:"Edit annotation",\u6279\u6CE8\u989C\u8272:"Annotation color",\u7EA2:"Red",\u6A59:"Orange",\u9EC4:"Yellow",\u7EFF:"Green",\u84DD:"Blue",\u767D:"White","\u8BF4\u660E\uFF08\u53EF\u9009\uFF09":"Comment (optional)",\u672A\u505A\u4EFB\u4F55\u4FEE\u6539:"No changes yet",\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9:"Add a comment first",\u6807\u6CE8\u6570\u636E\u65E0\u6548:"Invalid annotation","\u4FDD\u5B58\u5931\u8D25\uFF1Aannotation-limit":"Annotation limit reached; shorten or remove a note","\u4FDD\u5B58\u5931\u8D25\uFF1Ainvalid-annotation":"Could not save this annotation"};function Ot(e){let t=document.getElementById("__uibot-annotator-host")?.shadowRoot,n=e.target,i=null;try{if(n.kind==="element")i=document.querySelector(n.cssSelector)}catch{}if(i?.scrollIntoView({block:"center",behavior:"instant"}),i){let a=i.getBoundingClientRect(),c=document.createElement("div");c.className="flash",c.style.cssText=\`position:fixed;pointer-events:none;left:\${a.left}px;top:\${a.top}px;width:\${a.width}px;height:\${a.height}px;border:2px solid var(--pa-focus, #2563eb)\`,t?.append(c),setTimeout(()=>c.remove(),1300)}else if(n.kind==="region")window.scrollTo({top:Math.max(0,n.rect.y-window.innerHeight/2),behavior:"instant"});if(!i&&n.kind==="region"){let a=document.createElement("div");a.className="flash",a.style.cssText=\`position:fixed;pointer-events:none;left:\${n.rect.x-window.scrollX}px;top:\${n.rect.y-window.scrollY}px;width:\${n.rect.width}px;height:\${n.rect.height}px;border:2px solid var(--pa-focus, #2563eb)\`,t?.append(a),setTimeout(()=>a.remove(),1300)}}function _n(e){let t=document.getElementById("__uibot-annotator-host"),n=t?.shadowRoot;if(!n)return()=>{};let i=null,a=null,c=!1,s=0,u=new Map,b=e.locale==="zh",C=document.createElement("style");C.textContent="@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}} .pin.marker{cursor:pointer}.uibot-note{position:fixed;left:12px;top:60px;max-width:calc(100vw - 24px);padding:16px;background:var(--pa-popover, white);color:var(--pa-popover-contrast, #18181b);border:1px solid var(--pa-border, #d4d4d8);border-radius:12px;pointer-events:auto;box-shadow:0 12px 32px var(--pa-shadow, #0002)}.uibot-note textarea{display:block;min-width:240px;max-width:100%;margin:8px 0;padding:8px;color:var(--pa-surface-contrast, #18181b);background:var(--pa-field, #fafafa)}.uibot-note button{margin-right:12px;cursor:pointer}.pin.marker:focus-visible{outline:3px solid var(--pa-focus, #2563eb)}",n.append(C);function A(){i?.focus({preventScroll:!0})}function I(v){Ot(v),a?.remove(),a=document.createElement("section"),a.className="uibot-note",a.setAttribute("role","dialog"),a.setAttribute("aria-label",b?"\u7F16\u8F91\u6807\u6CE8":"Edit annotation");let E=document.createElement("textarea");E.value=v.comment,E.maxLength=4000,E.setAttribute("aria-label",b?"\u6279\u6CE8":"Comment");let M=document.createElement("button");M.textContent=b?"\u4FDD\u5B58":"Save";let S=document.createElement("button");S.textContent=b?"\u53D6\u6D88":"Cancel";let N=()=>{a?.remove(),a=null,A()};M.onclick=()=>{if(!E.value.trim())return;e.update(v.id,E.value.trim()),N()},S.onclick=N,a.onkeydown=(D)=>{if(D.key==="Escape")D.stopPropagation(),N();if(D.key==="Enter"&&!D.shiftKey&&!D.isComposing)D.preventDefault(),M.click();if(D.key==="Tab"){let G=[E,M,S].indexOf(n?.activeElement);if(D.shiftKey&&G===0)D.preventDefault(),S.focus();else if(!D.shiftKey&&G===2)D.preventDefault(),E.focus()}},a.append(E,M,S),n?.append(a),E.focus()}function k(){n?.querySelectorAll(".epanel").forEach((S)=>{if(S.setAttribute("role","dialog"),!S.hasAttribute("aria-label"))S.setAttribute("aria-label",b?"\u5FEB\u901F\u7F16\u8F91":"Quick edit")});let v=n?.querySelectorAll(".mark-svg > *").length??0;if(v>s&&!n?.querySelector(".mark-dock[hidden]"))n?.querySelector(".mark-comment")?.focus();s=v;let E=Dn(e.items());if(n?.querySelectorAll(".pin.marker").forEach((S,N)=>{let D=E[N];if(!D)return;S.dataset.annotationId=D.id,S.tabIndex=0,S.setAttribute("role","button"),S.setAttribute("aria-label",\`\${N+1} \xB7 \${D.comment}\`)}),n?.querySelectorAll("textarea").forEach((S)=>{S.maxLength=4000}),!b&&n){let S=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(let N=S.nextNode();N;N=S.nextNode()){let D=ut[N.textContent??""];if(D)N.textContent=D}n.querySelectorAll("[aria-label],[title],[placeholder]").forEach((N)=>{if(N.matches(".pin.marker"))return;for(let D of["aria-label","title","placeholder"]){let H=N.getAttribute(D);if(!H)continue;let G=ut[H]??(D==="placeholder"&&/[\\u3400-\\u9fff]/.test(H)?"Describe the change\u2026":H);if(G!==H)N.setAttribute(D,G)}})}let M=!!n?.querySelector(".epanel,.uibot-note");if(c&&!M)A();c=M}let T=new MutationObserver(k);T.observe(n,{childList:!0,subtree:!0});function R(v){let E=v.composedPath()[0];if(!(E instanceof Element))return;let M=E.closest(".pin.marker");if(M){let S=e.items().find((N)=>N.id===M.dataset.annotationId);if(S)v.preventDefault(),v.stopImmediatePropagation(),i=M,I(S)}}function O(v){let E=n?.activeElement;if(v.key==="Escape"&&E&&!a){let M=n?.querySelector(".epanel .cancel, .edit-panel .cancel, .quick-panel .cancel");if(M){v.preventDefault(),v.stopImmediatePropagation(),M.click(),A();return}}if(v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(E instanceof HTMLTextAreaElement||E instanceof HTMLInputElement)&&!a){let M=E.closest("[role=dialog],.mark-dock")?.querySelector("[data-action=save],button.ok,.mark-save");if(M&&!M.disabled)v.preventDefault(),v.stopImmediatePropagation(),M.click()}if(E instanceof HTMLElement&&E.matches(".pin.marker")&&(v.key==="Enter"||v.key===" "))v.preventDefault(),E.click()}let F=(v)=>{if(v.target instanceof HTMLElement&&v.target!==t){if(i=v.target,!i.hasAttribute("tabindex"))u.set(i,null),i.setAttribute("tabindex","-1")}},Y=(v)=>{v.preventDefault(),v.stopImmediatePropagation()};return window.addEventListener("click",F,!0),window.addEventListener("submit",Y,!0),n.addEventListener("click",R,!0),n.addEventListener("keydown",O,!0),k(),()=>{T.disconnect(),a?.remove(),C.remove();for(let[v,E]of u)if(E===null)v.removeAttribute("tabindex");window.removeEventListener("click",F,!0),window.removeEventListener("submit",Y,!0),n.removeEventListener("click",R,!0),n.removeEventListener("keydown",O,!0)}}var pt=document.currentScript?.getAttribute("data-uibot-annotation")==="shell",De="",_t=null,pe=[],Xe=!1,Lt=!1,Bt="zh",Ft,gt=new Set,Oe=(e)=>window.parent.postMessage({...e,source:lt,nonce:De},"*"),Ln=()=>{for(let e of gt)e({action:U.changed})},Fn=()=>{Ln(),Oe({action:"snapshot",items:pe})};function mt(){for(let e of[...gt])e({action:U.teardown});Ft?.(),Ft=void 0,Xe=!1,delete window.__uibotAnnotationActive}async function jr(e){if(e.action===U.list)return{success:!0,data:pe};if(e.action===U.closed)return mt(),Oe({action:"closed"}),{success:!0};if(e.action===U.enrich)return{success:!0};if(e.action!==U.save||Lt)return{success:!1,error:"locked"};try{let t=Sn(),n=e.data;if(Bt==="en"&&n.edits?.length){let s=n.edits.map((u)=>\`\${u.label} \${fe(u.before,24)}\u2192\${fe(u.after,24)}\`).join("\uFF1B");if(n.edits=n.edits.map((u)=>({...u,label:ut[u.label]??u.label})),n.comment===\`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A\${s}\`)n.comment=\`Visual changes: \${n.edits.map((u)=>\`\${u.label} \${u.before} \u2192 \${u.after}\`).join("; ")}\`}let i=t.save(n),a=i.target.kind==="element"&&i.edits?.length?pe.find((s)=>s.target.kind==="element"&&i.target.kind==="element"&&s.target.cssSelector===i.target.cssSelector):void 0;if(a)i={...i,id:a.id,createdAt:a.createdAt,target:a.target,comment:\`\${a.comment}
346
+ \${i.comment}\`,edits:[...a.edits??[],...i.edits??[]]};let c=Dt([...pe.filter((s)=>s.id!==i.id),i]);if(!c)return{success:!1,error:"annotation-limit"};if(pe=c,Fn(),i.target.kind==="region")setTimeout(()=>document.getElementById("__uibot-annotator-host")?.shadowRoot?.querySelector('[data-tool="element"]')?.click(),0);return{success:!0,data:i}}catch{return{success:!1,error:"invalid-annotation"}}}function qr(e){if(Xe)return;Xe=!0,Bt=e,window.__uibotAnnotationActive=!0,kn({annotationRegionV2:!0},{sendMessage:jr,subscribe(t){return gt.add(t),()=>{gt.delete(t)}}}),Ft=_n({locale:e,items:()=>pe,update(t,n){pe=pe.map((i)=>i.id===t?{...i,comment:n}:i),Fn()},close(){mt(),Oe({action:"closed"})}})}window.addEventListener("message",(e)=>{if(!ct(e.data))return;let t=e.data;if(pt&&e.source!==window.parent){let n=[...document.querySelectorAll("iframe.pg-frame")].find((i)=>i.contentWindow===e.source);if(!n||t.source!==lt)return;if(t.action==="boot"&&_t){n.contentWindow?.postMessage(_t,"*");return}if(t.nonce===De)Oe({...t,source:lt});return}if(e.source!==window.parent||t.source!==Pn||typeof t.nonce!=="string"||!/^[a-zA-Z0-9-]{16,100}$/.test(t.nonce))return;if(De&&t.nonce!==De)return;if(t.action!=="sync"&&t.action!=="reveal")return;if(t.action==="sync"){let n=Dt(t.items);if(!n||typeof t.enabled!=="boolean"||typeof t.locked!=="boolean"||t.locale!=="zh"&&t.locale!=="en")return;let i=kt(t.theme);if(t.theme=i,De=t.nonce,pt){_t=t;for(let a of document.querySelectorAll("iframe.pg-frame"))a.contentWindow?.postMessage(t,"*");return}if(pe=n,Lt=t.locked,!t.enabled||Lt)mt();else{if(Xe&&Bt!==t.locale)mt();qr(t.locale);let a=document.getElementById("__uibot-annotator-host");if(a)at(a,i);Ln()}Oe({action:"ready"})}else if(t.nonce===De){if(pt)for(let n of document.querySelectorAll("iframe.pg-frame"))n.contentWindow?.postMessage(t,"*");else if(Xe&&typeof t.id==="string"){let n=pe.find((i)=>i.id===t.id);if(n)Ot(n)}}});if(!pt)Oe({action:"boot"});})();`;export{O as ANNOTATION_ACTIONS,mt as ANNOTATION_CAPTURE_MARK,tr as ANNOTATION_PERFORMANCE_STAGES,Dr as ANNOTATION_THEME_MAX_BYTES,Qt as ANNOTATION_THEME_TOKENS,_r as ANNOTATOR_IIFE,en as applyAnnotationTheme,rt as attachOverlayDrag,xt as attachRegionMarkup,nt as buildElementAnnotationDraft,on as clampOverlayPosition,tt as collectPageContext,vt as createAnnotationPerformanceTracker,Rr as createInPageAnnotationHost,On as isAnnotationRuntimeControlMessage,et as isAnnotationThemeColor,fe as normalizePageUrl,Pr as readFiberSourceProbe,wt as scheduleAnnotationIdleTask,ke as shortText,ir as startAnnotationRuntime,qn as validateAnnotationTheme};
@@ -1 +1 @@
1
- export declare const ANNOTATOR_IIFE = "(()=>{var on=[\"--pa-accent\",\"--pa-accent-soft\",\"--pa-outline\",\"--pa-accent-contrast\",\"--pa-surface\",\"--pa-surface-contrast\",\"--pa-shadow\",\"--pa-muted\",\"--pa-hover\",\"--pa-border\",\"--pa-popover-contrast\",\"--pa-popover\",\"--pa-focus\",\"--pa-selected\",\"--pa-accent-halo\",\"--pa-field\",\"--pa-checker\",\"--pa-success\",\"--pa-success-contrast\",\"--pa-danger\",\"--pa-danger-contrast\",\"--pa-color-default\"];function it(e){if(typeof e!==\"string\"||e.length>256||!e.trim())return!1;if(/[;{}\\\\<>!@'\"]/.test(e)||[...e].some((s)=>s.charCodeAt(0)<32)||/url\\s*\\(|var\\s*\\(|\\/\\*|\\*\\//i.test(e))return!1;let t=e.trim();if(/^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i.test(t))return!0;if(new Set(\"aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen\".split(\" \")).has(t.toLowerCase()))return!0;let i=t.match(/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\\(([^()]+)\\)$/i);if(i){let s=(i[1]??\"\").toLowerCase(),u=(i[2]??\"\").trim(),b=u.includes(\",\");if(b&&(!/^(rgb|rgba|hsl|hsla)$/.test(s)||u.includes(\"/\")))return!1;let C=u.split(\"/\");if(C.length>2)return!1;let A=b?u.split(\",\").map((T)=>T.trim()):(C[0]??\"\").trim().split(/\\s+/),I=b?A[3]:C[1]?.trim();if(A.length!==3&&!(b&&A.length===4))return!1;let k=/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?%?$/i;if(I!==void 0&&!k.test(I)&&!(I===\"none\"&&!b))return!1;return A.slice(0,3).every((T,R)=>{if(T===\"none\")return!b;let O=/^(hsl|hsla|hwb)$/.test(s)?R===0:/^(lch|oklch)$/.test(s)&&R===2;return k.test(T)||O&&/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(deg|rad|grad|turn)$/i.test(T)})}let a=t.match(/^color\\((srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|xyz|xyz-d50|xyz-d65) ([^()]+)\\)$/i);if(a)return it(`rgb(${a[2]})`);let c=t.match(/^color-mix\\(in srgb, (.+) (\\d+(?:\\.\\d+)?)%, (.+)\\)$/i);return!!c&&Number(c[2])<=100&&it(c[1])&&it(c[3])}function kt(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return{};try{if(new TextEncoder().encode(JSON.stringify(e)).length>8192)return{}}catch{return{}}let t={};for(let n of on){let i=Object.hasOwn(e,n)?e[n]:void 0;if(it(i))t[n]=i.trim()}return t}function at(e,t){let n=kt(t);for(let i of on){let a=n[i];if(a===void 0)e.style.removeProperty(i);else e.style.setProperty(i,a)}}var tr=[\"color\",\"backgroundColor\",\"fontSize\",\"fontWeight\",\"fontFamily\",\"lineHeight\",\"margin\",\"padding\",\"border\",\"borderRadius\",\"width\",\"height\",\"display\",\"position\",\"zIndex\",\"flexDirection\",\"justifyContent\",\"alignItems\",\"gap\",\"overflow\",\"opacity\",\"transform\"];function vt(e){if(typeof CSS<\"u\"&&typeof CSS.escape===\"function\")return CSS.escape(e);return e.replace(/([^a-zA-Z0-9_-])/g,\"\\\\$1\")}function an(e){return e.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r\\f]/g,\"\\\\a \")}function sn(e){if(!e||e.length>40)return!1;if(/^(css-|sc-|jss|makeStyles|emotion-|_)/i.test(e))return!1;if(/[0-9a-f]{6,}/.test(e))return!1;return!0}function ln(e){if(!e||e.length>40)return!1;if(/[0-9a-f]{8,}/.test(e))return!1;if(/^(radix-|headlessui-|mui-|:r)/i.test(e))return!1;return!0}function nr(e){let t=[],n=e;while(n&&n.nodeType===1&&n!==document.documentElement){let i=n.tagName.toLowerCase();if(n.id&&ln(n.id)){t.unshift(`#${vt(n.id)}`);break}let a=n.parentElement;if(a){let c=Array.from(a.children).filter((u)=>u.tagName===n.tagName),s=c.indexOf(n)+1;t.unshift(c.length>1?`${i}:nth-of-type(${s})`:i)}else t.unshift(i);n=a}return t.join(\" > \")}function rr(e){let t=e.tagName.toLowerCase();for(let a of[\"data-testid\",\"data-cy\",\"data-qa\"]){let c=e.getAttribute(a);if(c)return{selector:`${t}[${a}=\"${an(c)}\"]`,strategy:\"testid\"}}if(e.id&&ln(e.id)){let a=`#${vt(e.id)}`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"id\"}}let n=e.getAttribute(\"aria-label\");if(n){let a=`${t}[aria-label=\"${an(n)}\"]`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"aria\"}}let i=Array.from(e.classList).filter(sn);if(i.length){let a=`${t}.${i.map(vt).join(\".\")}`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"class\"}}return{selector:nr(e),strategy:\"path\"}}function or(e){let t=[],n=e;while(n&&n.nodeType===1){let i=1,a=n.previousElementSibling;while(a){if(a.tagName===n.tagName)i+=1;a=a.previousElementSibling}t.unshift(`${n.tagName.toLowerCase()}[${i}]`),n=n.parentElement}return`/${t.join(\"/\")}`}function ir(e){let t=[],n=e,i=0;while(n&&n.nodeType===1&&i<6){let a=n.tagName.toLowerCase(),c=n.id?`#${n.id}`:\"\",s=Array.from(n.classList).filter(sn).slice(0,2);t.unshift(`${a}${c}${s.length?`.${s.join(\".\")}`:\"\"}`),n=n.parentElement,i+=1}return t}function ar(e){let t={};for(let n of Array.from(e.attributes)){if(n.name===\"style\")continue;t[n.name]=n.value.length>200?n.value.slice(0,200):n.value}return t}function sr(e){let t=getComputedStyle(e),n={};for(let i of tr){let a=t.getPropertyValue(i.replace(/[A-Z]/g,(c)=>`-${c.toLowerCase()}`));if(a)n[i]=a.trim()}return n}function lr(){let e=window;if(e.__NEXT_DATA__)return\"nextjs\";if(e.__NUXT__)return\"nuxt\";if(document.querySelector(\"[ng-version]\"))return\"angular\";if(document.querySelector(\"[data-reactroot]\")||e.React||e.__REACT_DEVTOOLS_GLOBAL_HOOK__)return\"react\";if(e.__VUE__||document.querySelector(\"[data-v-app]\"))return\"vue\";if(document.querySelector(\"[data-svelte-h]\"))return\"svelte\";return\"unknown\"}function At(){let e=window.location,t=document.documentElement.classList.contains(\"dark\")||Boolean(window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches);return{url:e.href,origin:e.origin,path:e.pathname,query:e.search||void 0,hash:e.hash||void 0,title:document.title,referrer:document.referrer||void 0,viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1},scroll:{x:window.scrollX,y:window.scrollY},theme:t?\"dark\":\"light\",framework:lr(),language:document.documentElement.lang||navigator.language,userAgent:navigator.userAgent,capturedAt:new Date().toISOString()}}function cr(e){let t=e.getBoundingClientRect(),n=getComputedStyle(e);return{viewport:{width:window.innerWidth,height:window.innerHeight},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)},visible:t.width>0&&t.height>0&&n.display!==\"none\"&&n.visibility!==\"hidden\",positioning:n.position}}function fe(e,t){let n=e.replace(/\\s+/g,\" \").trim();return n.length>t?`${n.slice(0,t)}\u2026`:n}function dr(e){let t=e.tagName.toLowerCase(),n=(e.getAttribute(\"role\")||\"\").toLowerCase();if(t===\"main\"||n===\"main\")return\"\u4E3B\u5185\u5BB9\u533A\";if(t===\"nav\"||n===\"navigation\")return\"\u5BFC\u822A/\u83DC\u5355\";if(t===\"header\"||n===\"banner\")return\"\u9875\u5934\";if(t===\"footer\"||n===\"contentinfo\")return\"\u9875\u811A\";if(t===\"aside\"||n===\"complementary\")return\"\u4FA7\u8FB9\u680F\";if(t===\"dialog\"||n===\"dialog\"||n===\"alertdialog\")return\"\u5F39\u7A97\";if(t===\"form\")return\"\u8868\u5355\";if(t===\"table\")return\"\u8868\u683C\";if(t===\"tr\")return\"\u8868\u683C\u884C\";if(t===\"th\"||t===\"td\")return\"\u5355\u5143\u683C\";if(t===\"li\")return\"\u5217\u8868\u9879\";if(t===\"ul\"||t===\"ol\")return\"\u5217\u8868\";if(t===\"section\"||t===\"article\"){let c=e.querySelector(\"h1,h2,h3,h4,h5,h6\"),u=(e.getAttribute(\"aria-label\")||c?.textContent||\"\").replace(/\\s+/g,\" \").trim();return u?`\u533A\u5757\u300C${fe(u,16)}\u300D`:\"\u533A\u5757\"}let i=Array.from(e.classList).find((c)=>/card|modal|dialog|drawer|side-?bar|menu|panel|toolbar|tabs?|header|footer|nav|hero|banner|widget|popover|dropdown/i.test(c));if(!i)return null;return`${/card/i.test(i)?\"\u5361\u7247\":/modal|dialog/i.test(i)?\"\u5F39\u7A97\":/drawer/i.test(i)?\"\u62BD\u5C49\":/side-?bar/i.test(i)?\"\u4FA7\u8FB9\u680F\":/toolbar/i.test(i)?\"\u5DE5\u5177\u680F\":/menu/i.test(i)?\"\u83DC\u5355\":/tab/i.test(i)?\"\u6807\u7B7E\u9875\":/panel/i.test(i)?\"\u9762\u677F\":/nav/i.test(i)?\"\u5BFC\u822A\":/header/i.test(i)?\"\u9875\u5934\":/footer/i.test(i)?\"\u9875\u811A\":/popover|dropdown/i.test(i)?\"\u6D6E\u5C42\":/hero|banner/i.test(i)?\"\u6A2A\u5E45\":\"\u533A\u5757\"}(.${i})`}function ur(e){let t=[],n=e.parentElement;while(n&&n.nodeType===1&&n!==document.body&&n!==document.documentElement){let A=dr(n);if(A&&t[t.length-1]!==A)t.push(A);n=n.parentElement}t.reverse();let i=e.getBoundingClientRect(),a=i.left+i.width/2,c=i.top+i.height/2,s=window.innerWidth||1,u=window.innerHeight||1,b=a<s/3?\"\u9760\u5DE6\":a>s*2/3?\"\u9760\u53F3\":\"\u6C34\u5E73\u5C45\u4E2D\",C=c<u/3?\"\u9760\u4E0A\":c>u*2/3?\"\u9760\u4E0B\":\"\u5782\u76F4\u5C45\u4E2D\";return{region:`${b} \u00B7 ${C}`,breadcrumb:t.slice(-5)}}function wt(e){let t=e.getBoundingClientRect(),{selector:n,strategy:i}=rr(e),a=(e.textContent||\"\").replace(/\\s+/g,\" \").trim(),c=ur(e);return{comment:\"\",type:\"style\",priority:\"medium\",target:{kind:\"element\",tagName:e.tagName.toLowerCase(),cssSelector:n,xpath:or(e),textContent:a?a.slice(0,200):void 0,attributes:ar(e),boundingBox:{x:Math.round(t.left+window.scrollX),y:Math.round(t.top+window.scrollY),width:Math.round(t.width),height:Math.round(t.height)},domPath:ir(e),accessibility:{role:e.getAttribute(\"role\")||void 0,ariaLabel:e.getAttribute(\"aria-label\")||void 0},selectorStrategy:i,region:c.region,breadcrumb:c.breadcrumb},styleSummary:sr(e),geometry:cr(e),pageContext:At()}}var We=[{id:\"red\",value:\"#ef4444\",label:\"\u7EA2\"},{id:\"orange\",value:\"#f97316\",label:\"\u6A59\"},{id:\"yellow\",value:\"#eab308\",label:\"\u9EC4\"},{id:\"green\",value:\"#22c55e\",label:\"\u7EFF\"},{id:\"blue\",value:\"#3b82f6\",label:\"\u84DD\"},{id:\"white\",value:\"#f8fafc\",label:\"\u767D\"}],cn=12,dn=48,Rt=4,St=16;function st(e){let t=Math.round(e/4)*4;return Math.min(48,Math.max(12,t))}function pr(e,t){let n=st(t),i=Math.max(1,[...e].length);return{width:Math.max(n,i*n),height:Math.ceil(n*1.35)}}var gr=new Set(We.map((e)=>e.value));function mr(e){return gr.has(e)}function un(){return We[0].value}function ie(e){return typeof e===\"number\"&&Number.isFinite(e)}function fr(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return null;let t=e;if(typeof t.color!==\"string\"||!mr(t.color))return null;if(t.kind===\"rect\"){if(!ie(t.x)||!ie(t.y)||!ie(t.width)||!ie(t.height))return null;if(t.width<8||t.height<8)return null;return{kind:\"rect\",color:t.color,x:t.x,y:t.y,width:t.width,height:t.height}}if(t.kind===\"arrow\"){if(!ie(t.x1)||!ie(t.y1)||!ie(t.x2)||!ie(t.y2))return null;return{kind:\"arrow\",color:t.color,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}if(t.kind===\"text\"){if(!ie(t.x)||!ie(t.y)||typeof t.text!==\"string\")return null;let n=t.text.trim();if(!n)return null;let i=t.fontSize===void 0?16:ie(t.fontSize)?st(t.fontSize):null;if(i==null)return null;return{kind:\"text\",color:t.color,x:t.x,y:t.y,text:n,fontSize:i}}return null}function pn(e){if(e===void 0)return;if(!Array.isArray(e))return;let t=[];for(let n of e){let i=fr(n);if(!i)return;t.push(i)}return t}function gn(e){if(e.length===0)return\"\u533A\u57DF\u6807\u6CE8\";let t=e.filter((c)=>c.kind===\"rect\").length,n=e.filter((c)=>c.kind===\"arrow\").length,i=e.filter((c)=>c.kind===\"text\"),a=[];if(t)a.push(`${t} \u4E2A\u6846`);if(n)a.push(`${n} \u4E2A\u7BAD\u5934`);if(i.length){let c=i.map((s)=>s.text.trim()).filter(Boolean).slice(0,3).map((s)=>`\u300C${s.length>16?`${s.slice(0,16)}\u2026`:s}\u300D`);a.push(c.length?`\u6587\u672C ${c.join(\" \")}`:`${i.length} \u5904\u6587\u672C`)}return`\u533A\u57DF\u6807\u6CE8\uFF08${a.join(\"\uFF0C\")}\uFF09`}function Ke(e,t=16){if(e.length===0)return null;let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let s of e)if(s.kind===\"rect\")n=Math.min(n,s.x),i=Math.min(i,s.y),a=Math.max(a,s.x+s.width),c=Math.max(c,s.y+s.height);else if(s.kind===\"arrow\")n=Math.min(n,s.x1,s.x2),i=Math.min(i,s.y1,s.y2),a=Math.max(a,s.x1,s.x2),c=Math.max(c,s.y1,s.y2);else{let u=pr(s.text,s.fontSize);n=Math.min(n,s.x),i=Math.min(i,s.y),a=Math.max(a,s.x+u.width),c=Math.max(c,s.y+u.height)}return{x:n-t,y:i-t,width:Math.max(8,a-n+t*2),height:Math.max(8,c-i+t*2)}}function mn(e,t,n){return e.map((i)=>{if(i.kind===\"rect\")return{...i,x:i.x+t,y:i.y+n};if(i.kind===\"arrow\")return{...i,x1:i.x1+t,y1:i.y1+n,x2:i.x2+t,y2:i.y2+n};return{...i,x:i.x+t,y:i.y+n,fontSize:i.fontSize}})}function Pt(e,t){let n=Math.max(0,Math.min(e.x,t.width)),i=Math.max(0,Math.min(e.y,t.height)),a=Math.min(e.width,t.width-n),c=Math.min(e.height,t.height-i);if(a<8||c<8)return null;return{x:n,y:i,width:a,height:c}}function yr(e,t,n,i,a=8){let c=Math.max(a,i.width-n.width-a),s=Math.max(a,i.height-n.height-a);return{left:Math.min(Math.max(e,a),c),top:Math.min(Math.max(t,a),s)}}function It(e,t){let n=!1,i=null,a=0,c=0,s=0,u=0;function b(){return{width:window.innerWidth,height:window.innerHeight}}function C(R,O){let F=e.getBoundingClientRect(),Y=yr(R,O,{width:F.width,height:F.height},b());e.style.left=`${Y.left}px`,e.style.top=`${Y.top}px`,e.style.right=\"auto\",e.style.transform=\"none\"}function A(R){if(R.button!==0)return;R.preventDefault(),R.stopPropagation(),n=!0,i=R.pointerId,t.setPointerCapture?.(R.pointerId);let O=e.getBoundingClientRect();a=R.clientX,c=R.clientY,s=O.left,u=O.top,C(s,u),t.classList.add(\"dragging\")}function I(R){if(!n||i!=null&&R.pointerId!==i)return;R.preventDefault(),C(s+R.clientX-a,u+R.clientY-c)}function k(R){if(!n||i!=null&&R.pointerId!==i)return;n=!1,i=null,t.classList.remove(\"dragging\");try{t.releasePointerCapture?.(R.pointerId)}catch{}}function T(){let R=e.getBoundingClientRect();C(R.left,R.top)}return t.addEventListener(\"pointerdown\",A),t.addEventListener(\"pointermove\",I),t.addEventListener(\"pointerup\",k),t.addEventListener(\"pointercancel\",k),window.addEventListener(\"resize\",T),()=>{t.removeEventListener(\"pointerdown\",A),t.removeEventListener(\"pointermove\",I),t.removeEventListener(\"pointerup\",k),t.removeEventListener(\"pointercancel\",k),window.removeEventListener(\"resize\",T)}}function fn(e){if(e?.isConnected)e.remove()}function ue(e,t){let n=document.createElementNS(\"http://www.w3.org/2000/svg\",e);for(let[i,a]of Object.entries(t))n.setAttribute(i,a);return n}function hr(e){let t=ue(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\"});if(t.setAttribute(\"aria-hidden\",\"true\"),e===\"rect\")t.appendChild(ue(\"rect\",{x:\"3\",y:\"4\",width:\"10\",height:\"8\",rx:\"1.5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\"}));else if(e===\"arrow\")t.appendChild(ue(\"path\",{d:\"M3 13 L12 4 M8 4 h4 v4\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));else t.appendChild(ue(\"path\",{d:\"M4 13 L8 3 L12 13 M5.5 10 h5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));return t}function yn(e,t){let n=!1,i=\"rect\",a=un(),c=St,s=[],u=null,b=null,C=null,A=document.createElement(\"div\");A.className=\"mark-layer\";let I=ue(\"svg\",{class:\"mark-svg\"});I.setAttribute(\"width\",\"100%\"),I.setAttribute(\"height\",\"100%\"),A.appendChild(I),e.appendChild(A);let k=document.createElement(\"div\");k.className=\"mark-dock\",k.hidden=!0;let T=document.createElement(\"div\");T.className=\"mark-seg\";let R=new Map;for(let m of[\"rect\",\"arrow\",\"text\"]){let h=document.createElement(\"button\");h.type=\"button\",h.dataset.mark=m,h.setAttribute(\"aria-label\",m===\"rect\"?\"\u6846\u9009\":m===\"arrow\"?\"\u7BAD\u5934\":\"\u6587\u672C\"),h.title=h.getAttribute(\"aria-label\")??m,h.appendChild(hr(m)),h.addEventListener(\"click\",()=>{i=m,D(),Q()}),R.set(m,h),T.appendChild(h)}let O=document.createElement(\"div\");O.className=\"mark-colors\",O.setAttribute(\"role\",\"radiogroup\"),O.setAttribute(\"aria-label\",\"\u6279\u6CE8\u989C\u8272\");let F=[];for(let m of We){let h=document.createElement(\"button\");h.type=\"button\",h.className=\"mark-color\",h.style.background=m.value,h.setAttribute(\"aria-label\",m.label),h.title=m.label,h.addEventListener(\"click\",()=>{a=m.value,H()}),F.push(h),O.appendChild(h)}let Y=document.createElement(\"div\");Y.className=\"mark-size\",Y.setAttribute(\"aria-label\",\"\u5B57\u53F7\");let v=document.createElement(\"button\");v.type=\"button\",v.setAttribute(\"aria-label\",\"\u51CF\u5C0F\u5B57\u53F7\"),v.title=\"\u51CF\u5C0F\u5B57\u53F7\",v.textContent=\"\u2212\";let E=document.createElement(\"span\");E.className=\"v\";let M=document.createElement(\"button\");M.type=\"button\",M.setAttribute(\"aria-label\",\"\u589E\u5927\u5B57\u53F7\"),M.title=\"\u589E\u5927\u5B57\u53F7\",M.textContent=\"+\",Y.append(v,E,M);let S=document.createElement(\"input\");S.type=\"text\",S.className=\"mark-comment\",S.placeholder=\"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\",S.setAttribute(\"aria-label\",\"\u533A\u57DF\u6807\u6CE8\u8BF4\u660E\");let N=document.createElement(\"button\");N.type=\"button\",N.className=\"mark-save\",N.textContent=\"\u2713\",N.title=\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\",N.setAttribute(\"aria-label\",\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\"),N.disabled=!0,N.addEventListener(\"click\",()=>{if(!s.length||N.disabled)return;t.onSave({marks:s.map((m)=>({...m})),comment:S.value.trim()})}),k.append(T,O,Y,S,N),e.appendChild(k);function D(){for(let[m,h]of R)h.classList.toggle(\"on\",m===i)}function H(){F.forEach((m,h)=>{m.classList.toggle(\"on\",We[h]?.value===a)})}function G(m){if(c=st(m),E.textContent=String(c),v.disabled=c<=cn,M.disabled=c>=dn,C){C.style.fontSize=`${c}px`;return}for(let h=s.length-1;h>=0;h-=1){let x=s[h];if(x?.kind!==\"text\")continue;s[h]={...x,fontSize:c},le();break}}function ae(m){m.preventDefault()}v.addEventListener(\"mousedown\",ae),M.addEventListener(\"mousedown\",ae),v.addEventListener(\"click\",()=>G(c-Rt)),M.addEventListener(\"click\",()=>G(c+Rt));function K(){N.disabled=s.length===0,t.onBusyChange?.(!1)}function Q(){u=null,b=null,le()}function se(){ge(!0)}function ge(m){let h=C;if(!h)return;C=null,h.removeEventListener(\"blur\",se);let x=h.value.trim(),j=Number.parseFloat(h.dataset.x??\"0\"),w=Number.parseFloat(h.dataset.y??\"0\");if(fn(h),m&&x)s.push({kind:\"text\",color:a,x:j,y:w,text:x,fontSize:c});le(),K()}function le(){I.replaceChildren();for(let x of[...A.querySelectorAll(\".mark-text\")]){if(x===C)continue;fn(x)}let m=ue(\"defs\",{});I.appendChild(m),(b?[...s,b]:s).forEach((x,j)=>{if(x.kind===\"rect\"){I.appendChild(ue(\"rect\",{x:String(x.x),y:String(x.y),width:String(x.width),height:String(x.height),fill:\"none\",stroke:x.color,\"stroke-width\":\"3\",rx:\"2\"}));return}if(x.kind===\"arrow\"){let oe=`uibot-arrow-${j}`,X=ue(\"marker\",{id:oe,markerWidth:\"8\",markerHeight:\"8\",refX:\"6\",refY:\"4\",orient:\"auto\",markerUnits:\"strokeWidth\"});X.appendChild(ue(\"path\",{d:\"M0,0 L8,4 L0,8 z\",fill:x.color})),m.appendChild(X),I.appendChild(ue(\"line\",{x1:String(x.x1),y1:String(x.y1),x2:String(x.x2),y2:String(x.y2),stroke:x.color,\"stroke-width\":\"3\",\"stroke-linecap\":\"round\",\"marker-end\":`url(#${oe})`}));return}let w=document.createElement(\"div\");w.className=\"mark-text\",w.textContent=x.text,w.style.left=`${x.x}px`,w.style.top=`${x.y}px`,w.style.color=x.color,w.style.fontSize=`${x.fontSize}px`,A.appendChild(w)})}return D(),H(),G(c),le(),{setActive(m){if(n=m,k.hidden=!m,A.classList.toggle(\"on\",m),!m)ge(!1),s.length=0,S.value=\"\",i=\"rect\",G(St),Q(),K(),D()},isActive:()=>n,tool:()=>i,getMarks:()=>s.map((m)=>({...m})),addRect(m){if(!n)return;s.push({kind:\"rect\",color:a,...m}),le(),K()},handlePointerDown(m){if(!n||m.button!==0||C)return!1;if(m.target instanceof Node&&k.contains(m.target))return!1;return u={x:m.clientX,y:m.clientY},b=null,!0},handlePointerMove(m){if(!n||!u||i===\"text\")return!1;let h=Math.min(u.x,m.clientX),x=Math.min(u.y,m.clientY),j=Math.abs(m.clientX-u.x),w=Math.abs(m.clientY-u.y);return b=i===\"arrow\"?{kind:\"arrow\",color:a,x1:u.x,y1:u.y,x2:m.clientX,y2:m.clientY}:{kind:\"rect\",color:a,x:h,y:x,width:j,height:w},le(),!0},handlePointerUp(m){if(!n||m.button!==0)return!1;if(i===\"text\"){let x=u;if(u=null,!x)return!1;return ge(!1),C=document.createElement(\"input\"),C.className=\"mark-text editing\",C.dataset.x=String(m.clientX),C.dataset.y=String(m.clientY),C.style.left=`${m.clientX}px`,C.style.top=`${m.clientY}px`,C.style.color=a,C.style.fontSize=`${c}px`,C.placeholder=\"\u8F93\u5165\u6587\u5B57\",C.addEventListener(\"keydown\",(j)=>{if(j.key===\"Enter\")j.preventDefault(),ge(!0);else if(j.key===\"Escape\")j.preventDefault(),ge(!1)}),C.addEventListener(\"blur\",se),A.appendChild(C),C.focus(),!0}if(!u)return!1;let h=u;if(u=null,i===\"arrow\"){let x=m.clientX-h.x,j=m.clientY-h.y;if(Math.hypot(x,j)<8)return Q(),!0;s.push({kind:\"arrow\",color:a,x1:h.x,y1:h.y,x2:m.clientX,y2:m.clientY})}else{let x={x:Math.min(h.x,m.clientX),y:Math.min(h.y,m.clientY),width:Math.abs(m.clientX-h.x),height:Math.abs(m.clientY-h.y)};if(x.width<8||x.height<8)return Q(),!0;s.push({kind:\"rect\",color:a,...x})}return b=null,le(),K(),!0},handlePointerCancel(){if(!n)return;Q()},captureRect(){return Ke(s,16)},setCapturing(m){k.hidden=m||!n},setBusy(m){N.disabled=m||s.length===0,N.textContent=m?\"\u2026\":\"\u2713\",S.disabled=m},clear(){ge(!1),s.length=0,S.value=\"\",Q(),K()},detach(){ge(!1),A.remove(),k.remove()}}}var br=()=>globalThis.performance?.now()??Date.now();function hn(e,t=br){let n=t(),i=(a,c,s)=>{e?.({stage:a,durationMs:Math.max(0,t()-c),outcome:s})};return{markFromStart(a,c=\"success\"){i(a,n,c)},start(a){let c=t(),s=!1;return(u=\"success\")=>{if(s)return;s=!0,i(a,c,u)}}}}var U={start:\"annotation:start\",teardown:\"annotation:teardown\",save:\"annotation:save\",enrich:\"annotation:enrich\",closed:\"annotation:overlay-closed\",list:\"annotation:list\",update:\"annotation:update\",remove:\"annotation:remove\",clear:\"annotation:clear\",changed:\"annotation:changed\",reveal:\"annotation:reveal\"};function Me(e){try{let t=new URL(e);return t.hash=\"\",t.toString()}catch{return e}}function xr(){return{requestIdleCallback:typeof window.requestIdleCallback===\"function\"?(e,t)=>window.requestIdleCallback(()=>e(),t):void 0,cancelIdleCallback:typeof window.cancelIdleCallback===\"function\"?(e)=>window.cancelIdleCallback(e):void 0,setTimeout:(e,t)=>window.setTimeout(e,t),clearTimeout:(e)=>window.clearTimeout(e)}}function bn(e,t=xr()){let n=!0,i=()=>{if(!n)return;n=!1,e()};if(t.requestIdleCallback){let c=t.requestIdleCallback(i,{timeout:120});return()=>{if(!n)return;n=!1,t.cancelIdleCallback?.(c)}}let a=t.setTimeout(i,0);return()=>{if(!n)return;n=!1,t.clearTimeout(a)}}var xn=`\n *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",system-ui,sans-serif;}\n .hl{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,0.10));border-radius:4px;\n pointer-events:none;transition:all .04s linear;z-index:1;box-shadow:0 0 0 1px var(--pa-outline, rgba(255,255,255,0.4));}\n .tag{position:fixed;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);font-size:11px;line-height:1.4;font-weight:500;\n padding:2px 7px;border-radius:5px;pointer-events:none;white-space:nowrap;z-index:2;}\n .bar{position:fixed;top:14px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));\n color:var(--pa-surface-contrast, #fff);font-size:12.5px;padding:6px 6px 6px 8px;border-radius:999px;pointer-events:auto;\n z-index:5;display:flex;gap:8px;align-items:center;box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .bar .grip{display:flex;align-items:center;justify-content:center;width:18px;height:22px;padding:0;\n border:none;background:transparent;color:var(--pa-muted, rgba(255,255,255,0.72));cursor:grab;touch-action:none;}\n .bar .grip:hover,.bar .grip.dragging{color:var(--pa-surface-contrast, #fff);background:transparent;}\n .bar .grip.dragging{cursor:grabbing;}\n .bar button{background:var(--pa-hover, rgba(255,255,255,0.14));color:var(--pa-surface-contrast, #fff);border:none;border-radius:999px;\n padding:4px 11px;font-size:12px;cursor:pointer;transition:background .12s;}\n .bar button:hover{background:var(--pa-hover, rgba(255,255,255,0.26));}\n .bar button.exit{width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;}\n\n @keyframes uibotpop{from{opacity:0;transform:translateY(4px) scale(.98);}to{opacity:1;transform:none;}}\n\n .dd{position:relative;}\n .dd-btn{width:100%;display:flex;align-items:center;gap:6px;border:1px solid var(--pa-border, #e6d6bf);border-radius:9px;\n padding:7px 10px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);background:var(--pa-popover, #fff);cursor:pointer;transition:border-color .12s,box-shadow .12s;}\n .dd-btn:hover{border-color:var(--pa-border, #d2bd9c);}\n .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.14));}\n .dd-btn .v{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px;}\n .dd-btn .chev{font-size:9px;color:var(--pa-muted, #b69b73);transition:transform .12s;}\n .dd-btn.open .chev{transform:rotate(180deg);}\n .dd-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--pa-popover, #fff);border:1px solid var(--pa-border, #ecdcc4);\n border-radius:10px;box-shadow:0 10px 28px var(--pa-shadow, rgba(60,40,15,0.18));padding:4px;z-index:10;max-height:208px;overflow:auto;}\n .dd-item{width:100%;display:flex;align-items:center;gap:7px;text-align:left;border:none;background:transparent;\n border-radius:7px;padding:7px 9px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);cursor:pointer;}\n .dd-item:hover{background:var(--pa-hover, #f6ecdb);}\n .dd-item.sel{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #7c2d34);font-weight:500;}\n .swatch{width:8px;height:8px;border-radius:50%;flex-shrink:0;}\n\n .toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);color:var(--pa-surface-contrast, #fff);font-size:12.5px;\n padding:8px 16px;border-radius:999px;pointer-events:none;z-index:7;box-shadow:0 6px 20px var(--pa-shadow, rgba(0,0,0,0.2));}\n .pin{position:fixed;width:21px;height:21px;border-radius:50% 50% 50% 2px;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);\n font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;\n pointer-events:none;z-index:3;box-shadow:0 2px 6px var(--pa-shadow, rgba(0,0,0,0.3));}\n .pin.marker{pointer-events:auto;cursor:pointer;transition:transform .1s;}\n .pin.marker:hover{transform:scale(1.18);}\n .flash{position:fixed;border:3px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:4;\n animation:uibotflash 1.2s ease-out forwards;}\n @keyframes uibotflash{0%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0.45));}100%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0));}}\n .selbox{position:fixed;border:2px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:2;\n box-shadow:0 0 0 1px var(--pa-outline, rgba(241,240,237,0.35));background:var(--pa-accent-soft, rgba(124,45,52,0.06));}\n .pin.active{background:var(--pa-accent, #7c2d34);}\n .sel-clear{position:fixed;width:22px;height:22px;padding:0;border:none;border-radius:50%;background:var(--pa-surface, #17171a);color:var(--pa-surface-contrast, #f1f0ed);display:none;align-items:center;justify-content:center;pointer-events:auto;z-index:6;cursor:pointer;box-shadow:0 2px 6px var(--pa-shadow, rgba(0,0,0,0.3));}\n .sel-clear:hover{background:var(--pa-hover, #3b352e);}\n .region-box{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,.10));pointer-events:none;z-index:3;display:none;}\n .region-size{position:absolute;right:0;bottom:-24px;background:var(--pa-surface, #17171a);color:var(--pa-surface-contrast, #f1f0ed);border-radius:999px;padding:3px 7px;font-size:11px;white-space:nowrap;}\n .sr-live{position:fixed;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}\n .mark-layer{position:fixed;inset:0;pointer-events:none;z-index:4;}\n .mark-layer .mark-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;}\n .mark-text{position:fixed;font-size:15px;font-weight:700;line-height:1.2;pointer-events:none;white-space:pre;\n text-shadow:0 1px 2px var(--pa-shadow, rgba(0,0,0,.75)),0 0 8px var(--pa-shadow, rgba(0,0,0,.45));z-index:4;}\n .mark-text.editing{pointer-events:auto;min-width:72px;background:var(--pa-surface, rgba(23,23,26,.9));border:1px solid var(--pa-border, rgba(255,255,255,.24));\n border-radius:6px;padding:4px 8px;outline:none;font:inherit;}\n .mark-dock{position:fixed;top:58px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));color:var(--pa-surface-contrast, #fff);\n padding:6px 8px;border-radius:14px;pointer-events:auto;z-index:5;display:flex;gap:8px;align-items:center;\n flex-wrap:wrap;max-width:calc(100vw - 16px);box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .mark-dock[hidden]{display:none;}\n .mark-seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;gap:2px;}\n .mark-seg button{width:28px;height:26px;padding:0;display:flex;align-items:center;justify-content:center;\n background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,.72));border-radius:999px;cursor:pointer;}\n .mark-seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);}\n .mark-colors{display:flex;gap:5px;align-items:center;}\n .mark-color{width:16px;height:16px;border-radius:50%;border:2px solid transparent;padding:0;cursor:pointer;\n box-shadow:inset 0 0 0 1px var(--pa-shadow, rgba(0,0,0,.28));}\n .mark-color.on{border-color:var(--pa-surface-contrast, #fff);}\n .mark-size{display:flex;align-items:center;gap:2px;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px 4px;}\n .mark-size button{width:22px;height:22px;padding:0;border:none;border-radius:999px;background:transparent;\n color:var(--pa-surface-contrast, #fff);cursor:pointer;font-size:14px;line-height:1;}\n .mark-size button:hover:not(:disabled){background:var(--pa-hover, rgba(255,255,255,0.16));}\n .mark-size button:disabled{opacity:.34;cursor:default;}\n .mark-size .v{min-width:22px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums;color:var(--pa-surface-contrast, #f1f0ed);}\n .mark-comment{width:120px;height:28px;border:1px solid var(--pa-border, rgba(255,255,255,.18));background:var(--pa-field, rgba(0,0,0,.25));\n color:var(--pa-surface-contrast, #f1f0ed);border-radius:8px;padding:0 8px;font-size:12px;outline:none;}\n .mark-save{width:28px;height:28px;border:none;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);cursor:pointer;font-size:15px;}\n .mark-save:disabled{opacity:.45;cursor:default;}\n :host(.capturing) .bar,:host(.capturing) .mark-dock,:host(.capturing) .epanel,:host(.capturing) .pin,\n :host(.capturing) .toast,:host(.capturing) .hl,:host(.capturing) .tag,:host(.capturing) .region-box,\n :host(.capturing) .region-size,:host(.capturing) .sel-clear{visibility:hidden!important;}\n\n .seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;}\n .seg button{background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,0.72));padding:3px 12px;\n border-radius:999px;font-size:12px;cursor:pointer;transition:background .12s,color .12s;}\n .seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);font-weight:600;}\n\n .epanel{position:fixed;width:360px;max-width:94vw;background:var(--pa-surface, #17171a);border:1px solid var(--pa-border, #3a352f);\n border-radius:16px;box-shadow:0 18px 48px var(--pa-shadow, rgba(0,0,0,0.5));pointer-events:auto;z-index:6;\n color:var(--pa-surface-contrast, #f1f0ed);overflow:hidden;animation:uibotpop .12s ease-out;}\n .epanel .etop{display:flex;align-items:center;gap:9px;padding:11px 13px;border-bottom:1px solid var(--pa-border, #332f29);}\n .epanel .etop .ico{flex-shrink:0;color:var(--pa-muted, #b9b1a4);font-size:15px;}\n .epanel .etop input{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;}\n .epanel .etop input::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .etop textarea{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;\n resize:none;font-family:inherit;line-height:1.45;max-height:96px;padding:0;}\n .epanel .etop textarea::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .ehead{display:flex;align-items:center;gap:8px;padding:8px 10px;color:var(--pa-surface-contrast, #cfc8bb);font-size:12.5px;user-select:none;}\n .epanel .ehead .back{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;border:none;border-radius:8px;background:transparent;color:var(--pa-surface-contrast, #ece7df);cursor:pointer;}\n .epanel .ehead .back:hover{background:var(--pa-hover, rgba(255,255,255,0.06));}\n .epanel .ehead .name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,Menlo,monospace;background:var(--pa-selected, #3f372c);color:var(--pa-accent-contrast, #f1f0ed);border-radius:8px;padding:3px 8px;}\n .epanel .ehead .grip{margin-left:auto;color:var(--pa-muted, #6f685c);letter-spacing:2px;font-size:12px;cursor:move;padding:4px;}\n .prop-filter{display:flex;align-items:center;margin:8px 12px 4px;padding:7px 10px;border:1px solid var(--pa-border, #3a352f);border-radius:10px;background:var(--pa-field, #1d1b19);}\n .prop-filter input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13px;}\n .prop-filter input::placeholder{color:var(--pa-muted, #8a8275);}\n .einstruct{padding:0 12px 6px;}\n .einstruct input{width:100%;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:12.5px;}\n .einstruct input::placeholder{color:var(--pa-muted, #8a8275);}\n .prow{display:grid;grid-template-columns:16px minmax(88px,0.85fr) minmax(0,1.3fr);align-items:center;gap:8px;padding:5px 12px;}\n .prow[hidden]{display:none;}\n .prow .pname{font-size:12px;color:var(--pa-muted, #a9a194);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,Menlo,monospace;}\n .prow input[type=checkbox]{width:14px;height:14px;margin:0;accent-color:var(--pa-accent, #7c2d34);}\n .mbox{display:grid;grid-template-columns:1fr 1fr;gap:4px;}\n .mbox input{min-width:0;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:8px;color:var(--pa-surface-contrast, #ece7df);padding:6px 8px;font-size:12px;font-family:ui-monospace,Menlo,monospace;}\n .erows{max-height:46vh;overflow:auto;padding:2px 0 4px;}\n .erow{display:flex;align-items:center;gap:10px;padding:6px 14px;}\n .erow>span.lb{width:64px;flex-shrink:0;font-size:12.5px;color:var(--pa-muted, #a9a194);}\n .erow .ctl{flex:1;min-width:0;}\n .efield{width:100%;display:flex;align-items:center;gap:8px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);\n border-radius:9px;padding:7px 10px;transition:border-color .12s;}\n .efield:focus-within{border-color:var(--pa-accent, #7c2d34);}\n .efield input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);\n font-size:12.5px;font-family:ui-monospace,Menlo,monospace;}\n .sw{width:22px;height:22px;border-radius:50%;flex-shrink:0;border:1px solid var(--pa-border, rgba(255,255,255,0.28));cursor:pointer;\n background-image:linear-gradient(45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(-45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pa-checker, #555) 75%),linear-gradient(-45deg,transparent 75%,var(--pa-checker, #555) 75%);\n background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0;position:relative;overflow:hidden;}\n .sw i{position:absolute;inset:0;border-radius:50%;}\n .sw:focus-within{outline:2px solid var(--pa-selected, #f1f0ed);outline-offset:2px;}\n .color-hit{position:absolute;inset:0;width:100%!important;height:100%;opacity:0;cursor:pointer;pointer-events:auto;}\n .stepper{display:grid;grid-template-columns:30px minmax(48px,1fr) auto 30px;align-items:center;gap:4px;padding:3px;}\n .stepper button{width:30px;height:30px;border:0;border-radius:7px;background:var(--pa-field, #2b2723);color:var(--pa-surface-contrast, #ece7df);cursor:pointer;\n display:flex;align-items:center;justify-content:center;transition:background .12s,color .12s;}\n .stepper button:hover:not(:disabled){background:var(--pa-hover, #3b352e);color:var(--pa-surface-contrast, #fff);}\n .stepper button:disabled{opacity:.34;cursor:default;}\n .stepper button svg{width:14px;height:14px;pointer-events:none;}\n .stepper input[type=number]{width:100%;text-align:center;font-variant-numeric:tabular-nums;appearance:textfield;}\n .stepper input[type=number]::-webkit-inner-spin-button,.stepper input[type=number]::-webkit-outer-spin-button{appearance:none;margin:0;}\n .stepper .unit{min-width:18px;color:var(--pa-muted, #8a8275);font-size:11px;text-align:left;}\n .ebar{display:flex;align-items:center;padding:11px 14px;border-top:1px solid var(--pa-border, #332f29);gap:10px;}\n .ebar .cancel{background:transparent;border:1px solid var(--pa-border, #4a443c);color:var(--pa-surface-contrast, #cfc8bb);border-radius:999px;\n padding:6px 16px;font-size:13px;cursor:pointer;transition:background .12s;}\n .ebar .cancel:hover{background:var(--pa-hover, rgba(255,255,255,0.06));}\n .ebar .ok{margin-left:auto;width:36px;height:36px;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);border:none;\n cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:17px;line-height:1;transition:background .12s;}\n .ebar .ok:hover{background:var(--pa-hover, #f0ece4);}\n .ebar .ok:disabled{opacity:.55;cursor:default;}\n .epanel .dd-btn{background:var(--pa-field, #1d1b19);border-color:var(--pa-border, #3a352f);color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-btn:hover{border-color:var(--pa-border, #5a5347);}\n .epanel .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.18));}\n .epanel .dd-btn .chev{color:var(--pa-muted, #8a8275);}\n .epanel .dd-menu{background:var(--pa-field, #2b2723);border-color:var(--pa-border, #3a352f);}\n .epanel .dd-item{color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-item:hover{background:var(--pa-hover, #37322b);}\n .epanel .dd-item.sel{background:var(--pa-selected, #3f372c);color:var(--pa-accent-contrast, #f1f0ed);}\n .quick-target{padding:10px 14px 0;color:var(--pa-muted, #a9a194);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}\n .quick-more{background:transparent;border:0;color:var(--pa-surface-contrast, #cfc8bb);cursor:pointer;padding:8px 14px;text-align:left;font-size:12px;}\n .advanced{border-top:1px solid var(--pa-border, #332f29);padding:4px 0;}\n .advanced[hidden]{display:none;}\n .advanced textarea{width:100%;min-height:54px;resize:vertical;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:8px;font-size:12px;}\n .advanced select{width:100%;min-height:34px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:6px 8px;}\n @media (prefers-reduced-motion: reduce){\n *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}\n }\n`;function Et(e){let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");return t.setAttribute(\"viewBox\",\"0 0 16 16\"),t.setAttribute(\"width\",\"14\"),t.setAttribute(\"height\",\"14\"),t.setAttribute(\"aria-hidden\",\"true\"),e(t),t}function Cr(){return Et((e)=>{for(let[t,n]of[[5.5,3],[10.5,3],[5.5,8],[10.5,8],[5.5,13],[10.5,13]]){let i=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");i.setAttribute(\"cx\",String(t)),i.setAttribute(\"cy\",String(n)),i.setAttribute(\"r\",\"1.15\"),i.setAttribute(\"fill\",\"currentColor\"),e.appendChild(i)}})}function Cn(){return Et((e)=>{let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");t.setAttribute(\"d\",\"M4 4l8 8M12 4l-8 8\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"stroke\",\"currentColor\"),t.setAttribute(\"stroke-width\",\"1.8\"),t.setAttribute(\"stroke-linecap\",\"round\"),e.appendChild(t)})}function kn(e,t){let n=e.annotationRegionV2!==!1,i=\"__uibotAnnotatorActive\",a=window;if(a.__uibotAnnotatorActive)return;a.__uibotAnnotatorActive=!0;let c=hn(t.recordPerformance?.bind(t)),s=()=>{return},u=document.createElement(\"div\");u.id=\"__uibot-annotator-host\",u.style.cssText=\"position:fixed;inset:0;z-index:2147483646;pointer-events:none;color-scheme:dark;\",at(u,e.theme);let b=u.attachShadow({mode:\"open\"});(document.documentElement||document.body).appendChild(u);let C=document.createElement(\"style\");C.textContent=xn,b.appendChild(C);let A=document.createElement(\"div\");b.appendChild(A);let I=document.createElement(\"div\");I.className=\"hl\",I.style.display=\"none\";let k=document.createElement(\"div\");k.className=\"tag\",k.style.display=\"none\";let T=document.createElement(\"div\");T.className=\"selbox\",T.style.display=\"none\";let R=document.createElement(\"div\");R.className=\"pin active\",R.style.display=\"none\";let O=document.createElement(\"button\");O.type=\"button\",O.className=\"sel-clear\",O.style.display=\"none\",O.setAttribute(\"aria-label\",\"\u53D6\u6D88\u9009\u62E9\"),O.title=\"\u53D6\u6D88\u9009\u62E9\",O.appendChild(Cn()),O.addEventListener(\"click\",(r)=>{r.preventDefault(),r.stopPropagation(),Ct(!0)});let F=document.createElement(\"div\");F.className=\"region-box\";let Y=document.createElement(\"span\");Y.className=\"region-size\",F.appendChild(Y);let v=document.createElement(\"div\");v.className=\"sr-live\",v.setAttribute(\"aria-live\",\"polite\"),A.append(I,k,T,R,O,F,v);let E=null;function M(r,o){E=r,R.textContent=String(o),N()}function S(){E=null,T.style.display=\"none\",R.style.display=\"none\",O.style.display=\"none\"}function N(){if(!E)return;let r=E.getBoundingClientRect();T.style.display=\"block\",T.style.left=`${r.left-1}px`,T.style.top=`${r.top-1}px`,T.style.width=`${r.width+2}px`,T.style.height=`${r.height+2}px`,R.style.display=\"flex\",R.style.left=`${Math.max(2,r.left-6)}px`,R.style.top=`${Math.max(2,r.top-6)}px`,O.style.display=\"flex\",O.style.left=`${Math.min(window.innerWidth-26,Math.max(2,r.right-6))}px`,O.style.top=`${Math.max(2,r.top-16)}px`}let D=document.createElement(\"div\");D.className=\"bar\";let H=document.createElement(\"button\");H.type=\"button\",H.className=\"grip\",H.setAttribute(\"aria-label\",\"\u62D6\u52A8\u5DE5\u5177\u680F\"),H.title=\"\u62D6\u52A8\",H.appendChild(Cr());let G=document.createElement(\"div\");G.className=\"seg\";let ae=document.createElement(\"button\");ae.type=\"button\",ae.dataset.tool=\"element\",ae.textContent=\"\u5143\u7D20\",ae.className=\"on\";let K=document.createElement(\"button\");K.type=\"button\",K.dataset.tool=\"region\",K.textContent=\"\u533A\u57DF\",K.disabled=!n,K.title=n?\"\u6846\u9009\u533A\u57DF\":\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\";let Q=document.createElement(\"button\");Q.type=\"button\",Q.dataset.tool=\"adjust\",Q.textContent=\"\u8C03\u6574\",G.append(ae,K,Q);let se=document.createElement(\"button\");se.type=\"button\",se.className=\"exit\",se.setAttribute(\"aria-label\",\"\u9000\u51FA\"),se.title=\"\u9000\u51FA\",se.appendChild(Cn()),D.append(H,G,se),A.appendChild(D);let ge=It(D,H),le={current:()=>{return}},m=yn(A,{onSave:(r)=>le.current(r)}),h=\"element\",x=\"hovering\",j=null,w=null,oe=null,X=!1,_e=null,ye=null;function ft(){if(_e&&ye!=null)try{_e.releasePointerCapture?.(ye)}catch{}_e=null,ye=null}function Vt(){ft(),oe=null,X=!1,w=null,F.style.display=\"none\"}function Re(r){if(r===\"region\"&&!n)return;if(r===h)return;Ct(!0),h=r,ae.classList.toggle(\"on\",h===\"element\"),K.classList.toggle(\"on\",h===\"region\"),Q.classList.toggle(\"on\",h===\"adjust\"),ht(),F.style.display=\"none\",w=null,oe=null,X=!1,ft(),m.setActive(h===\"region\")}ae.addEventListener(\"click\",()=>Re(\"element\")),K.addEventListener(\"click\",()=>Re(\"region\")),Q.addEventListener(\"click\",()=>Re(\"adjust\"));function he(r,o,l){return Math.min(l,Math.max(o,r))}function zr(r,o){let l=he(r.x,0,window.innerWidth),d=he(r.y,0,window.innerHeight),f=he(o.x,0,window.innerWidth),g=he(o.y,0,window.innerHeight),p={x:Math.min(l,f),y:Math.min(d,g),width:Math.abs(f-l),height:Math.abs(g-d)};return p.width>=8&&p.height>=8?p:null}function yt(r){F.style.display=\"block\",F.style.left=`${r.x}px`,F.style.top=`${r.y}px`,F.style.width=`${r.width}px`,F.style.height=`${r.height}px`,Y.textContent=`${Math.round(r.width)} \u00D7 ${Math.round(r.height)}`,v.textContent=`\u533A\u57DF x ${Math.round(r.x)}\uFF0Cy ${Math.round(r.y)}\uFF0C\u5BBD ${Math.round(r.width)}\uFF0C\u9AD8 ${Math.round(r.height)}`}function Bn(r){let o=[[r.x+r.width/2,r.y+r.height/2],[r.x+1,r.y+1],[r.x+r.width-1,r.y+r.height-1]],l=[];return o.forEach(([d,f])=>{let g=document.elementFromPoint(d,f);if(!g||nt(g)||l.some((p)=>p.tagName===g.tagName.toLowerCase()))return;l.push({tagName:g.tagName.toLowerCase(),...fe(g.textContent||\"\",60)?{text:fe(g.textContent||\"\",60)}:{},...g.getAttribute(\"role\")?{role:g.getAttribute(\"role\")}:{}})}),l}function jt(r,o=[]){let l={x:Math.round(r.x+window.scrollX),y:Math.round(r.y+window.scrollY),width:Math.round(r.width),height:Math.round(r.height)},d={width:window.innerWidth,height:window.innerHeight},f={x:window.scrollX,y:window.scrollY},g=mn(o,window.scrollX,window.scrollY);return{comment:\"\",type:\"other\",priority:\"medium\",target:{kind:\"region\",rect:l,viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,topLevelElements:Bn(r),...g.length?{marks:g}:{}},styleSummary:{},geometry:{viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2)},visible:!0},pageContext:At()}}function zt(r){let o=r.getBoundingClientRect();I.style.display=\"block\",I.style.left=`${o.left}px`,I.style.top=`${o.top}px`,I.style.width=`${o.width}px`,I.style.height=`${o.height}px`;let l=Array.from(r.classList).slice(0,2).join(\".\");k.textContent=`${r.tagName.toLowerCase()}${l?\".\"+l:\"\"} \u00B7 ${Math.round(o.width)}\u00D7${Math.round(o.height)}`,k.style.display=\"block\";let d=o.top>22?o.top-20:o.bottom+4;k.style.left=`${Math.max(2,o.left)}px`,k.style.top=`${d}px`}function ht(){I.style.display=\"none\",k.style.display=\"none\"}function Le(r){let o=document.createElement(\"div\");o.className=\"toast\",o.style.background=\"var(--pa-success, #15803d)\",o.style.color=\"var(--pa-success-contrast, #fff)\",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1600)}let qt={blocker:0,high:1,medium:2,low:3},Se=[];function Vn(r){let o=r.getBoundingClientRect(),l=document.createElement(\"div\");l.className=\"flash\",l.style.left=`${o.left-2}px`,l.style.top=`${o.top-2}px`,l.style.width=`${o.width+4}px`,l.style.height=`${o.height+4}px`,A.appendChild(l),setTimeout(()=>l.remove(),1300)}function bt(r,o){let l=r.kind===\"element\"?document.querySelector(r.cssSelector):null;if(r.kind===\"element\"&&!l){o.style.display=\"none\";return}let d=l?.getBoundingClientRect()??{left:r.kind===\"region\"?r.rect.x-window.scrollX:0,top:r.kind===\"region\"?r.rect.y-window.scrollY:0,width:r.kind===\"region\"?r.rect.width:0,height:r.kind===\"region\"?r.rect.height:0};if(d.width===0&&d.height===0){o.style.display=\"none\";return}o.style.display=\"flex\",o.style.left=`${Math.max(2,d.left-6)}px`,o.style.top=`${Math.max(2,d.top-6)}px`}function $t(){for(let r of Se)r.pinEl.remove();Se=[]}function jn(r){$t(),r.filter((l)=>l.status===\"open\"||l.status===\"processing\").sort((l,d)=>(qt[l.priority]??9)-(qt[d.priority]??9)||(l.createdAt||\"\").localeCompare(d.createdAt||\"\")).forEach((l,d)=>{if(!l.target||l.target.kind===\"element\"&&!l.target.cssSelector)return;let f=document.createElement(\"div\");f.className=\"pin marker\",f.textContent=String(d+1),f.title=l.comment||\"\",f.addEventListener(\"click\",(g)=>{g.stopPropagation();let p=l.target.kind===\"element\"?document.querySelector(l.target.cssSelector):null;if(p)p.scrollIntoView({block:\"center\"}),Vn(p),Le(l.comment?`#${d+1} ${l.comment}`:`#${d+1}`),bt(l.target,f);else if(l.target.kind===\"region\")window.scrollTo({top:Math.max(0,l.target.rect.y-window.innerHeight/2),left:l.target.rect.x}),yt({x:l.target.rect.x-window.scrollX,y:l.target.rect.y-window.scrollY,width:l.target.rect.width,height:l.target.rect.height}),setTimeout(()=>{if(!w)F.style.display=\"none\"},1300),Le(l.comment?`#${d+1} ${l.comment}`:`#${d+1}`);else ee(`#${d+1} \u5143\u7D20\u672A\u627E\u5230\uFF08\u9875\u9762\u53EF\u80FD\u5DF2\u53D8\u5316\uFF09`)}),A.appendChild(f),Se.push({target:l.target,pinEl:f}),bt(l.target,f)})}async function Fe(){let r=c.start(\"markers_loaded\");try{let o=await t.sendMessage({action:U.list,pageUrl:location.href});if(o&&o.success&&Array.isArray(o.data))jn(o.data),r(\"success\");else r(\"failure\")}catch{r(\"failure\")}}let be=[];function zn(r,o,l){let d=o,f=document.createElement(\"div\");f.className=\"dd\";let g=document.createElement(\"button\");g.type=\"button\",g.className=\"dd-btn\";let p=document.createElement(\"span\");p.className=\"v\";let y=document.createElement(\"span\");y.className=\"chev\",y.textContent=\"\u25BE\",g.append(p,y);let P=document.createElement(\"div\");P.className=\"dd-menu\",P.style.display=\"none\";function z(){let V=r.find((B)=>B.value===d);if(p.textContent=\"\",V?.color){let B=document.createElement(\"span\");B.className=\"swatch\",B.style.background=V.color,p.appendChild(B)}p.appendChild(document.createTextNode(V?.label??\"\")),Array.from(P.children).forEach((B,ne)=>{B.classList.toggle(\"sel\",r[ne].value===d)})}function L(){P.style.display=\"none\",g.classList.remove(\"open\")}function de(){for(let V of be)V();P.style.display=\"block\",g.classList.add(\"open\")}return be.push(L),r.forEach((V)=>{let B=document.createElement(\"button\");if(B.type=\"button\",B.className=\"dd-item\",V.color){let ne=document.createElement(\"span\");ne.className=\"swatch\",ne.style.background=V.color,B.appendChild(ne)}B.appendChild(document.createTextNode(V.label)),B.addEventListener(\"click\",(ne)=>{ne.stopPropagation(),d=V.value,z(),L(),l?.(d)}),P.appendChild(B)}),g.addEventListener(\"click\",(V)=>{V.stopPropagation(),P.style.display===\"none\"?de():L()}),f.append(g,P),z(),{el:f,get:()=>d,set:(V)=>{d=V,z()},close:L}}let qn=[{value:\"style\",label:\"\u6837\u5F0F\u95EE\u9898\"},{value:\"copywriting\",label:\"\u6587\u6848\u4FEE\u6539\"},{value:\"bug\",label:\"Bug\"},{value:\"feature\",label:\"\u529F\u80FD\u5EFA\u8BAE\"},{value:\"interaction\",label:\"\u4EA4\u4E92\u95EE\u9898\"},{value:\"data\",label:\"\u6570\u636E\u95EE\u9898\"},{value:\"other\",label:\"\u5176\u4ED6\"}],$n=[{value:\"low\",label:\"\u4F4E\",color:\"var(--pa-muted, #737373)\"},{value:\"medium\",label:\"\u4E2D\",color:\"var(--pa-surface-contrast, #17171a)\"},{value:\"high\",label:\"\u9AD8\",color:\"var(--pa-accent, #7c2d34)\"},{value:\"blocker\",label:\"\u963B\u585E\",color:\"var(--pa-danger, #5c151c)\"}],W=null,Z=null,Be=null,Ve=null,je=null,ze=null,ce=null;function Ut(r){let o=document.createElement(\"button\");return o.type=\"button\",o.className=\"ok\",o.dataset.icon=\"confirm\",o.textContent=\"\u2713\",o.title=r,o.setAttribute(\"aria-label\",r),o}function Pe(r,o){if(!r)return;r.textContent=o?\"\u2026\":\"\u2713\",r.toggleAttribute(\"aria-busy\",o),r.disabled=o}function Ht(r){for(let o of[\"data-component\",\"data-uibot-component\",\"data-testid\"]){let l=r.getAttribute(o)?.trim();if(l)return l.slice(0,48)}return r.tagName.toLowerCase()}function Un(){return Et((r)=>{let o=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");o.setAttribute(\"d\",\"M10 3L5 8l5 5\"),o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"currentColor\"),o.setAttribute(\"stroke-width\",\"1.8\"),o.setAttribute(\"stroke-linecap\",\"round\"),o.setAttribute(\"stroke-linejoin\",\"round\"),r.appendChild(o)})}function Wt(r,o){let l=document.createElement(\"div\");l.className=\"ehead\";let d=document.createElement(\"button\");d.type=\"button\",d.className=\"back\",d.setAttribute(\"aria-label\",\"\u53D6\u6D88\u9009\u62E9\"),d.title=\"\u53D6\u6D88\u9009\u62E9\",d.appendChild(Un()),d.addEventListener(\"click\",(g)=>{g.preventDefault(),g.stopPropagation(),o()});let f=document.createElement(\"span\");return f.className=\"name\",f.textContent=r,f.title=r,l.append(d,f),l}function Ze(){W?.remove(),W=null,Z=Be=Ve=ce=null,je=ze=null,be.length=0,S(),F.style.display=\"none\",x=\"hovering\",j=null,w=null,X=!1}function Kt(r,o){if(o&&!n)return;if(x=\"editing\",j=r,w=o??null,ht(),r)M(r,Se.length+1);else S();if(o)yt(o);let l=r?.getBoundingClientRect(),d=l?{left:l.left,top:l.top,right:l.right,bottom:l.bottom}:o?{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height}:{left:8,top:80,right:8,bottom:80};be.length=0,W=document.createElement(\"div\"),W.className=\"epanel\",W.setAttribute(\"role\",\"dialog\"),W.setAttribute(\"aria-modal\",\"true\"),W.setAttribute(\"aria-label\",o?\"\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8\":\"\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8\"),W.addEventListener(\"click\",()=>{for(let _ of be)_()});let f=Wt(o?`\u533A\u57DF ${Math.round(o.width)}\u00D7${Math.round(o.height)}`:Ht(r),Ze),g=document.createElement(\"div\");g.className=\"etop\",Z=document.createElement(\"textarea\"),Z.rows=3,Z.placeholder=\"\u54EA\u91CC\u4E0D\u5BF9\uFF1F\u8BF4\u660E\u671F\u671B\u5373\u53EF\uFF0C\u4F8B\u5982\uFF1A\u79FB\u52A8\u7AEF\u6309\u94AE\u6587\u5B57\u6362\u884C\uFF1B\u80FD\u653E\u4E0B\u65F6\u4FDD\u6301\u5355\u884C\uFF0C\u4E14\u5361\u7247\u9AD8\u5EA6\u4E0D\u53D8\u3002\",Z.addEventListener(\"input\",()=>{if(Z.style.height=\"auto\",Z.style.height=`${Math.min(Math.max(Z.scrollHeight,72),144)}px`,ce)ce.disabled=!Z.value.trim()}),g.append(Z);let p=document.createElement(\"button\");p.type=\"button\",p.dataset.action=\"more\",p.className=\"quick-more\",p.textContent=\"\u66F4\u591A\u8BBE\u7F6E \u25BE\",p.setAttribute(\"aria-expanded\",\"false\");let y=document.createElement(\"div\");y.className=\"advanced\",y.id=\"__uibot-annotation-advanced\",y.hidden=!0,p.setAttribute(\"aria-controls\",y.id);let P=(_,me)=>{let xe=document.createElement(\"label\");xe.className=\"erow\";let Te=document.createElement(\"span\");Te.className=\"lb\",Te.textContent=_;let Ne=document.createElement(\"div\");return Ne.className=\"ctl\",Ne.append(me),xe.append(Te,Ne),xe};Be=document.createElement(\"textarea\"),Be.placeholder=\"\u4F8B\u5982\uFF1A\u5BBD\u5EA6\u8DB3\u591F\u65F6\u4FDD\u6301\u5355\u884C\",Ve=document.createElement(\"textarea\"),Ve.placeholder=\"\u4F8B\u5982\uFF1A\u5361\u7247\u9AD8\u5EA6\u548C\u70B9\u51FB\u884C\u4E3A\u4E0D\u53D8\",je=document.createElement(\"select\");for(let _ of qn)je.add(new Option(_.label,_.value,!1,_.value===\"other\"));ze=document.createElement(\"select\");for(let _ of $n)ze.add(new Option(_.label,_.value,!1,_.value===\"medium\"));y.append(P(\"\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09\",Be),P(\"\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09\",Ve),P(\"\u7C7B\u578B\",je),P(\"\u4F18\u5148\u7EA7\",ze)),p.addEventListener(\"click\",(_)=>{_.stopPropagation(),y.hidden=!y.hidden,p.textContent=y.hidden?\"\u66F4\u591A\u8BBE\u7F6E \u25BE\":\"\u6536\u8D77\u8BBE\u7F6E \u25B4\",p.setAttribute(\"aria-expanded\",String(!y.hidden))});let z=document.createElement(\"div\");z.className=\"ebar\";let L=document.createElement(\"button\");L.type=\"button\",L.className=\"cancel\",L.textContent=\"\u53D6\u6D88\",L.addEventListener(\"click\",Ze),ce=Ut(\"\u4FDD\u5B58\u6807\u6CE8\"),ce.dataset.action=\"save\",ce.disabled=!0,ce.addEventListener(\"click\",()=>void Yt()),z.append(L,ce),W.append(f,g,p,y,z),W.addEventListener(\"keydown\",(_)=>{if(_.key===\"Enter\"&&(_.ctrlKey||_.metaKey)){if(_.preventDefault(),!ce?.disabled)Yt();return}if(_.key!==\"Tab\")return;let me=[...W.querySelectorAll(\"button:not([disabled]),textarea:not([disabled]),select:not([disabled]),input:not([disabled])\")].filter((er)=>!er.closest(\"[hidden]\"));if(!me.length)return;let xe=me[0],Te=me[me.length-1],Ne=b.activeElement;if(_.shiftKey&&Ne===xe)_.preventDefault(),Te.focus();else if(!_.shiftKey&&Ne===Te)_.preventDefault(),xe.focus()}),A.appendChild(W);let de=360,V=d.left,B=d.bottom+10;if(V+de>window.innerWidth-8)V=window.innerWidth-de-8;if(V<8)V=8;let ne=W.offsetHeight||300;if(B+ne>window.innerHeight-8)B=Math.max(8,d.top-ne-10);W.style.left=`${V}px`,W.style.top=`${B}px`,Z.focus()}async function Yt(){if(!j&&!w||!Z)return;if(w&&!n){ee(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let r=Z.value.trim();if(!r){ee(\"\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9\"),Z.focus();return}let o=w?jt(w):wt(j);o.comment=r,o.type=je?.value??\"other\",o.priority=ze?.value??\"medium\";let l=Be?.value.trim();if(l)o.expectedResult=l;let d=Ve?.value.trim();if(d)o.preserve=d;u.style.visibility=\"hidden\";let f=ce;Pe(f,!0);let g=c.start(\"save_durable\");try{let p=await t.sendMessage({action:U.save,data:o});if(u.style.visibility=\"visible\",p&&p.success){g(\"success\"),Ze(),Fe(),Le(\"\u5DF2\u4FDD\u5B58\");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:o}).catch(()=>{})}else g(\"failure\"),console.error(\"[uibot annotation] save rejected:\",p),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Pe(f,!1)}catch(p){g(\"failure\"),u.style.visibility=\"visible\",console.error(\"[uibot annotation] save threw:\",p);let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),Pe(f,!1)}}async function Hn(r){if(!n){ee(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let o=Ke(r.marks,0),l=o?Pt(o,{width:window.innerWidth,height:window.innerHeight}):null;if(!l){ee(\"\u8BF7\u5148\u6846\u9009\u533A\u57DF\u6216\u6DFB\u52A0\u7BAD\u5934/\u6587\u672C\");return}let d=r.comment.trim()||gn(r.marks),f=jt(l,r.marks);f.comment=d,m.setBusy(!0),u.classList.add(\"capturing\"),m.setCapturing(!0);let g=c.start(\"save_durable\");try{let p=await t.sendMessage({action:U.save,data:f});if(p&&p.success){g(\"success\");let y=p.data?.id,P=Pt(Ke(r.marks,16)??l,{width:window.innerWidth,height:window.innerHeight}),z=!0;if(y&&P&&t.captureRegion)await new Promise((L)=>{requestAnimationFrame(()=>requestAnimationFrame(()=>L()))}),z=await t.captureRegion({id:y,...P}).catch(()=>!1);if(m.clear(),m.setBusy(!1),Fe(),z)Le(\"\u5DF2\u4FDD\u5B58\");else ee(\"\u6807\u6CE8\u5DF2\u4FDD\u5B58\uFF0C\u622A\u56FE\u672A\u5B8C\u6210\");if(y)t.sendMessage({action:U.enrich,annotationId:y,data:f}).catch(()=>{})}else g(\"failure\"),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),m.setBusy(!1)}catch(p){g(\"failure\");let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),m.setBusy(!1)}finally{u.classList.remove(\"capturing\"),m.setCapturing(!1)}}le.current=(r)=>{Hn(r)};function ee(r){let o=document.createElement(\"div\");o.className=\"toast\",o.style.background=\"var(--pa-danger, #b91c1c)\",o.style.color=\"var(--pa-danger-contrast, #fff)\",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1800)}let te=null,Je=null,Ae=null,qe=null,Qe=[],$e=[];function Gt(r){let o=r.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);if(!o){let d=document.createElement(\"span\");if(d.style.color=r,!d.style.color)d.style.color=\"var(--pa-color-default, #000000)\";b.appendChild(d);let f=getComputedStyle(d).color;d.remove();let g=document.createElement(\"canvas\").getContext(\"2d\");if(!g)return\"#000000\";if(g.fillStyle=f,/^#[0-9a-f]{6}$/i.test(g.fillStyle))return g.fillStyle;g.fillRect(0,0,1,1);let p=g.getImageData(0,0,1,1).data;return`#${[p[0],p[1],p[2]].map((y)=>(y??0).toString(16).padStart(2,\"0\")).join(\"\")}`}let l=(d)=>Math.max(0,Math.min(255,Number.parseInt(d,10))).toString(16).padStart(2,\"0\");return`#${l(o[1])}${l(o[2])}${l(o[3])}`}function et(r,o){let l=r.style.getPropertyValue(o),d=()=>{if(l)r.style.setProperty(o,l);else r.style.removeProperty(o)};return $e.push(d),{revert:d,apply:(f)=>{r.style.setProperty(o,f)}}}function Ue(r){let o=document.createElement(\"div\");o.className=\"prow\",o.dataset.filter=r.filter.toLowerCase();let l=document.createElement(\"input\");l.type=\"checkbox\",l.setAttribute(\"aria-label\",`\u9009\u62E9 ${r.name}`);let d=document.createElement(\"span\");d.className=\"pname\",d.textContent=r.name,d.title=r.name;let f=()=>{l.checked=!0,r.apply()};return l.addEventListener(\"change\",()=>{if(l.checked){if(r.read()!==r.before)r.apply()}else r.revert(),r.reset()}),r.control.addEventListener(\"input\",()=>{f()}),r.onReady?.(f),o.append(l,d,r.control),Qe.push({kind:r.kind,label:r.name,before:r.before,read:r.read,selected:()=>l.checked,...r.property===void 0?{}:{property:r.property}}),o}function xt(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"label\");g.className=\"sw\";let p=document.createElement(\"i\");p.style.background=l||\"transparent\",g.appendChild(p);let y=document.createElement(\"input\");y.value=l,y.setAttribute(\"aria-label\",o);let P=document.createElement(\"input\");P.type=\"color\",P.value=Gt(l||\"#000000\"),P.className=\"color-hit\",P.setAttribute(\"aria-label\",`\u9009\u62E9${o}`);let z=(L)=>{p.style.background=L||\"transparent\"};return P.addEventListener(\"input\",()=>{y.value=P.value,z(P.value)}),y.addEventListener(\"input\",()=>{z(y.value)}),g.appendChild(P),f.append(g,y),Ue({name:o,filter:o,control:f,kind:\"style\",property:o,before:l,read:()=>y.value.trim(),reset:()=>{y.value=l,z(l),P.value=Gt(l||\"#000000\")},apply:()=>d.apply(y.value.trim()),revert:d.revert})}function Ie(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"input\");return g.value=l,g.setAttribute(\"aria-label\",o),f.appendChild(g),Ue({name:o,filter:o,control:f,kind:\"style\",property:o,before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>d.apply(g.value.trim()),revert:d.revert})}function Ee(r,o,l){let d=getComputedStyle(r).getPropertyValue(o).trim(),f=et(r,o),g=[...l];if(d&&!g.includes(d))g.unshift(d);let p=g.includes(d)?d:g[0]??\"\",y=p,P=()=>{},z=zn(g.map((L)=>({value:L,label:L})),p,(L)=>{y=L,P()});return Ue({name:o,filter:o,control:z.el,kind:\"style\",property:o,before:d,read:()=>y,reset:()=>{y=p,z.set(p)},apply:()=>f.apply(y),revert:f.revert,onReady:(L)=>{P=L}})}function Wn(r){let o=[\"top\",\"right\",\"bottom\",\"left\"],l=o.map((p)=>getComputedStyle(r).getPropertyValue(`margin-${p}`).trim()),d=o.map((p)=>et(r,`margin-${p}`)),f=o.map((p,y)=>{let P=document.createElement(\"input\");return P.value=l[y]??\"\",P.setAttribute(\"aria-label\",`margin-${p}`),P}),g=document.createElement(\"div\");return g.className=\"mbox\",g.append(...f),Ue({name:\"margin\",filter:\"margin\",control:g,kind:\"style\",property:\"margin\",before:l.join(\" \"),read:()=>f.map((p)=>p.value.trim()).join(\" \"),reset:()=>{f.forEach((p,y)=>{p.value=l[y]??\"\"})},apply:()=>{for(let[p,y]of f.entries())d[p]?.apply(y.value.trim())},revert:()=>{for(let p of d)p.revert()}})}function Kn(r){if(r.children.length>0||!(r.textContent||\"\").trim())return null;let o=r.textContent||\"\",l=o.replace(/\\s+/g,\" \").trim(),d=()=>{r.textContent=o};$e.push(d);let f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"input\");return g.value=l,g.setAttribute(\"aria-label\",\"\u6587\u6848\"),f.appendChild(g),Ue({name:\"\u6587\u6848\",filter:\"\u6587\u6848 text\",control:f,kind:\"text\",before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>{r.textContent=g.value},revert:d})}let He=()=>{return};function tt(r){if(r)$e.forEach((o)=>{try{o()}catch{}});$e.length=0,Qe=[],He(),He=()=>{return},te?.remove(),te=null,Je=null,Ae=qe=null,be.length=0,S(),x=\"hovering\",j=null}function Ct(r){if(W)Ze();if(te)tt(r)}function Yn(r){x=\"editing\",j=r,Je=r,ht(),M(r,Se.length+1),Qe=[],$e.length=0,be.length=0;let o=r.getBoundingClientRect();te=document.createElement(\"div\"),te.className=\"epanel\",te.addEventListener(\"click\",()=>{for(let _ of be)_()});let l=Wt(Ht(r),()=>tt(!0)),d=document.createElement(\"span\");d.className=\"grip\",d.textContent=\"\u283F\",d.setAttribute(\"aria-hidden\",\"true\"),l.appendChild(d);let f=document.createElement(\"label\");f.className=\"prop-filter\";let g=document.createElement(\"input\");g.placeholder=\"\u7B5B\u9009\u5C5E\u6027\",g.setAttribute(\"aria-label\",\"\u7B5B\u9009\u5C5E\u6027\"),f.appendChild(g);let p=document.createElement(\"div\");p.className=\"einstruct\",Ae=document.createElement(\"input\"),Ae.placeholder=\"\u7528\u4E00\u53E5\u8BDD\u63CF\u8FF0\u60F3\u8981\u7684\u4FEE\u6539\uFF08\u53EF\u9009\uFF09\",Ae.setAttribute(\"aria-label\",\"\u4FEE\u6539\u8BF4\u660E\"),p.appendChild(Ae);let y=document.createElement(\"div\");y.className=\"erows\";let P=[xt(r,\"background-color\"),xt(r,\"border-color\"),Ie(r,\"border-width\"),Ee(r,\"border-style\",[\"none\",\"solid\",\"dashed\",\"dotted\",\"double\"]),Ie(r,\"border-radius\"),Ie(r,\"opacity\"),Wn(r),Ie(r,\"padding\"),Ie(r,\"gap\"),Ee(r,\"display\",[\"block\",\"flex\",\"inline-flex\",\"grid\",\"inline-block\",\"inline\",\"none\"]),Ee(r,\"flex-direction\",[\"row\",\"column\",\"row-reverse\",\"column-reverse\"]),Ee(r,\"flex-wrap\",[\"nowrap\",\"wrap\",\"wrap-reverse\"]),Ee(r,\"justify-content\",[\"flex-start\",\"center\",\"flex-end\",\"space-between\",\"space-around\",\"space-evenly\"]),xt(r,\"color\"),Ie(r,\"font-size\"),Ee(r,\"font-weight\",[\"300\",\"400\",\"500\",\"600\",\"700\"])],z=Kn(r);if(z)P.push(z);y.append(...P),g.addEventListener(\"input\",()=>{let _=g.value.trim().toLowerCase();for(let me of y.querySelectorAll(\".prow\")){let xe=me.dataset.filter??\"\";me.hidden=_.length>0&&!xe.includes(_)}});let L=document.createElement(\"div\");L.className=\"ebar\";let de=document.createElement(\"button\");de.type=\"button\",de.className=\"cancel\",de.textContent=\"\u53D6\u6D88\",de.addEventListener(\"click\",()=>tt(!0)),qe=Ut(\"\u4FDD\u5B58\u4FEE\u6539\"),qe.addEventListener(\"click\",()=>void Xn()),L.append(de,qe),te.append(l,f,p,y,L),A.appendChild(te),He(),He=It(te,d);let V=360,B=o.right+12;if(B+V>window.innerWidth-8)B=Math.max(8,o.left-V-12);if(B<8)B=8;let ne=Math.max(8,Math.min(o.top,window.innerHeight-(te.offsetHeight||360)-8));te.style.left=`${B}px`,te.style.top=`${ne}px`,Ae.focus()}function Gn(r){return r.map((o)=>`${o.label} ${fe(o.before,24)}\u2192${fe(o.after,24)}`).join(\"\uFF1B\")}async function Xn(){if(!Je)return;let r=Je,o=[];for(let p of Qe){if(!p.selected())continue;let y=p.read();if(y!==p.before)o.push({kind:p.kind,label:p.label,...p.property===void 0?{}:{property:p.property},before:p.before,after:y})}let l=Ae?.value.trim()||\"\";if(o.length===0&&!l){ee(\"\u672A\u505A\u4EFB\u4F55\u4FEE\u6539\");return}let d=wt(r);d.type=\"style\",d.edits=o;let f=Gn(o);if(d.comment=l||(f?`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A${f}`:\"\u53EF\u89C6\u5316\u4FEE\u6539\"),l&&f)d.expectedResult=f;u.style.visibility=\"hidden\";let g=qe;Pe(g,!0);try{let p=await t.sendMessage({action:U.save,data:d});if(u.style.visibility=\"visible\",p&&p.success){tt(!1),Fe(),Le(\"\u5DF2\u4FDD\u5B58\");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:d}).catch(()=>{})}else console.error(\"[uibot annotation] edit save rejected:\",p),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Pe(g,!1)}catch(p){u.style.visibility=\"visible\";let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),Pe(g,!1)}}function nt(r){if(!(r instanceof Node))return!1;if(u.contains(r))return!0;let o=r.getRootNode();return o instanceof ShadowRoot&&o.host===u}function Xt(r){if(x!==\"hovering\"||h===\"region\")return;let o=r.target;if(!o||nt(o)||o===u)return;j=o,zt(o)}function Zt(r){if(nt(r.target))return;let o=r.target;if(!o)return;if(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation?.(),x===\"hovering\"){if(h===\"adjust\")Yn(o);else if(h===\"element\")Kt(o)}}function Zn(){let r=b.activeElement;return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLElement&&r.isContentEditable}function Jt(r){if(Zn()||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLElement&&r.target.isContentEditable)return;if(x===\"hovering\"&&!X){if(r.key.toLowerCase()===\"e\")Re(\"element\");if(n&&r.key.toLowerCase()===\"r\")Re(\"region\");if(r.key.toLowerCase()===\"a\")Re(\"adjust\")}if(n&&h===\"region\"&&X&&w&&x===\"hovering\"){if(r.key===\"Enter\"){r.preventDefault(),X=!1,Kt(null,w);return}if(r.key.startsWith(\"Arrow\")){r.preventDefault();let l=r.shiftKey?10:1,d=r.key.replace(\"Arrow\",\"\").toLowerCase();if(r.altKey){let f=d===\"left\"?-l:d===\"right\"?l:0,g=d===\"up\"?-l:d===\"down\"?l:0;w={...w,width:he(w.width+f,8,window.innerWidth-w.x),height:he(w.height+g,8,window.innerHeight-w.y)}}else{let f=d===\"left\"?-l:d===\"right\"?l:0,g=d===\"up\"?-l:d===\"down\"?l:0;w={...w,x:he(w.x+f,0,window.innerWidth-w.width),y:he(w.y+g,0,window.innerHeight-w.height)}}yt(w);return}}if(r.key!==\"Escape\")return;if(m.isActive()&&(m.getMarks().length>0||oe||X)){m.clear(),Vt();return}if(oe||X){oe=null,X=!1,w=null,F.style.display=\"none\";return}if(x===\"editing\")Ct(!0);else ot(!0)}function Qt(r){if(!n||h!==\"region\"||x!==\"hovering\"||nt(r.target))return;let o=r;if(!m.handlePointerDown(o))return;o.preventDefault(),o.stopPropagation(),_e=o.target instanceof Element?o.target:null,ye=o.pointerId;try{_e?.setPointerCapture?.(o.pointerId)}catch{}oe={x:o.clientX,y:o.clientY},w=null,X=!1}function en(r){if(!n||h!==\"region\"||x!==\"hovering\")return;let o=r;if(!m.handlePointerMove(o))return;o.preventDefault()}function tn(r){if(!n||h!==\"region\"||x!==\"hovering\")return;let o=r;if(o.button!==0||ye!=null&&o.pointerId!==ye)return;if(m.handlePointerUp(o))o.preventDefault(),o.stopPropagation();ft(),oe=null,F.style.display=\"none\"}function nn(){m.handlePointerCancel(),Vt()}function rn(r){let o=r;if(ye!=null&&o.pointerId!==ye)return;nn()}K.addEventListener(\"keydown\",(r)=>{if(!n||r.key!==\"Enter\"||h!==\"region\")return;r.preventDefault(),r.stopPropagation();let o=Math.min(160,window.innerWidth),l=Math.min(96,window.innerHeight);w={x:Math.round((window.innerWidth-o)/2),y:Math.round((window.innerHeight-l)/2),width:o,height:l},X=!1,m.addRect(w),F.style.display=\"none\"});function rt(){if(oe)nn();if(x===\"hovering\"&&j)zt(j);if(E)N();for(let r of Se)bt(r.target,r.pinEl)}document.addEventListener(\"mousemove\",Xt,!0),document.addEventListener(\"click\",Zt,!0),document.addEventListener(\"keydown\",Jt,!0),document.addEventListener(\"pointerdown\",Qt,!0),document.addEventListener(\"pointermove\",en,!0),document.addEventListener(\"pointerup\",tn,!0),document.addEventListener(\"pointercancel\",rn,!0),window.addEventListener(\"scroll\",rt,!0),window.addEventListener(\"resize\",rt,!0),se.addEventListener(\"click\",()=>ot(!0));function ot(r){let o=c.start(\"overlay_exit\");if(s(),ge(),He(),m.detach(),document.removeEventListener(\"mousemove\",Xt,!0),document.removeEventListener(\"click\",Zt,!0),document.removeEventListener(\"keydown\",Jt,!0),document.removeEventListener(\"pointerdown\",Qt,!0),document.removeEventListener(\"pointermove\",en,!0),document.removeEventListener(\"pointerup\",tn,!0),document.removeEventListener(\"pointercancel\",rn,!0),window.removeEventListener(\"scroll\",rt,!0),window.removeEventListener(\"resize\",rt,!0),Qn(),$t(),u.remove(),delete a.__uibotAnnotatorActive,delete a.__uibotAnnotatorTeardown,o(\"success\"),r)try{t.sendMessage({action:U.closed}).catch(()=>{}),a.__uibotAnnotationClosed?.()}catch{}}function Jn(r){if(r.action===U.teardown)ot(!1);else if(r.action===U.changed)Fe()}let Qn=t.subscribe(Jn);a.__uibotAnnotatorTeardown=()=>ot(!1),c.markFromStart(\"overlay_ready\"),s=bn(()=>{Fe()})}var kr=[\"open\",\"processing\",\"done\",\"verified\",\"ignored\"],vr=[\"bug\",\"style\",\"copywriting\",\"feature\",\"interaction\",\"data\",\"other\"],Ar=[\"low\",\"medium\",\"high\",\"blocker\"],wr=[\"testid\",\"id\",\"aria\",\"class\",\"text\",\"path\"],Rr=[\"light\",\"dark\",\"unknown\"],Sr=[\"react\",\"vue\",\"angular\",\"svelte\",\"nextjs\",\"nuxt\",\"unknown\"];function J(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function we(e,t){return typeof e===\"string\"&&t.includes(e)}function Ce(e){return typeof e===\"number\"&&Number.isFinite(e)}function ke(e){return Ce(e)&&e>0}function Tt(e){return Array.isArray(e)&&e.every((t)=>typeof t===\"string\")}function An(e){return J(e)&&Object.values(e).every((t)=>typeof t===\"string\")}function q(e){return e===void 0||typeof e===\"string\"}function wn(e){if(!J(e)||!Ce(e.x)||!Ce(e.y)||!ke(e.width)||!ke(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function Nt(e){if(!J(e)||!ke(e.width)||!ke(e.height))return;return{width:e.width,height:e.height}}function Mt(e){if(!J(e)||!Ce(e.x)||!Ce(e.y))return;return{x:e.x,y:e.y}}function vn(e){if(!J(e)||typeof e.fileName!==\"string\"||!ke(e.lineNumber))return;if(e.columnNumber!==void 0&&(!Ce(e.columnNumber)||e.columnNumber<0))return;if(!q(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function Pr(e){let t=wn(e.boundingBox);if(typeof e.tagName!==\"string\"||!e.tagName||typeof e.cssSelector!==\"string\"||!e.cssSelector||typeof e.xpath!==\"string\"||!e.xpath||!An(e.attributes)||!t||!Tt(e.domPath))return;if(!q(e.textContent)||e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!we(e.selectorStrategy,wr))return;if(!q(e.region))return;let n;if(e.accessibility!==void 0){if(!J(e.accessibility)||!q(e.accessibility.role)||!q(e.accessibility.name)||!q(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let i=e.sourceLocation===void 0?void 0:vn(e.sourceLocation);if(e.sourceLocation!==void 0&&!i)return;let a;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let c=e.sourceStack.map(vn);if(c.some((s)=>!s))return;a=c.filter((s)=>Boolean(s))}return{kind:\"element\",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{sourceLocation:i}:{},...a?{sourceStack:a}:{}}}function Ir(e){let t=wn(e.rect),n=Nt(e.viewport),i=Mt(e.scroll);if(!t||t.width<8||t.height<8||!n||!i||!ke(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;let a;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;a=[];for(let s of e.topLevelElements){if(!J(s)||typeof s.tagName!==\"string\"||!s.tagName||!q(s.text)||!q(s.role))return;a.push({tagName:s.tagName,...s.text===void 0?{}:{text:s.text},...s.role===void 0?{}:{role:s.role}})}}let c=e.marks===void 0?void 0:pn(e.marks);if(e.marks!==void 0&&!c)return;return{kind:\"region\",rect:t,viewport:n,scroll:i,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...a?{topLevelElements:a}:{},...c?.length?{marks:c}:{}}}function Er(e){if(!J(e))return{ok:!1,reason:\"target is not an object\",raw:e};if(e.kind===\"region\"){let t=Ir(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid region target\",raw:e}}if(e.kind===\"element\"||e.kind===void 0){let t=Pr(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid element target\",raw:e}}return{ok:!1,reason:`unknown target kind: ${String(e.kind)}`,raw:e}}function Tr(e){if(!J(e))return;let t=Nt(e.viewport),n=Mt(e.scroll);if(!t||!n||!ke(e.devicePixelRatio)||!J(e.center)||!Ce(e.center.x)||!Ce(e.center.y)||typeof e.visible!==\"boolean\"||!q(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function Nr(e){if(!J(e))return;let{url:t,origin:n,path:i,title:a,capturedAt:c,query:s,hash:u,referrer:b,language:C,userAgent:A,uiState:I}=e,k=Nt(e.viewport),T=Mt(e.scroll);if(!k||!J(e.viewport)||!ke(e.viewport.devicePixelRatio)||!T)return;if(typeof t!==\"string\"||!t||typeof n!==\"string\"||!n||typeof i!==\"string\"||!i||typeof a!==\"string\"||typeof c!==\"string\"||!c)return;if(!q(s)||!q(u)||!q(b)||!q(C)||!q(A)||!q(I))return;if(e.theme!==void 0&&!we(e.theme,Rr))return;if(e.framework!==void 0&&!we(e.framework,Sr))return;return{url:t,origin:n,path:i,title:a,viewport:{...k,devicePixelRatio:e.viewport.devicePixelRatio},scroll:T,capturedAt:c,...s===void 0?{}:{query:s},...u===void 0?{}:{hash:u},...b===void 0?{}:{referrer:b},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...C===void 0?{}:{language:C},...A===void 0?{}:{userAgent:A},...I===void 0?{}:{uiState:I}}}function Mr(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!J(n)||!we(n.kind,[\"style\",\"text\"])||typeof n.label!==\"string\"||!q(n.property)||typeof n.before!==\"string\"||typeof n.after!==\"string\")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Ye(e){if(!J(e))return{ok:!1,reason:\"annotation is not an object\",raw:e};let{id:t,pageUrl:n,comment:i,createdAt:a,updatedAt:c}=e;if(!we(e.status,kr))return{ok:!1,reason:\"invalid status\",raw:e};if(!we(e.type,vr))return{ok:!1,reason:\"invalid type\",raw:e};if(!we(e.priority,Ar))return{ok:!1,reason:\"invalid priority\",raw:e};if(typeof t!==\"string\"||!t)return{ok:!1,reason:\"invalid id\",raw:e};if(typeof n!==\"string\"||!n)return{ok:!1,reason:\"invalid pageUrl\",raw:e};if(typeof i!==\"string\"||!i)return{ok:!1,reason:\"invalid comment\",raw:e};if(typeof a!==\"string\"||!a)return{ok:!1,reason:\"invalid createdAt\",raw:e};if(typeof c!==\"string\"||!c)return{ok:!1,reason:\"invalid updatedAt\",raw:e};if(!q(e.expectedResult)||!q(e.preserve)||!q(e.screenshot))return{ok:!1,reason:\"invalid optional annotation text\",raw:e};if(!An(e.styleSummary))return{ok:!1,reason:\"invalid styleSummary\",raw:e};let s=Tr(e.geometry);if(!s)return{ok:!1,reason:\"invalid geometry\",raw:e};let u=Nr(e.pageContext);if(!u)return{ok:!1,reason:\"invalid pageContext\",raw:e};let b=Mr(e.edits);if(!b)return{ok:!1,reason:\"invalid edits\",raw:e};let C=Er(e.target);if(!C.ok)return C;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:i,target:C.value,styleSummary:{...e.styleSummary},geometry:s,pageContext:u,createdAt:a,updatedAt:c,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...b.length?{edits:b}:{}}}}function Rn(e){return new Date(e()).toISOString()}function Dr(e,t){return`ann_${e().toString(36)}_${Math.floor(t()*1e9).toString(36)}`}function Sn(e={}){let t=e.now??Date.now,n=e.random??Math.random,i=new Map;return{list(a){let c=Me(a);return[...i.values()].filter((s)=>Me(s.pageUrl)===c)},listAll(){return[...i.values()]},save(a,c){let s=Rn(t),u={...a,id:Dr(t,n),pageUrl:Me(c??a.pageContext.url),status:\"open\",createdAt:s,updatedAt:s},b=Ye(u);if(!b.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${b.reason}`);return i.set(b.value.id,b.value),b.value},update(a,c){let s=i.get(a);if(!s)return null;let u={...s,...c,id:s.id,updatedAt:Rn(t)},b=Ye(u);if(!b.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${b.reason}`);return i.set(a,b.value),b.value},remove(a){return i.delete(a)},clear(a){let c=Me(a),s=0;for(let[u,b]of i)if(Me(b.pageUrl)===c)i.delete(u),s+=1;return s},clearAll(){let a=i.size;return i.clear(),a}}}var Pn=\"uibot.annotation.host.v1\",lt=\"uibot.annotation.page.v1\";var In=20,En=262144,Tn=2;function ct(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var Lr={spec:[\"html\",\"markdown\",\"zip\"],prototype:[\"html\",\"zip\"],deck:[\"html\",\"pptx\",\"zip\"],poster:[\"html\",\"zip\"]},ui=Array.from(new Set(Object.values(Lr).flat()));var mi=Object.freeze([Object.freeze({name:\"manifest\",summary:\"Describe query operations and list the derived resource index.\",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:\"search\",summary:\"Search resources with deterministic bilingual ranking and reasons.\",positionals:Object.freeze([Object.freeze({name:\"text\",property:\"text\",type:\"string\",required:!1})]),options:Object.freeze([...[[\"function\",\"functions\"],[\"scenario\",\"scenarios\"],[\"unit\",\"units\"],[\"industry\",\"industries\"]].map(([e,t])=>Object.freeze({name:e,property:t,type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"})),Object.freeze({name:\"kind\",property:\"kinds\",type:\"resource-kind\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"tag\",property:\"tags\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"category\",property:\"categories\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"capability\",property:\"capabilities\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"maturity\",property:\"maturities\",type:\"resource-maturity\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"limit\",property:\"limit\",type:\"positive-integer\"})])}),Object.freeze({name:\"get\",summary:\"Resolve one canonical resource id or unambiguous alias.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([])}),Object.freeze({name:\"build\",summary:\"Plan dependency closure and gaps without writing or installing.\",positionals:Object.freeze([Object.freeze({name:\"root\",property:\"roots\",type:\"string\",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:\"docs\",summary:\"Read curated public documentation for one resource.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([{name:\"locale\",property:\"locale\",type:\"string\"},{name:\"page\",property:\"page\",type:\"positive-integer\"}])}),Object.freeze({name:\"examples\",summary:\"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([{name:\"page\",property:\"page\",type:\"positive-integer\"}])}),Object.freeze({name:\"install-plan\",summary:\"Describe distribution channels and fixed snapshot identity/closure without installing or writing.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([])})]);var Fr=[\"background\",\"foreground\",\"card\",\"card-foreground\",\"popover\",\"popover-foreground\",\"primary\",\"primary-foreground\",\"secondary\",\"secondary-foreground\",\"muted\",\"muted-foreground\",\"accent\",\"accent-foreground\",\"border\",\"input\",\"ring\",\"destructive\",\"destructive-foreground\",\"success\",\"success-foreground\",\"warning\",\"warning-foreground\"],hi=[...Fr,\"radius\",\"font-display\",\"font-body\",\"font-mono\"];var ve={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function dt(e){if(!e||typeof e!==\"object\"||Array.isArray(e))throw Error(\"Invalid annotation object\");return e}function Ge(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error(\"Unknown annotation field\")}function re(e,t,n=!1){if(typeof e!==\"string\"||!n&&!e.trim()||e.length>t||Array.from(e).some((i)=>{let a=i.charCodeAt(0);return a===127||a<32&&a!==9&&a!==10&&a!==13}))throw Error(\"Invalid annotation text\");return e}function Nn(e){let t=dt(e);Ge(t,[\"x\",\"y\",\"width\",\"height\"]);for(let n of[\"x\",\"y\",\"width\",\"height\"])if(typeof t[n]!==\"number\"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error(\"Invalid annotation coordinates\");if(t.width<0||t.height<0)throw Error(\"Invalid annotation dimensions\");return{x:t.x,y:t.y,width:t.width,height:t.height}}function Mn(e){if(!Array.isArray(e)||!e.length||e.length>ve.count)throw Error(\"Expected 1 to 20 annotations\");if(new TextEncoder().encode(JSON.stringify(e)).length>ve.messageBytes)throw Error(\"Annotations exceed the message budget\");let t=0,n=new Set;return e.map((i)=>{let a=dt(i);Ge(a,[\"id\",\"comment\",\"target\",\"type\",\"priority\",\"edits\",\"screenshot\"]);let c=re(a.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(c)||n.has(c))throw Error(\"Invalid or duplicate annotation ID\");n.add(c);let s=re(a.comment,ve.comment).trim();if(![\"bug\",\"style\",\"copywriting\",\"feature\",\"interaction\",\"data\",\"other\"].includes(a.type)||![\"low\",\"medium\",\"high\",\"blocker\"].includes(a.priority))throw Error(\"Invalid annotation classification\");let u=dt(a.target),b;if(u.kind===\"element\"){Ge(u,[\"kind\",\"cssSelector\",\"xpath\",\"tagName\",\"textContent\",\"boundingBox\",\"uibotId\"]);let I=re(u.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(I))throw Error(\"Invalid annotation tag\");let k=u.uibotId===void 0?void 0:re(u.uibotId,200);if(k!==void 0&&!/^[\\w:.-]+$/.test(k))throw Error(\"Invalid annotation element ID\");b={kind:\"element\",cssSelector:re(u.cssSelector,ve.selector),xpath:re(u.xpath,ve.selector,!0),tagName:I,boundingBox:Nn(u.boundingBox),...u.textContent===void 0?{}:{textContent:re(u.textContent,1000,!0)},...k===void 0?{}:{uibotId:k}}}else if(u.kind===\"region\")Ge(u,[\"kind\",\"rect\"]),b={kind:\"region\",rect:Nn(u.rect)};else throw Error(\"Invalid annotation target\");let C;if(a.edits!==void 0){if(!Array.isArray(a.edits)||a.edits.length>ve.edits)throw Error(\"Invalid annotation edits\");C=a.edits.map((I)=>{let k=dt(I);if(Ge(k,[\"kind\",\"label\",\"property\",\"before\",\"after\"]),k.kind!==\"style\"&&k.kind!==\"text\")throw Error(\"Invalid annotation edit kind\");let T=k.property===void 0?void 0:re(k.property,100);if(T!==void 0&&!/^[-a-zA-Z][\\w-]*$/.test(T))throw Error(\"Invalid annotation style property\");return{kind:k.kind,label:re(k.label,200),before:re(k.before,4000,!0),after:re(k.after,4000,!0),...T===void 0?{}:{property:T}}})}let A;if(a.screenshot!==void 0){if(A=re(a.screenshot,ve.screenshotBytes),!/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(A)||++t>ve.screenshots)throw Error(\"Invalid annotation screenshot\")}return{id:c,comment:s,type:a.type,priority:a.priority,target:b,...C?{edits:C}:{},...A?{screenshot:A}:{}}})}function Dn(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,i)=>t[n.priority]-t[i.priority]||n.createdAt.localeCompare(i.createdAt))}function On(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind===\"region\"?{kind:\"region\",rect:t.rect}:{kind:\"element\",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes[\"data-uibot-id\"]?{uibotId:t.attributes[\"data-uibot-id\"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}function Br(e){return typeof e===\"string\"&&e.length<=En&&/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function Dt(e){if(!Array.isArray(e)||e.length>In||!ct({items:e}))return null;let t=[],n=0,i=new Set;for(let a of e){let c=Ye(a);if(!c.ok)return null;let s=c.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||i.has(s.id)||!s.comment.trim()||s.comment.length>4000)return null;if(i.add(s.id),s.target.kind===\"element\"&&(s.target.cssSelector.length>2000||s.target.xpath.length>2000||(s.target.textContent?.length??0)>1000))return null;if(s.screenshot!==void 0&&(!Br(s.screenshot)||++n>Tn))return null;if((s.edits?.length??0)>20||s.edits?.some((u)=>u.before.length>4000||u.after.length>4000))return null;t.push(s)}try{if(t.length)Mn(t.map(On))}catch{return null}return t}var ut={\u5143\u7D20:\"Element\",\u533A\u57DF:\"Region\",\u8C03\u6574:\"Quick edit\",\u9000\u51FA:\"Exit\",\u53D6\u6D88:\"Cancel\",\u4FDD\u5B58\u6807\u6CE8:\"Save annotation\",\u5DF2\u4FDD\u5B58:\"Saved\",\"\u66F4\u591A\u8BBE\u7F6E \u25BE\":\"More settings \u25BE\",\"\u6536\u8D77\u8BBE\u7F6E \u25B4\":\"Less settings \u25B4\",\"\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09\":\"Expected result (optional)\",\"\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09\":\"Preserve (optional)\",\u7C7B\u578B:\"Type\",\u4F18\u5148\u7EA7:\"Priority\",\u6837\u5F0F\u95EE\u9898:\"Style\",\u6587\u6848\u4FEE\u6539:\"Copy\",\u529F\u80FD\u5EFA\u8BAE:\"Feature\",\u4EA4\u4E92\u95EE\u9898:\"Interaction\",\u6570\u636E\u95EE\u9898:\"Data\",\u5176\u4ED6:\"Other\",\u4F4E:\"Low\",\u4E2D:\"Medium\",\u9AD8:\"High\",\u963B\u585E:\"Blocker\",\u62D6\u52A8\u5DE5\u5177\u680F:\"Move toolbar\",\u62D6\u52A8:\"Move\",\u6846\u9009\u533A\u57DF:\"Select region\",\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8:\"New region annotation\",\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8:\"New element annotation\",\u6587\u5B57:\"Text\",\u6587\u5B57\u5185\u5BB9:\"Text content\",\u5B57\u53F7:\"Font size\",\u989C\u8272:\"Color\",\u80CC\u666F:\"Background\",\u80CC\u666F\u8272:\"Background color\",\u5B57\u4F53:\"Font\",\u5B57\u91CD:\"Weight\",\u5706\u89D2:\"Radius\",\u95F4\u8DDD:\"Spacing\",\u4FDD\u5B58\u4FEE\u6539:\"Save changes\",\u53EF\u89C6\u5316\u4FEE\u6539:\"Visual changes\",\u6587\u6848:\"Text\",\u6587\u5B57\u989C\u8272:\"Text color\",\u4E0D\u900F\u660E\u5EA6:\"Opacity\",\u5185\u8FB9\u8DDD:\"Padding\",\"\u7EC6 300\":\"Light 300\",\"\u5E38\u89C4 400\":\"Regular 400\",\"\u4E2D 500\":\"Medium 500\",\"\u534A\u7C97 600\":\"Semibold 600\",\"\u7C97 700\":\"Bold 700\",\u6846\u9009:\"Rectangle\",\u7BAD\u5934:\"Arrow\",\u6587\u672C:\"Label\",\u589E\u5927\u5B57\u53F7:\"Increase font size\",\u51CF\u5C0F\u5B57\u53F7:\"Decrease font size\",\u533A\u57DF\u6807\u6CE8\u8BF4\u660E:\"Region comment\",\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8:\"Save region annotation\",\u5FEB\u901F\u7F16\u8F91:\"Quick edit\",\u7F16\u8F91\u6807\u6CE8:\"Edit annotation\",\u6279\u6CE8\u989C\u8272:\"Annotation color\",\u7EA2:\"Red\",\u6A59:\"Orange\",\u9EC4:\"Yellow\",\u7EFF:\"Green\",\u84DD:\"Blue\",\u767D:\"White\",\"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\":\"Comment (optional)\",\u672A\u505A\u4EFB\u4F55\u4FEE\u6539:\"No changes yet\",\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9:\"Add a comment first\",\u6807\u6CE8\u6570\u636E\u65E0\u6548:\"Invalid annotation\",\"\u4FDD\u5B58\u5931\u8D25\uFF1Aannotation-limit\":\"Annotation limit reached; shorten or remove a note\",\"\u4FDD\u5B58\u5931\u8D25\uFF1Ainvalid-annotation\":\"Could not save this annotation\"};function Ot(e){let t=document.getElementById(\"__uibot-annotator-host\")?.shadowRoot,n=e.target,i=null;try{if(n.kind===\"element\")i=document.querySelector(n.cssSelector)}catch{}if(i?.scrollIntoView({block:\"center\",behavior:\"instant\"}),i){let a=i.getBoundingClientRect(),c=document.createElement(\"div\");c.className=\"flash\",c.style.cssText=`position:fixed;pointer-events:none;left:${a.left}px;top:${a.top}px;width:${a.width}px;height:${a.height}px;border:2px solid var(--pa-focus, #2563eb)`,t?.append(c),setTimeout(()=>c.remove(),1300)}else if(n.kind===\"region\")window.scrollTo({top:Math.max(0,n.rect.y-window.innerHeight/2),behavior:\"instant\"});if(!i&&n.kind===\"region\"){let a=document.createElement(\"div\");a.className=\"flash\",a.style.cssText=`position:fixed;pointer-events:none;left:${n.rect.x-window.scrollX}px;top:${n.rect.y-window.scrollY}px;width:${n.rect.width}px;height:${n.rect.height}px;border:2px solid var(--pa-focus, #2563eb)`,t?.append(a),setTimeout(()=>a.remove(),1300)}}function _n(e){let t=document.getElementById(\"__uibot-annotator-host\"),n=t?.shadowRoot;if(!n)return()=>{};let i=null,a=null,c=!1,s=0,u=new Map,b=e.locale===\"zh\",C=document.createElement(\"style\");C.textContent=\"@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}} .pin.marker{cursor:pointer}.uibot-note{position:fixed;left:12px;top:60px;max-width:calc(100vw - 24px);padding:16px;background:var(--pa-popover, white);color:var(--pa-popover-contrast, #18181b);border:1px solid var(--pa-border, #d4d4d8);border-radius:12px;pointer-events:auto;box-shadow:0 12px 32px var(--pa-shadow, #0002)}.uibot-note textarea{display:block;min-width:240px;max-width:100%;margin:8px 0;padding:8px;color:var(--pa-surface-contrast, #18181b);background:var(--pa-field, #fafafa)}.uibot-note button{margin-right:12px;cursor:pointer}.pin.marker:focus-visible{outline:3px solid var(--pa-focus, #2563eb)}\",n.append(C);function A(){i?.focus({preventScroll:!0})}function I(v){Ot(v),a?.remove(),a=document.createElement(\"section\"),a.className=\"uibot-note\",a.setAttribute(\"role\",\"dialog\"),a.setAttribute(\"aria-label\",b?\"\u7F16\u8F91\u6807\u6CE8\":\"Edit annotation\");let E=document.createElement(\"textarea\");E.value=v.comment,E.maxLength=4000,E.setAttribute(\"aria-label\",b?\"\u6279\u6CE8\":\"Comment\");let M=document.createElement(\"button\");M.textContent=b?\"\u4FDD\u5B58\":\"Save\";let S=document.createElement(\"button\");S.textContent=b?\"\u53D6\u6D88\":\"Cancel\";let N=()=>{a?.remove(),a=null,A()};M.onclick=()=>{if(!E.value.trim())return;e.update(v.id,E.value.trim()),N()},S.onclick=N,a.onkeydown=(D)=>{if(D.key===\"Escape\")D.stopPropagation(),N();if(D.key===\"Enter\"&&!D.shiftKey&&!D.isComposing)D.preventDefault(),M.click();if(D.key===\"Tab\"){let G=[E,M,S].indexOf(n?.activeElement);if(D.shiftKey&&G===0)D.preventDefault(),S.focus();else if(!D.shiftKey&&G===2)D.preventDefault(),E.focus()}},a.append(E,M,S),n?.append(a),E.focus()}function k(){n?.querySelectorAll(\".epanel\").forEach((S)=>{if(S.setAttribute(\"role\",\"dialog\"),!S.hasAttribute(\"aria-label\"))S.setAttribute(\"aria-label\",b?\"\u5FEB\u901F\u7F16\u8F91\":\"Quick edit\")});let v=n?.querySelectorAll(\".mark-svg > *\").length??0;if(v>s&&!n?.querySelector(\".mark-dock[hidden]\"))n?.querySelector(\".mark-comment\")?.focus();s=v;let E=Dn(e.items());if(n?.querySelectorAll(\".pin.marker\").forEach((S,N)=>{let D=E[N];if(!D)return;S.dataset.annotationId=D.id,S.tabIndex=0,S.setAttribute(\"role\",\"button\"),S.setAttribute(\"aria-label\",`${N+1} \u00B7 ${D.comment}`)}),n?.querySelectorAll(\"textarea\").forEach((S)=>{S.maxLength=4000}),!b&&n){let S=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(let N=S.nextNode();N;N=S.nextNode()){let D=ut[N.textContent??\"\"];if(D)N.textContent=D}n.querySelectorAll(\"[aria-label],[title],[placeholder]\").forEach((N)=>{if(N.matches(\".pin.marker\"))return;for(let D of[\"aria-label\",\"title\",\"placeholder\"]){let H=N.getAttribute(D);if(!H)continue;let G=ut[H]??(D===\"placeholder\"&&/[\\u3400-\\u9fff]/.test(H)?\"Describe the change\u2026\":H);if(G!==H)N.setAttribute(D,G)}})}let M=!!n?.querySelector(\".epanel,.uibot-note\");if(c&&!M)A();c=M}let T=new MutationObserver(k);T.observe(n,{childList:!0,subtree:!0});function R(v){let E=v.composedPath()[0];if(!(E instanceof Element))return;let M=E.closest(\".pin.marker\");if(M){let S=e.items().find((N)=>N.id===M.dataset.annotationId);if(S)v.preventDefault(),v.stopImmediatePropagation(),i=M,I(S)}}function O(v){let E=n?.activeElement;if(v.key===\"Escape\"&&E&&!a){let M=n?.querySelector(\".epanel .cancel, .edit-panel .cancel, .quick-panel .cancel\");if(M){v.preventDefault(),v.stopImmediatePropagation(),M.click(),A();return}}if(v.key===\"Enter\"&&!v.shiftKey&&!v.isComposing&&(E instanceof HTMLTextAreaElement||E instanceof HTMLInputElement)&&!a){let M=E.closest(\"[role=dialog],.mark-dock\")?.querySelector(\"[data-action=save],button.ok,.mark-save\");if(M&&!M.disabled)v.preventDefault(),v.stopImmediatePropagation(),M.click()}if(E instanceof HTMLElement&&E.matches(\".pin.marker\")&&(v.key===\"Enter\"||v.key===\" \"))v.preventDefault(),E.click()}let F=(v)=>{if(v.target instanceof HTMLElement&&v.target!==t){if(i=v.target,!i.hasAttribute(\"tabindex\"))u.set(i,null),i.setAttribute(\"tabindex\",\"-1\")}},Y=(v)=>{v.preventDefault(),v.stopImmediatePropagation()};return window.addEventListener(\"click\",F,!0),window.addEventListener(\"submit\",Y,!0),n.addEventListener(\"click\",R,!0),n.addEventListener(\"keydown\",O,!0),k(),()=>{T.disconnect(),a?.remove(),C.remove();for(let[v,E]of u)if(E===null)v.removeAttribute(\"tabindex\");window.removeEventListener(\"click\",F,!0),window.removeEventListener(\"submit\",Y,!0),n.removeEventListener(\"click\",R,!0),n.removeEventListener(\"keydown\",O,!0)}}var pt=document.currentScript?.getAttribute(\"data-uibot-annotation\")===\"shell\",De=\"\",_t=null,pe=[],Xe=!1,Lt=!1,Bt=\"zh\",Ft,gt=new Set,Oe=(e)=>window.parent.postMessage({...e,source:lt,nonce:De},\"*\"),Ln=()=>{for(let e of gt)e({action:U.changed})},Fn=()=>{Ln(),Oe({action:\"snapshot\",items:pe})};function mt(){for(let e of[...gt])e({action:U.teardown});Ft?.(),Ft=void 0,Xe=!1,delete window.__uibotAnnotationActive}async function Vr(e){if(e.action===U.list)return{success:!0,data:pe};if(e.action===U.closed)return mt(),Oe({action:\"closed\"}),{success:!0};if(e.action===U.enrich)return{success:!0};if(e.action!==U.save||Lt)return{success:!1,error:\"locked\"};try{let t=Sn(),n=e.data;if(Bt===\"en\"&&n.edits?.length){let s=n.edits.map((u)=>`${u.label} ${fe(u.before,24)}\u2192${fe(u.after,24)}`).join(\"\uFF1B\");if(n.edits=n.edits.map((u)=>({...u,label:ut[u.label]??u.label})),n.comment===`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A${s}`)n.comment=`Visual changes: ${n.edits.map((u)=>`${u.label} ${u.before} \u2192 ${u.after}`).join(\"; \")}`}let i=t.save(n),a=i.target.kind===\"element\"&&i.edits?.length?pe.find((s)=>s.target.kind===\"element\"&&i.target.kind===\"element\"&&s.target.cssSelector===i.target.cssSelector):void 0;if(a)i={...i,id:a.id,createdAt:a.createdAt,target:a.target,comment:`${a.comment}\n${i.comment}`,edits:[...a.edits??[],...i.edits??[]]};let c=Dt([...pe.filter((s)=>s.id!==i.id),i]);if(!c)return{success:!1,error:\"annotation-limit\"};if(pe=c,Fn(),i.target.kind===\"region\")setTimeout(()=>document.getElementById(\"__uibot-annotator-host\")?.shadowRoot?.querySelector('[data-tool=\"element\"]')?.click(),0);return{success:!0,data:i}}catch{return{success:!1,error:\"invalid-annotation\"}}}function jr(e){if(Xe)return;Xe=!0,Bt=e,window.__uibotAnnotationActive=!0,kn({annotationRegionV2:!0},{sendMessage:Vr,subscribe(t){return gt.add(t),()=>{gt.delete(t)}}}),Ft=_n({locale:e,items:()=>pe,update(t,n){pe=pe.map((i)=>i.id===t?{...i,comment:n}:i),Fn()},close(){mt(),Oe({action:\"closed\"})}})}window.addEventListener(\"message\",(e)=>{if(!ct(e.data))return;let t=e.data;if(pt&&e.source!==window.parent){let n=[...document.querySelectorAll(\"iframe.pg-frame\")].find((i)=>i.contentWindow===e.source);if(!n||t.source!==lt)return;if(t.action===\"boot\"&&_t){n.contentWindow?.postMessage(_t,\"*\");return}if(t.nonce===De)Oe({...t,source:lt});return}if(e.source!==window.parent||t.source!==Pn||typeof t.nonce!==\"string\"||!/^[a-zA-Z0-9-]{16,100}$/.test(t.nonce))return;if(De&&t.nonce!==De)return;if(t.action!==\"sync\"&&t.action!==\"reveal\")return;if(t.action===\"sync\"){let n=Dt(t.items);if(!n||typeof t.enabled!==\"boolean\"||typeof t.locked!==\"boolean\"||t.locale!==\"zh\"&&t.locale!==\"en\")return;let i=kt(t.theme);if(t.theme=i,De=t.nonce,pt){_t=t;for(let a of document.querySelectorAll(\"iframe.pg-frame\"))a.contentWindow?.postMessage(t,\"*\");return}if(pe=n,Lt=t.locked,!t.enabled||Lt)mt();else{if(Xe&&Bt!==t.locale)mt();jr(t.locale);let a=document.getElementById(\"__uibot-annotator-host\");if(a)at(a,i);Ln()}Oe({action:\"ready\"})}else if(t.nonce===De){if(pt)for(let n of document.querySelectorAll(\"iframe.pg-frame\"))n.contentWindow?.postMessage(t,\"*\");else if(Xe&&typeof t.id===\"string\"){let n=pe.find((i)=>i.id===t.id);if(n)Ot(n)}}});if(!pt)Oe({action:\"boot\"});})();";
1
+ export declare const ANNOTATOR_IIFE = "(()=>{var on=[\"--pa-accent\",\"--pa-accent-soft\",\"--pa-outline\",\"--pa-accent-contrast\",\"--pa-surface\",\"--pa-surface-contrast\",\"--pa-shadow\",\"--pa-muted\",\"--pa-hover\",\"--pa-border\",\"--pa-popover-contrast\",\"--pa-popover\",\"--pa-focus\",\"--pa-selected\",\"--pa-accent-halo\",\"--pa-field\",\"--pa-checker\",\"--pa-success\",\"--pa-success-contrast\",\"--pa-danger\",\"--pa-danger-contrast\",\"--pa-color-default\"];function it(e){if(typeof e!==\"string\"||e.length>256||!e.trim())return!1;if(/[;{}\\\\<>!@'\"]/.test(e)||[...e].some((s)=>s.charCodeAt(0)<32)||/url\\s*\\(|var\\s*\\(|\\/\\*|\\*\\//i.test(e))return!1;let t=e.trim();if(/^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i.test(t))return!0;if(new Set(\"aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen\".split(\" \")).has(t.toLowerCase()))return!0;let i=t.match(/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\\(([^()]+)\\)$/i);if(i){let s=(i[1]??\"\").toLowerCase(),u=(i[2]??\"\").trim(),b=u.includes(\",\");if(b&&(!/^(rgb|rgba|hsl|hsla)$/.test(s)||u.includes(\"/\")))return!1;let C=u.split(\"/\");if(C.length>2)return!1;let A=b?u.split(\",\").map((T)=>T.trim()):(C[0]??\"\").trim().split(/\\s+/),I=b?A[3]:C[1]?.trim();if(A.length!==3&&!(b&&A.length===4))return!1;let k=/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?%?$/i;if(I!==void 0&&!k.test(I)&&!(I===\"none\"&&!b))return!1;return A.slice(0,3).every((T,R)=>{if(T===\"none\")return!b;let O=/^(hsl|hsla|hwb)$/.test(s)?R===0:/^(lch|oklch)$/.test(s)&&R===2;return k.test(T)||O&&/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(deg|rad|grad|turn)$/i.test(T)})}let a=t.match(/^color\\((srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|xyz|xyz-d50|xyz-d65) ([^()]+)\\)$/i);if(a)return it(`rgb(${a[2]})`);let c=t.match(/^color-mix\\(in srgb, (.+) (\\d+(?:\\.\\d+)?)%, (.+)\\)$/i);return!!c&&Number(c[2])<=100&&it(c[1])&&it(c[3])}function kt(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return{};try{if(new TextEncoder().encode(JSON.stringify(e)).length>8192)return{}}catch{return{}}let t={};for(let n of on){let i=Object.hasOwn(e,n)?e[n]:void 0;if(it(i))t[n]=i.trim()}return t}function at(e,t){let n=kt(t);for(let i of on){let a=n[i];if(a===void 0)e.style.removeProperty(i);else e.style.setProperty(i,a)}}var tr=[\"color\",\"backgroundColor\",\"fontSize\",\"fontWeight\",\"fontFamily\",\"lineHeight\",\"margin\",\"padding\",\"border\",\"borderRadius\",\"width\",\"height\",\"display\",\"position\",\"zIndex\",\"flexDirection\",\"justifyContent\",\"alignItems\",\"gap\",\"overflow\",\"opacity\",\"transform\"];function vt(e){if(typeof CSS<\"u\"&&typeof CSS.escape===\"function\")return CSS.escape(e);return e.replace(/([^a-zA-Z0-9_-])/g,\"\\\\$1\")}function an(e){return e.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r\\f]/g,\"\\\\a \")}function sn(e){if(!e||e.length>40)return!1;if(/^(css-|sc-|jss|makeStyles|emotion-|_)/i.test(e))return!1;if(/[0-9a-f]{6,}/.test(e))return!1;return!0}function ln(e){if(!e||e.length>40)return!1;if(/[0-9a-f]{8,}/.test(e))return!1;if(/^(radix-|headlessui-|mui-|:r)/i.test(e))return!1;return!0}function nr(e){let t=[],n=e;while(n&&n.nodeType===1&&n!==document.documentElement){let i=n.tagName.toLowerCase();if(n.id&&ln(n.id)){t.unshift(`#${vt(n.id)}`);break}let a=n.parentElement;if(a){let c=Array.from(a.children).filter((u)=>u.tagName===n.tagName),s=c.indexOf(n)+1;t.unshift(c.length>1?`${i}:nth-of-type(${s})`:i)}else t.unshift(i);n=a}return t.join(\" > \")}function rr(e){let t=e.tagName.toLowerCase();for(let a of[\"data-testid\",\"data-cy\",\"data-qa\"]){let c=e.getAttribute(a);if(c)return{selector:`${t}[${a}=\"${an(c)}\"]`,strategy:\"testid\"}}if(e.id&&ln(e.id)){let a=`#${vt(e.id)}`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"id\"}}let n=e.getAttribute(\"aria-label\");if(n){let a=`${t}[aria-label=\"${an(n)}\"]`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"aria\"}}let i=Array.from(e.classList).filter(sn);if(i.length){let a=`${t}.${i.map(vt).join(\".\")}`;if(document.querySelectorAll(a).length===1)return{selector:a,strategy:\"class\"}}return{selector:nr(e),strategy:\"path\"}}function or(e){let t=[],n=e;while(n&&n.nodeType===1){let i=1,a=n.previousElementSibling;while(a){if(a.tagName===n.tagName)i+=1;a=a.previousElementSibling}t.unshift(`${n.tagName.toLowerCase()}[${i}]`),n=n.parentElement}return`/${t.join(\"/\")}`}function ir(e){let t=[],n=e,i=0;while(n&&n.nodeType===1&&i<6){let a=n.tagName.toLowerCase(),c=n.id?`#${n.id}`:\"\",s=Array.from(n.classList).filter(sn).slice(0,2);t.unshift(`${a}${c}${s.length?`.${s.join(\".\")}`:\"\"}`),n=n.parentElement,i+=1}return t}function ar(e){let t={};for(let n of Array.from(e.attributes)){if(n.name===\"style\")continue;t[n.name]=n.value.length>200?n.value.slice(0,200):n.value}return t}function sr(e){let t=getComputedStyle(e),n={};for(let i of tr){let a=t.getPropertyValue(i.replace(/[A-Z]/g,(c)=>`-${c.toLowerCase()}`));if(a)n[i]=a.trim()}return n}function lr(){let e=window;if(e.__NEXT_DATA__)return\"nextjs\";if(e.__NUXT__)return\"nuxt\";if(document.querySelector(\"[ng-version]\"))return\"angular\";if(document.querySelector(\"[data-reactroot]\")||e.React||e.__REACT_DEVTOOLS_GLOBAL_HOOK__)return\"react\";if(e.__VUE__||document.querySelector(\"[data-v-app]\"))return\"vue\";if(document.querySelector(\"[data-svelte-h]\"))return\"svelte\";return\"unknown\"}function At(){let e=window.location,t=document.documentElement.classList.contains(\"dark\")||Boolean(window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches);return{url:e.href,origin:e.origin,path:e.pathname,query:e.search||void 0,hash:e.hash||void 0,title:document.title,referrer:document.referrer||void 0,viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1},scroll:{x:window.scrollX,y:window.scrollY},theme:t?\"dark\":\"light\",framework:lr(),language:document.documentElement.lang||navigator.language,userAgent:navigator.userAgent,capturedAt:new Date().toISOString()}}function cr(e){let t=e.getBoundingClientRect(),n=getComputedStyle(e);return{viewport:{width:window.innerWidth,height:window.innerHeight},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)},visible:t.width>0&&t.height>0&&n.display!==\"none\"&&n.visibility!==\"hidden\",positioning:n.position}}function fe(e,t){let n=e.replace(/\\s+/g,\" \").trim();return n.length>t?`${n.slice(0,t)}\u2026`:n}function dr(e){let t=e.tagName.toLowerCase(),n=(e.getAttribute(\"role\")||\"\").toLowerCase();if(t===\"main\"||n===\"main\")return\"\u4E3B\u5185\u5BB9\u533A\";if(t===\"nav\"||n===\"navigation\")return\"\u5BFC\u822A/\u83DC\u5355\";if(t===\"header\"||n===\"banner\")return\"\u9875\u5934\";if(t===\"footer\"||n===\"contentinfo\")return\"\u9875\u811A\";if(t===\"aside\"||n===\"complementary\")return\"\u4FA7\u8FB9\u680F\";if(t===\"dialog\"||n===\"dialog\"||n===\"alertdialog\")return\"\u5F39\u7A97\";if(t===\"form\")return\"\u8868\u5355\";if(t===\"table\")return\"\u8868\u683C\";if(t===\"tr\")return\"\u8868\u683C\u884C\";if(t===\"th\"||t===\"td\")return\"\u5355\u5143\u683C\";if(t===\"li\")return\"\u5217\u8868\u9879\";if(t===\"ul\"||t===\"ol\")return\"\u5217\u8868\";if(t===\"section\"||t===\"article\"){let c=e.querySelector(\"h1,h2,h3,h4,h5,h6\"),u=(e.getAttribute(\"aria-label\")||c?.textContent||\"\").replace(/\\s+/g,\" \").trim();return u?`\u533A\u5757\u300C${fe(u,16)}\u300D`:\"\u533A\u5757\"}let i=Array.from(e.classList).find((c)=>/card|modal|dialog|drawer|side-?bar|menu|panel|toolbar|tabs?|header|footer|nav|hero|banner|widget|popover|dropdown/i.test(c));if(!i)return null;return`${/card/i.test(i)?\"\u5361\u7247\":/modal|dialog/i.test(i)?\"\u5F39\u7A97\":/drawer/i.test(i)?\"\u62BD\u5C49\":/side-?bar/i.test(i)?\"\u4FA7\u8FB9\u680F\":/toolbar/i.test(i)?\"\u5DE5\u5177\u680F\":/menu/i.test(i)?\"\u83DC\u5355\":/tab/i.test(i)?\"\u6807\u7B7E\u9875\":/panel/i.test(i)?\"\u9762\u677F\":/nav/i.test(i)?\"\u5BFC\u822A\":/header/i.test(i)?\"\u9875\u5934\":/footer/i.test(i)?\"\u9875\u811A\":/popover|dropdown/i.test(i)?\"\u6D6E\u5C42\":/hero|banner/i.test(i)?\"\u6A2A\u5E45\":\"\u533A\u5757\"}(.${i})`}function ur(e){let t=[],n=e.parentElement;while(n&&n.nodeType===1&&n!==document.body&&n!==document.documentElement){let A=dr(n);if(A&&t[t.length-1]!==A)t.push(A);n=n.parentElement}t.reverse();let i=e.getBoundingClientRect(),a=i.left+i.width/2,c=i.top+i.height/2,s=window.innerWidth||1,u=window.innerHeight||1,b=a<s/3?\"\u9760\u5DE6\":a>s*2/3?\"\u9760\u53F3\":\"\u6C34\u5E73\u5C45\u4E2D\",C=c<u/3?\"\u9760\u4E0A\":c>u*2/3?\"\u9760\u4E0B\":\"\u5782\u76F4\u5C45\u4E2D\";return{region:`${b} \u00B7 ${C}`,breadcrumb:t.slice(-5)}}function wt(e){let t=e.getBoundingClientRect(),{selector:n,strategy:i}=rr(e),a=(e.textContent||\"\").replace(/\\s+/g,\" \").trim(),c=ur(e);return{comment:\"\",type:\"style\",priority:\"medium\",target:{kind:\"element\",tagName:e.tagName.toLowerCase(),cssSelector:n,xpath:or(e),textContent:a?a.slice(0,200):void 0,attributes:ar(e),boundingBox:{x:Math.round(t.left+window.scrollX),y:Math.round(t.top+window.scrollY),width:Math.round(t.width),height:Math.round(t.height)},domPath:ir(e),accessibility:{role:e.getAttribute(\"role\")||void 0,ariaLabel:e.getAttribute(\"aria-label\")||void 0},selectorStrategy:i,region:c.region,breadcrumb:c.breadcrumb},styleSummary:sr(e),geometry:cr(e),pageContext:At()}}var We=[{id:\"red\",value:\"#ef4444\",label:\"\u7EA2\"},{id:\"orange\",value:\"#f97316\",label:\"\u6A59\"},{id:\"yellow\",value:\"#eab308\",label:\"\u9EC4\"},{id:\"green\",value:\"#22c55e\",label:\"\u7EFF\"},{id:\"blue\",value:\"#3b82f6\",label:\"\u84DD\"},{id:\"white\",value:\"#f8fafc\",label:\"\u767D\"}],cn=12,dn=48,Rt=4,St=16;function st(e){let t=Math.round(e/4)*4;return Math.min(48,Math.max(12,t))}function pr(e,t){let n=st(t),i=Math.max(1,[...e].length);return{width:Math.max(n,i*n),height:Math.ceil(n*1.35)}}var gr=new Set(We.map((e)=>e.value));function mr(e){return gr.has(e)}function un(){return We[0].value}function ie(e){return typeof e===\"number\"&&Number.isFinite(e)}function fr(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return null;let t=e;if(typeof t.color!==\"string\"||!mr(t.color))return null;if(t.kind===\"rect\"){if(!ie(t.x)||!ie(t.y)||!ie(t.width)||!ie(t.height))return null;if(t.width<8||t.height<8)return null;return{kind:\"rect\",color:t.color,x:t.x,y:t.y,width:t.width,height:t.height}}if(t.kind===\"arrow\"){if(!ie(t.x1)||!ie(t.y1)||!ie(t.x2)||!ie(t.y2))return null;return{kind:\"arrow\",color:t.color,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}if(t.kind===\"text\"){if(!ie(t.x)||!ie(t.y)||typeof t.text!==\"string\")return null;let n=t.text.trim();if(!n)return null;let i=t.fontSize===void 0?16:ie(t.fontSize)?st(t.fontSize):null;if(i==null)return null;return{kind:\"text\",color:t.color,x:t.x,y:t.y,text:n,fontSize:i}}return null}function pn(e){if(e===void 0)return;if(!Array.isArray(e))return;let t=[];for(let n of e){let i=fr(n);if(!i)return;t.push(i)}return t}function gn(e){if(e.length===0)return\"\u533A\u57DF\u6807\u6CE8\";let t=e.filter((c)=>c.kind===\"rect\").length,n=e.filter((c)=>c.kind===\"arrow\").length,i=e.filter((c)=>c.kind===\"text\"),a=[];if(t)a.push(`${t} \u4E2A\u6846`);if(n)a.push(`${n} \u4E2A\u7BAD\u5934`);if(i.length){let c=i.map((s)=>s.text.trim()).filter(Boolean).slice(0,3).map((s)=>`\u300C${s.length>16?`${s.slice(0,16)}\u2026`:s}\u300D`);a.push(c.length?`\u6587\u672C ${c.join(\" \")}`:`${i.length} \u5904\u6587\u672C`)}return`\u533A\u57DF\u6807\u6CE8\uFF08${a.join(\"\uFF0C\")}\uFF09`}function Ke(e,t=16){if(e.length===0)return null;let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let s of e)if(s.kind===\"rect\")n=Math.min(n,s.x),i=Math.min(i,s.y),a=Math.max(a,s.x+s.width),c=Math.max(c,s.y+s.height);else if(s.kind===\"arrow\")n=Math.min(n,s.x1,s.x2),i=Math.min(i,s.y1,s.y2),a=Math.max(a,s.x1,s.x2),c=Math.max(c,s.y1,s.y2);else{let u=pr(s.text,s.fontSize);n=Math.min(n,s.x),i=Math.min(i,s.y),a=Math.max(a,s.x+u.width),c=Math.max(c,s.y+u.height)}return{x:n-t,y:i-t,width:Math.max(8,a-n+t*2),height:Math.max(8,c-i+t*2)}}function mn(e,t,n){return e.map((i)=>{if(i.kind===\"rect\")return{...i,x:i.x+t,y:i.y+n};if(i.kind===\"arrow\")return{...i,x1:i.x1+t,y1:i.y1+n,x2:i.x2+t,y2:i.y2+n};return{...i,x:i.x+t,y:i.y+n,fontSize:i.fontSize}})}function Pt(e,t){let n=Math.max(0,Math.min(e.x,t.width)),i=Math.max(0,Math.min(e.y,t.height)),a=Math.min(e.width,t.width-n),c=Math.min(e.height,t.height-i);if(a<8||c<8)return null;return{x:n,y:i,width:a,height:c}}function yr(e,t,n,i,a=8){let c=Math.max(a,i.width-n.width-a),s=Math.max(a,i.height-n.height-a);return{left:Math.min(Math.max(e,a),c),top:Math.min(Math.max(t,a),s)}}function It(e,t){let n=!1,i=null,a=0,c=0,s=0,u=0;function b(){return{width:window.innerWidth,height:window.innerHeight}}function C(R,O){let F=e.getBoundingClientRect(),Y=yr(R,O,{width:F.width,height:F.height},b());e.style.left=`${Y.left}px`,e.style.top=`${Y.top}px`,e.style.right=\"auto\",e.style.transform=\"none\"}function A(R){if(R.button!==0)return;R.preventDefault(),R.stopPropagation(),n=!0,i=R.pointerId,t.setPointerCapture?.(R.pointerId);let O=e.getBoundingClientRect();a=R.clientX,c=R.clientY,s=O.left,u=O.top,C(s,u),t.classList.add(\"dragging\")}function I(R){if(!n||i!=null&&R.pointerId!==i)return;R.preventDefault(),C(s+R.clientX-a,u+R.clientY-c)}function k(R){if(!n||i!=null&&R.pointerId!==i)return;n=!1,i=null,t.classList.remove(\"dragging\");try{t.releasePointerCapture?.(R.pointerId)}catch{}}function T(){let R=e.getBoundingClientRect();C(R.left,R.top)}return t.addEventListener(\"pointerdown\",A),t.addEventListener(\"pointermove\",I),t.addEventListener(\"pointerup\",k),t.addEventListener(\"pointercancel\",k),window.addEventListener(\"resize\",T),()=>{t.removeEventListener(\"pointerdown\",A),t.removeEventListener(\"pointermove\",I),t.removeEventListener(\"pointerup\",k),t.removeEventListener(\"pointercancel\",k),window.removeEventListener(\"resize\",T)}}function fn(e){if(e?.isConnected)e.remove()}function ue(e,t){let n=document.createElementNS(\"http://www.w3.org/2000/svg\",e);for(let[i,a]of Object.entries(t))n.setAttribute(i,a);return n}function hr(e){let t=ue(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\"});if(t.setAttribute(\"aria-hidden\",\"true\"),e===\"rect\")t.appendChild(ue(\"rect\",{x:\"3\",y:\"4\",width:\"10\",height:\"8\",rx:\"1.5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\"}));else if(e===\"arrow\")t.appendChild(ue(\"path\",{d:\"M3 13 L12 4 M8 4 h4 v4\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));else t.appendChild(ue(\"path\",{d:\"M4 13 L8 3 L12 13 M5.5 10 h5\",fill:\"none\",stroke:\"currentColor\",\"stroke-width\":\"1.6\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}));return t}function yn(e,t){let n=!1,i=\"rect\",a=un(),c=St,s=[],u=null,b=null,C=null,A=document.createElement(\"div\");A.className=\"mark-layer\";let I=ue(\"svg\",{class:\"mark-svg\"});I.setAttribute(\"width\",\"100%\"),I.setAttribute(\"height\",\"100%\"),A.appendChild(I),e.appendChild(A);let k=document.createElement(\"div\");k.className=\"mark-dock\",k.hidden=!0;let T=document.createElement(\"div\");T.className=\"mark-seg\";let R=new Map;for(let m of[\"rect\",\"arrow\",\"text\"]){let h=document.createElement(\"button\");h.type=\"button\",h.dataset.mark=m,h.setAttribute(\"aria-label\",m===\"rect\"?\"\u6846\u9009\":m===\"arrow\"?\"\u7BAD\u5934\":\"\u6587\u672C\"),h.title=h.getAttribute(\"aria-label\")??m,h.appendChild(hr(m)),h.addEventListener(\"click\",()=>{i=m,D(),Q()}),R.set(m,h),T.appendChild(h)}let O=document.createElement(\"div\");O.className=\"mark-colors\",O.setAttribute(\"role\",\"radiogroup\"),O.setAttribute(\"aria-label\",\"\u6279\u6CE8\u989C\u8272\");let F=[];for(let m of We){let h=document.createElement(\"button\");h.type=\"button\",h.className=\"mark-color\",h.style.background=m.value,h.setAttribute(\"aria-label\",m.label),h.title=m.label,h.addEventListener(\"click\",()=>{a=m.value,H()}),F.push(h),O.appendChild(h)}let Y=document.createElement(\"div\");Y.className=\"mark-size\",Y.setAttribute(\"aria-label\",\"\u5B57\u53F7\");let v=document.createElement(\"button\");v.type=\"button\",v.setAttribute(\"aria-label\",\"\u51CF\u5C0F\u5B57\u53F7\"),v.title=\"\u51CF\u5C0F\u5B57\u53F7\",v.textContent=\"\u2212\";let E=document.createElement(\"span\");E.className=\"v\";let M=document.createElement(\"button\");M.type=\"button\",M.setAttribute(\"aria-label\",\"\u589E\u5927\u5B57\u53F7\"),M.title=\"\u589E\u5927\u5B57\u53F7\",M.textContent=\"+\",Y.append(v,E,M);let S=document.createElement(\"input\");S.type=\"text\",S.className=\"mark-comment\",S.placeholder=\"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\",S.setAttribute(\"aria-label\",\"\u533A\u57DF\u6807\u6CE8\u8BF4\u660E\");let N=document.createElement(\"button\");N.type=\"button\",N.className=\"mark-save\",N.textContent=\"\u2713\",N.title=\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\",N.setAttribute(\"aria-label\",\"\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8\"),N.disabled=!0,N.addEventListener(\"click\",()=>{if(!s.length||N.disabled)return;t.onSave({marks:s.map((m)=>({...m})),comment:S.value.trim()})}),k.append(T,O,Y,S,N),e.appendChild(k);function D(){for(let[m,h]of R)h.classList.toggle(\"on\",m===i)}function H(){F.forEach((m,h)=>{m.classList.toggle(\"on\",We[h]?.value===a)})}function G(m){if(c=st(m),E.textContent=String(c),v.disabled=c<=cn,M.disabled=c>=dn,C){C.style.fontSize=`${c}px`;return}for(let h=s.length-1;h>=0;h-=1){let x=s[h];if(x?.kind!==\"text\")continue;s[h]={...x,fontSize:c},le();break}}function ae(m){m.preventDefault()}v.addEventListener(\"mousedown\",ae),M.addEventListener(\"mousedown\",ae),v.addEventListener(\"click\",()=>G(c-Rt)),M.addEventListener(\"click\",()=>G(c+Rt));function K(){N.disabled=s.length===0,t.onBusyChange?.(!1)}function Q(){u=null,b=null,le()}function se(){ge(!0)}function ge(m){let h=C;if(!h)return;C=null,h.removeEventListener(\"blur\",se);let x=h.value.trim(),j=Number.parseFloat(h.dataset.x??\"0\"),w=Number.parseFloat(h.dataset.y??\"0\");if(fn(h),m&&x)s.push({kind:\"text\",color:a,x:j,y:w,text:x,fontSize:c});le(),K()}function le(){I.replaceChildren();for(let x of[...A.querySelectorAll(\".mark-text\")]){if(x===C)continue;fn(x)}let m=ue(\"defs\",{});I.appendChild(m),(b?[...s,b]:s).forEach((x,j)=>{if(x.kind===\"rect\"){I.appendChild(ue(\"rect\",{x:String(x.x),y:String(x.y),width:String(x.width),height:String(x.height),fill:\"none\",stroke:x.color,\"stroke-width\":\"3\",rx:\"2\"}));return}if(x.kind===\"arrow\"){let oe=`uibot-arrow-${j}`,X=ue(\"marker\",{id:oe,markerWidth:\"8\",markerHeight:\"8\",refX:\"6\",refY:\"4\",orient:\"auto\",markerUnits:\"strokeWidth\"});X.appendChild(ue(\"path\",{d:\"M0,0 L8,4 L0,8 z\",fill:x.color})),m.appendChild(X),I.appendChild(ue(\"line\",{x1:String(x.x1),y1:String(x.y1),x2:String(x.x2),y2:String(x.y2),stroke:x.color,\"stroke-width\":\"3\",\"stroke-linecap\":\"round\",\"marker-end\":`url(#${oe})`}));return}let w=document.createElement(\"div\");w.className=\"mark-text\",w.textContent=x.text,w.style.left=`${x.x}px`,w.style.top=`${x.y}px`,w.style.color=x.color,w.style.fontSize=`${x.fontSize}px`,A.appendChild(w)})}return D(),H(),G(c),le(),{setActive(m){if(n=m,k.hidden=!m,A.classList.toggle(\"on\",m),!m)ge(!1),s.length=0,S.value=\"\",i=\"rect\",G(St),Q(),K(),D()},isActive:()=>n,tool:()=>i,getMarks:()=>s.map((m)=>({...m})),addRect(m){if(!n)return;s.push({kind:\"rect\",color:a,...m}),le(),K()},handlePointerDown(m){if(!n||m.button!==0||C)return!1;if(m.target instanceof Node&&k.contains(m.target))return!1;return u={x:m.clientX,y:m.clientY},b=null,!0},handlePointerMove(m){if(!n||!u||i===\"text\")return!1;let h=Math.min(u.x,m.clientX),x=Math.min(u.y,m.clientY),j=Math.abs(m.clientX-u.x),w=Math.abs(m.clientY-u.y);return b=i===\"arrow\"?{kind:\"arrow\",color:a,x1:u.x,y1:u.y,x2:m.clientX,y2:m.clientY}:{kind:\"rect\",color:a,x:h,y:x,width:j,height:w},le(),!0},handlePointerUp(m){if(!n||m.button!==0)return!1;if(i===\"text\"){let x=u;if(u=null,!x)return!1;return ge(!1),C=document.createElement(\"input\"),C.className=\"mark-text editing\",C.dataset.x=String(m.clientX),C.dataset.y=String(m.clientY),C.style.left=`${m.clientX}px`,C.style.top=`${m.clientY}px`,C.style.color=a,C.style.fontSize=`${c}px`,C.placeholder=\"\u8F93\u5165\u6587\u5B57\",C.addEventListener(\"keydown\",(j)=>{if(j.key===\"Enter\")j.preventDefault(),ge(!0);else if(j.key===\"Escape\")j.preventDefault(),ge(!1)}),C.addEventListener(\"blur\",se),A.appendChild(C),C.focus(),!0}if(!u)return!1;let h=u;if(u=null,i===\"arrow\"){let x=m.clientX-h.x,j=m.clientY-h.y;if(Math.hypot(x,j)<8)return Q(),!0;s.push({kind:\"arrow\",color:a,x1:h.x,y1:h.y,x2:m.clientX,y2:m.clientY})}else{let x={x:Math.min(h.x,m.clientX),y:Math.min(h.y,m.clientY),width:Math.abs(m.clientX-h.x),height:Math.abs(m.clientY-h.y)};if(x.width<8||x.height<8)return Q(),!0;s.push({kind:\"rect\",color:a,...x})}return b=null,le(),K(),!0},handlePointerCancel(){if(!n)return;Q()},captureRect(){return Ke(s,16)},setCapturing(m){k.hidden=m||!n},setBusy(m){N.disabled=m||s.length===0,N.textContent=m?\"\u2026\":\"\u2713\",S.disabled=m},clear(){ge(!1),s.length=0,S.value=\"\",Q(),K()},detach(){ge(!1),A.remove(),k.remove()}}}var br=()=>globalThis.performance?.now()??Date.now();function hn(e,t=br){let n=t(),i=(a,c,s)=>{e?.({stage:a,durationMs:Math.max(0,t()-c),outcome:s})};return{markFromStart(a,c=\"success\"){i(a,n,c)},start(a){let c=t(),s=!1;return(u=\"success\")=>{if(s)return;s=!0,i(a,c,u)}}}}var U={start:\"annotation:start\",teardown:\"annotation:teardown\",save:\"annotation:save\",enrich:\"annotation:enrich\",closed:\"annotation:overlay-closed\",list:\"annotation:list\",update:\"annotation:update\",remove:\"annotation:remove\",clear:\"annotation:clear\",changed:\"annotation:changed\",reveal:\"annotation:reveal\"};function Me(e){try{let t=new URL(e);return t.hash=\"\",t.toString()}catch{return e}}function xr(){return{requestIdleCallback:typeof window.requestIdleCallback===\"function\"?(e,t)=>window.requestIdleCallback(()=>e(),t):void 0,cancelIdleCallback:typeof window.cancelIdleCallback===\"function\"?(e)=>window.cancelIdleCallback(e):void 0,setTimeout:(e,t)=>window.setTimeout(e,t),clearTimeout:(e)=>window.clearTimeout(e)}}function bn(e,t=xr()){let n=!0,i=()=>{if(!n)return;n=!1,e()};if(t.requestIdleCallback){let c=t.requestIdleCallback(i,{timeout:120});return()=>{if(!n)return;n=!1,t.cancelIdleCallback?.(c)}}let a=t.setTimeout(i,0);return()=>{if(!n)return;n=!1,t.clearTimeout(a)}}var xn=`\n *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",system-ui,sans-serif;}\n .hl{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,0.10));border-radius:4px;\n pointer-events:none;transition:all .04s linear;z-index:1;box-shadow:0 0 0 1px var(--pa-outline, rgba(255,255,255,0.4));}\n .tag{position:fixed;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);font-size:11px;line-height:1.4;font-weight:500;\n padding:2px 7px;border-radius:5px;pointer-events:none;white-space:nowrap;z-index:2;}\n .bar{position:fixed;top:14px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));\n color:var(--pa-surface-contrast, #fff);font-size:12.5px;padding:6px 6px 6px 8px;border-radius:999px;pointer-events:auto;\n z-index:5;display:flex;gap:8px;align-items:center;box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .bar .grip{display:flex;align-items:center;justify-content:center;width:18px;height:22px;padding:0;\n border:none;background:transparent;color:var(--pa-muted, rgba(255,255,255,0.72));cursor:grab;touch-action:none;}\n .bar .grip:hover,.bar .grip.dragging{color:var(--pa-surface-contrast, #fff);background:transparent;}\n .bar .grip.dragging{cursor:grabbing;}\n .bar button{background:var(--pa-hover, rgba(255,255,255,0.14));color:var(--pa-surface-contrast, #fff);border:none;border-radius:999px;\n padding:4px 11px;font-size:12px;cursor:pointer;transition:background .12s;}\n .bar button:hover{background:var(--pa-hover, rgba(255,255,255,0.26));}\n .bar button.exit{width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;}\n\n @keyframes uibotpop{from{opacity:0;transform:translateY(4px) scale(.98);}to{opacity:1;transform:none;}}\n\n .dd{position:relative;}\n .dd-btn{width:100%;display:flex;align-items:center;gap:6px;border:1px solid var(--pa-border, #e6d6bf);border-radius:9px;\n padding:7px 10px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);background:var(--pa-popover, #fff);cursor:pointer;transition:border-color .12s,box-shadow .12s;}\n .dd-btn:hover{border-color:var(--pa-border, #d2bd9c);}\n .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.14));}\n .dd-btn .v{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px;}\n .dd-btn .chev{font-size:9px;color:var(--pa-muted, #b69b73);transition:transform .12s;}\n .dd-btn.open .chev{transform:rotate(180deg);}\n .dd-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--pa-popover, #fff);border:1px solid var(--pa-border, #ecdcc4);\n border-radius:10px;box-shadow:0 10px 28px var(--pa-shadow, rgba(60,40,15,0.18));padding:4px;z-index:10;max-height:208px;overflow:auto;}\n .dd-item{width:100%;display:flex;align-items:center;gap:7px;text-align:left;border:none;background:transparent;\n border-radius:7px;padding:7px 9px;font-size:12.5px;color:var(--pa-popover-contrast, #3b3024);cursor:pointer;}\n .dd-item:hover{background:var(--pa-hover, #f6ecdb);}\n .dd-item.sel{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #7c2d34);font-weight:500;}\n .swatch{width:8px;height:8px;border-radius:50%;flex-shrink:0;}\n\n .toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);color:var(--pa-surface-contrast, #fff);font-size:12.5px;\n padding:8px 16px;border-radius:999px;pointer-events:none;z-index:7;box-shadow:0 6px 20px var(--pa-shadow, rgba(0,0,0,0.2));}\n .pin{position:fixed;width:21px;height:21px;border-radius:50% 50% 50% 2px;background:var(--pa-accent, #7c2d34);color:var(--pa-accent-contrast, #f1f0ed);\n font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;\n pointer-events:none;z-index:3;box-shadow:0 2px 6px var(--pa-shadow, rgba(0,0,0,0.3));}\n .pin.marker{pointer-events:auto;cursor:pointer;transition:transform .1s;}\n .pin.marker:hover{transform:scale(1.18);}\n .flash{position:fixed;border:3px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:4;\n animation:uibotflash 1.2s ease-out forwards;}\n @keyframes uibotflash{0%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0.45));}100%{box-shadow:0 0 0 5px var(--pa-accent-halo, rgba(124,45,52,0));}}\n .selbox{position:fixed;border:2px solid var(--pa-accent, #7c2d34);border-radius:4px;pointer-events:none;z-index:2;\n box-shadow:0 0 0 1px var(--pa-outline, rgba(241,240,237,0.35));background:var(--pa-accent-soft, rgba(124,45,52,0.06));}\n .pin.active{background:var(--pa-accent, #7c2d34);}\n .sel-clear{position:fixed;width:22px;height:22px;padding:0;border:none;border-radius:50%;background:var(--pa-surface, #17171a);color:var(--pa-surface-contrast, #f1f0ed);display:none;align-items:center;justify-content:center;pointer-events:auto;z-index:6;cursor:pointer;box-shadow:0 2px 6px var(--pa-shadow, rgba(0,0,0,0.3));}\n .sel-clear:hover{background:var(--pa-hover, #3b352e);}\n .region-box{position:fixed;border:2px solid var(--pa-accent, #7c2d34);background:var(--pa-accent-soft, rgba(124,45,52,.10));pointer-events:none;z-index:3;display:none;}\n .region-size{position:absolute;right:0;bottom:-24px;background:var(--pa-surface, #17171a);color:var(--pa-surface-contrast, #f1f0ed);border-radius:999px;padding:3px 7px;font-size:11px;white-space:nowrap;}\n .sr-live{position:fixed;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}\n .mark-layer{position:fixed;inset:0;pointer-events:none;z-index:4;}\n .mark-layer .mark-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;}\n .mark-text{position:fixed;font-size:15px;font-weight:700;line-height:1.2;pointer-events:none;white-space:pre;\n text-shadow:0 1px 2px var(--pa-shadow, rgba(0,0,0,.75)),0 0 8px var(--pa-shadow, rgba(0,0,0,.45));z-index:4;}\n .mark-text.editing{pointer-events:auto;min-width:72px;background:var(--pa-surface, rgba(23,23,26,.9));border:1px solid var(--pa-border, rgba(255,255,255,.24));\n border-radius:6px;padding:4px 8px;outline:none;font:inherit;}\n .mark-dock{position:fixed;top:58px;left:50%;transform:translateX(-50%);background:var(--pa-surface, rgba(23,23,26,0.94));color:var(--pa-surface-contrast, #fff);\n padding:6px 8px;border-radius:14px;pointer-events:auto;z-index:5;display:flex;gap:8px;align-items:center;\n flex-wrap:wrap;max-width:calc(100vw - 16px);box-shadow:0 8px 24px var(--pa-shadow, rgba(0,0,0,0.28));}\n .mark-dock[hidden]{display:none;}\n .mark-seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;gap:2px;}\n .mark-seg button{width:28px;height:26px;padding:0;display:flex;align-items:center;justify-content:center;\n background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,.72));border-radius:999px;cursor:pointer;}\n .mark-seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);}\n .mark-colors{display:flex;gap:5px;align-items:center;}\n .mark-color{width:16px;height:16px;border-radius:50%;border:2px solid transparent;padding:0;cursor:pointer;\n box-shadow:inset 0 0 0 1px var(--pa-shadow, rgba(0,0,0,.28));}\n .mark-color.on{border-color:var(--pa-surface-contrast, #fff);}\n .mark-size{display:flex;align-items:center;gap:2px;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px 4px;}\n .mark-size button{width:22px;height:22px;padding:0;border:none;border-radius:999px;background:transparent;\n color:var(--pa-surface-contrast, #fff);cursor:pointer;font-size:14px;line-height:1;}\n .mark-size button:hover:not(:disabled){background:var(--pa-hover, rgba(255,255,255,0.16));}\n .mark-size button:disabled{opacity:.34;cursor:default;}\n .mark-size .v{min-width:22px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums;color:var(--pa-surface-contrast, #f1f0ed);}\n .mark-comment{width:120px;height:28px;border:1px solid var(--pa-border, rgba(255,255,255,.18));background:var(--pa-field, rgba(0,0,0,.25));\n color:var(--pa-surface-contrast, #f1f0ed);border-radius:8px;padding:0 8px;font-size:12px;outline:none;}\n .mark-save{width:28px;height:28px;border:none;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);cursor:pointer;font-size:15px;}\n .mark-save:disabled{opacity:.45;cursor:default;}\n :host(.capturing) .bar,:host(.capturing) .mark-dock,:host(.capturing) .epanel,:host(.capturing) .pin,\n :host(.capturing) .toast,:host(.capturing) .hl,:host(.capturing) .tag,:host(.capturing) .region-box,\n :host(.capturing) .region-size,:host(.capturing) .sel-clear{visibility:hidden!important;}\n\n .seg{display:flex;background:var(--pa-field, rgba(255,255,255,0.12));border-radius:999px;padding:2px;}\n .seg button{background:transparent;border:none;color:var(--pa-muted, rgba(255,255,255,0.72));padding:3px 12px;\n border-radius:999px;font-size:12px;cursor:pointer;transition:background .12s,color .12s;}\n .seg button.on{background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);font-weight:600;}\n\n .epanel{position:fixed;width:360px;max-width:94vw;background:var(--pa-surface, #17171a);border:1px solid var(--pa-border, #3a352f);\n border-radius:16px;box-shadow:0 18px 48px var(--pa-shadow, rgba(0,0,0,0.5));pointer-events:auto;z-index:6;\n color:var(--pa-surface-contrast, #f1f0ed);overflow:hidden;animation:uibotpop .12s ease-out;}\n .epanel .etop{display:flex;align-items:center;gap:9px;padding:11px 13px;border-bottom:1px solid var(--pa-border, #332f29);}\n .epanel .etop .ico{flex-shrink:0;color:var(--pa-muted, #b9b1a4);font-size:15px;}\n .epanel .etop input{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;}\n .epanel .etop input::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .etop textarea{flex:1;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13.5px;\n resize:none;font-family:inherit;line-height:1.45;max-height:96px;padding:0;}\n .epanel .etop textarea::placeholder{color:var(--pa-muted, #8a8275);}\n .epanel .ehead{display:flex;align-items:center;gap:8px;padding:8px 10px;color:var(--pa-surface-contrast, #cfc8bb);font-size:12.5px;user-select:none;}\n .epanel .ehead .back{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;border:none;border-radius:8px;background:transparent;color:var(--pa-surface-contrast, #ece7df);cursor:pointer;}\n .epanel .ehead .back:hover{background:var(--pa-hover, rgba(255,255,255,0.06));}\n .epanel .ehead .name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,Menlo,monospace;background:var(--pa-selected, #3f372c);color:var(--pa-accent-contrast, #f1f0ed);border-radius:8px;padding:3px 8px;}\n .epanel .ehead .grip{margin-left:auto;color:var(--pa-muted, #6f685c);letter-spacing:2px;font-size:12px;cursor:move;padding:4px;}\n .prop-filter{display:flex;align-items:center;margin:8px 12px 4px;padding:7px 10px;border:1px solid var(--pa-border, #3a352f);border-radius:10px;background:var(--pa-field, #1d1b19);}\n .prop-filter input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:13px;}\n .prop-filter input::placeholder{color:var(--pa-muted, #8a8275);}\n .einstruct{padding:0 12px 6px;}\n .einstruct input{width:100%;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);font-size:12.5px;}\n .einstruct input::placeholder{color:var(--pa-muted, #8a8275);}\n .prow{display:grid;grid-template-columns:16px minmax(88px,0.85fr) minmax(0,1.3fr);align-items:center;gap:8px;padding:5px 12px;}\n .prow[hidden]{display:none;}\n .prow .pname{font-size:12px;color:var(--pa-muted, #a9a194);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,Menlo,monospace;}\n .prow input[type=checkbox]{width:14px;height:14px;margin:0;accent-color:var(--pa-accent, #7c2d34);}\n .mbox{display:grid;grid-template-columns:1fr 1fr;gap:4px;}\n .mbox input{min-width:0;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:8px;color:var(--pa-surface-contrast, #ece7df);padding:6px 8px;font-size:12px;font-family:ui-monospace,Menlo,monospace;}\n .erows{max-height:46vh;overflow:auto;padding:2px 0 4px;}\n .erow{display:flex;align-items:center;gap:10px;padding:6px 14px;}\n .erow>span.lb{width:64px;flex-shrink:0;font-size:12.5px;color:var(--pa-muted, #a9a194);}\n .erow .ctl{flex:1;min-width:0;}\n .efield{width:100%;display:flex;align-items:center;gap:8px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);\n border-radius:9px;padding:7px 10px;transition:border-color .12s;}\n .efield:focus-within{border-color:var(--pa-accent, #7c2d34);}\n .efield input{flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--pa-surface-contrast, #ece7df);\n font-size:12.5px;font-family:ui-monospace,Menlo,monospace;}\n .sw{width:22px;height:22px;border-radius:50%;flex-shrink:0;border:1px solid var(--pa-border, rgba(255,255,255,0.28));cursor:pointer;\n background-image:linear-gradient(45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(-45deg,var(--pa-checker, #555) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pa-checker, #555) 75%),linear-gradient(-45deg,transparent 75%,var(--pa-checker, #555) 75%);\n background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0;position:relative;overflow:hidden;}\n .sw i{position:absolute;inset:0;border-radius:50%;}\n .sw:focus-within{outline:2px solid var(--pa-selected, #f1f0ed);outline-offset:2px;}\n .color-hit{position:absolute;inset:0;width:100%!important;height:100%;opacity:0;cursor:pointer;pointer-events:auto;}\n .stepper{display:grid;grid-template-columns:30px minmax(48px,1fr) auto 30px;align-items:center;gap:4px;padding:3px;}\n .stepper button{width:30px;height:30px;border:0;border-radius:7px;background:var(--pa-field, #2b2723);color:var(--pa-surface-contrast, #ece7df);cursor:pointer;\n display:flex;align-items:center;justify-content:center;transition:background .12s,color .12s;}\n .stepper button:hover:not(:disabled){background:var(--pa-hover, #3b352e);color:var(--pa-surface-contrast, #fff);}\n .stepper button:disabled{opacity:.34;cursor:default;}\n .stepper button svg{width:14px;height:14px;pointer-events:none;}\n .stepper input[type=number]{width:100%;text-align:center;font-variant-numeric:tabular-nums;appearance:textfield;}\n .stepper input[type=number]::-webkit-inner-spin-button,.stepper input[type=number]::-webkit-outer-spin-button{appearance:none;margin:0;}\n .stepper .unit{min-width:18px;color:var(--pa-muted, #8a8275);font-size:11px;text-align:left;}\n .ebar{display:flex;align-items:center;padding:11px 14px;border-top:1px solid var(--pa-border, #332f29);gap:10px;}\n .ebar .cancel{background:transparent;border:1px solid var(--pa-border, #4a443c);color:var(--pa-surface-contrast, #cfc8bb);border-radius:999px;\n padding:6px 16px;font-size:13px;cursor:pointer;transition:background .12s;}\n .ebar .cancel:hover{background:var(--pa-hover, rgba(255,255,255,0.06));}\n .ebar .ok{margin-left:auto;width:36px;height:36px;border-radius:50%;background:var(--pa-selected, #f1f0ed);color:var(--pa-accent-contrast, #17171a);border:none;\n cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:17px;line-height:1;transition:background .12s;}\n .ebar .ok:hover{background:var(--pa-hover, #f0ece4);}\n .ebar .ok:disabled{opacity:.55;cursor:default;}\n .epanel .dd-btn{background:var(--pa-field, #1d1b19);border-color:var(--pa-border, #3a352f);color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-btn:hover{border-color:var(--pa-border, #5a5347);}\n .epanel .dd-btn.open{border-color:var(--pa-accent, #7c2d34);box-shadow:0 0 0 3px var(--pa-focus, rgba(124,45,52,0.18));}\n .epanel .dd-btn .chev{color:var(--pa-muted, #8a8275);}\n .epanel .dd-menu{background:var(--pa-field, #2b2723);border-color:var(--pa-border, #3a352f);}\n .epanel .dd-item{color:var(--pa-surface-contrast, #ece7df);}\n .epanel .dd-item:hover{background:var(--pa-hover, #37322b);}\n .epanel .dd-item.sel{background:var(--pa-selected, #3f372c);color:var(--pa-accent-contrast, #f1f0ed);}\n .quick-target{padding:10px 14px 0;color:var(--pa-muted, #a9a194);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}\n .quick-more{background:transparent;border:0;color:var(--pa-surface-contrast, #cfc8bb);cursor:pointer;padding:8px 14px;text-align:left;font-size:12px;}\n .advanced{border-top:1px solid var(--pa-border, #332f29);padding:4px 0;}\n .advanced[hidden]{display:none;}\n .advanced textarea{width:100%;min-height:54px;resize:vertical;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:8px;font-size:12px;}\n .advanced select{width:100%;min-height:34px;background:var(--pa-field, #1d1b19);border:1px solid var(--pa-border, #3a352f);border-radius:9px;color:var(--pa-surface-contrast, #ece7df);padding:6px 8px;}\n @media (prefers-reduced-motion: reduce){\n *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}\n }\n`;function Et(e){let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");return t.setAttribute(\"viewBox\",\"0 0 16 16\"),t.setAttribute(\"width\",\"14\"),t.setAttribute(\"height\",\"14\"),t.setAttribute(\"aria-hidden\",\"true\"),e(t),t}function Cr(){return Et((e)=>{for(let[t,n]of[[5.5,3],[10.5,3],[5.5,8],[10.5,8],[5.5,13],[10.5,13]]){let i=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");i.setAttribute(\"cx\",String(t)),i.setAttribute(\"cy\",String(n)),i.setAttribute(\"r\",\"1.15\"),i.setAttribute(\"fill\",\"currentColor\"),e.appendChild(i)}})}function Cn(){return Et((e)=>{let t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");t.setAttribute(\"d\",\"M4 4l8 8M12 4l-8 8\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"stroke\",\"currentColor\"),t.setAttribute(\"stroke-width\",\"1.8\"),t.setAttribute(\"stroke-linecap\",\"round\"),e.appendChild(t)})}function kn(e,t){let n=e.annotationRegionV2!==!1,i=\"__uibotAnnotatorActive\",a=window;if(a.__uibotAnnotatorActive)return;a.__uibotAnnotatorActive=!0;let c=hn(t.recordPerformance?.bind(t)),s=()=>{return},u=document.createElement(\"div\");u.id=\"__uibot-annotator-host\",u.style.cssText=\"position:fixed;inset:0;z-index:2147483646;pointer-events:none;color-scheme:dark;\",at(u,e.theme);let b=u.attachShadow({mode:\"open\"});(document.documentElement||document.body).appendChild(u);let C=document.createElement(\"style\");C.textContent=xn,b.appendChild(C);let A=document.createElement(\"div\");b.appendChild(A);let I=document.createElement(\"div\");I.className=\"hl\",I.style.display=\"none\";let k=document.createElement(\"div\");k.className=\"tag\",k.style.display=\"none\";let T=document.createElement(\"div\");T.className=\"selbox\",T.style.display=\"none\";let R=document.createElement(\"div\");R.className=\"pin active\",R.style.display=\"none\";let O=document.createElement(\"button\");O.type=\"button\",O.className=\"sel-clear\",O.style.display=\"none\",O.setAttribute(\"aria-label\",\"\u53D6\u6D88\u9009\u62E9\"),O.title=\"\u53D6\u6D88\u9009\u62E9\",O.appendChild(Cn()),O.addEventListener(\"click\",(r)=>{r.preventDefault(),r.stopPropagation(),Ct(!0)});let F=document.createElement(\"div\");F.className=\"region-box\";let Y=document.createElement(\"span\");Y.className=\"region-size\",F.appendChild(Y);let v=document.createElement(\"div\");v.className=\"sr-live\",v.setAttribute(\"aria-live\",\"polite\"),A.append(I,k,T,R,O,F,v);let E=null;function M(r,o){E=r,R.textContent=String(o),N()}function S(){E=null,T.style.display=\"none\",R.style.display=\"none\",O.style.display=\"none\"}function N(){if(!E)return;let r=E.getBoundingClientRect();T.style.display=\"block\",T.style.left=`${r.left-1}px`,T.style.top=`${r.top-1}px`,T.style.width=`${r.width+2}px`,T.style.height=`${r.height+2}px`,R.style.display=\"flex\",R.style.left=`${Math.max(2,r.left-6)}px`,R.style.top=`${Math.max(2,r.top-6)}px`,O.style.display=\"flex\",O.style.left=`${Math.min(window.innerWidth-26,Math.max(2,r.right-6))}px`,O.style.top=`${Math.max(2,r.top-16)}px`}let D=document.createElement(\"div\");D.className=\"bar\";let H=document.createElement(\"button\");H.type=\"button\",H.className=\"grip\",H.setAttribute(\"aria-label\",\"\u62D6\u52A8\u5DE5\u5177\u680F\"),H.title=\"\u62D6\u52A8\",H.appendChild(Cr());let G=document.createElement(\"div\");G.className=\"seg\";let ae=document.createElement(\"button\");ae.type=\"button\",ae.dataset.tool=\"element\",ae.textContent=\"\u5143\u7D20\",ae.className=\"on\";let K=document.createElement(\"button\");K.type=\"button\",K.dataset.tool=\"region\",K.textContent=\"\u533A\u57DF\",K.disabled=!n,K.title=n?\"\u6846\u9009\u533A\u57DF\":\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\";let Q=document.createElement(\"button\");Q.type=\"button\",Q.dataset.tool=\"adjust\",Q.textContent=\"\u8C03\u6574\",G.append(ae,K,Q);let se=document.createElement(\"button\");se.type=\"button\",se.className=\"exit\",se.setAttribute(\"aria-label\",\"\u9000\u51FA\"),se.title=\"\u9000\u51FA\",se.appendChild(Cn()),D.append(H,G,se),A.appendChild(D);let ge=It(D,H),le={current:()=>{return}},m=yn(A,{onSave:(r)=>le.current(r)}),h=\"element\",x=\"hovering\",j=null,w=null,oe=null,X=!1,_e=null,ye=null;function ft(){if(_e&&ye!=null)try{_e.releasePointerCapture?.(ye)}catch{}_e=null,ye=null}function Vt(){ft(),oe=null,X=!1,w=null,F.style.display=\"none\"}function Re(r){if(r===\"region\"&&!n)return;if(r===h)return;Ct(!0),h=r,ae.classList.toggle(\"on\",h===\"element\"),K.classList.toggle(\"on\",h===\"region\"),Q.classList.toggle(\"on\",h===\"adjust\"),ht(),F.style.display=\"none\",w=null,oe=null,X=!1,ft(),m.setActive(h===\"region\")}ae.addEventListener(\"click\",()=>Re(\"element\")),K.addEventListener(\"click\",()=>Re(\"region\")),Q.addEventListener(\"click\",()=>Re(\"adjust\"));function he(r,o,l){return Math.min(l,Math.max(o,r))}function zr(r,o){let l=he(r.x,0,window.innerWidth),d=he(r.y,0,window.innerHeight),f=he(o.x,0,window.innerWidth),g=he(o.y,0,window.innerHeight),p={x:Math.min(l,f),y:Math.min(d,g),width:Math.abs(f-l),height:Math.abs(g-d)};return p.width>=8&&p.height>=8?p:null}function yt(r){F.style.display=\"block\",F.style.left=`${r.x}px`,F.style.top=`${r.y}px`,F.style.width=`${r.width}px`,F.style.height=`${r.height}px`,Y.textContent=`${Math.round(r.width)} \u00D7 ${Math.round(r.height)}`,v.textContent=`\u533A\u57DF x ${Math.round(r.x)}\uFF0Cy ${Math.round(r.y)}\uFF0C\u5BBD ${Math.round(r.width)}\uFF0C\u9AD8 ${Math.round(r.height)}`}function Bn(r){let o=[[r.x+r.width/2,r.y+r.height/2],[r.x+1,r.y+1],[r.x+r.width-1,r.y+r.height-1]],l=[];return o.forEach(([d,f])=>{let g=document.elementFromPoint(d,f);if(!g||nt(g)||l.some((p)=>p.tagName===g.tagName.toLowerCase()))return;l.push({tagName:g.tagName.toLowerCase(),...fe(g.textContent||\"\",60)?{text:fe(g.textContent||\"\",60)}:{},...g.getAttribute(\"role\")?{role:g.getAttribute(\"role\")}:{}})}),l}function jt(r,o=[]){let l={x:Math.round(r.x+window.scrollX),y:Math.round(r.y+window.scrollY),width:Math.round(r.width),height:Math.round(r.height)},d={width:window.innerWidth,height:window.innerHeight},f={x:window.scrollX,y:window.scrollY},g=mn(o,window.scrollX,window.scrollY);return{comment:\"\",type:\"other\",priority:\"medium\",target:{kind:\"region\",rect:l,viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,topLevelElements:Bn(r),...g.length?{marks:g}:{}},styleSummary:{},geometry:{viewport:d,scroll:f,devicePixelRatio:window.devicePixelRatio||1,center:{x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2)},visible:!0},pageContext:At()}}function qt(r){let o=r.getBoundingClientRect();I.style.display=\"block\",I.style.left=`${o.left}px`,I.style.top=`${o.top}px`,I.style.width=`${o.width}px`,I.style.height=`${o.height}px`;let l=Array.from(r.classList).slice(0,2).join(\".\");k.textContent=`${r.tagName.toLowerCase()}${l?\".\"+l:\"\"} \u00B7 ${Math.round(o.width)}\u00D7${Math.round(o.height)}`,k.style.display=\"block\";let d=o.top>22?o.top-20:o.bottom+4;k.style.left=`${Math.max(2,o.left)}px`,k.style.top=`${d}px`}function ht(){I.style.display=\"none\",k.style.display=\"none\"}function Le(r){let o=document.createElement(\"div\");o.className=\"toast\",o.style.background=\"var(--pa-success, #15803d)\",o.style.color=\"var(--pa-success-contrast, #fff)\",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1600)}let zt={blocker:0,high:1,medium:2,low:3},Se=[];function Vn(r){let o=r.getBoundingClientRect(),l=document.createElement(\"div\");l.className=\"flash\",l.style.left=`${o.left-2}px`,l.style.top=`${o.top-2}px`,l.style.width=`${o.width+4}px`,l.style.height=`${o.height+4}px`,A.appendChild(l),setTimeout(()=>l.remove(),1300)}function bt(r,o){let l=r.kind===\"element\"?document.querySelector(r.cssSelector):null;if(r.kind===\"element\"&&!l){o.style.display=\"none\";return}let d=l?.getBoundingClientRect()??{left:r.kind===\"region\"?r.rect.x-window.scrollX:0,top:r.kind===\"region\"?r.rect.y-window.scrollY:0,width:r.kind===\"region\"?r.rect.width:0,height:r.kind===\"region\"?r.rect.height:0};if(d.width===0&&d.height===0){o.style.display=\"none\";return}o.style.display=\"flex\",o.style.left=`${Math.max(2,d.left-6)}px`,o.style.top=`${Math.max(2,d.top-6)}px`}function $t(){for(let r of Se)r.pinEl.remove();Se=[]}function jn(r){$t(),r.filter((l)=>l.status===\"open\"||l.status===\"processing\").sort((l,d)=>(zt[l.priority]??9)-(zt[d.priority]??9)||(l.createdAt||\"\").localeCompare(d.createdAt||\"\")).forEach((l,d)=>{if(!l.target||l.target.kind===\"element\"&&!l.target.cssSelector)return;let f=document.createElement(\"div\");f.className=\"pin marker\",f.textContent=String(d+1),f.title=l.comment||\"\",f.addEventListener(\"click\",(g)=>{g.stopPropagation();let p=l.target.kind===\"element\"?document.querySelector(l.target.cssSelector):null;if(p)p.scrollIntoView({block:\"center\"}),Vn(p),Le(l.comment?`#${d+1} ${l.comment}`:`#${d+1}`),bt(l.target,f);else if(l.target.kind===\"region\")window.scrollTo({top:Math.max(0,l.target.rect.y-window.innerHeight/2),left:l.target.rect.x}),yt({x:l.target.rect.x-window.scrollX,y:l.target.rect.y-window.scrollY,width:l.target.rect.width,height:l.target.rect.height}),setTimeout(()=>{if(!w)F.style.display=\"none\"},1300),Le(l.comment?`#${d+1} ${l.comment}`:`#${d+1}`);else ee(`#${d+1} \u5143\u7D20\u672A\u627E\u5230\uFF08\u9875\u9762\u53EF\u80FD\u5DF2\u53D8\u5316\uFF09`)}),A.appendChild(f),Se.push({target:l.target,pinEl:f}),bt(l.target,f)})}async function Fe(){let r=c.start(\"markers_loaded\");try{let o=await t.sendMessage({action:U.list,pageUrl:location.href});if(o&&o.success&&Array.isArray(o.data))jn(o.data),r(\"success\");else r(\"failure\")}catch{r(\"failure\")}}let be=[];function qn(r,o,l){let d=o,f=document.createElement(\"div\");f.className=\"dd\";let g=document.createElement(\"button\");g.type=\"button\",g.className=\"dd-btn\";let p=document.createElement(\"span\");p.className=\"v\";let y=document.createElement(\"span\");y.className=\"chev\",y.textContent=\"\u25BE\",g.append(p,y);let P=document.createElement(\"div\");P.className=\"dd-menu\",P.style.display=\"none\";function q(){let V=r.find((B)=>B.value===d);if(p.textContent=\"\",V?.color){let B=document.createElement(\"span\");B.className=\"swatch\",B.style.background=V.color,p.appendChild(B)}p.appendChild(document.createTextNode(V?.label??\"\")),Array.from(P.children).forEach((B,ne)=>{B.classList.toggle(\"sel\",r[ne].value===d)})}function L(){P.style.display=\"none\",g.classList.remove(\"open\")}function de(){for(let V of be)V();P.style.display=\"block\",g.classList.add(\"open\")}return be.push(L),r.forEach((V)=>{let B=document.createElement(\"button\");if(B.type=\"button\",B.className=\"dd-item\",V.color){let ne=document.createElement(\"span\");ne.className=\"swatch\",ne.style.background=V.color,B.appendChild(ne)}B.appendChild(document.createTextNode(V.label)),B.addEventListener(\"click\",(ne)=>{ne.stopPropagation(),d=V.value,q(),L(),l?.(d)}),P.appendChild(B)}),g.addEventListener(\"click\",(V)=>{V.stopPropagation(),P.style.display===\"none\"?de():L()}),f.append(g,P),q(),{el:f,get:()=>d,set:(V)=>{d=V,q()},close:L}}let zn=[{value:\"style\",label:\"\u6837\u5F0F\u95EE\u9898\"},{value:\"copywriting\",label:\"\u6587\u6848\u4FEE\u6539\"},{value:\"bug\",label:\"Bug\"},{value:\"feature\",label:\"\u529F\u80FD\u5EFA\u8BAE\"},{value:\"interaction\",label:\"\u4EA4\u4E92\u95EE\u9898\"},{value:\"data\",label:\"\u6570\u636E\u95EE\u9898\"},{value:\"other\",label:\"\u5176\u4ED6\"}],$n=[{value:\"low\",label:\"\u4F4E\",color:\"var(--pa-muted, #737373)\"},{value:\"medium\",label:\"\u4E2D\",color:\"var(--pa-surface-contrast, #17171a)\"},{value:\"high\",label:\"\u9AD8\",color:\"var(--pa-accent, #7c2d34)\"},{value:\"blocker\",label:\"\u963B\u585E\",color:\"var(--pa-danger, #5c151c)\"}],W=null,Z=null,Be=null,Ve=null,je=null,qe=null,ce=null;function Ut(r){let o=document.createElement(\"button\");return o.type=\"button\",o.className=\"ok\",o.dataset.icon=\"confirm\",o.textContent=\"\u2713\",o.title=r,o.setAttribute(\"aria-label\",r),o}function Pe(r,o){if(!r)return;r.textContent=o?\"\u2026\":\"\u2713\",r.toggleAttribute(\"aria-busy\",o),r.disabled=o}function Ht(r){for(let o of[\"data-component\",\"data-uibot-component\",\"data-testid\"]){let l=r.getAttribute(o)?.trim();if(l)return l.slice(0,48)}return r.tagName.toLowerCase()}function Un(){return Et((r)=>{let o=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");o.setAttribute(\"d\",\"M10 3L5 8l5 5\"),o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"currentColor\"),o.setAttribute(\"stroke-width\",\"1.8\"),o.setAttribute(\"stroke-linecap\",\"round\"),o.setAttribute(\"stroke-linejoin\",\"round\"),r.appendChild(o)})}function Wt(r,o){let l=document.createElement(\"div\");l.className=\"ehead\";let d=document.createElement(\"button\");d.type=\"button\",d.className=\"back\",d.setAttribute(\"aria-label\",\"\u53D6\u6D88\u9009\u62E9\"),d.title=\"\u53D6\u6D88\u9009\u62E9\",d.appendChild(Un()),d.addEventListener(\"click\",(g)=>{g.preventDefault(),g.stopPropagation(),o()});let f=document.createElement(\"span\");return f.className=\"name\",f.textContent=r,f.title=r,l.append(d,f),l}function Ze(){W?.remove(),W=null,Z=Be=Ve=ce=null,je=qe=null,be.length=0,S(),F.style.display=\"none\",x=\"hovering\",j=null,w=null,X=!1}function Kt(r,o){if(o&&!n)return;if(x=\"editing\",j=r,w=o??null,ht(),r)M(r,Se.length+1);else S();if(o)yt(o);let l=r?.getBoundingClientRect(),d=l?{left:l.left,top:l.top,right:l.right,bottom:l.bottom}:o?{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height}:{left:8,top:80,right:8,bottom:80};be.length=0,W=document.createElement(\"div\"),W.className=\"epanel\",W.setAttribute(\"role\",\"dialog\"),W.setAttribute(\"aria-modal\",\"true\"),W.setAttribute(\"aria-label\",o?\"\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8\":\"\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8\"),W.addEventListener(\"click\",()=>{for(let _ of be)_()});let f=Wt(o?`\u533A\u57DF ${Math.round(o.width)}\u00D7${Math.round(o.height)}`:Ht(r),Ze),g=document.createElement(\"div\");g.className=\"etop\",Z=document.createElement(\"textarea\"),Z.rows=3,Z.placeholder=\"\u54EA\u91CC\u4E0D\u5BF9\uFF1F\u8BF4\u660E\u671F\u671B\u5373\u53EF\uFF0C\u4F8B\u5982\uFF1A\u79FB\u52A8\u7AEF\u6309\u94AE\u6587\u5B57\u6362\u884C\uFF1B\u80FD\u653E\u4E0B\u65F6\u4FDD\u6301\u5355\u884C\uFF0C\u4E14\u5361\u7247\u9AD8\u5EA6\u4E0D\u53D8\u3002\",Z.addEventListener(\"input\",()=>{if(Z.style.height=\"auto\",Z.style.height=`${Math.min(Math.max(Z.scrollHeight,72),144)}px`,ce)ce.disabled=!Z.value.trim()}),g.append(Z);let p=document.createElement(\"button\");p.type=\"button\",p.dataset.action=\"more\",p.className=\"quick-more\",p.textContent=\"\u66F4\u591A\u8BBE\u7F6E \u25BE\",p.setAttribute(\"aria-expanded\",\"false\");let y=document.createElement(\"div\");y.className=\"advanced\",y.id=\"__uibot-annotation-advanced\",y.hidden=!0,p.setAttribute(\"aria-controls\",y.id);let P=(_,me)=>{let xe=document.createElement(\"label\");xe.className=\"erow\";let Te=document.createElement(\"span\");Te.className=\"lb\",Te.textContent=_;let Ne=document.createElement(\"div\");return Ne.className=\"ctl\",Ne.append(me),xe.append(Te,Ne),xe};Be=document.createElement(\"textarea\"),Be.placeholder=\"\u4F8B\u5982\uFF1A\u5BBD\u5EA6\u8DB3\u591F\u65F6\u4FDD\u6301\u5355\u884C\",Ve=document.createElement(\"textarea\"),Ve.placeholder=\"\u4F8B\u5982\uFF1A\u5361\u7247\u9AD8\u5EA6\u548C\u70B9\u51FB\u884C\u4E3A\u4E0D\u53D8\",je=document.createElement(\"select\");for(let _ of zn)je.add(new Option(_.label,_.value,!1,_.value===\"other\"));qe=document.createElement(\"select\");for(let _ of $n)qe.add(new Option(_.label,_.value,!1,_.value===\"medium\"));y.append(P(\"\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09\",Be),P(\"\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09\",Ve),P(\"\u7C7B\u578B\",je),P(\"\u4F18\u5148\u7EA7\",qe)),p.addEventListener(\"click\",(_)=>{_.stopPropagation(),y.hidden=!y.hidden,p.textContent=y.hidden?\"\u66F4\u591A\u8BBE\u7F6E \u25BE\":\"\u6536\u8D77\u8BBE\u7F6E \u25B4\",p.setAttribute(\"aria-expanded\",String(!y.hidden))});let q=document.createElement(\"div\");q.className=\"ebar\";let L=document.createElement(\"button\");L.type=\"button\",L.className=\"cancel\",L.textContent=\"\u53D6\u6D88\",L.addEventListener(\"click\",Ze),ce=Ut(\"\u4FDD\u5B58\u6807\u6CE8\"),ce.dataset.action=\"save\",ce.disabled=!0,ce.addEventListener(\"click\",()=>void Yt()),q.append(L,ce),W.append(f,g,p,y,q),W.addEventListener(\"keydown\",(_)=>{if(_.key===\"Enter\"&&(_.ctrlKey||_.metaKey)){if(_.preventDefault(),!ce?.disabled)Yt();return}if(_.key!==\"Tab\")return;let me=[...W.querySelectorAll(\"button:not([disabled]),textarea:not([disabled]),select:not([disabled]),input:not([disabled])\")].filter((er)=>!er.closest(\"[hidden]\"));if(!me.length)return;let xe=me[0],Te=me[me.length-1],Ne=b.activeElement;if(_.shiftKey&&Ne===xe)_.preventDefault(),Te.focus();else if(!_.shiftKey&&Ne===Te)_.preventDefault(),xe.focus()}),A.appendChild(W);let de=360,V=d.left,B=d.bottom+10;if(V+de>window.innerWidth-8)V=window.innerWidth-de-8;if(V<8)V=8;let ne=W.offsetHeight||300;if(B+ne>window.innerHeight-8)B=Math.max(8,d.top-ne-10);W.style.left=`${V}px`,W.style.top=`${B}px`,Z.focus()}async function Yt(){if(!j&&!w||!Z)return;if(w&&!n){ee(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let r=Z.value.trim();if(!r){ee(\"\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9\"),Z.focus();return}let o=w?jt(w):wt(j);o.comment=r,o.type=je?.value??\"other\",o.priority=qe?.value??\"medium\";let l=Be?.value.trim();if(l)o.expectedResult=l;let d=Ve?.value.trim();if(d)o.preserve=d;u.style.visibility=\"hidden\";let f=ce;Pe(f,!0);let g=c.start(\"save_durable\");try{let p=await t.sendMessage({action:U.save,data:o});if(u.style.visibility=\"visible\",p&&p.success){g(\"success\"),Ze(),Fe(),Le(\"\u5DF2\u4FDD\u5B58\");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:o}).catch(()=>{})}else g(\"failure\"),console.error(\"[uibot annotation] save rejected:\",p),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Pe(f,!1)}catch(p){g(\"failure\"),u.style.visibility=\"visible\",console.error(\"[uibot annotation] save threw:\",p);let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),Pe(f,!1)}}async function Hn(r){if(!n){ee(\"\u533A\u57DF\u6807\u6CE8\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6539\u7528\u5143\u7D20\u6807\u6CE8\");return}let o=Ke(r.marks,0),l=o?Pt(o,{width:window.innerWidth,height:window.innerHeight}):null;if(!l){ee(\"\u8BF7\u5148\u6846\u9009\u533A\u57DF\u6216\u6DFB\u52A0\u7BAD\u5934/\u6587\u672C\");return}let d=r.comment.trim()||gn(r.marks),f=jt(l,r.marks);f.comment=d,m.setBusy(!0),u.classList.add(\"capturing\"),m.setCapturing(!0);let g=c.start(\"save_durable\");try{let p=await t.sendMessage({action:U.save,data:f});if(p&&p.success){g(\"success\");let y=p.data?.id,P=Pt(Ke(r.marks,16)??l,{width:window.innerWidth,height:window.innerHeight}),q=!0;if(y&&P&&t.captureRegion)await new Promise((L)=>{requestAnimationFrame(()=>requestAnimationFrame(()=>L()))}),q=await t.captureRegion({id:y,...P}).catch(()=>!1);if(m.clear(),m.setBusy(!1),Fe(),q)Le(\"\u5DF2\u4FDD\u5B58\");else ee(\"\u6807\u6CE8\u5DF2\u4FDD\u5B58\uFF0C\u622A\u56FE\u672A\u5B8C\u6210\");if(y)t.sendMessage({action:U.enrich,annotationId:y,data:f}).catch(()=>{})}else g(\"failure\"),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),m.setBusy(!1)}catch(p){g(\"failure\");let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u65B0\u6807\u6CE8\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),m.setBusy(!1)}finally{u.classList.remove(\"capturing\"),m.setCapturing(!1)}}le.current=(r)=>{Hn(r)};function ee(r){let o=document.createElement(\"div\");o.className=\"toast\",o.style.background=\"var(--pa-danger, #b91c1c)\",o.style.color=\"var(--pa-danger-contrast, #fff)\",o.textContent=r,A.appendChild(o),setTimeout(()=>o.remove(),1800)}let te=null,Je=null,Ae=null,ze=null,Qe=[],$e=[];function Gt(r){let o=r.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);if(!o){let d=document.createElement(\"span\");if(d.style.color=r,!d.style.color)d.style.color=\"var(--pa-color-default, #000000)\";b.appendChild(d);let f=getComputedStyle(d).color;d.remove();let g=document.createElement(\"canvas\").getContext(\"2d\");if(!g)return\"#000000\";if(g.fillStyle=f,/^#[0-9a-f]{6}$/i.test(g.fillStyle))return g.fillStyle;g.fillRect(0,0,1,1);let p=g.getImageData(0,0,1,1).data;return`#${[p[0],p[1],p[2]].map((y)=>(y??0).toString(16).padStart(2,\"0\")).join(\"\")}`}let l=(d)=>Math.max(0,Math.min(255,Number.parseInt(d,10))).toString(16).padStart(2,\"0\");return`#${l(o[1])}${l(o[2])}${l(o[3])}`}function et(r,o){let l=r.style.getPropertyValue(o),d=()=>{if(l)r.style.setProperty(o,l);else r.style.removeProperty(o)};return $e.push(d),{revert:d,apply:(f)=>{r.style.setProperty(o,f)}}}function Ue(r){let o=document.createElement(\"div\");o.className=\"prow\",o.dataset.filter=r.filter.toLowerCase();let l=document.createElement(\"input\");l.type=\"checkbox\",l.setAttribute(\"aria-label\",`\u9009\u62E9 ${r.name}`);let d=document.createElement(\"span\");d.className=\"pname\",d.textContent=r.name,d.title=r.name;let f=()=>{l.checked=!0,r.apply()};return l.addEventListener(\"change\",()=>{if(l.checked){if(r.read()!==r.before)r.apply()}else r.revert(),r.reset()}),r.control.addEventListener(\"input\",()=>{f()}),r.onReady?.(f),o.append(l,d,r.control),Qe.push({kind:r.kind,label:r.name,before:r.before,read:r.read,selected:()=>l.checked,...r.property===void 0?{}:{property:r.property}}),o}function xt(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"label\");g.className=\"sw\";let p=document.createElement(\"i\");p.style.background=l||\"transparent\",g.appendChild(p);let y=document.createElement(\"input\");y.value=l,y.setAttribute(\"aria-label\",o);let P=document.createElement(\"input\");P.type=\"color\",P.value=Gt(l||\"#000000\"),P.className=\"color-hit\",P.setAttribute(\"aria-label\",`\u9009\u62E9${o}`);let q=(L)=>{p.style.background=L||\"transparent\"};return P.addEventListener(\"input\",()=>{y.value=P.value,q(P.value)}),y.addEventListener(\"input\",()=>{q(y.value)}),g.appendChild(P),f.append(g,y),Ue({name:o,filter:o,control:f,kind:\"style\",property:o,before:l,read:()=>y.value.trim(),reset:()=>{y.value=l,q(l),P.value=Gt(l||\"#000000\")},apply:()=>d.apply(y.value.trim()),revert:d.revert})}function Ie(r,o){let l=getComputedStyle(r).getPropertyValue(o).trim(),d=et(r,o),f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"input\");return g.value=l,g.setAttribute(\"aria-label\",o),f.appendChild(g),Ue({name:o,filter:o,control:f,kind:\"style\",property:o,before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>d.apply(g.value.trim()),revert:d.revert})}function Ee(r,o,l){let d=getComputedStyle(r).getPropertyValue(o).trim(),f=et(r,o),g=[...l];if(d&&!g.includes(d))g.unshift(d);let p=g.includes(d)?d:g[0]??\"\",y=p,P=()=>{},q=qn(g.map((L)=>({value:L,label:L})),p,(L)=>{y=L,P()});return Ue({name:o,filter:o,control:q.el,kind:\"style\",property:o,before:d,read:()=>y,reset:()=>{y=p,q.set(p)},apply:()=>f.apply(y),revert:f.revert,onReady:(L)=>{P=L}})}function Wn(r){let o=[\"top\",\"right\",\"bottom\",\"left\"],l=o.map((p)=>getComputedStyle(r).getPropertyValue(`margin-${p}`).trim()),d=o.map((p)=>et(r,`margin-${p}`)),f=o.map((p,y)=>{let P=document.createElement(\"input\");return P.value=l[y]??\"\",P.setAttribute(\"aria-label\",`margin-${p}`),P}),g=document.createElement(\"div\");return g.className=\"mbox\",g.append(...f),Ue({name:\"margin\",filter:\"margin\",control:g,kind:\"style\",property:\"margin\",before:l.join(\" \"),read:()=>f.map((p)=>p.value.trim()).join(\" \"),reset:()=>{f.forEach((p,y)=>{p.value=l[y]??\"\"})},apply:()=>{for(let[p,y]of f.entries())d[p]?.apply(y.value.trim())},revert:()=>{for(let p of d)p.revert()}})}function Kn(r){if(r.children.length>0||!(r.textContent||\"\").trim())return null;let o=r.textContent||\"\",l=o.replace(/\\s+/g,\" \").trim(),d=()=>{r.textContent=o};$e.push(d);let f=document.createElement(\"div\");f.className=\"efield\";let g=document.createElement(\"input\");return g.value=l,g.setAttribute(\"aria-label\",\"\u6587\u6848\"),f.appendChild(g),Ue({name:\"\u6587\u6848\",filter:\"\u6587\u6848 text\",control:f,kind:\"text\",before:l,read:()=>g.value.trim(),reset:()=>{g.value=l},apply:()=>{r.textContent=g.value},revert:d})}let He=()=>{return};function tt(r){if(r)$e.forEach((o)=>{try{o()}catch{}});$e.length=0,Qe=[],He(),He=()=>{return},te?.remove(),te=null,Je=null,Ae=ze=null,be.length=0,S(),x=\"hovering\",j=null}function Ct(r){if(W)Ze();if(te)tt(r)}function Yn(r){x=\"editing\",j=r,Je=r,ht(),M(r,Se.length+1),Qe=[],$e.length=0,be.length=0;let o=r.getBoundingClientRect();te=document.createElement(\"div\"),te.className=\"epanel\",te.addEventListener(\"click\",()=>{for(let _ of be)_()});let l=Wt(Ht(r),()=>tt(!0)),d=document.createElement(\"span\");d.className=\"grip\",d.textContent=\"\u283F\",d.setAttribute(\"aria-hidden\",\"true\"),l.appendChild(d);let f=document.createElement(\"label\");f.className=\"prop-filter\";let g=document.createElement(\"input\");g.placeholder=\"\u7B5B\u9009\u5C5E\u6027\",g.setAttribute(\"aria-label\",\"\u7B5B\u9009\u5C5E\u6027\"),f.appendChild(g);let p=document.createElement(\"div\");p.className=\"einstruct\",Ae=document.createElement(\"input\"),Ae.placeholder=\"\u7528\u4E00\u53E5\u8BDD\u63CF\u8FF0\u60F3\u8981\u7684\u4FEE\u6539\uFF08\u53EF\u9009\uFF09\",Ae.setAttribute(\"aria-label\",\"\u4FEE\u6539\u8BF4\u660E\"),p.appendChild(Ae);let y=document.createElement(\"div\");y.className=\"erows\";let P=[xt(r,\"background-color\"),xt(r,\"border-color\"),Ie(r,\"border-width\"),Ee(r,\"border-style\",[\"none\",\"solid\",\"dashed\",\"dotted\",\"double\"]),Ie(r,\"border-radius\"),Ie(r,\"opacity\"),Wn(r),Ie(r,\"padding\"),Ie(r,\"gap\"),Ee(r,\"display\",[\"block\",\"flex\",\"inline-flex\",\"grid\",\"inline-block\",\"inline\",\"none\"]),Ee(r,\"flex-direction\",[\"row\",\"column\",\"row-reverse\",\"column-reverse\"]),Ee(r,\"flex-wrap\",[\"nowrap\",\"wrap\",\"wrap-reverse\"]),Ee(r,\"justify-content\",[\"flex-start\",\"center\",\"flex-end\",\"space-between\",\"space-around\",\"space-evenly\"]),xt(r,\"color\"),Ie(r,\"font-size\"),Ee(r,\"font-weight\",[\"300\",\"400\",\"500\",\"600\",\"700\"])],q=Kn(r);if(q)P.push(q);y.append(...P),g.addEventListener(\"input\",()=>{let _=g.value.trim().toLowerCase();for(let me of y.querySelectorAll(\".prow\")){let xe=me.dataset.filter??\"\";me.hidden=_.length>0&&!xe.includes(_)}});let L=document.createElement(\"div\");L.className=\"ebar\";let de=document.createElement(\"button\");de.type=\"button\",de.className=\"cancel\",de.textContent=\"\u53D6\u6D88\",de.addEventListener(\"click\",()=>tt(!0)),ze=Ut(\"\u4FDD\u5B58\u4FEE\u6539\"),ze.addEventListener(\"click\",()=>void Xn()),L.append(de,ze),te.append(l,f,p,y,L),A.appendChild(te),He(),He=It(te,d);let V=360,B=o.right+12;if(B+V>window.innerWidth-8)B=Math.max(8,o.left-V-12);if(B<8)B=8;let ne=Math.max(8,Math.min(o.top,window.innerHeight-(te.offsetHeight||360)-8));te.style.left=`${B}px`,te.style.top=`${ne}px`,Ae.focus()}function Gn(r){return r.map((o)=>`${o.label} ${fe(o.before,24)}\u2192${fe(o.after,24)}`).join(\"\uFF1B\")}async function Xn(){if(!Je)return;let r=Je,o=[];for(let p of Qe){if(!p.selected())continue;let y=p.read();if(y!==p.before)o.push({kind:p.kind,label:p.label,...p.property===void 0?{}:{property:p.property},before:p.before,after:y})}let l=Ae?.value.trim()||\"\";if(o.length===0&&!l){ee(\"\u672A\u505A\u4EFB\u4F55\u4FEE\u6539\");return}let d=wt(r);d.type=\"style\",d.edits=o;let f=Gn(o);if(d.comment=l||(f?`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A${f}`:\"\u53EF\u89C6\u5316\u4FEE\u6539\"),l&&f)d.expectedResult=f;u.style.visibility=\"hidden\";let g=ze;Pe(g,!0);try{let p=await t.sendMessage({action:U.save,data:d});if(u.style.visibility=\"visible\",p&&p.success){tt(!1),Fe(),Le(\"\u5DF2\u4FDD\u5B58\");let y=p.data?.id;if(y)t.sendMessage({action:U.enrich,annotationId:y,data:d}).catch(()=>{})}else console.error(\"[uibot annotation] edit save rejected:\",p),ee(p?.error?`\u4FDD\u5B58\u5931\u8D25\uFF1A${p.error}`:\"\u4FDD\u5B58\u5931\u8D25\"),Pe(g,!1)}catch(p){u.style.visibility=\"visible\";let y=p instanceof Error?p.message:String(p);ee(/context invalidated/i.test(y)?\"\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\":`\u4FDD\u5B58\u5931\u8D25\uFF1A${y}`),Pe(g,!1)}}function nt(r){if(!(r instanceof Node))return!1;if(u.contains(r))return!0;let o=r.getRootNode();return o instanceof ShadowRoot&&o.host===u}function Xt(r){if(x!==\"hovering\"||h===\"region\")return;let o=r.target;if(!o||nt(o)||o===u)return;j=o,qt(o)}function Zt(r){if(nt(r.target))return;let o=r.target;if(!o)return;if(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation?.(),x===\"hovering\"){if(h===\"adjust\")Yn(o);else if(h===\"element\")Kt(o)}}function Zn(){let r=b.activeElement;return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLElement&&r.isContentEditable}function Jt(r){if(Zn()||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLElement&&r.target.isContentEditable)return;if(x===\"hovering\"&&!X){if(r.key.toLowerCase()===\"e\")Re(\"element\");if(n&&r.key.toLowerCase()===\"r\")Re(\"region\");if(r.key.toLowerCase()===\"a\")Re(\"adjust\")}if(n&&h===\"region\"&&X&&w&&x===\"hovering\"){if(r.key===\"Enter\"){r.preventDefault(),X=!1,Kt(null,w);return}if(r.key.startsWith(\"Arrow\")){r.preventDefault();let l=r.shiftKey?10:1,d=r.key.replace(\"Arrow\",\"\").toLowerCase();if(r.altKey){let f=d===\"left\"?-l:d===\"right\"?l:0,g=d===\"up\"?-l:d===\"down\"?l:0;w={...w,width:he(w.width+f,8,window.innerWidth-w.x),height:he(w.height+g,8,window.innerHeight-w.y)}}else{let f=d===\"left\"?-l:d===\"right\"?l:0,g=d===\"up\"?-l:d===\"down\"?l:0;w={...w,x:he(w.x+f,0,window.innerWidth-w.width),y:he(w.y+g,0,window.innerHeight-w.height)}}yt(w);return}}if(r.key!==\"Escape\")return;if(m.isActive()&&(m.getMarks().length>0||oe||X)){m.clear(),Vt();return}if(oe||X){oe=null,X=!1,w=null,F.style.display=\"none\";return}if(x===\"editing\")Ct(!0);else ot(!0)}function Qt(r){if(!n||h!==\"region\"||x!==\"hovering\"||nt(r.target))return;let o=r;if(!m.handlePointerDown(o))return;o.preventDefault(),o.stopPropagation(),_e=o.target instanceof Element?o.target:null,ye=o.pointerId;try{_e?.setPointerCapture?.(o.pointerId)}catch{}oe={x:o.clientX,y:o.clientY},w=null,X=!1}function en(r){if(!n||h!==\"region\"||x!==\"hovering\")return;let o=r;if(!m.handlePointerMove(o))return;o.preventDefault()}function tn(r){if(!n||h!==\"region\"||x!==\"hovering\")return;let o=r;if(o.button!==0||ye!=null&&o.pointerId!==ye)return;if(m.handlePointerUp(o))o.preventDefault(),o.stopPropagation();ft(),oe=null,F.style.display=\"none\"}function nn(){m.handlePointerCancel(),Vt()}function rn(r){let o=r;if(ye!=null&&o.pointerId!==ye)return;nn()}K.addEventListener(\"keydown\",(r)=>{if(!n||r.key!==\"Enter\"||h!==\"region\")return;r.preventDefault(),r.stopPropagation();let o=Math.min(160,window.innerWidth),l=Math.min(96,window.innerHeight);w={x:Math.round((window.innerWidth-o)/2),y:Math.round((window.innerHeight-l)/2),width:o,height:l},X=!1,m.addRect(w),F.style.display=\"none\"});function rt(){if(oe)nn();if(x===\"hovering\"&&j)qt(j);if(E)N();for(let r of Se)bt(r.target,r.pinEl)}document.addEventListener(\"mousemove\",Xt,!0),document.addEventListener(\"click\",Zt,!0),document.addEventListener(\"keydown\",Jt,!0),document.addEventListener(\"pointerdown\",Qt,!0),document.addEventListener(\"pointermove\",en,!0),document.addEventListener(\"pointerup\",tn,!0),document.addEventListener(\"pointercancel\",rn,!0),window.addEventListener(\"scroll\",rt,!0),window.addEventListener(\"resize\",rt,!0),se.addEventListener(\"click\",()=>ot(!0));function ot(r){let o=c.start(\"overlay_exit\");if(s(),ge(),He(),m.detach(),document.removeEventListener(\"mousemove\",Xt,!0),document.removeEventListener(\"click\",Zt,!0),document.removeEventListener(\"keydown\",Jt,!0),document.removeEventListener(\"pointerdown\",Qt,!0),document.removeEventListener(\"pointermove\",en,!0),document.removeEventListener(\"pointerup\",tn,!0),document.removeEventListener(\"pointercancel\",rn,!0),window.removeEventListener(\"scroll\",rt,!0),window.removeEventListener(\"resize\",rt,!0),Qn(),$t(),u.remove(),delete a.__uibotAnnotatorActive,delete a.__uibotAnnotatorTeardown,o(\"success\"),r)try{t.sendMessage({action:U.closed}).catch(()=>{}),a.__uibotAnnotationClosed?.()}catch{}}function Jn(r){if(r.action===U.teardown)ot(!1);else if(r.action===U.changed)Fe()}let Qn=t.subscribe(Jn);a.__uibotAnnotatorTeardown=()=>ot(!1),c.markFromStart(\"overlay_ready\"),s=bn(()=>{Fe()})}var kr=[\"open\",\"processing\",\"done\",\"verified\",\"ignored\"],vr=[\"bug\",\"style\",\"copywriting\",\"feature\",\"interaction\",\"data\",\"other\"],Ar=[\"low\",\"medium\",\"high\",\"blocker\"],wr=[\"testid\",\"id\",\"aria\",\"class\",\"text\",\"path\"],Rr=[\"light\",\"dark\",\"unknown\"],Sr=[\"react\",\"vue\",\"angular\",\"svelte\",\"nextjs\",\"nuxt\",\"unknown\"];function J(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function we(e,t){return typeof e===\"string\"&&t.includes(e)}function Ce(e){return typeof e===\"number\"&&Number.isFinite(e)}function ke(e){return Ce(e)&&e>0}function Tt(e){return Array.isArray(e)&&e.every((t)=>typeof t===\"string\")}function An(e){return J(e)&&Object.values(e).every((t)=>typeof t===\"string\")}function z(e){return e===void 0||typeof e===\"string\"}function wn(e){if(!J(e)||!Ce(e.x)||!Ce(e.y)||!ke(e.width)||!ke(e.height))return;return{x:e.x,y:e.y,width:e.width,height:e.height}}function Nt(e){if(!J(e)||!ke(e.width)||!ke(e.height))return;return{width:e.width,height:e.height}}function Mt(e){if(!J(e)||!Ce(e.x)||!Ce(e.y))return;return{x:e.x,y:e.y}}function vn(e){if(!J(e)||typeof e.fileName!==\"string\"||!ke(e.lineNumber))return;if(e.columnNumber!==void 0&&(!Ce(e.columnNumber)||e.columnNumber<0))return;if(!z(e.componentName))return;return{fileName:e.fileName,lineNumber:e.lineNumber,...e.columnNumber===void 0?{}:{columnNumber:e.columnNumber},...e.componentName===void 0?{}:{componentName:e.componentName}}}function Pr(e){let t=wn(e.boundingBox);if(typeof e.tagName!==\"string\"||!e.tagName||typeof e.cssSelector!==\"string\"||!e.cssSelector||typeof e.xpath!==\"string\"||!e.xpath||!An(e.attributes)||!t||!Tt(e.domPath))return;if(!z(e.textContent)||e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;if(e.selectorStrategy!==void 0&&!we(e.selectorStrategy,wr))return;if(!z(e.region))return;let n;if(e.accessibility!==void 0){if(!J(e.accessibility)||!z(e.accessibility.role)||!z(e.accessibility.name)||!z(e.accessibility.ariaLabel))return;n={...e.accessibility.role===void 0?{}:{role:e.accessibility.role},...e.accessibility.name===void 0?{}:{name:e.accessibility.name},...e.accessibility.ariaLabel===void 0?{}:{ariaLabel:e.accessibility.ariaLabel}}}let i=e.sourceLocation===void 0?void 0:vn(e.sourceLocation);if(e.sourceLocation!==void 0&&!i)return;let a;if(e.sourceStack!==void 0){if(!Array.isArray(e.sourceStack))return;let c=e.sourceStack.map(vn);if(c.some((s)=>!s))return;a=c.filter((s)=>Boolean(s))}return{kind:\"element\",tagName:e.tagName,cssSelector:e.cssSelector,xpath:e.xpath,...e.textContent===void 0?{}:{textContent:e.textContent},attributes:{...e.attributes},boundingBox:t,domPath:[...e.domPath],...n?{accessibility:n}:{},...e.selectorStrategy===void 0?{}:{selectorStrategy:e.selectorStrategy},...e.region===void 0?{}:{region:e.region},...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...i?{sourceLocation:i}:{},...a?{sourceStack:a}:{}}}function Ir(e){let t=wn(e.rect),n=Nt(e.viewport),i=Mt(e.scroll);if(!t||t.width<8||t.height<8||!n||!i||!ke(e.devicePixelRatio))return;if(e.breadcrumb!==void 0&&!Tt(e.breadcrumb))return;let a;if(e.topLevelElements!==void 0){if(!Array.isArray(e.topLevelElements))return;a=[];for(let s of e.topLevelElements){if(!J(s)||typeof s.tagName!==\"string\"||!s.tagName||!z(s.text)||!z(s.role))return;a.push({tagName:s.tagName,...s.text===void 0?{}:{text:s.text},...s.role===void 0?{}:{role:s.role}})}}let c=e.marks===void 0?void 0:pn(e.marks);if(e.marks!==void 0&&!c)return;return{kind:\"region\",rect:t,viewport:n,scroll:i,devicePixelRatio:e.devicePixelRatio,...e.breadcrumb===void 0?{}:{breadcrumb:[...e.breadcrumb]},...a?{topLevelElements:a}:{},...c?.length?{marks:c}:{}}}function Er(e){if(!J(e))return{ok:!1,reason:\"target is not an object\",raw:e};if(e.kind===\"region\"){let t=Ir(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid region target\",raw:e}}if(e.kind===\"element\"||e.kind===void 0){let t=Pr(e);return t?{ok:!0,value:t}:{ok:!1,reason:\"invalid element target\",raw:e}}return{ok:!1,reason:`unknown target kind: ${String(e.kind)}`,raw:e}}function Tr(e){if(!J(e))return;let t=Nt(e.viewport),n=Mt(e.scroll);if(!t||!n||!ke(e.devicePixelRatio)||!J(e.center)||!Ce(e.center.x)||!Ce(e.center.y)||typeof e.visible!==\"boolean\"||!z(e.positioning))return;return{viewport:t,scroll:n,devicePixelRatio:e.devicePixelRatio,center:{x:e.center.x,y:e.center.y},visible:e.visible,...e.positioning===void 0?{}:{positioning:e.positioning}}}function Nr(e){if(!J(e))return;let{url:t,origin:n,path:i,title:a,capturedAt:c,query:s,hash:u,referrer:b,language:C,userAgent:A,uiState:I}=e,k=Nt(e.viewport),T=Mt(e.scroll);if(!k||!J(e.viewport)||!ke(e.viewport.devicePixelRatio)||!T)return;if(typeof t!==\"string\"||!t||typeof n!==\"string\"||!n||typeof i!==\"string\"||!i||typeof a!==\"string\"||typeof c!==\"string\"||!c)return;if(!z(s)||!z(u)||!z(b)||!z(C)||!z(A)||!z(I))return;if(e.theme!==void 0&&!we(e.theme,Rr))return;if(e.framework!==void 0&&!we(e.framework,Sr))return;return{url:t,origin:n,path:i,title:a,viewport:{...k,devicePixelRatio:e.viewport.devicePixelRatio},scroll:T,capturedAt:c,...s===void 0?{}:{query:s},...u===void 0?{}:{hash:u},...b===void 0?{}:{referrer:b},...e.theme===void 0?{}:{theme:e.theme},...e.framework===void 0?{}:{framework:e.framework},...C===void 0?{}:{language:C},...A===void 0?{}:{userAgent:A},...I===void 0?{}:{uiState:I}}}function Mr(e){if(e===void 0)return[];if(!Array.isArray(e))return;let t=[];for(let n of e){if(!J(n)||!we(n.kind,[\"style\",\"text\"])||typeof n.label!==\"string\"||!z(n.property)||typeof n.before!==\"string\"||typeof n.after!==\"string\")return;t.push({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property===void 0?{}:{property:n.property}})}return t}function Ye(e){if(!J(e))return{ok:!1,reason:\"annotation is not an object\",raw:e};let{id:t,pageUrl:n,comment:i,createdAt:a,updatedAt:c}=e;if(!we(e.status,kr))return{ok:!1,reason:\"invalid status\",raw:e};if(!we(e.type,vr))return{ok:!1,reason:\"invalid type\",raw:e};if(!we(e.priority,Ar))return{ok:!1,reason:\"invalid priority\",raw:e};if(typeof t!==\"string\"||!t)return{ok:!1,reason:\"invalid id\",raw:e};if(typeof n!==\"string\"||!n)return{ok:!1,reason:\"invalid pageUrl\",raw:e};if(typeof i!==\"string\"||!i)return{ok:!1,reason:\"invalid comment\",raw:e};if(typeof a!==\"string\"||!a)return{ok:!1,reason:\"invalid createdAt\",raw:e};if(typeof c!==\"string\"||!c)return{ok:!1,reason:\"invalid updatedAt\",raw:e};if(!z(e.expectedResult)||!z(e.preserve)||!z(e.screenshot))return{ok:!1,reason:\"invalid optional annotation text\",raw:e};if(!An(e.styleSummary))return{ok:!1,reason:\"invalid styleSummary\",raw:e};let s=Tr(e.geometry);if(!s)return{ok:!1,reason:\"invalid geometry\",raw:e};let u=Nr(e.pageContext);if(!u)return{ok:!1,reason:\"invalid pageContext\",raw:e};let b=Mr(e.edits);if(!b)return{ok:!1,reason:\"invalid edits\",raw:e};let C=Er(e.target);if(!C.ok)return C;return{ok:!0,value:{id:t,pageUrl:n,status:e.status,type:e.type,priority:e.priority,comment:i,target:C.value,styleSummary:{...e.styleSummary},geometry:s,pageContext:u,createdAt:a,updatedAt:c,...e.expectedResult===void 0?{}:{expectedResult:e.expectedResult},...e.preserve===void 0?{}:{preserve:e.preserve},...e.screenshot===void 0?{}:{screenshot:e.screenshot},...b.length?{edits:b}:{}}}}function Rn(e){return new Date(e()).toISOString()}function Dr(e,t){return`ann_${e().toString(36)}_${Math.floor(t()*1e9).toString(36)}`}function Sn(e={}){let t=e.now??Date.now,n=e.random??Math.random,i=new Map;return{list(a){let c=Me(a);return[...i.values()].filter((s)=>Me(s.pageUrl)===c)},listAll(){return[...i.values()]},save(a,c){let s=Rn(t),u={...a,id:Dr(t,n),pageUrl:Me(c??a.pageContext.url),status:\"open\",createdAt:s,updatedAt:s},b=Ye(u);if(!b.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${b.reason}`);return i.set(b.value.id,b.value),b.value},update(a,c){let s=i.get(a);if(!s)return null;let u={...s,...c,id:s.id,updatedAt:Rn(t)},b=Ye(u);if(!b.ok)throw Error(`\u6807\u6CE8\u6570\u636E\u65E0\u6548\uFF1A${b.reason}`);return i.set(a,b.value),b.value},remove(a){return i.delete(a)},clear(a){let c=Me(a),s=0;for(let[u,b]of i)if(Me(b.pageUrl)===c)i.delete(u),s+=1;return s},clearAll(){let a=i.size;return i.clear(),a}}}var Pn=\"uibot.annotation.host.v1\",lt=\"uibot.annotation.page.v1\";var In=20,En=262144,Tn=2;function ct(e){if(!e||typeof e!==\"object\"||Array.isArray(e))return!1;try{return new TextEncoder().encode(JSON.stringify(e)).length<=1048576}catch{return!1}}var Lr={spec:[\"html\",\"markdown\",\"zip\"],prototype:[\"html\",\"zip\"],deck:[\"html\",\"pptx\",\"zip\"],poster:[\"html\",\"zip\"]},pi=Array.from(new Set(Object.values(Lr).flat()));var fi=Object.freeze([Object.freeze({name:\"manifest\",summary:\"Describe query operations and list the derived resource index.\",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:\"search\",summary:\"Search resources with deterministic bilingual ranking and reasons.\",positionals:Object.freeze([Object.freeze({name:\"text\",property:\"text\",type:\"string\",required:!1})]),options:Object.freeze([...[[\"function\",\"functions\"],[\"scenario\",\"scenarios\"],[\"unit\",\"units\"],[\"industry\",\"industries\"]].map(([e,t])=>Object.freeze({name:e,property:t,type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"})),Object.freeze({name:\"kind\",property:\"kinds\",type:\"resource-kind\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"tag\",property:\"tags\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"category\",property:\"categories\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"capability\",property:\"capabilities\",type:\"string\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"maturity\",property:\"maturities\",type:\"resource-maturity\",multiple:!0,cliEncoding:\"comma-separated\"}),Object.freeze({name:\"limit\",property:\"limit\",type:\"positive-integer\"})])}),Object.freeze({name:\"get\",summary:\"Resolve one canonical resource id or unambiguous alias.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([])}),Object.freeze({name:\"build\",summary:\"Plan dependency closure and gaps without writing or installing.\",positionals:Object.freeze([Object.freeze({name:\"root\",property:\"roots\",type:\"string\",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:\"docs\",summary:\"Read curated public documentation for one resource.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([{name:\"locale\",property:\"locale\",type:\"string\"},{name:\"page\",property:\"page\",type:\"positive-integer\"}])}),Object.freeze({name:\"examples\",summary:\"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([{name:\"page\",property:\"page\",type:\"positive-integer\"}])}),Object.freeze({name:\"install-plan\",summary:\"Describe distribution channels and fixed snapshot identity/closure without installing or writing.\",positionals:Object.freeze([Object.freeze({name:\"id-or-alias\",property:\"id\",type:\"string\",required:!0})]),options:Object.freeze([])})]);var Fr=[\"background\",\"foreground\",\"card\",\"card-foreground\",\"popover\",\"popover-foreground\",\"primary\",\"primary-foreground\",\"secondary\",\"secondary-foreground\",\"muted\",\"muted-foreground\",\"accent\",\"accent-foreground\",\"border\",\"input\",\"ring\",\"destructive\",\"destructive-foreground\",\"success\",\"success-foreground\",\"warning\",\"warning-foreground\"],bi=[...Fr,\"radius\",\"font-display\",\"font-body\",\"font-mono\"];var ve={count:20,messageBytes:1048576,screenshotBytes:262144,screenshots:2,comment:4000,selector:2000,edits:20};function dt(e){if(!e||typeof e!==\"object\"||Array.isArray(e))throw Error(\"Invalid annotation object\");return e}function Ge(e,t){if(Object.keys(e).some((n)=>!t.includes(n)))throw Error(\"Unknown annotation field\")}function re(e,t,n=!1){if(typeof e!==\"string\"||!n&&!e.trim()||e.length>t||Array.from(e).some((i)=>{let a=i.charCodeAt(0);return a===127||a<32&&a!==9&&a!==10&&a!==13}))throw Error(\"Invalid annotation text\");return e}function Nn(e){let t=dt(e);Ge(t,[\"x\",\"y\",\"width\",\"height\"]);for(let n of[\"x\",\"y\",\"width\",\"height\"])if(typeof t[n]!==\"number\"||!Number.isFinite(t[n])||Math.abs(t[n])>1e7)throw Error(\"Invalid annotation coordinates\");if(t.width<0||t.height<0)throw Error(\"Invalid annotation dimensions\");return{x:t.x,y:t.y,width:t.width,height:t.height}}function Mn(e){if(!Array.isArray(e)||!e.length||e.length>ve.count)throw Error(\"Expected 1 to 20 annotations\");if(new TextEncoder().encode(JSON.stringify(e)).length>ve.messageBytes)throw Error(\"Annotations exceed the message budget\");let t=0,n=new Set;return e.map((i)=>{let a=dt(i);Ge(a,[\"id\",\"comment\",\"target\",\"type\",\"priority\",\"edits\",\"screenshot\"]);let c=re(a.id,100);if(!/^[a-zA-Z0-9_-]+$/.test(c)||n.has(c))throw Error(\"Invalid or duplicate annotation ID\");n.add(c);let s=re(a.comment,ve.comment).trim();if(![\"bug\",\"style\",\"copywriting\",\"feature\",\"interaction\",\"data\",\"other\"].includes(a.type)||![\"low\",\"medium\",\"high\",\"blocker\"].includes(a.priority))throw Error(\"Invalid annotation classification\");let u=dt(a.target),b;if(u.kind===\"element\"){Ge(u,[\"kind\",\"cssSelector\",\"xpath\",\"tagName\",\"textContent\",\"boundingBox\",\"uibotId\"]);let I=re(u.tagName,80);if(!/^[a-zA-Z][a-zA-Z0-9:_-]*$/.test(I))throw Error(\"Invalid annotation tag\");let k=u.uibotId===void 0?void 0:re(u.uibotId,200);if(k!==void 0&&!/^[\\w:.-]+$/.test(k))throw Error(\"Invalid annotation element ID\");b={kind:\"element\",cssSelector:re(u.cssSelector,ve.selector),xpath:re(u.xpath,ve.selector,!0),tagName:I,boundingBox:Nn(u.boundingBox),...u.textContent===void 0?{}:{textContent:re(u.textContent,1000,!0)},...k===void 0?{}:{uibotId:k}}}else if(u.kind===\"region\")Ge(u,[\"kind\",\"rect\"]),b={kind:\"region\",rect:Nn(u.rect)};else throw Error(\"Invalid annotation target\");let C;if(a.edits!==void 0){if(!Array.isArray(a.edits)||a.edits.length>ve.edits)throw Error(\"Invalid annotation edits\");C=a.edits.map((I)=>{let k=dt(I);if(Ge(k,[\"kind\",\"label\",\"property\",\"before\",\"after\"]),k.kind!==\"style\"&&k.kind!==\"text\")throw Error(\"Invalid annotation edit kind\");let T=k.property===void 0?void 0:re(k.property,100);if(T!==void 0&&!/^[-a-zA-Z][\\w-]*$/.test(T))throw Error(\"Invalid annotation style property\");return{kind:k.kind,label:re(k.label,200),before:re(k.before,4000,!0),after:re(k.after,4000,!0),...T===void 0?{}:{property:T}}})}let A;if(a.screenshot!==void 0){if(A=re(a.screenshot,ve.screenshotBytes),!/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(A)||++t>ve.screenshots)throw Error(\"Invalid annotation screenshot\")}return{id:c,comment:s,type:a.type,priority:a.priority,target:b,...C?{edits:C}:{},...A?{screenshot:A}:{}}})}function Dn(e){let t={blocker:0,high:1,medium:2,low:3};return[...e].sort((n,i)=>t[n.priority]-t[i.priority]||n.createdAt.localeCompare(i.createdAt))}function On(e){let t=e.target;return{id:e.id,comment:e.comment.trim(),type:e.type,priority:e.priority,target:t.kind===\"region\"?{kind:\"region\",rect:t.rect}:{kind:\"element\",cssSelector:t.cssSelector,xpath:t.xpath,tagName:t.tagName,...t.textContent?{textContent:t.textContent}:{},boundingBox:t.boundingBox,...t.attributes[\"data-uibot-id\"]?{uibotId:t.attributes[\"data-uibot-id\"]}:{}},...e.edits?.length?{edits:e.edits.map((n)=>({kind:n.kind,label:n.label,before:n.before,after:n.after,...n.property?{property:n.property}:{}}))}:{},...e.screenshot?{screenshot:e.screenshot}:{}}}function Vr(e){return typeof e===\"string\"&&e.length<=En&&/^data:image\\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(e)}function Dt(e){if(!Array.isArray(e)||e.length>In||!ct({items:e}))return null;let t=[],n=0,i=new Set;for(let a of e){let c=Ye(a);if(!c.ok)return null;let s=c.value;if(!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||i.has(s.id)||!s.comment.trim()||s.comment.length>4000)return null;if(i.add(s.id),s.target.kind===\"element\"&&(s.target.cssSelector.length>2000||s.target.xpath.length>2000||(s.target.textContent?.length??0)>1000))return null;if(s.screenshot!==void 0&&(!Vr(s.screenshot)||++n>Tn))return null;if((s.edits?.length??0)>20||s.edits?.some((u)=>u.before.length>4000||u.after.length>4000))return null;t.push(s)}try{if(t.length)Mn(t.map(On))}catch{return null}return t}var ut={\u5143\u7D20:\"Element\",\u533A\u57DF:\"Region\",\u8C03\u6574:\"Quick edit\",\u9000\u51FA:\"Exit\",\u53D6\u6D88:\"Cancel\",\u4FDD\u5B58\u6807\u6CE8:\"Save annotation\",\u5DF2\u4FDD\u5B58:\"Saved\",\"\u66F4\u591A\u8BBE\u7F6E \u25BE\":\"More settings \u25BE\",\"\u6536\u8D77\u8BBE\u7F6E \u25B4\":\"Less settings \u25B4\",\"\u671F\u671B\u7ED3\u679C\uFF08\u53EF\u9009\uFF09\":\"Expected result (optional)\",\"\u4FDD\u62A4\u8303\u56F4\uFF08\u53EF\u9009\uFF09\":\"Preserve (optional)\",\u7C7B\u578B:\"Type\",\u4F18\u5148\u7EA7:\"Priority\",\u6837\u5F0F\u95EE\u9898:\"Style\",\u6587\u6848\u4FEE\u6539:\"Copy\",\u529F\u80FD\u5EFA\u8BAE:\"Feature\",\u4EA4\u4E92\u95EE\u9898:\"Interaction\",\u6570\u636E\u95EE\u9898:\"Data\",\u5176\u4ED6:\"Other\",\u4F4E:\"Low\",\u4E2D:\"Medium\",\u9AD8:\"High\",\u963B\u585E:\"Blocker\",\u62D6\u52A8\u5DE5\u5177\u680F:\"Move toolbar\",\u62D6\u52A8:\"Move\",\u6846\u9009\u533A\u57DF:\"Select region\",\u65B0\u5EFA\u533A\u57DF\u6807\u6CE8:\"New region annotation\",\u65B0\u5EFA\u5143\u7D20\u6807\u6CE8:\"New element annotation\",\u6587\u5B57:\"Text\",\u6587\u5B57\u5185\u5BB9:\"Text content\",\u5B57\u53F7:\"Font size\",\u989C\u8272:\"Color\",\u80CC\u666F:\"Background\",\u80CC\u666F\u8272:\"Background color\",\u5B57\u4F53:\"Font\",\u5B57\u91CD:\"Weight\",\u5706\u89D2:\"Radius\",\u95F4\u8DDD:\"Spacing\",\u4FDD\u5B58\u4FEE\u6539:\"Save changes\",\u53EF\u89C6\u5316\u4FEE\u6539:\"Visual changes\",\u6587\u6848:\"Text\",\u6587\u5B57\u989C\u8272:\"Text color\",\u4E0D\u900F\u660E\u5EA6:\"Opacity\",\u5185\u8FB9\u8DDD:\"Padding\",\"\u7EC6 300\":\"Light 300\",\"\u5E38\u89C4 400\":\"Regular 400\",\"\u4E2D 500\":\"Medium 500\",\"\u534A\u7C97 600\":\"Semibold 600\",\"\u7C97 700\":\"Bold 700\",\u6846\u9009:\"Rectangle\",\u7BAD\u5934:\"Arrow\",\u6587\u672C:\"Label\",\u589E\u5927\u5B57\u53F7:\"Increase font size\",\u51CF\u5C0F\u5B57\u53F7:\"Decrease font size\",\u533A\u57DF\u6807\u6CE8\u8BF4\u660E:\"Region comment\",\u4FDD\u5B58\u533A\u57DF\u6807\u6CE8:\"Save region annotation\",\u5FEB\u901F\u7F16\u8F91:\"Quick edit\",\u7F16\u8F91\u6807\u6CE8:\"Edit annotation\",\u6279\u6CE8\u989C\u8272:\"Annotation color\",\u7EA2:\"Red\",\u6A59:\"Orange\",\u9EC4:\"Yellow\",\u7EFF:\"Green\",\u84DD:\"Blue\",\u767D:\"White\",\"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\":\"Comment (optional)\",\u672A\u505A\u4EFB\u4F55\u4FEE\u6539:\"No changes yet\",\u8BF7\u5148\u586B\u5199\u6807\u6CE8\u5185\u5BB9:\"Add a comment first\",\u6807\u6CE8\u6570\u636E\u65E0\u6548:\"Invalid annotation\",\"\u4FDD\u5B58\u5931\u8D25\uFF1Aannotation-limit\":\"Annotation limit reached; shorten or remove a note\",\"\u4FDD\u5B58\u5931\u8D25\uFF1Ainvalid-annotation\":\"Could not save this annotation\"};function Ot(e){let t=document.getElementById(\"__uibot-annotator-host\")?.shadowRoot,n=e.target,i=null;try{if(n.kind===\"element\")i=document.querySelector(n.cssSelector)}catch{}if(i?.scrollIntoView({block:\"center\",behavior:\"instant\"}),i){let a=i.getBoundingClientRect(),c=document.createElement(\"div\");c.className=\"flash\",c.style.cssText=`position:fixed;pointer-events:none;left:${a.left}px;top:${a.top}px;width:${a.width}px;height:${a.height}px;border:2px solid var(--pa-focus, #2563eb)`,t?.append(c),setTimeout(()=>c.remove(),1300)}else if(n.kind===\"region\")window.scrollTo({top:Math.max(0,n.rect.y-window.innerHeight/2),behavior:\"instant\"});if(!i&&n.kind===\"region\"){let a=document.createElement(\"div\");a.className=\"flash\",a.style.cssText=`position:fixed;pointer-events:none;left:${n.rect.x-window.scrollX}px;top:${n.rect.y-window.scrollY}px;width:${n.rect.width}px;height:${n.rect.height}px;border:2px solid var(--pa-focus, #2563eb)`,t?.append(a),setTimeout(()=>a.remove(),1300)}}function _n(e){let t=document.getElementById(\"__uibot-annotator-host\"),n=t?.shadowRoot;if(!n)return()=>{};let i=null,a=null,c=!1,s=0,u=new Map,b=e.locale===\"zh\",C=document.createElement(\"style\");C.textContent=\"@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}} .pin.marker{cursor:pointer}.uibot-note{position:fixed;left:12px;top:60px;max-width:calc(100vw - 24px);padding:16px;background:var(--pa-popover, white);color:var(--pa-popover-contrast, #18181b);border:1px solid var(--pa-border, #d4d4d8);border-radius:12px;pointer-events:auto;box-shadow:0 12px 32px var(--pa-shadow, #0002)}.uibot-note textarea{display:block;min-width:240px;max-width:100%;margin:8px 0;padding:8px;color:var(--pa-surface-contrast, #18181b);background:var(--pa-field, #fafafa)}.uibot-note button{margin-right:12px;cursor:pointer}.pin.marker:focus-visible{outline:3px solid var(--pa-focus, #2563eb)}\",n.append(C);function A(){i?.focus({preventScroll:!0})}function I(v){Ot(v),a?.remove(),a=document.createElement(\"section\"),a.className=\"uibot-note\",a.setAttribute(\"role\",\"dialog\"),a.setAttribute(\"aria-label\",b?\"\u7F16\u8F91\u6807\u6CE8\":\"Edit annotation\");let E=document.createElement(\"textarea\");E.value=v.comment,E.maxLength=4000,E.setAttribute(\"aria-label\",b?\"\u6279\u6CE8\":\"Comment\");let M=document.createElement(\"button\");M.textContent=b?\"\u4FDD\u5B58\":\"Save\";let S=document.createElement(\"button\");S.textContent=b?\"\u53D6\u6D88\":\"Cancel\";let N=()=>{a?.remove(),a=null,A()};M.onclick=()=>{if(!E.value.trim())return;e.update(v.id,E.value.trim()),N()},S.onclick=N,a.onkeydown=(D)=>{if(D.key===\"Escape\")D.stopPropagation(),N();if(D.key===\"Enter\"&&!D.shiftKey&&!D.isComposing)D.preventDefault(),M.click();if(D.key===\"Tab\"){let G=[E,M,S].indexOf(n?.activeElement);if(D.shiftKey&&G===0)D.preventDefault(),S.focus();else if(!D.shiftKey&&G===2)D.preventDefault(),E.focus()}},a.append(E,M,S),n?.append(a),E.focus()}function k(){n?.querySelectorAll(\".epanel\").forEach((S)=>{if(S.setAttribute(\"role\",\"dialog\"),!S.hasAttribute(\"aria-label\"))S.setAttribute(\"aria-label\",b?\"\u5FEB\u901F\u7F16\u8F91\":\"Quick edit\")});let v=n?.querySelectorAll(\".mark-svg > *\").length??0;if(v>s&&!n?.querySelector(\".mark-dock[hidden]\"))n?.querySelector(\".mark-comment\")?.focus();s=v;let E=Dn(e.items());if(n?.querySelectorAll(\".pin.marker\").forEach((S,N)=>{let D=E[N];if(!D)return;S.dataset.annotationId=D.id,S.tabIndex=0,S.setAttribute(\"role\",\"button\"),S.setAttribute(\"aria-label\",`${N+1} \u00B7 ${D.comment}`)}),n?.querySelectorAll(\"textarea\").forEach((S)=>{S.maxLength=4000}),!b&&n){let S=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(let N=S.nextNode();N;N=S.nextNode()){let D=ut[N.textContent??\"\"];if(D)N.textContent=D}n.querySelectorAll(\"[aria-label],[title],[placeholder]\").forEach((N)=>{if(N.matches(\".pin.marker\"))return;for(let D of[\"aria-label\",\"title\",\"placeholder\"]){let H=N.getAttribute(D);if(!H)continue;let G=ut[H]??(D===\"placeholder\"&&/[\\u3400-\\u9fff]/.test(H)?\"Describe the change\u2026\":H);if(G!==H)N.setAttribute(D,G)}})}let M=!!n?.querySelector(\".epanel,.uibot-note\");if(c&&!M)A();c=M}let T=new MutationObserver(k);T.observe(n,{childList:!0,subtree:!0});function R(v){let E=v.composedPath()[0];if(!(E instanceof Element))return;let M=E.closest(\".pin.marker\");if(M){let S=e.items().find((N)=>N.id===M.dataset.annotationId);if(S)v.preventDefault(),v.stopImmediatePropagation(),i=M,I(S)}}function O(v){let E=n?.activeElement;if(v.key===\"Escape\"&&E&&!a){let M=n?.querySelector(\".epanel .cancel, .edit-panel .cancel, .quick-panel .cancel\");if(M){v.preventDefault(),v.stopImmediatePropagation(),M.click(),A();return}}if(v.key===\"Enter\"&&!v.shiftKey&&!v.isComposing&&(E instanceof HTMLTextAreaElement||E instanceof HTMLInputElement)&&!a){let M=E.closest(\"[role=dialog],.mark-dock\")?.querySelector(\"[data-action=save],button.ok,.mark-save\");if(M&&!M.disabled)v.preventDefault(),v.stopImmediatePropagation(),M.click()}if(E instanceof HTMLElement&&E.matches(\".pin.marker\")&&(v.key===\"Enter\"||v.key===\" \"))v.preventDefault(),E.click()}let F=(v)=>{if(v.target instanceof HTMLElement&&v.target!==t){if(i=v.target,!i.hasAttribute(\"tabindex\"))u.set(i,null),i.setAttribute(\"tabindex\",\"-1\")}},Y=(v)=>{v.preventDefault(),v.stopImmediatePropagation()};return window.addEventListener(\"click\",F,!0),window.addEventListener(\"submit\",Y,!0),n.addEventListener(\"click\",R,!0),n.addEventListener(\"keydown\",O,!0),k(),()=>{T.disconnect(),a?.remove(),C.remove();for(let[v,E]of u)if(E===null)v.removeAttribute(\"tabindex\");window.removeEventListener(\"click\",F,!0),window.removeEventListener(\"submit\",Y,!0),n.removeEventListener(\"click\",R,!0),n.removeEventListener(\"keydown\",O,!0)}}var pt=document.currentScript?.getAttribute(\"data-uibot-annotation\")===\"shell\",De=\"\",_t=null,pe=[],Xe=!1,Lt=!1,Bt=\"zh\",Ft,gt=new Set,Oe=(e)=>window.parent.postMessage({...e,source:lt,nonce:De},\"*\"),Ln=()=>{for(let e of gt)e({action:U.changed})},Fn=()=>{Ln(),Oe({action:\"snapshot\",items:pe})};function mt(){for(let e of[...gt])e({action:U.teardown});Ft?.(),Ft=void 0,Xe=!1,delete window.__uibotAnnotationActive}async function jr(e){if(e.action===U.list)return{success:!0,data:pe};if(e.action===U.closed)return mt(),Oe({action:\"closed\"}),{success:!0};if(e.action===U.enrich)return{success:!0};if(e.action!==U.save||Lt)return{success:!1,error:\"locked\"};try{let t=Sn(),n=e.data;if(Bt===\"en\"&&n.edits?.length){let s=n.edits.map((u)=>`${u.label} ${fe(u.before,24)}\u2192${fe(u.after,24)}`).join(\"\uFF1B\");if(n.edits=n.edits.map((u)=>({...u,label:ut[u.label]??u.label})),n.comment===`\u53EF\u89C6\u5316\u4FEE\u6539\uFF1A${s}`)n.comment=`Visual changes: ${n.edits.map((u)=>`${u.label} ${u.before} \u2192 ${u.after}`).join(\"; \")}`}let i=t.save(n),a=i.target.kind===\"element\"&&i.edits?.length?pe.find((s)=>s.target.kind===\"element\"&&i.target.kind===\"element\"&&s.target.cssSelector===i.target.cssSelector):void 0;if(a)i={...i,id:a.id,createdAt:a.createdAt,target:a.target,comment:`${a.comment}\n${i.comment}`,edits:[...a.edits??[],...i.edits??[]]};let c=Dt([...pe.filter((s)=>s.id!==i.id),i]);if(!c)return{success:!1,error:\"annotation-limit\"};if(pe=c,Fn(),i.target.kind===\"region\")setTimeout(()=>document.getElementById(\"__uibot-annotator-host\")?.shadowRoot?.querySelector('[data-tool=\"element\"]')?.click(),0);return{success:!0,data:i}}catch{return{success:!1,error:\"invalid-annotation\"}}}function qr(e){if(Xe)return;Xe=!0,Bt=e,window.__uibotAnnotationActive=!0,kn({annotationRegionV2:!0},{sendMessage:jr,subscribe(t){return gt.add(t),()=>{gt.delete(t)}}}),Ft=_n({locale:e,items:()=>pe,update(t,n){pe=pe.map((i)=>i.id===t?{...i,comment:n}:i),Fn()},close(){mt(),Oe({action:\"closed\"})}})}window.addEventListener(\"message\",(e)=>{if(!ct(e.data))return;let t=e.data;if(pt&&e.source!==window.parent){let n=[...document.querySelectorAll(\"iframe.pg-frame\")].find((i)=>i.contentWindow===e.source);if(!n||t.source!==lt)return;if(t.action===\"boot\"&&_t){n.contentWindow?.postMessage(_t,\"*\");return}if(t.nonce===De)Oe({...t,source:lt});return}if(e.source!==window.parent||t.source!==Pn||typeof t.nonce!==\"string\"||!/^[a-zA-Z0-9-]{16,100}$/.test(t.nonce))return;if(De&&t.nonce!==De)return;if(t.action!==\"sync\"&&t.action!==\"reveal\")return;if(t.action===\"sync\"){let n=Dt(t.items);if(!n||typeof t.enabled!==\"boolean\"||typeof t.locked!==\"boolean\"||t.locale!==\"zh\"&&t.locale!==\"en\")return;let i=kt(t.theme);if(t.theme=i,De=t.nonce,pt){_t=t;for(let a of document.querySelectorAll(\"iframe.pg-frame\"))a.contentWindow?.postMessage(t,\"*\");return}if(pe=n,Lt=t.locked,!t.enabled||Lt)mt();else{if(Xe&&Bt!==t.locale)mt();qr(t.locale);let a=document.getElementById(\"__uibot-annotator-host\");if(a)at(a,i);Ln()}Oe({action:\"ready\"})}else if(t.nonce===De){if(pt)for(let n of document.querySelectorAll(\"iframe.pg-frame\"))n.contentWindow?.postMessage(t,\"*\");else if(Xe&&typeof t.id===\"string\"){let n=pe.find((i)=>i.id===t.id);if(n)Ot(n)}}});if(!pt)Oe({action:\"boot\"});})();";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uibot/page-annotation",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "test": "bun test"
44
44
  },
45
45
  "dependencies": {
46
- "@uibot/contracts": "^0.19.0"
46
+ "@uibot/contracts": "^0.20.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@happy-dom/global-registrator": "^21.0.1"