1import{c as v,r as o,j as e}from"./bootstrapApp-D7_qjC6j.js";import"./index-D6z0c_Gc.js";const p="mailivery-embed-test:url",c="mailivery-embed-test:left-at";function h(r){try{return sessionStorage.getItem(r)??""}catch{return""}}function E(){const r=v(),[m,u]=o.useState(()=>h(p)),[n,s]=o.useState(""),[b,d]=o.useState(!1),x=`${window.location.origin}/mailivery-embed-test`,l=h(c),i=o.useMemo(()=>{const t=new URLSearchParams(r.search);return Array.from(t.entries())},[r.search]),y=i.length>0||!!l,f=()=>{const t=m.trim();if(!t){s("请å
ç²è´´ Embed Form URL");return}try{const a=new URL(t);if(a.protocol!=="http:"&&a.protocol!=="https:"){s("URL å¿
须以 http æ https å¼å¤´");return}}catch{s("è¿ä¸æ¯ä¸ä¸ªææç URL");return}s("");try{sessionStorage.setItem(p,t),sessionStorage.setItem(c,new Date().toISOString())}catch{}window.location.assign(t)},g=async()=>{try{await navigator.clipboard.writeText(x),d(!0),window.setTimeout(()=>d(!1),2e3)}catch{s("å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶ä¸æ¹åè·³å°å")}},j=()=>{try{sessionStorage.removeItem(c)}catch{}window.history.replaceState(null,"","/mailivery-embed-test"),window.location.reload()};return e.jsx("div",{className:"min-h-dvh bg-[#F4F6F8] px-6 py-10 font-body text-[#121A2A]",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[720px] flex-col gap-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-caption font-semibold uppercase tracking-[0.08em] text-[#6B7280]",children:"æ¬å°æµè¯é¡µ"}),e.jsx("h1",{className:"mt-1 text-[28px] font-semibold leading-9",children:"Mailivery Embed Form åè·³æµè¯"}),e.jsx("p",{className:"mt-2 text-ui leading-6 text-[#4B5563]",children:"æå端æå¨ç¾åç Embed URL è´´å°ä¸é¢ï¼ç¹å»è·³è½¬ç¦»å¼æ¬é¡µãææç»æåï¼çæµè§å¨ä¼ä¸ä¼åå°è¿ä¸ªå°åï¼ä»¥å URL ä¸å¸¦äºä»ä¹åæ°ã"})]}),e.jsxs("section",{className:"rounded-2xl border border-[#E5E7EB] bg-white p-5",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Mailivery åå°åºé
ç½®ç Return URL"}),e.jsx("p",{className:"mt-1 text-caption leading-5 text-[#6B7280]",children:"Embed Form ä¸ä¼èªå¨åå°ã离å¼åç页é¢ãï¼åªä¼è·³å° Mailivery åå°å¡«çåºå®åè·³å°åãæµè¯åè·³æ¶è¯·é
æä¸é¢è¿ä¸æ¡ã"}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row",children:[e.jsx("code",{className:"min-h-[40px] flex-1 break-all rounded-lg bg-[#F3F4F6] px-3 py-2 text-sm",children:x}),e.jsx("button",{type:"button",onClick:g,className:"btn-corvia-secondary btn-corvia-sm shrink-0",children:b?"å·²å¤å¶":"å¤å¶"})]})]}),y&&e.jsxs("section",{className:"rounded-2xl border border-[#BBF7D0] bg-[#F0FDF4] p-5",children:[e.jsx("p",{className:"text-sm font-semibold text-[#166534]",children:"æ£æµå°åå°æ¬é¡µ"}),l&&e.jsxs("p",{className:"mt-1 text-caption text-[#166534]",children:["䏿¬¡ç¦»å¼æ¶é´ï¼",new Date(l).toLocaleString()]}),i.length>0?e.jsx("dl",{className:"mt-3 grid gap-2",children:i.map(([t,a])=>e.jsxs("div",{className:"rounded-lg bg-white/80 px-3 py-2",children:[e.jsx("dt",{className:"text-caption font-semibold text-[#6B7280]",children:t}),e.jsx("dd",{className:"break-all text-sm",children:a})]},t))}):e.jsx("p",{className:"mt-2 text-sm text-[#166534]",children:"å½å没æ query åæ°ãå¦æè¿æ¯ææå忥çï¼è¯´æ Mailivery åè·³äºï¼ä½æ²¡æå¸¦ metaã"}),e.jsx("button",{type:"button",onClick:j,className:"mt-3 text-caption font-medium text-[#166534] underline",children:"æ¸
é¤åè·³ç迹"})]}),e.jsxs("section",{className:"rounded-2xl border border-[#E5E7EB] bg-white p-5",children:[e.jsx("label",{htmlFor:"mailivery-embed-url",className:"text-sm font-semibold",children:"Embed Form URL"}),e.jsx("textarea",{id:"mailivery-embed-url",value:m,onChange:t=>{u(t.target.value),n&&s("")},rows:5,placeholder:"https://app.mailivery.io/embed/form?expires=...",className:"mt-2 w-full resize-y rounded-lg border border-[#D1D5DB] px-3 py-2 text-sm outline-none focus:border-[#121A2A]"}),n&&e.jsx("p",{className:"mt-2 text-caption font-medium text-red-600",children:n}),e.jsx("button",{type:"button",onClick:f,className:"btn-corvia-primary mt-4",children:"è·³è½¬å° Embed Form"})]})]})})}export{E 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.