ai-helper-agent 2.8.10 → 2.8.11

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.
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,l as n}from"./i18n-DvmxOw8q.js";import{C as r,S as i,Y as a,b as o,h as s}from"./version-h3EcDzjp.js";import{AlignmentType as c,BorderStyle as l,Document as u,ExternalHyperlink as d,HeadingLevel as f,ImageRun as p,LevelFormat as m,Packer as h,Paragraph as g,Table as ee,TableCell as te,TableRow as ne,TextRun as _,WidthType as v,convertInchesToTwip as y}from"./dist-BUuoW_84.js";var re=40,b=3e3,x=/^\s{0,3}(`{3,}|~{3,})/,S=/^\s{0,3}(#{1,6})[ \t]+(.*)$/,C=/^\s{0,3}=+\s*$/,w=/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/,T=/^\s*\|.*\|\s*$/,E=/^\s*(?:\d+(?:\.\d+)+[.、))]?\s*|\d+[.、))]\s*|[一二三四五六七八九十]+[、.]\s*|[((][一二三四五六七八九十\d]+[))]\s*)/,D=/[/\\:*?"<>|]/g,ie=/[\u0000-\u001f\u007f\u200b-\u200f\u2028\u2029\ufeff]/g,O=`
1
+ import{a as e,c as t,l as n}from"./i18n-DvmxOw8q.js";import{C as r,S as i,Y as a,b as o,h as s}from"./version-kRemUQxx.js";import{AlignmentType as c,BorderStyle as l,Document as u,ExternalHyperlink as d,HeadingLevel as f,ImageRun as p,LevelFormat as m,Packer as h,Paragraph as g,Table as ee,TableCell as te,TableRow as ne,TextRun as _,WidthType as v,convertInchesToTwip as y}from"./dist-BUuoW_84.js";var re=40,b=3e3,x=/^\s{0,3}(`{3,}|~{3,})/,S=/^\s{0,3}(#{1,6})[ \t]+(.*)$/,C=/^\s{0,3}=+\s*$/,w=/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/,T=/^\s*\|.*\|\s*$/,E=/^\s*(?:\d+(?:\.\d+)+[.、))]?\s*|\d+[.、))]\s*|[一二三四五六七八九十]+[、.]\s*|[((][一二三四五六七八九十\d]+[))]\s*)/,D=/[/\\:*?"<>|]/g,ie=/[\u0000-\u001f\u007f\u200b-\u200f\u2028\u2029\ufeff]/g,O=`
2
2
  `;function ae(e){return typeof e==`string`?e.replace(/\r\n?/g,O).replace(/\n{3,}/g,`
3
3
 
4
4
  `):``}function oe(e){return(e.length>b?e.slice(0,b):e).split(O).slice(0,re).join(O)}function se(e){return String(e).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/`+/g,``).replace(/(\*\*|__|\*|_|~~)/g,``).replace(/https?:\/\/\S+/gi,``).replace(/<[^>]+>/g,``)}function k(e){if(typeof e!=`string`||!e.trim())return``;let t=se(e);return t=t.replace(ie,``),t=t.replace(E,``),t=t.replace(D,`_`),t=t.replace(/\s+/g,`-`).replace(/-{2,}/g,`-`),t=t.replace(/^[-_.\s]+/,``).replace(/[-_.\s]+$/,``),t}function A(e,t=40){let n=Array.from(e);return(n.length>t?n.slice(0,t).join(``):e).replace(/[-_.,;:、,。;:\s]+$/u,``)}function ce(e){if(typeof e!=`string`||!e.trim())return``;let t=oe(e).split(O),n=[],r=``;for(let e=0;e<t.length;e++){let i=t[e],a=i.match(x);if(r){a&&a[1][0]===r&&(r=``);continue}if(a){r=a[1][0];continue}let o=i.match(S);if(o){let e=o[2].replace(/[ \t]+#+[ \t]*$/,``).trim();e&&n.push({level:o[1].length,text:e});continue}let s=t[e+1];s&&C.test(s)&&i.trim()&&!w.test(i)&&!T.test(i)&&(n.push({level:1,text:i.trim()}),e++)}return n.length===0?``:A(k((n.find(e=>e.level===1)||n[0]).text))}function le({title:e=``,kind:t,timestamp:n,ext:r}){let i=`${t}-${n}.${r}`,a=A(k(e));return a?`${a}-${i}`:i}function j(e,{kind:t,ext:n,timestamp:r=Date.now()}){return le({title:ce(e),kind:t,timestamp:r,ext:n})}e(`zh`,{chatExport:{exportFailed:`导出失败:{message}`,pdfLibNotLoaded:`PDF 库未加载,无法导出`,noContent:`没有可导出的内容`,imageLibNotLoaded:`图片库未加载,无法导出为图片`,imagePlaceholder:`[图片: {name}]`,canvasFailed:`Canvas 转 DataURL 失败:{message}`,svgLoadFailed:`SVG 图片加载失败`}}),e(`en`,{chatExport:{exportFailed:`Export failed: {message}`,pdfLibNotLoaded:`PDF library not loaded, cannot export`,noContent:`No content to export`,imageLibNotLoaded:`Image library not loaded, cannot export as image`,imagePlaceholder:`[Image: {name}]`,canvasFailed:`Canvas to DataURL failed: {message}`,svgLoadFailed:`SVG image loading failed`}});var M=new Map,N=/Mac|iPhone|iPad|iPod/i.test(typeof navigator<`u`?navigator.userAgent:``)?`Apple Color Emoji`:`Segoe UI Emoji`,P=RegExp(`(?:\\p{Regional_Indicator}{2})|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)(?:[\\u{1F3FB}-\\u{1F3FF}]|\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F))*`,`gu`),F=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE\uFFFF]/g,I=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;function L(e){return e==null||e===``?e:String(e).replace(F,``).replace(I,`�`)}var R=0;function z(){return R+=1,R}var B=new Set([`png`,`jpg`,`jpeg`,`gif`,`bmp`]);function V(e){return B.has(String(e||``).toLowerCase())}function H(e,t={}){if(!e)return[];let n=[];return String(e).split(/\r?\n/).forEach((e,r)=>{r>0&&n.push(new _({...t,break:1}));let i=0;for(let r of e.matchAll(P))r.index>i&&n.push(new _({...t,text:e.slice(i,r.index)})),n.push(new _({...t,text:r[0],font:{name:N}})),i=r.index+r[0].length;i<e.length&&n.push(new _({...t,text:e.slice(i)}))}),n}function U(e){if(!e)return[];let r=/(\*\*(.+?)\*\*|(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)|__(.+?)__|(?<!_)_(?!_)(.+?)(?<!_)_(?!_)|`([^`]+)`|\[([^\]]+)\]\(([^)]+)\)|!\[([^\]]*)\]\(([^)]+)\))/,i=[],a=e;for(;a.length>0;){let e=a.match(r);if(!e){i.push(...H(a));break}let o=e.index;o>0&&i.push(...H(a.slice(0,o)));let s=e[1];if(e[2]!==void 0)i.push(...H(e[2],{bold:!0}));else if(e[3]!==void 0)i.push(...H(e[3],{italics:!0}));else if(e[4]!==void 0)i.push(...H(e[4],{bold:!0}));else if(e[5]!==void 0)i.push(...H(e[5],{italics:!0}));else if(e[6]!==void 0)i.push(new _({text:e[6],font:`Consolas`,size:20}));else if(e[7]!==void 0)i.push(new d({children:[new _({text:e[7],style:`Hyperlink`})],link:e[8]}));else if(e[9]!==void 0){let r=e[10];if(r.startsWith(`data:`))try{let[n,a]=r.split(`,`),o=n.match(/data:(image\/(\w+))/);if(o&&a&&V(o[2])){let t=atob(a),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=o[2],s=ue(n,r),c=s.width,l=s.height;if(c>567){let e=567/c;c=Math.round(c*e),l=Math.round(l*e)}i.push(new p({data:n,transformation:{width:c,height:l},type:r,altText:{id:z(),name:e[9]||`image`}}))}else i.push(new _({text:t(`chatExport.imagePlaceholder`,{name:e[9]||`image`}),italics:!0,color:`999999`}))}catch(r){n.warn(`[ChatExport] ImageRun create failed:`,r.message),i.push(new _({text:t(`chatExport.imagePlaceholder`,{name:e[9]||`image`}),italics:!0,color:`999999`}))}else i.push(new _({text:t(`chatExport.imagePlaceholder`,{name:e[9]||r}),italics:!0,color:`999999`}))}a=a.slice(o+s.length)}return i}function ue(e,t){if(t===`png`&&e.length>24){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{width:t.getUint32(16),height:t.getUint32(20)}}if((t===`jpeg`||t===`jpg`)&&e.length>100){let t=2;for(;t<e.length-9;)if(e[t]===255){let n=e[t+1];if(n>=192&&n<=195){let n=new DataView(e.buffer,e.byteOffset,e.byteLength);return{height:n.getUint16(t+5),width:n.getUint16(t+7)}}t+=2+(e[t+2]<<8|e[t+3])}else t++}return{width:600,height:400}}async function W(e){if(!e||!e.trim())return[new g({children:[new _({text:``})]})];let t=[],n=L(e),r=[];n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,n)=>{let i=r.length;return r.push({lang:t||``,code:n.trimEnd()}),`\n\n%%CODEBLOCK_${i}%%\n\n`});let i=[];n=n.replace(/<table[\s\S]*?<\/table>/gi,e=>{let t=i.length;return i.push(e),`\n\n%%HTMLTABLE_${t}%%\n\n`});let a=[];n=n.replace(/(?:^\|.+\|\s*$\n)+^\|[\s\-:|]+\|\s*$\n(?:^\|.+\|\s*$\n?)+/gm,e=>{let t=a.length;return a.push(e),`\n\n%%MDTABLE_${t}%%\n\n`});let o=n.split(/\n{2,}/).filter(e=>e.trim());for(let e of o){let n=e.trim(),o=n.match(/^%%CODEBLOCK_(\d+)%%$/);if(o){let{lang:e,code:n}=r[parseInt(o[1])],i=e?`${e} code`:`code`;t.push(new g({children:[new _({text:i,bold:!0,font:`Consolas`,size:18})]}));let a=n.split(`
@@ -839,10 +839,10 @@ Question 1
839
839
  Question 2
840
840
  Question 3`}});var T={search:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',explain:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18h6"/><path d="M10 22h4"/><path d="M12 2a7 7 0 0 0-7 7c0 2.4 1.2 4.5 3 5.7V17h8v-2.3c1.8-1.2 3-3.3 3-5.7a7 7 0 0 0-7-7Z"/></svg>',translate:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',summary:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><path d="M14 2v6h6"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/></svg>',copy:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',close:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',sparkle:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',lock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',unlock:'<svg class="aih-ic" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>',copyLarge:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',grip:'<svg class="aih-ic aih-ic-solid" width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="8" cy="6" r="1.5"/><circle cx="16" cy="6" r="1.5"/><circle cx="8" cy="12" r="1.5"/><circle cx="16" cy="12" r="1.5"/><circle cx="8" cy="18" r="1.5"/><circle cx="16" cy="18" r="1.5"/></svg>',send:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>',more:'<svg class="aih-ic aih-ic-solid" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>',gear:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',refresh:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>',block:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>',eyeOff:'<svg class="aih-ic" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',check:'<svg class="aih-ic" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>'},b=null,g=null,B=!1,N=!1,_e="",Ce=null,Ee="",F=!1,V=!1,z="",Ie="",Ue="",Tt="",x="",ue=!0,ve=[],wo=!1,Re=!1,vo=0,re=!1;function Yt(){re=!1}var Vn=!1;function jn(){Vn||=(document.addEventListener("mouseup",Yt,!0),window.addEventListener("blur",Yt),!0)}var de={x:0,y:0},W=null,U=null,Xt=5,It=!1,D=!1,K=null,S="",k=null,ne="",Ke=!1,je=0,xo=null,Qe=!1,St=new Set,Ye=null,Xe=null,Ze=0,P=window.top===window;if(!P)try{window.parent===window.top&&window.top.document.querySelector("frameset")&&(P=!0)}catch{}R.debug("[SelectionToolbar] moduleload isTopFrame:",P,"top===window:",window.top===window,"hasBody:",!!document.body,"parent===top:",window.parent===window.top);var M=null,le=!1;function Qn(){let e=document.getElementById("aih-overlay-host");return e||(e=document.createElement("div"),e.id="aih-overlay-host",e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false"),e.style.display="contents",(document.documentElement||document.body).appendChild(e)),e}function G(e){Qn().appendChild(e)}function tt(e){e.setAttribute("data-aih",""),e.setAttribute("contenteditable","false")}function ke(e,t){if(e){try{e.showPopover()}catch{}e.style.display=t}}function X(e){if(e){try{e.hidePopover()}catch{}e.style.display="none"}}function Pe(e){return!!e&&e.style.display!==""&&e.style.display!=="none"}var Fe=new Map;function Yn(){return Pe(b)||Pe(k)||Pe(g)||Qe}function Xn(){Fe.forEach((e,t)=>{e===null?t.style.removeProperty("display"):t.style.display=e}),Fe.clear()}function ot(e){if(!e||typeof e.getBoundingClientRect!="function"||!document.elementFromPoint)return;let t=e.getBoundingClientRect();if(!(t.width>0)||!(t.height>0))return;let o=[t.left+t.width*.25,t.left+t.width/2,t.left+t.width*.75],n=[t.top+t.height/2,t.bottom-2];for(let a of o)for(let i of n){let r=document.elementFromPoint(a,i);!r||r.closest("[data-aih]")||Fe.has(r)||(Fe.set(r,r.style.display),r.style.display="none")}}function Z(){Fe.size&&!Yn()&&Xn()}var O=null;function ko(e,t){let o=t?e.querySelector(t):e;o&&(o.style.cursor="grab",o.addEventListener("mousedown",n=>{if(n.target.closest('[role="button"]')||n.button!==0)return;n.preventDefault(),n.stopPropagation();let a=e.getBoundingClientRect();O={el:e,startX:n.clientX,startY:n.clientY,startLeft:a.left,startTop:a.top,pointerId:n.pointerId||0},o.style.cursor="grabbing",e.style.transition="none"}))}document.addEventListener("mousemove",e=>{if(!O)return;let t=e.clientX-O.startX,o=e.clientY-O.startY,n=O.startLeft+t,a=O.startTop+o,i=window.innerWidth,r=window.innerHeight,l=O.el.getBoundingClientRect();n=Math.max(0,Math.min(n,i-l.width)),a=Math.max(0,Math.min(a,r-l.height)),O.el.style.left=n+"px",O.el.style.top=a+"px"}),document.addEventListener("mouseup",()=>{if(!O)return;O.el.style.transition="";let e=O.el.querySelector(".aih-result-header")||O.el;e.style.cursor="grab",O=null});function q(){try{return typeof chrome!="object"||!chrome||typeof chrome.runtime!="object"||!chrome.runtime?!1:!!chrome.runtime.id}catch{return!1}}var qe=[{id:"ai-search",name:u("optionsConst.aiSearch"),systemPrompt:u("selToolbar.sysPromptAisearch"),builtin:!0,order:0},{id:"explain",name:u("optionsConst.explain"),systemPrompt:u("selToolbar.sysPromptExplain"),builtin:!0,order:1},{id:"translate",name:u("optionsConst.translate"),systemPrompt:u("selToolbar.sysPromptTranslate"),builtin:!0,order:2},{id:"summary",name:u("optionsConst.summary"),systemPrompt:u("selToolbar.sysPromptSummary"),builtin:!0,order:3},{id:"copy",name:u("optionsConst.copy"),systemPrompt:u("selToolbar.sysPromptCopy"),builtin:!0,order:99}];function Zt(e){return e.map(t=>{let o=Oe(t.id);return o?{...t,name:o}:t})}function To(){return new Promise(e=>{if(!q()){U=Zt([...qe]),e(U);return}if(U){e(U);return}try{chrome.storage.local.get(["toolbarTools","toolbarIconOnly"],t=>{let o=t.toolbarTools&&t.toolbarTools.length>0?t.toolbarTools:qe,n=new Map(qe.map(a=>[a.id,a]));U=o.map(a=>{if(a.builtin&&n.has(a.id)){let i=Oe(a.id);return{...a,systemPrompt:n.get(a.id).systemPrompt,name:i||a.name}}return a}),It=t.toolbarIconOnly||!1,e(U)})}catch{U=Zt([...qe]),e(U)}})}function Jt(){U=null,It=!1,To()}function So(e){return{"ai-search":T.search,explain:T.explain,translate:T.translate,summary:T.summary,copy:T.copy}[e]||T.sparkle}function Zn(){k||(k=document.createElement("div"),k.id="aih-overflow-dropdown",k.className="aih-overflow-dropdown",k.setAttribute("popover","manual"),tt(k),k.style.display="none",G(k),document.addEventListener("click",e=>{k&&Pe(k)&&!k.contains(e.target)&&!e.target.closest(".aih-tb-btn-overflow")&&(X(k),Z())}))}function Jn(e){k||Zn();let t=e.map(o=>{let n=So(o.id),a=o.builtin&&Oe(o.id)||o.name;return`<div class="aih-dropdown-item" role="button" tabindex="0" data-action="${o.id}">
841
841
  <span class="aih-tb-icon">${n}</span>${a}
842
- </div>`}).join("");t+=`<div class="aih-dropdown-item aih-dropdown-context" role="button" tabindex="0" title="${u("selToolbar.contextAwareTitle")}" aria-pressed="${D?"true":"false"}">
843
- <span class="aih-tb-icon aih-context-check">${D?T.check:""}</span>${u("selToolbar.contextAware")}
844
- </div>`,t+='<div class="aih-dropdown-divider"></div>',t+=`<div class="aih-dropdown-item aih-dropdown-settings" role="button" tabindex="0" title="${u("selToolbar.settingsTitle")}">
842
+ </div>`}).join("");t+='<div class="aih-dropdown-divider"></div>',t+=`<div class="aih-dropdown-item aih-dropdown-settings" role="button" tabindex="0" title="${u("selToolbar.settingsTitle")}">
845
843
  <span class="aih-tb-icon">${T.gear}</span>${u("selToolbar.settings")}
844
+ </div>`,t+=`<div class="aih-dropdown-item aih-dropdown-context" role="button" tabindex="0" title="${u("selToolbar.contextAwareTitle")}" aria-pressed="${D?"true":"false"}">
845
+ <span class="aih-tb-icon aih-context-check">${D?T.check:""}</span>${u("selToolbar.contextAware")}
846
846
  </div>`,t+=`<div class="aih-dropdown-item aih-dropdown-hide" role="button" tabindex="0" title="${u("selToolbar.disableTemporarilyTitle")}">
847
847
  <span class="aih-tb-icon">${T.eyeOff}</span>${u("selToolbar.disableTemporarily")}
848
848
  </div>`,t+=`<div class="aih-dropdown-item aih-dropdown-block" role="button" tabindex="0" title="${u("selToolbar.disableOnSiteTitle")}">