PageSourceSearch

https://legalaios2.manus.space/assets/Embed-CR5E4ZYy.js

js legalaios2.manus.space collected 2026-10-03 05:03:42 UTC 9,087 bytes, 21 lines download raw bytes

1import{r as n,j as e}from"./vendor-react-D_PmJq1g.js";import{C as m,E as g}from"./ConsolePage-hLYCyqMG.js";import{B as b}from"./badge-DKUuEzvb.js";import{v as h,B as d,p as i}from"./index-CH-dzzKG.js";import{u as r,J as x,E as u,W as f,X as E,S as j}from"./vendor-ui-CX5AecA-.js";import"./vendor-data-tjINLo7H.js";function y(s,t){const a=`${s}/widget/${encodeURIComponent(t)}`;return`<script>
2(function(w,d){
3  if(w.PingLexAIWidget) return;
4  var frame=d.createElement('iframe');
5  var button=d.createElement('button');
6  frame.src=${JSON.stringify(a)};
7  frame.title='PingLexAI 法律資訊助理';
8  frame.loading='lazy';
9  frame.allow='clipboard-write';
10  frame.style.cssText='display:none;position:fixed;right:20px;bottom:92px;width:min(430px,calc(100vw - 24px));height:min(700px,calc(100dvh - 116px));border:0;border-radius:24px;box-shadow:0 28px 90px rgba(2,8,23,.48);z-index:2147483646;background:#081225;';
11  button.type='button';
12  button.setAttribute('aria-label','開啟 PingLexAI 法律資訊助理');
13  button.textContent='AI';
14  button.style.cssText='position:fixed;right:20px;bottom:20px;width:60px;height:60px;border-radius:50%;border:1px solid rgba(218,182,105,.58);background:linear-gradient(145deg,#182747,#081225);color:#efd69b;font:700 15px system-ui;box-shadow:0 16px 46px rgba(2,8,23,.45);cursor:pointer;z-index:2147483647;';
15  var open=false;
16  function toggle(){open=!open;frame.style.display=open?'block':'none';button.textContent=open?'×':'AI';button.setAttribute('aria-label',open?'關閉 PingLexAI 法律資訊助理':'開啟 PingLexAI 法律資訊助理');}
17  button.addEventListener('click',toggle);
18  d.body.appendChild(frame);d.body.appendChild(button);
19  w.PingLexAIWidget={open:function(){if(!open)toggle();},close:function(){if(open)toggle();},destroy:function(){frame.remove();button.remove();delete w.PingLexAIWidget;}};
20})(window,document);
21<\/script>`}function I(){const{activeSite:s}=h(),[t,a]=n.useState(!1),c=typeof window>"u"?"https://your-legalaios-domain.example":window.location.origin,l=n.useMemo(()=>s?y(c,s.publicKey):"",[s,c]),p=s?`${c}/widget/${encodeURIComponent(s.publicKey)}`:"";async function o(){if(l)try{await navigator.clipboard.writeText(l),a(!0),i.success("Widget 嵌入碼已複製"),window.setTimeout(()=>a(!1),1800)}catch{i.error("無法存取剪貼簿,請手動選取程式碼")}}return e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:54",children:[e.jsx(m,{"data-loc":"client/src/pages/console/Embed.tsx:55",eyebrow:"Widget Delivery",title:"嵌入碼",description:"為目前網站產生框架無關的 PingLexAI 安裝碼。貼到第三方網站的 </body> 前即可使用,不需要 React、Vue 或其他套件。",action:s?e.jsxs(d,{"data-loc":"client/src/pages/console/Embed.tsx:60",type:"button",onClick:o,className:"rounded-xl bg-champagne-400 text-navy-950 hover:bg-champagne-300",children:[t?e.jsx(r,{"data-loc":"client/src/pages/console/Embed.tsx:61",className:"mr-2 size-4"}):e.jsx(x,{"data-loc":"client/src/pages/console/Embed.tsx:61",className:"mr-2 size-4"}),t?"已複製":"複製嵌入碼"]}):void 0}),s?e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:70",className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[e.jsxs("section",{"data-loc":"client/src/pages/console/Embed.tsx:71",className:"glass-panel overflow-hidden rounded-[1.4rem]",children:[e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:72",className:"flex flex-wrap items-center justify-between gap-3 border-b border-slate-200 px-5 py-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:73",children:[e.jsx("p",{"data-loc":"client/src/pages/console/Embed.tsx:74",className:"text-[0.62rem] font-bold tracking-[0.16em] text-champagne-700 uppercase",children:"Universal Install Code"}),e.jsxs("h2",{"data-loc":"client/src/pages/console/Embed.tsx:75",className:"mt-1 text-lg font-bold text-navy-950",children:[s.name," · Widget 安裝碼"]})]}),e.jsx(b,{"data-loc":"client/src/pages/console/Embed.tsx:77",variant:"outline",className:"border-emerald-200/16 text-emerald-800",children:"跨框架"})]}),e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:79",className:"relative bg-[#070d1c] p-4 sm:p-5",children:[e.jsx("pre",{"data-loc":"client/src/pages/console/Embed.tsx:80",className:"max-h-[31rem] overflow-auto whitespace-pre-wrap break-all rounded-xl border border-slate-200 bg-black/18 p-4 text-[0.72rem] leading-6 text-slate-500 selection:bg-champagne-300/24",children:e.jsx("code",{"data-loc":"client/src/pages/console/Embed.tsx:81",children:l})}),e.jsxs(d,{"data-loc":"client/src/pages/console/Embed.tsx:83",type:"button",variant:"outline",size:"sm",onClick:o,className:"absolute top-7 right-7 rounded-lg border-slate-200 bg-white text-slate-500 hover:border-champagne-300/24 hover:text-navy-950",children:[t?e.jsx(r,{"data-loc":"client/src/pages/console/Embed.tsx:84",className:"mr-2 size-3.5"}):e.jsx(x,{"data-loc":"client/src/pages/console/Embed.tsx:84",className:"mr-2 size-3.5"}),t?"已複製":"複製"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:90",className:"space-y-4",children:[e.jsxs("section",{"data-loc":"client/src/pages/console/Embed.tsx:91",className:"glass-panel roun
21ded-[1.4rem] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:92",className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:93",children:[e.jsx("p",{"data-loc":"client/src/pages/console/Embed.tsx:94",className:"text-[0.62rem] font-bold tracking-[0.16em] text-champagne-700 uppercase",children:"Live Preview"}),e.jsx("h2",{"data-loc":"client/src/pages/console/Embed.tsx:95",className:"mt-2 text-xl font-bold text-navy-950",children:"獨立 Widget 頁面"})]}),e.jsx(f,{"data-loc":"client/src/pages/console/Embed.tsx:97",className:"size-5 text-champagne-700"})]}),e.jsx("p",{"data-loc":"client/src/pages/console/Embed.tsx:99",className:"mt-3 text-sm leading-7 text-slate-600",children:"嵌入碼會載入目前網站的公開 Agent 設定與已發布知識。預覽頁可用來檢查品牌、歡迎訊息與實際回答。"}),e.jsxs("a",{"data-loc":"client/src/pages/console/Embed.tsx:100",href:p,target:"_blank",rel:"noreferrer",className:"mt-5 flex items-center justify-between rounded-xl border border-champagne-400/18 bg-champagne-400/6 px-4 py-3 text-sm font-bold text-champagne-700 hover:bg-champagne-400/10",children:["開啟 Widget 預覽",e.jsx(E,{"data-loc":"client/src/pages/console/Embed.tsx:102",className:"size-4"})]}),e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:104",className:"mt-4 rounded-xl border border-slate-200 bg-slate-50 px-4 py-3",children:[e.jsx("p",{"data-loc":"client/src/pages/console/Embed.tsx:105",className:"text-[0.62rem] text-slate-500",children:"網站識別碼"}),e.jsx("p",{"data-loc":"client/src/pages/console/Embed.tsx:106",className:"mt-1 break-all font-mono text-xs text-slate-500",children:s.publicKey})]})]}),e.jsxs("section",{"data-loc":"client/src/pages/console/Embed.tsx:110",className:"glass-panel rounded-[1.4rem] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/console/Embed.tsx:111",className:"flex items-center gap-2 text-sm font-bold text-navy-950",children:[e.jsx(j,{"data-loc":"client/src/pages/console/Embed.tsx:112",className:"size-4 text-emerald-700"})," 安裝與安全說明"]}),e.jsxs("ol",{"data-loc":"client/src/pages/console/Embed.tsx:114",className:"mt-4 space-y-3 text-sm leading-7 text-slate-600",children:[e.jsxs("li",{"data-loc":"client/src/pages/console/Embed.tsx:115",className:"flex gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/console/Embed.tsx:115",className:"font-display text-champagne-700",children:"01"}),e.jsxs("span",{"data-loc":"client/src/pages/console/Embed.tsx:115",children:["將程式碼貼在網站 HTML 的 ",e.jsx("code",{"data-loc":"client/src/pages/console/Embed.tsx:115",className:"rounded bg-slate-100 px-1.5 py-0.5 text-xs",children:"</body>"})," 前。"]})]}),e.jsxs("li",{"data-loc":"client/src/pages/console/Embed.tsx:116",className:"flex gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/console/Embed.tsx:116",className:"font-display text-champagne-700",children:"02"}),e.jsx("span",{"data-loc":"client/src/pages/console/Embed.tsx:116",children:"Agent 以 iframe 隔離執行,不會依賴或改寫第三方網站框架。"})]}),e.jsxs("li",{"data-loc":"client/src/pages/console/Embed.tsx:117",className:"flex gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/console/Embed.tsx:117",className:"font-display text-champagne-700",children:"03"}),e.jsx("span",{"data-loc":"client/src/pages/console/Embed.tsx:117",children:"重新發布知識或 Agent 設定後,既有嵌入碼無須更換。"})]})]})]})]})]}):e.jsx(g,{"data-loc":"client/src/pages/console/Embed.tsx:68",icon:e.jsx(u,{"data-loc":"client/src/pages/console/Embed.tsx:68",className:"size-5"}),title:"尚未選擇網站",description:"請先建立或選擇網站,再產生對應的 Widget 安裝碼。"})]})}export{I as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.