@lightworkai.official/debug-capture 0.19.3 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -484,7 +484,10 @@ beside it — แชทกับทีมงาน until the person first opens
484
484
  the call's card are drawn in your page's own font (read from `<body>`). The
485
485
  panel's head has เปิดในระบบแจ้งปัญหา (0.19.3): the same hand-off as
486
486
  `openSupportPortal` — its countdown, signed in, a new tab — to the page the
487
- panel was on (the chat, the person's tickets, or the one open). Your
487
+ panel was on (the chat, the person's tickets, or the one open). The team can
488
+ call from the chat too, and the person can ask for a call back there (0.19.4):
489
+ the ring card says จากแชทกับทีมงาน instead of a ticket's key, and its fallback
490
+ opens their chat. Your
488
491
  own button instead of ours: `openSupportChat()` /
489
492
  `closeSupportChat()`; on a page with no bundler, `data-chat` and
490
493
  `data-identity-url` on the script tag, and `window.lwOpenSupportChat()`.
@@ -1,4 +1,4 @@
1
- (()=>{var O8=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(z,$)=>(typeof require<"u"?require:z)[$]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});function _1(J){if(!J)return null;let z=J===!0?{}:J,$=(j,Q)=>typeof j==="number"&&Number.isFinite(j)&&j>=0&&j<2000?j:Q;return{side:z.position==="left"?"left":"right",x:$(z.offset?.x,16),y:$(z.offset?.y,16)}}var L8={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},n=null;function X4(J){let z=[];if(!J.host?.trim())z.push("host");if(!J.realmKey?.trim())z.push("realmKey");if(!J.app?.name?.trim())z.push("app.name");if(typeof J.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");n=J}function M(){if(!n)throw Error("[debug-capture] configureDebugCapture() has not been called");return n}function I1(){return n!==null}function q0(){let J=M().app;return{name:J.name,version:J.version??"0.0.0",environment:J.environment??S8()}}function S8(){if(typeof window>"u")return"unknown";let J=window.location.hostname;if(J==="localhost"||J==="127.0.0.1"||J.endsWith(".local"))return"development";return"production"}function B0(J){let z=n?.capture?.[J];return typeof z==="number"?z:L8[J]}function C1(J){let z=n?.module;if(!z)return null;try{return z(J)??null}catch{return null}}function O1(){let J=n?.redact;return{headers:J?.headers??[],queryKeys:(J?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:(J?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function V4(){return n?.capture?.overlaySelectors??[]}var R8='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',T8="[data-lw-mask]",Z4={fps:1,quality:0.5};function t0(){let J=n?.replay;if(!J)return null;let z=J===!0?{}:J,$=(Z,V)=>typeof Z==="number"&&Z>0?Z:V,j=z.maskInputs!==!1,Q=z.recordCanvas?{fps:$(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,Z4.fps),quality:$(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,Z4.quality)}:null;return{seconds:$(z.seconds,60),maskInputs:j,maskTextSelector:z.maskTextSelector?.trim()||(j?R8:T8),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:$(z.maxBytes,4000000),canvas:Q}}function W4(J){if(typeof window>"u")return!1;let z;try{z=new URL(J,window.location.href)}catch{return!1}if(A8(z))return!1;if(z.origin===window.location.origin)return!0;return(n?.capture?.bodyOrigins??[]).some(($)=>{try{return new URL($).origin===z.origin}catch{return!1}})}function A8(J){if(!n?.host)return!1;try{if(new URL(n.host).origin!==J.origin)return!1}catch{return!1}return J.pathname.startsWith("/ingest/")}function Y4(J){let z=Object.entries(J).map(([$,j])=>[$.replace(/\/+$/,"")||"/",j]).sort(($,j)=>j[0].length-$[0].length);return($)=>{let j=($||"/").replace(/\/+$/,"")||"/";for(let[Q,Z]of z)if(j===Q||j.startsWith(`${Q}/`))return{key:Q,label:Z};return null}}var e0="‹redacted›",k8=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,x8=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),E8=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,f8=/[\w.+-]+@[\w-]+\.[\w.-]+/g,w8=/\d(?:[\d\s-]{7,})\d/g;function J1(J){return J.replace(f8,e0).replace(w8,e0)}function y8(J){if(k8.test(J))return!0;return O1().headers.some(($)=>$.toLowerCase()===J.toLowerCase())}function z1(J){let z={};for(let[$,j]of Object.entries(J))z[$]=y8($)?e0:j;return z}function N0(J){try{let z=/^https?:\/\//i.test(J),$=new URL(J,z?void 0:"http://local.invalid"),j=!1;if($.searchParams.forEach((Q,Z)=>{if(x8.has(Z.toLowerCase())||O1().queryKeys.includes(Z.toLowerCase()))$.searchParams.set(Z,e0),j=!0}),!j)return J;return z?$.toString():`${$.pathname}${$.search}`}catch{return J}}function V2(J,z){if(z>6||J===null||typeof J!=="object")return J;if(Array.isArray(J))return J.map((j)=>V2(j,z+1));let $={};for(let[j,Q]of Object.entries(J)){let Z=E8.test(j)||O1().bodyKeys.some((V)=>j.toLowerCase().includes(V));$[j]=Z?e0:V2(Q,z+1)}return $}function $1(J,z){if(J==null)return null;let $=J,j=J.trim();if(j.startsWith("{")||j.startsWith("["))try{let Q=JSON.parse(j);$=JSON.stringify(V2(Q,0))}catch{}if($.length>z)return`${$.slice(0,z)}… [truncated ${$.length-z} chars]`;return $}var W2=120,Y2=40,v0=(J,z)=>J.length>z?`${J.slice(0,z)}…`:J,K2=(J)=>{try{return decodeURIComponent(J)}catch{return J}},g0=[],K4=0,G4=!1;function j1(J,z,$,j){let Q=v0(z,W2),Z=g0[g0.length-1];if(J==="navigate"&&Z?.kind==="click"){let W=Q.replace(/^ไปที่\s*/,"");if(Z.detail.includes(`→ ${W}`))return Z.at=new Date().toISOString(),Z;let U=W.split(/[?#]/)[0]??W,q=Z.source?K2(Z.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(q&&(U===q||U.startsWith(q)))return Z.detail=v0(`${Z.detail} → ${W}`,W2),Z.source=void 0,Z.at=new Date().toISOString(),Z}if(Z&&Z.kind===J&&Z.detail===Q){if(Z.at=new Date().toISOString(),J!=="navigate")Z.count=(Z.count??1)+1;return Z}K4+=1;let V={id:`act_${K4}`,at:new Date().toISOString(),kind:J,detail:Q,count:1,source:$,html:S1(j)};g0.push(V);while(g0.length>B0("maxActions"))v8(g0.shift());return V}var g8=200000,Q1=0;function S1(J){if(!J)return;if(Q1+J.length>g8)return;return Q1+=J.length,J}function v8(J){if(!J)return;if(Q1-=(J.html?.length??0)+(J.afterHtml?.length??0),Q1<0)Q1=0}function L1(J){return J instanceof Element&&Boolean(J.closest("[data-debug-reporter]"))}var h8='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',m8={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},U4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function b8(J){let z=J.getAttribute("role");if(z&&U4[z])return U4[z];return m8[J.tagName.toLowerCase()]??"ปุ่ม"}function u8(J,z){try{let $=J,j=0;while($&&j<=z){let Q=F4($);if(Q&&typeof Q.memoizedProps?.onClick==="function")return $;$=$.parentElement,j+=1}}catch{}return null}function p8(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("title")?.trim();if($)return $;if(J instanceof HTMLInputElement||J instanceof HTMLTextAreaElement||J instanceof HTMLSelectElement)return(J.getAttribute("placeholder")||J.getAttribute("name")||"").trim();if(J instanceof HTMLImageElement)return(J.getAttribute("alt")||"").trim();let j=(J.textContent??"").replace(/\s+/g," ").trim();if(j)return j;if(J instanceof HTMLAnchorElement){let Q=J.getAttribute("href");if(Q?.startsWith("/"))return K2(Q)}return""}function i8(J){if(!(J instanceof Element))return null;let z=J.closest(h8)??u8(J,4);if(!z)return null;let $=z.tagName.toLowerCase();if($==="html"||$==="body")return null;return z}function d8(J){let z=J1(p8(J));if(!z)return null;return`${b8(J)} “${v0(z,Y2)}”`}var M4=6000,c8=4000,l8=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function o8(J){J.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Q)=>Q.remove());let z=[J,...Array.from(J.querySelectorAll("*"))];for(let Q of z){for(let V of Array.from(Q.attributes)){let W=V.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))Q.removeAttribute(V.name)}if(Q instanceof HTMLAnchorElement)Q.setAttribute("href","#");if(Q instanceof HTMLImageElement)Q.removeAttribute("src");let Z=Q.getAttribute("class");if(Z){let V=Z.replace(l8," ").replace(/\s+/g," ").trim();if(V)Q.setAttribute("class",V);else Q.removeAttribute("class")}}let $=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),j=$.nextNode();while(j){if(j.nodeValue)j.nodeValue=J1(j.nodeValue);j=$.nextNode()}}function G2(J,z,$){try{let j=J.outerHTML;if(!j||j.length>z)return;let Q=J.cloneNode(!0);o8(Q);let Z=Q.outerHTML;return Z&&Z.length<=$?Z:void 0}catch{return}}var r8=(J)=>G2(J,M4,c8),n8=150000,s8=40000,q4=(J)=>G2(J,n8,s8);function a8(J){if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLTextAreaElement)&&!(J instanceof HTMLSelectElement))return null;let z=J.name||J.id||J.getAttribute("aria-label")||J.getAttribute("placeholder")||J.tagName.toLowerCase();return`ช่อง “${J1(z)}”`}var H4=80;function F4(J){let z=Object.keys(J).find(($)=>$.startsWith("__reactFiber$")||$.startsWith("__reactInternalInstance$"));return z?J[z]:null}function t8(J){if(typeof J!=="function")return null;try{let z=Function.prototype.toString.call(J);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function D4(J){if(!J)return;return`→ ${J.length>H4?`${J.slice(0,H4)}…`:J}`}function e8(J){try{let z=J.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return D4(z);let $=F4(J),j=0;while($&&j<30){if(typeof $.memoizedProps?.onClick==="function")return D4(t8($.memoizedProps.onClick));$=$.return,j+=1}return}catch{return}}var J5='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function z5(){let J=V4();return J.length?J.join(", "):J5}function $5(J){let z=J.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function j5(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("aria-labelledby");if($){let Z=$.split(/\s+/).map((V)=>document.getElementById(V)?.textContent?.trim()??"").filter(Boolean).join(" ");if(Z)return Z}let Q=J.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Q)return Q;return(J.textContent??"").replace(/\s+/g," ").trim()}function B4(J){let z=J1(j5(J)),$=$5(J);return z?`เปิด ${$} “${v0(z,Y2)}”`:`เปิด ${$}`}var Q5='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',Z5=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function X5(J){if(J.querySelector(Q5))return!0;return Z5.test(J.textContent??"")}var V5=400,W5=250,Y5=8000;function K5(J,z){if(typeof MutationObserver>"u"){z.html=S1(q4(J));return}let $=Date.now(),j=!1,Q=()=>{j=!0,V.disconnect(),window.clearInterval(W),window.clearTimeout(U)},Z=()=>{if(j)return;if(Q(),!J.isConnected)return;z.detail=v0(B4(J),W2),z.html=S1(q4(J))},V=new MutationObserver(()=>{$=Date.now()});V.observe(J,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(j)return;if(!J.isConnected){Q();return}if(Date.now()-$>=V5&&!X5(J))Z()},W5),U=window.setTimeout(Z,Y5)}function G5(J){if(L1(J))return;let z=j1("ui",B4(J));if(z)K5(J,z)}function U5(){if(typeof MutationObserver>"u")return;let J=new WeakSet;new MutationObserver(($)=>{for(let j of $)for(let Q of Array.from(j.addedNodes)){if(!(Q instanceof Element))continue;let Z=z5(),V=Q.matches(Z)?[Q]:Array.from(Q.querySelectorAll(Z));for(let W of V){if(J.has(W))continue;J.add(W),G5(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var q5=1600,H5=2500;function P4(J){return{disabled:J.hasAttribute("disabled")||J.getAttribute("aria-disabled")==="true",busy:J.getAttribute("aria-busy")==="true",text:v0((J.textContent??"").replace(/\s+/g," ").trim(),Y2)}}function D5(J,z){if(!J.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!J.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if(J.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function P5(J,z){if(typeof MutationObserver>"u")return;let $=P4(J),j=!1,Q=(W,U)=>{if(j)return;if(j=!0,Z.disconnect(),window.clearTimeout(V),z.afterNote=W,U)z.afterHtml=S1(G2(J,M4,H5))},Z=new MutationObserver(()=>{if(!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=D5($,P4(J));if(W)Q(W,!0)});Z.observe(J,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let V=window.setTimeout(()=>{if(!j&&!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,Z.disconnect()},q5)}function N4(){if(G4||typeof window>"u")return;G4=!0,document.addEventListener("click",(j)=>{if(L1(j.target))return;let Q=i8(j.target);if(!Q)return;let Z=d8(Q);if(!Z)return;let V=j1("click",`คลิก ${Z}`,e8(Q),r8(Q));if(V)P5(Q,V)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(L1(j.target))return;let Q=a8(j.target);if(Q)j1("input",`แก้ไข ${Q}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(L1(j.target))return;j1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let J=()=>j1("navigate",`ไปที่ ${K2(N0(location.pathname+location.search))}`),z=history.pushState.bind(history),$=history.replaceState.bind(history);history.pushState=(...j)=>{let Q=z(...j);return J(),Q},history.replaceState=(...j)=>{let Q=$(...j);return J(),Q},window.addEventListener("popstate",J),U5()}function _4(){return g0.map((J)=>({...J}))}var I4=2000,R1=[],C4=0,O4=!1;function U2(J,z){C4+=1,R1.push({id:`log_${C4}`,at:new Date().toISOString(),level:J,message:z.length>I4?`${z.slice(0,I4)}…`:z});while(R1.length>B0("maxConsoleEntries"))R1.shift()}function M5(){let J=new WeakSet;return(z,$)=>{if(typeof $==="object"&&$!==null){if(J.has($))return"[Circular]";J.add($)}if(typeof $==="bigint")return $.toString();return $}}function L4(J){if(typeof J==="string")return J;if(J instanceof Error)return`${J.name}: ${J.message}`;try{let z=JSON.stringify(J,M5());if(z!==void 0)return z}catch{}try{return String(J)}catch{}try{return Object.prototype.toString.call(J)}catch{return`[${typeof J}]`}}function S4(){if(O4||typeof window>"u")return;O4=!0;let J=["log","info","warn","error","debug"];for(let z of J){let $=console[z].bind(console);console[z]=(...j)=>{U2(z,j.map(L4).join(" ")),$(...j)}}window.addEventListener("error",(z)=>{let $=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";U2("exception",`${z.message}${$}`)}),window.addEventListener("unhandledrejection",(z)=>{let $=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:L4(z.reason);U2("unhandledrejection",$)})}function R4(){return R1.map((J)=>({...J}))}var T4=new Set,A4=new Set;function k4(J,z){return J.add(z),()=>J.delete(z)}function x4(J,z){for(let $ of[...J])$(z)}function E4(J){return k4(T4,J)}function h0(J={type:"manual"}){x4(T4,J)}function f4(J){return k4(A4,J)}function w4(J){x4(A4,J)}var F5=15000,B5=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],y4=!1,g4=0;function N5(J){return B5.some((z)=>J.includes(z))}function v4(J){let z=J.message??"";if(!z||N5(z))return;let $=Date.now();if($-g4<F5)return;g4=$,w4({...J,message:z})}function h4(){if(y4||typeof window>"u")return;y4=!0,window.addEventListener("error",(J)=>{if(!J.message&&!J.error)return;let z=J.error instanceof Error?J.error:null;v4({type:"runtime-error",message:J.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",(J)=>{let z=J.reason;v4({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var p4=4000,_5=1e6,I5=1e7,T1=[],m4=0,b4=!1;function i4(J){T1.push(J);while(T1.length>B0("maxRequests"))T1.shift()}function d4(){return m4+=1,`req_${m4}`}function u4(J){let z={};if(!J)return z;if(J instanceof Headers)J.forEach(($,j)=>{z[j]=$});else if(Array.isArray(J))for(let[$,j]of J)z[$]=j;else Object.assign(z,J);return z}function C5(J){let z={};return J.forEach(($,j)=>{z[j]=$}),z}function O5(J){if(J==null)return null;if(typeof J==="string")return J;if(J instanceof URLSearchParams)return J.toString();if(typeof FormData<"u"&&J instanceof FormData)return`[FormData: ${Array.from(J.keys()).join(", ")}]`;if(typeof Blob<"u"&&J instanceof Blob)return`[Blob ${J.size} bytes]`;if(J instanceof ArrayBuffer)return`[ArrayBuffer ${J.byteLength} bytes]`;return"[binary]"}function L5(J,z){let $="",j="GET",Q={},Z=null;if(typeof J==="string")$=J;else if(J instanceof URL)$=J.toString();else $=J.url,j=J.method||j,Q=u4(J.headers);if(z){if(z.method)j=z.method;if(z.headers)Q={...Q,...u4(z.headers)};if(z.body!==void 0)Z=O5(z.body)}return{method:j.toUpperCase(),url:$,headers:Q,body:Z}}function c4(J){return!W4(J)}function S5(J,z){if(c4(z.url)){z.responseSnippet="[body not captured for this origin]";return}let $=J.headers.get("content-type")??"",j=Number(J.headers.get("content-length")??"0"),Q=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test($)){z.responseSnippet=`[binary ${$||"unknown"}${Q}]`;return}if(j>_5){z.responseSnippet=`[response ${$||"text"}${Q} — omitted]`;return}try{J.clone().text().then((Z)=>{z.responseSnippet=$1(Z,B0("maxBodyChars"))}).catch(()=>{})}catch{}}function l4(J,z){if(/[?&]_rsc=/.test(J))return!0;for(let $ of Object.keys(z)){let j=$.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function R5(){if(typeof window>"u"||typeof window.fetch!=="function")return;let J=window.fetch.bind(window);window.fetch=Object.assign(async(z,$)=>{let j=L5(z,$);if(l4(j.url,j.headers))return J(z,$);let Q={id:d4(),startedAt:new Date().toISOString(),method:j.method,url:N0(j.url),requestHeaders:z1(j.headers),requestBody:$1(j.body,p4),status:null,statusText:null,durationMs:null,via:"fetch"};i4(Q);let Z=performance.now();try{let V=await J(z,$);return Q.status=V.status,Q.statusText=V.statusText,Q.durationMs=Math.round(performance.now()-Z),Q.responseHeaders=z1(C5(V.headers)),S5(V,Q),V}catch(V){throw Q.durationMs=Math.round(performance.now()-Z),Q.error=V instanceof Error?`${V.name}: ${V.message}`:String(V),V}},J)}function T5(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let J=XMLHttpRequest.prototype,z=J.open,$=J.send,j=function(Z,V){let W=typeof V==="string"?V:V.toString();return this.__lwEntry=l4(W,{})?void 0:{id:d4(),startedAt:"",method:(Z||"GET").toUpperCase(),url:N0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},Q=function(Z){let V=this.__lwEntry;if(V){V.startedAt=new Date().toISOString(),V.requestBody=typeof Z==="string"?$1(Z,p4):Z==null?null:"[non-string body]";let W=performance.now();i4(V),this.addEventListener("loadend",()=>{if(V.status=this.status||null,V.statusText=this.statusText||null,V.durationMs=Math.round(performance.now()-W),c4(V.url))V.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{V.responseSnippet=$1(this.responseText||"",B0("maxBodyChars"))}catch{}else{let U=this.getResponseHeader("content-type")??this.responseType;V.responseSnippet=`[binary ${U}]`}})}return $.apply(this,arguments)};J.open=j,J.send=Q}function o4(){if(b4)return;b4=!0,R5(),T5()}function r4(){let J=T1.map(($)=>({...$})),z=0;for(let $=J.length-1;$>=0;$-=1){let j=J[$],Q=j?.responseSnippet;if(!j||typeof Q!=="string"||Q.length===0)continue;if(z+Q.length>I5)j.responseSnippet=`[response omitted — report size budget reached (${Q.length.toLocaleString()} chars)]`;else z+=Q.length}return J}var A5=4,n4=3,k5=4000,x5="[data-debug-reporter]",s4=()=>import("@rrweb/record");function a4(J){s4=J}var t=[],q2=null,A1=!1;function t4(){if(typeof window>"u"||q2||A1)return;let J=t0();if(!J)return;A1=!0;let z=()=>void E5(J);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function E5(J){let z;try{z=(await s4()).record}catch($){A1=!1,console.warn("[debug-capture] session replay could not start:",$);return}if(q2)return;try{q2=z({emit:($)=>f5($),checkoutEveryNms:Math.max(1000,J.seconds*1000/2),checkoutEveryNth:k5,maskAllInputs:J.maskInputs,maskTextSelector:J.maskText?"*":J.maskTextSelector,blockSelector:`${J.blockSelector}, ${x5}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...J.canvas?{canvas:J.canvas.fps}:{}},recordCanvas:J.canvas!==null,...J.canvas?{dataURLOptions:{type:"image/webp",quality:J.canvas.quality}}:{},errorHandler:()=>!0})??null}catch($){console.warn("[debug-capture] session replay could not start:",$)}finally{A1=!1}}function f5(J){if(J.type===A5||t.length===0){if(t.push([]),t.length>n4)t=t.slice(-n4)}t[t.length-1].push(J)}function e4(J=Date.now()){let z=t0();if(!z||!t.length)return null;let $=J-z.seconds*1000,j=t.length-1;while(j>0&&(t[j][0]?.timestamp??J)>$)j-=1;let Q=t.slice(j).flat(),Z=Q[0]?.timestamp,V=Q[Q.length-1]?.timestamp;if(Z===void 0||V===void 0)return null;return{events:Q,startedAt:new Date(Z).toISOString(),endedAt:new Date(V).toISOString(),durationMs:Math.max(0,V-Z)}}var w5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},y5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function c(J){return J==="en"?y5:w5}var g5="lw-debug-toasts",v5=6000,h5=`
1
+ (()=>{var O8=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(z,$)=>(typeof require<"u"?require:z)[$]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});function _1(J){if(!J)return null;let z=J===!0?{}:J,$=(j,Q)=>typeof j==="number"&&Number.isFinite(j)&&j>=0&&j<2000?j:Q;return{side:z.position==="left"?"left":"right",x:$(z.offset?.x,16),y:$(z.offset?.y,16)}}var L8={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},n=null;function X4(J){let z=[];if(!J.host?.trim())z.push("host");if(!J.realmKey?.trim())z.push("realmKey");if(!J.app?.name?.trim())z.push("app.name");if(typeof J.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");n=J}function M(){if(!n)throw Error("[debug-capture] configureDebugCapture() has not been called");return n}function I1(){return n!==null}function q0(){let J=M().app;return{name:J.name,version:J.version??"0.0.0",environment:J.environment??S8()}}function S8(){if(typeof window>"u")return"unknown";let J=window.location.hostname;if(J==="localhost"||J==="127.0.0.1"||J.endsWith(".local"))return"development";return"production"}function B0(J){let z=n?.capture?.[J];return typeof z==="number"?z:L8[J]}function C1(J){let z=n?.module;if(!z)return null;try{return z(J)??null}catch{return null}}function O1(){let J=n?.redact;return{headers:J?.headers??[],queryKeys:(J?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:(J?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function V4(){return n?.capture?.overlaySelectors??[]}var R8='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',T8="[data-lw-mask]",Z4={fps:1,quality:0.5};function t0(){let J=n?.replay;if(!J)return null;let z=J===!0?{}:J,$=(Z,V)=>typeof Z==="number"&&Z>0?Z:V,j=z.maskInputs!==!1,Q=z.recordCanvas?{fps:$(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,Z4.fps),quality:$(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,Z4.quality)}:null;return{seconds:$(z.seconds,60),maskInputs:j,maskTextSelector:z.maskTextSelector?.trim()||(j?R8:T8),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:$(z.maxBytes,4000000),canvas:Q}}function W4(J){if(typeof window>"u")return!1;let z;try{z=new URL(J,window.location.href)}catch{return!1}if(A8(z))return!1;if(z.origin===window.location.origin)return!0;return(n?.capture?.bodyOrigins??[]).some(($)=>{try{return new URL($).origin===z.origin}catch{return!1}})}function A8(J){if(!n?.host)return!1;try{if(new URL(n.host).origin!==J.origin)return!1}catch{return!1}return J.pathname.startsWith("/ingest/")}function Y4(J){let z=Object.entries(J).map(([$,j])=>[$.replace(/\/+$/,"")||"/",j]).sort(($,j)=>j[0].length-$[0].length);return($)=>{let j=($||"/").replace(/\/+$/,"")||"/";for(let[Q,Z]of z)if(j===Q||j.startsWith(`${Q}/`))return{key:Q,label:Z};return null}}var e0="‹redacted›",k8=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,x8=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),E8=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,f8=/[\w.+-]+@[\w-]+\.[\w.-]+/g,w8=/\d(?:[\d\s-]{7,})\d/g;function J1(J){return J.replace(f8,e0).replace(w8,e0)}function y8(J){if(k8.test(J))return!0;return O1().headers.some(($)=>$.toLowerCase()===J.toLowerCase())}function z1(J){let z={};for(let[$,j]of Object.entries(J))z[$]=y8($)?e0:j;return z}function N0(J){try{let z=/^https?:\/\//i.test(J),$=new URL(J,z?void 0:"http://local.invalid"),j=!1;if($.searchParams.forEach((Q,Z)=>{if(x8.has(Z.toLowerCase())||O1().queryKeys.includes(Z.toLowerCase()))$.searchParams.set(Z,e0),j=!0}),!j)return J;return z?$.toString():`${$.pathname}${$.search}`}catch{return J}}function V2(J,z){if(z>6||J===null||typeof J!=="object")return J;if(Array.isArray(J))return J.map((j)=>V2(j,z+1));let $={};for(let[j,Q]of Object.entries(J)){let Z=E8.test(j)||O1().bodyKeys.some((V)=>j.toLowerCase().includes(V));$[j]=Z?e0:V2(Q,z+1)}return $}function $1(J,z){if(J==null)return null;let $=J,j=J.trim();if(j.startsWith("{")||j.startsWith("["))try{let Q=JSON.parse(j);$=JSON.stringify(V2(Q,0))}catch{}if($.length>z)return`${$.slice(0,z)}… [truncated ${$.length-z} chars]`;return $}var W2=120,Y2=40,v0=(J,z)=>J.length>z?`${J.slice(0,z)}…`:J,K2=(J)=>{try{return decodeURIComponent(J)}catch{return J}},g0=[],K4=0,G4=!1;function j1(J,z,$,j){let Q=v0(z,W2),Z=g0[g0.length-1];if(J==="navigate"&&Z?.kind==="click"){let W=Q.replace(/^ไปที่\s*/,"");if(Z.detail.includes(`→ ${W}`))return Z.at=new Date().toISOString(),Z;let U=W.split(/[?#]/)[0]??W,q=Z.source?K2(Z.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(q&&(U===q||U.startsWith(q)))return Z.detail=v0(`${Z.detail} → ${W}`,W2),Z.source=void 0,Z.at=new Date().toISOString(),Z}if(Z&&Z.kind===J&&Z.detail===Q){if(Z.at=new Date().toISOString(),J!=="navigate")Z.count=(Z.count??1)+1;return Z}K4+=1;let V={id:`act_${K4}`,at:new Date().toISOString(),kind:J,detail:Q,count:1,source:$,html:S1(j)};g0.push(V);while(g0.length>B0("maxActions"))v8(g0.shift());return V}var g8=200000,Q1=0;function S1(J){if(!J)return;if(Q1+J.length>g8)return;return Q1+=J.length,J}function v8(J){if(!J)return;if(Q1-=(J.html?.length??0)+(J.afterHtml?.length??0),Q1<0)Q1=0}function L1(J){return J instanceof Element&&Boolean(J.closest("[data-debug-reporter]"))}var h8='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',m8={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},U4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function b8(J){let z=J.getAttribute("role");if(z&&U4[z])return U4[z];return m8[J.tagName.toLowerCase()]??"ปุ่ม"}function u8(J,z){try{let $=J,j=0;while($&&j<=z){let Q=F4($);if(Q&&typeof Q.memoizedProps?.onClick==="function")return $;$=$.parentElement,j+=1}}catch{}return null}function p8(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("title")?.trim();if($)return $;if(J instanceof HTMLInputElement||J instanceof HTMLTextAreaElement||J instanceof HTMLSelectElement)return(J.getAttribute("placeholder")||J.getAttribute("name")||"").trim();if(J instanceof HTMLImageElement)return(J.getAttribute("alt")||"").trim();let j=(J.textContent??"").replace(/\s+/g," ").trim();if(j)return j;if(J instanceof HTMLAnchorElement){let Q=J.getAttribute("href");if(Q?.startsWith("/"))return K2(Q)}return""}function i8(J){if(!(J instanceof Element))return null;let z=J.closest(h8)??u8(J,4);if(!z)return null;let $=z.tagName.toLowerCase();if($==="html"||$==="body")return null;return z}function d8(J){let z=J1(p8(J));if(!z)return null;return`${b8(J)} “${v0(z,Y2)}”`}var M4=6000,c8=4000,l8=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function o8(J){J.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Q)=>Q.remove());let z=[J,...Array.from(J.querySelectorAll("*"))];for(let Q of z){for(let V of Array.from(Q.attributes)){let W=V.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))Q.removeAttribute(V.name)}if(Q instanceof HTMLAnchorElement)Q.setAttribute("href","#");if(Q instanceof HTMLImageElement)Q.removeAttribute("src");let Z=Q.getAttribute("class");if(Z){let V=Z.replace(l8," ").replace(/\s+/g," ").trim();if(V)Q.setAttribute("class",V);else Q.removeAttribute("class")}}let $=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),j=$.nextNode();while(j){if(j.nodeValue)j.nodeValue=J1(j.nodeValue);j=$.nextNode()}}function G2(J,z,$){try{let j=J.outerHTML;if(!j||j.length>z)return;let Q=J.cloneNode(!0);o8(Q);let Z=Q.outerHTML;return Z&&Z.length<=$?Z:void 0}catch{return}}var r8=(J)=>G2(J,M4,c8),n8=150000,s8=40000,q4=(J)=>G2(J,n8,s8);function a8(J){if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLTextAreaElement)&&!(J instanceof HTMLSelectElement))return null;let z=J.name||J.id||J.getAttribute("aria-label")||J.getAttribute("placeholder")||J.tagName.toLowerCase();return`ช่อง “${J1(z)}”`}var H4=80;function F4(J){let z=Object.keys(J).find(($)=>$.startsWith("__reactFiber$")||$.startsWith("__reactInternalInstance$"));return z?J[z]:null}function t8(J){if(typeof J!=="function")return null;try{let z=Function.prototype.toString.call(J);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function D4(J){if(!J)return;return`→ ${J.length>H4?`${J.slice(0,H4)}…`:J}`}function e8(J){try{let z=J.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return D4(z);let $=F4(J),j=0;while($&&j<30){if(typeof $.memoizedProps?.onClick==="function")return D4(t8($.memoizedProps.onClick));$=$.return,j+=1}return}catch{return}}var J5='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function z5(){let J=V4();return J.length?J.join(", "):J5}function $5(J){let z=J.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function j5(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("aria-labelledby");if($){let Z=$.split(/\s+/).map((V)=>document.getElementById(V)?.textContent?.trim()??"").filter(Boolean).join(" ");if(Z)return Z}let Q=J.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Q)return Q;return(J.textContent??"").replace(/\s+/g," ").trim()}function B4(J){let z=J1(j5(J)),$=$5(J);return z?`เปิด ${$} “${v0(z,Y2)}”`:`เปิด ${$}`}var Q5='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',Z5=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function X5(J){if(J.querySelector(Q5))return!0;return Z5.test(J.textContent??"")}var V5=400,W5=250,Y5=8000;function K5(J,z){if(typeof MutationObserver>"u"){z.html=S1(q4(J));return}let $=Date.now(),j=!1,Q=()=>{j=!0,V.disconnect(),window.clearInterval(W),window.clearTimeout(U)},Z=()=>{if(j)return;if(Q(),!J.isConnected)return;z.detail=v0(B4(J),W2),z.html=S1(q4(J))},V=new MutationObserver(()=>{$=Date.now()});V.observe(J,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(j)return;if(!J.isConnected){Q();return}if(Date.now()-$>=V5&&!X5(J))Z()},W5),U=window.setTimeout(Z,Y5)}function G5(J){if(L1(J))return;let z=j1("ui",B4(J));if(z)K5(J,z)}function U5(){if(typeof MutationObserver>"u")return;let J=new WeakSet;new MutationObserver(($)=>{for(let j of $)for(let Q of Array.from(j.addedNodes)){if(!(Q instanceof Element))continue;let Z=z5(),V=Q.matches(Z)?[Q]:Array.from(Q.querySelectorAll(Z));for(let W of V){if(J.has(W))continue;J.add(W),G5(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var q5=1600,H5=2500;function P4(J){return{disabled:J.hasAttribute("disabled")||J.getAttribute("aria-disabled")==="true",busy:J.getAttribute("aria-busy")==="true",text:v0((J.textContent??"").replace(/\s+/g," ").trim(),Y2)}}function D5(J,z){if(!J.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!J.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if(J.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function P5(J,z){if(typeof MutationObserver>"u")return;let $=P4(J),j=!1,Q=(W,U)=>{if(j)return;if(j=!0,Z.disconnect(),window.clearTimeout(V),z.afterNote=W,U)z.afterHtml=S1(G2(J,M4,H5))},Z=new MutationObserver(()=>{if(!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=D5($,P4(J));if(W)Q(W,!0)});Z.observe(J,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let V=window.setTimeout(()=>{if(!j&&!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,Z.disconnect()},q5)}function N4(){if(G4||typeof window>"u")return;G4=!0,document.addEventListener("click",(j)=>{if(L1(j.target))return;let Q=i8(j.target);if(!Q)return;let Z=d8(Q);if(!Z)return;let V=j1("click",`คลิก ${Z}`,e8(Q),r8(Q));if(V)P5(Q,V)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(L1(j.target))return;let Q=a8(j.target);if(Q)j1("input",`แก้ไข ${Q}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(L1(j.target))return;j1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let J=()=>j1("navigate",`ไปที่ ${K2(N0(location.pathname+location.search))}`),z=history.pushState.bind(history),$=history.replaceState.bind(history);history.pushState=(...j)=>{let Q=z(...j);return J(),Q},history.replaceState=(...j)=>{let Q=$(...j);return J(),Q},window.addEventListener("popstate",J),U5()}function _4(){return g0.map((J)=>({...J}))}var I4=2000,R1=[],C4=0,O4=!1;function U2(J,z){C4+=1,R1.push({id:`log_${C4}`,at:new Date().toISOString(),level:J,message:z.length>I4?`${z.slice(0,I4)}…`:z});while(R1.length>B0("maxConsoleEntries"))R1.shift()}function M5(){let J=new WeakSet;return(z,$)=>{if(typeof $==="object"&&$!==null){if(J.has($))return"[Circular]";J.add($)}if(typeof $==="bigint")return $.toString();return $}}function L4(J){if(typeof J==="string")return J;if(J instanceof Error)return`${J.name}: ${J.message}`;try{let z=JSON.stringify(J,M5());if(z!==void 0)return z}catch{}try{return String(J)}catch{}try{return Object.prototype.toString.call(J)}catch{return`[${typeof J}]`}}function S4(){if(O4||typeof window>"u")return;O4=!0;let J=["log","info","warn","error","debug"];for(let z of J){let $=console[z].bind(console);console[z]=(...j)=>{U2(z,j.map(L4).join(" ")),$(...j)}}window.addEventListener("error",(z)=>{let $=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";U2("exception",`${z.message}${$}`)}),window.addEventListener("unhandledrejection",(z)=>{let $=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:L4(z.reason);U2("unhandledrejection",$)})}function R4(){return R1.map((J)=>({...J}))}var T4=new Set,A4=new Set;function k4(J,z){return J.add(z),()=>J.delete(z)}function x4(J,z){for(let $ of[...J])$(z)}function E4(J){return k4(T4,J)}function h0(J={type:"manual"}){x4(T4,J)}function f4(J){return k4(A4,J)}function w4(J){x4(A4,J)}var F5=15000,B5=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],y4=!1,g4=0;function N5(J){return B5.some((z)=>J.includes(z))}function v4(J){let z=J.message??"";if(!z||N5(z))return;let $=Date.now();if($-g4<F5)return;g4=$,w4({...J,message:z})}function h4(){if(y4||typeof window>"u")return;y4=!0,window.addEventListener("error",(J)=>{if(!J.message&&!J.error)return;let z=J.error instanceof Error?J.error:null;v4({type:"runtime-error",message:J.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",(J)=>{let z=J.reason;v4({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var p4=4000,_5=1e6,I5=1e7,T1=[],m4=0,b4=!1;function i4(J){T1.push(J);while(T1.length>B0("maxRequests"))T1.shift()}function d4(){return m4+=1,`req_${m4}`}function u4(J){let z={};if(!J)return z;if(J instanceof Headers)J.forEach(($,j)=>{z[j]=$});else if(Array.isArray(J))for(let[$,j]of J)z[$]=j;else Object.assign(z,J);return z}function C5(J){let z={};return J.forEach(($,j)=>{z[j]=$}),z}function O5(J){if(J==null)return null;if(typeof J==="string")return J;if(J instanceof URLSearchParams)return J.toString();if(typeof FormData<"u"&&J instanceof FormData)return`[FormData: ${Array.from(J.keys()).join(", ")}]`;if(typeof Blob<"u"&&J instanceof Blob)return`[Blob ${J.size} bytes]`;if(J instanceof ArrayBuffer)return`[ArrayBuffer ${J.byteLength} bytes]`;return"[binary]"}function L5(J,z){let $="",j="GET",Q={},Z=null;if(typeof J==="string")$=J;else if(J instanceof URL)$=J.toString();else $=J.url,j=J.method||j,Q=u4(J.headers);if(z){if(z.method)j=z.method;if(z.headers)Q={...Q,...u4(z.headers)};if(z.body!==void 0)Z=O5(z.body)}return{method:j.toUpperCase(),url:$,headers:Q,body:Z}}function c4(J){return!W4(J)}function S5(J,z){if(c4(z.url)){z.responseSnippet="[body not captured for this origin]";return}let $=J.headers.get("content-type")??"",j=Number(J.headers.get("content-length")??"0"),Q=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test($)){z.responseSnippet=`[binary ${$||"unknown"}${Q}]`;return}if(j>_5){z.responseSnippet=`[response ${$||"text"}${Q} — omitted]`;return}try{J.clone().text().then((Z)=>{z.responseSnippet=$1(Z,B0("maxBodyChars"))}).catch(()=>{})}catch{}}function l4(J,z){if(/[?&]_rsc=/.test(J))return!0;for(let $ of Object.keys(z)){let j=$.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function R5(){if(typeof window>"u"||typeof window.fetch!=="function")return;let J=window.fetch.bind(window);window.fetch=Object.assign(async(z,$)=>{let j=L5(z,$);if(l4(j.url,j.headers))return J(z,$);let Q={id:d4(),startedAt:new Date().toISOString(),method:j.method,url:N0(j.url),requestHeaders:z1(j.headers),requestBody:$1(j.body,p4),status:null,statusText:null,durationMs:null,via:"fetch"};i4(Q);let Z=performance.now();try{let V=await J(z,$);return Q.status=V.status,Q.statusText=V.statusText,Q.durationMs=Math.round(performance.now()-Z),Q.responseHeaders=z1(C5(V.headers)),S5(V,Q),V}catch(V){throw Q.durationMs=Math.round(performance.now()-Z),Q.error=V instanceof Error?`${V.name}: ${V.message}`:String(V),V}},J)}function T5(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let J=XMLHttpRequest.prototype,z=J.open,$=J.send,j=function(Z,V){let W=typeof V==="string"?V:V.toString();return this.__lwEntry=l4(W,{})?void 0:{id:d4(),startedAt:"",method:(Z||"GET").toUpperCase(),url:N0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},Q=function(Z){let V=this.__lwEntry;if(V){V.startedAt=new Date().toISOString(),V.requestBody=typeof Z==="string"?$1(Z,p4):Z==null?null:"[non-string body]";let W=performance.now();i4(V),this.addEventListener("loadend",()=>{if(V.status=this.status||null,V.statusText=this.statusText||null,V.durationMs=Math.round(performance.now()-W),c4(V.url))V.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{V.responseSnippet=$1(this.responseText||"",B0("maxBodyChars"))}catch{}else{let U=this.getResponseHeader("content-type")??this.responseType;V.responseSnippet=`[binary ${U}]`}})}return $.apply(this,arguments)};J.open=j,J.send=Q}function o4(){if(b4)return;b4=!0,R5(),T5()}function r4(){let J=T1.map(($)=>({...$})),z=0;for(let $=J.length-1;$>=0;$-=1){let j=J[$],Q=j?.responseSnippet;if(!j||typeof Q!=="string"||Q.length===0)continue;if(z+Q.length>I5)j.responseSnippet=`[response omitted — report size budget reached (${Q.length.toLocaleString()} chars)]`;else z+=Q.length}return J}var A5=4,n4=3,k5=4000,x5="[data-debug-reporter]",s4=()=>import("@rrweb/record");function a4(J){s4=J}var t=[],q2=null,A1=!1;function t4(){if(typeof window>"u"||q2||A1)return;let J=t0();if(!J)return;A1=!0;let z=()=>void E5(J);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function E5(J){let z;try{z=(await s4()).record}catch($){A1=!1,console.warn("[debug-capture] session replay could not start:",$);return}if(q2)return;try{q2=z({emit:($)=>f5($),checkoutEveryNms:Math.max(1000,J.seconds*1000/2),checkoutEveryNth:k5,maskAllInputs:J.maskInputs,maskTextSelector:J.maskText?"*":J.maskTextSelector,blockSelector:`${J.blockSelector}, ${x5}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...J.canvas?{canvas:J.canvas.fps}:{}},recordCanvas:J.canvas!==null,...J.canvas?{dataURLOptions:{type:"image/webp",quality:J.canvas.quality}}:{},errorHandler:()=>!0})??null}catch($){console.warn("[debug-capture] session replay could not start:",$)}finally{A1=!1}}function f5(J){if(J.type===A5||t.length===0){if(t.push([]),t.length>n4)t=t.slice(-n4)}t[t.length-1].push(J)}function e4(J=Date.now()){let z=t0();if(!z||!t.length)return null;let $=J-z.seconds*1000,j=t.length-1;while(j>0&&(t[j][0]?.timestamp??J)>$)j-=1;let Q=t.slice(j).flat(),Z=Q[0]?.timestamp,V=Q[Q.length-1]?.timestamp;if(Z===void 0||V===void 0)return null;return{events:Q,startedAt:new Date(Z).toISOString(),endedAt:new Date(V).toISOString(),durationMs:Math.max(0,V-Z)}}var w5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringChat:"จากแชทกับทีมงาน",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},y5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringChat:"From your chat with support",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function c(J){return J==="en"?y5:w5}var g5="lw-debug-toasts",v5=6000,h5=`
2
2
  :host { all: initial; }
3
3
  .stack {
4
4
  position: fixed; top: 16px; right: 16px; z-index: 2147483001;
@@ -325,10 +325,10 @@ h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: #1a1
325
325
  @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
326
326
  @keyframes spin { to { transform: rotate(360deg); } }
327
327
  @media (prefers-reduced-motion: reduce) { .card { animation: none; } .icon::after { animation: none; opacity: 0; } .spin { animation: none; } }
328
- `,u1=(J)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${J}</svg>`,w6=u1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),y3=u1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),g3=u1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),v3=u1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),v=null,D0=null,p0=null;function h3(J,z){return J.replace("{key}",z.ticketKey).replace("{title}",z.ticketTitle)}var i0=()=>c(M().locale);function m3(){if(typeof document>"u")return null;if(v?.isConnected)return v.shadowRoot;v=document.createElement(f3),v.dataset.debugReporter="true",m1(v);let J=v.attachShadow({mode:"open"});return u0(J),document.body.append(v),J}function b1(J,z,$,j){let Q=document.createElement("button");return Q.type="button",Q.className=J,Q.innerHTML=z,Q.dataset.lwRing=$,Q.onclick=j,Q}var Y1=(J)=>{let z=document.createElement("span");return z.textContent=J,z.outerHTML};function g6(J,z,$,j,Q){let Z=i0();J.innerHTML="";let V=document.createElement("style");V.textContent=w3;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",Z.ringTitle),W.dataset.lwCallRing=z.id,W.dataset.lwRingMode=j;let U=document.createElement("div");U.className="head";let q=document.createElement("span");q.className="icon",q.innerHTML=w6;let C=document.createElement("div");C.className="words";let F=document.createElement("h2");F.textContent=Z.ringTitle;let _=document.createElement("p");_.className="about",_.textContent=h3(Z.ringAbout,z),_.title=_.textContent,C.append(F,_),U.append(q,C);let x=document.createElement("p");x.className="how",x.textContent=Q??(j==="frame"?Z.ringHint:Z.ringHow);let A=document.createElement("div");A.className="actions";let h=b1("decline",y3+Y1(Z.ringDecline),"decline",()=>$.decline());if(W.append(U,x),j==="frame"&&$.answer){if($.voice)W.append(b1("test",g3+Y1(Z.ringTest),"test",()=>$.voice?.()));let r=b1("answer",w6+Y1(Z.ringAnswer),"answer",()=>$.answer?.());A.append(h,r)}else A.append(h,b1("open",Y1(Z.ringOpen),"open",()=>$.open()));W.append(A),J.append(V,W)}function p1(J,z,$="portal"){if(D0===J.id&&v?.isConnected)return;let j=m3();if(!j)return;if(D0=J.id,g6(j,J,z,$),b3(),p0===null)p0=document.title,document.title=`${i0().ringTab} — ${p0}`}function v6(J){let z=v?.shadowRoot;if(!z||D0!==J)return;let $=z.querySelector(".answer");if($)$.innerHTML=v3+Y1(i0().ringAnswering),$.disabled=!0;let j=z.querySelector(".decline");if(j)j.disabled=!0}function h6(J,z){let $=v?.isConnected?v.shadowRoot:null;if(!$||D0!==J.id)return p1(J,z,"portal");v.style.display="",g6($,J,z,"portal",i0().ringFallback)}function i1(J){let z=v?.shadowRoot;if(!z)return;T2(),u6();let $=i0(),j=z.querySelector(".how"),Q=z.querySelector(".actions");if(j)if(j.textContent="",J){let Z=document.createElement("a");Z.href=J,Z.target="_blank",Z.rel="noopener",Z.textContent=$.ringBlocked,Z.dataset.lwRing="link",Z.onclick=()=>window.setTimeout(()=>i1(),0),j.append(Z)}else j.textContent=$.ringOpened;if(Q){Q.innerHTML="";let Z=document.createElement("button");Z.type="button",Z.className="close",Z.textContent=$.ringClose,Z.dataset.lwRing="close",Z.onclick=()=>d0(),Q.append(Z)}}function m6(J,z=!0){if(!v?.isConnected||D0!==J)return;let $=v;if(clearTimeout(y6),!z){$.style.display="",$.style.opacity="";return}$.style.transition="opacity 150ms ease-out",$.style.opacity="0",y6=setTimeout(()=>{if($.style.opacity==="0")$.style.display="none"},160)}var y6;function d0(J){if(J&&D0&&J!==D0)return;T2(),u6(),v?.remove(),v=null,D0=null}function b6(){return v?.isConnected?D0:null}function u6(){if(p0===null||typeof document>"u")return;if(document.title.startsWith(i0().ringTab))document.title=p0;p0=null}var I0=null,R2;function b3(){T2();let J=window,z=J.AudioContext??J.webkitAudioContext;if(!z)return;try{let j=I0??new z;I0=j,j.resume?.().catch(()=>{return})}catch{return}let $=()=>{if(!I0||I0.state!=="running")return;let j=I0.currentTime;for(let[Q,Z]of[660,880].entries()){let V=I0.createOscillator(),W=I0.createGain();V.frequency.value=Z,W.gain.setValueAtTime(0.0001,j+Q*0.22),W.gain.exponentialRampToValueAtTime(0.08,j+Q*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,j+Q*0.22+0.2),V.connect(W).connect(I0.destination),V.start(j+Q*0.22),V.stop(j+Q*0.22+0.21)}};$(),R2=setInterval($,2200)}function T2(){clearInterval(R2),R2=void 0}var u3=/^[A-Za-z0-9_-]{1,32}$/,p3=/^#[0-9a-fA-F]{6}$/,i3=["pen","rect","laser"],p6=(J)=>J<0?0:J>1?1:J;function i6(J,z){if(!Array.isArray(J)||J.length<z||J.length>64)return null;let $=[];for(let j of J){if(!Array.isArray(j)||j.length!==2)return null;let[Q,Z]=j;if(typeof Q!=="number"||typeof Z!=="number"||!Number.isFinite(Q)||!Number.isFinite(Z))return null;$.push([p6(Q),p6(Z)])}return $}function d1(J){if(!J||typeof J!=="object")return null;let z=J;if(z.op==="clear")return{op:"clear"};if(typeof z.id!=="string"||!u3.test(z.id))return null;if(z.op==="end")return{op:"end",id:z.id};if(z.op==="add"){let $=i6(z.pts,1);return $?{op:"add",id:z.id,pts:$}:null}if(z.op==="begin"){if(!i3.includes(z.kind)||typeof z.color!=="string"||!p3.test(z.color))return null;let $=i6(z.pts,1);return $?{op:"begin",id:z.id,kind:z.kind,color:z.color,pts:$}:null}return null}function A2(J,z){if(J.endedAt!==null)return J.endedAt;return z-J.lastAt>20000?J.lastAt:null}function d6(J,z,$){if(z===null)return 1;let j=$-z;if(J==="laser")return j>=900?0:1-j/900;if(j<=3500)return 1;return Math.max(0,1-(j-3500)/700)}class k2{marks=new Map;apply(J,z=Date.now()){if(J.op==="clear"){this.marks.clear();return}if(J.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete(J.id),this.marks.set(J.id,{kind:J.kind,color:J.color,pts:J.pts.map(([j,Q])=>({x:j,y:Q,t:z})),endedAt:null,lastAt:z});return}let $=this.marks.get(J.id);if(!$||A2($,z)!==null)return;if(J.op==="end"){$.endedAt=z;return}if($.lastAt=z,$.kind==="rect"){let[j,Q]=J.pts[J.pts.length-1];$.pts=[$.pts[0],{x:j,y:Q,t:z}];return}for(let[j,Q]of J.pts)$.pts.push({x:j,y:Q,t:z});if($.pts.length>4000)$.pts.splice(0,$.pts.length-4000)}alive(J=Date.now()){for(let[z,$]of this.marks)if(d6($.kind,A2($,J),J)<=0)this.marks.delete(z);return this.marks.size>0}get size(){return this.marks.size}draw(J,z,$,j=Date.now()){J.clearRect(0,0,z,$);let Q=Math.max(1,Math.min(z,$));for(let Z of this.marks.values()){let V=d6(Z.kind,A2(Z,j),j);if(V<=0||!Z.pts.length)continue;if(J.save(),J.lineCap="round",J.lineJoin="round",Z.kind==="pen")c3(J,Z,z,$,Math.max(3,Q*0.0045),V);else if(Z.kind==="rect")l3(J,Z,z,$,Math.max(2.5,Q*0.003),V);else o3(J,Z,z,$,Math.max(6,Q*0.008),V,j);J.restore()}}}function d3(J,z,$,j){if(J.beginPath(),J.moveTo(z[0].x*$,z[0].y*j),z.length===1){J.lineTo(z[0].x*$+0.01,z[0].y*j);return}for(let Z=1;Z<z.length-1;Z++){let V=z[Z],W=z[Z+1];J.quadraticCurveTo(V.x*$,V.y*j,(V.x+W.x)/2*$,(V.y+W.y)/2*j)}let Q=z[z.length-1];J.lineTo(Q.x*$,Q.y*j)}function c3(J,z,$,j,Q,Z){J.globalAlpha=Z,d3(J,z.pts,$,j),J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.stroke(),J.strokeStyle=z.color,J.lineWidth=Q,J.stroke()}function l3(J,z,$,j,Q,Z){let V=z.pts[0],W=z.pts[z.pts.length-1],U=Math.min(V.x,W.x)*$,q=Math.min(V.y,W.y)*j,C=Math.abs(W.x-V.x)*$,F=Math.abs(W.y-V.y)*j;J.globalAlpha=Z,J.fillStyle=z.color,J.globalAlpha=Z*0.14,J.fillRect(U,q,C,F),J.globalAlpha=Z,J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.strokeRect(U,q,C,F),J.strokeStyle=z.color,J.lineWidth=Q,J.strokeRect(U,q,C,F)}function o3(J,z,$,j,Q,Z,V){let W=z.pts.filter((q)=>V-q.t<=450);for(let q=1;q<W.length;q++){let C=W[q-1],F=W[q];J.globalAlpha=Z*Math.max(0,1-(V-F.t)/450)*0.7,J.strokeStyle=z.color,J.lineWidth=Q*0.9,J.beginPath(),J.moveTo(C.x*$,C.y*j),J.lineTo(F.x*$,F.y*j),J.stroke()}let U=z.pts[z.pts.length-1];J.globalAlpha=Z,J.shadowColor=z.color,J.shadowBlur=Q*2,J.fillStyle=z.color,J.beginPath(),J.arc(U.x*$,U.y*j,Q,0,Math.PI*2),J.fill(),J.shadowBlur=0,J.strokeStyle="rgba(255,255,255,0.95)",J.lineWidth=2,J.stroke()}function r3(J,z,$,j=typeof window>"u"?1:window.devicePixelRatio||1){let Q=Math.max(1,Math.round(z*j)),Z=Math.max(1,Math.round($*j));if(J.width!==Q)J.width=Q;if(J.height!==Z)J.height=Z;let V=J.getContext("2d");return V?.setTransform(j,0,0,j,0,0),V}class x2{canvas;scene;box;frame=0;constructor(J,z,$){this.canvas=J;this.scene=z;this.box=$}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let J=()=>{this.frame=0;let{w:z,h:$}=this.box(),j=r3(this.canvas,z,$),Q=Date.now(),Z=this.scene.alive(Q);if(j)this.scene.draw(j,z,$,Q);if(Z)this.frame=requestAnimationFrame(J)};this.frame=requestAnimationFrame(J)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var n3="lw-call-ink",C0=null,c1=null,K1=null;function s3(){if(C0?.isConnected&&K1)return;C0=document.createElement(n3),C0.dataset.debugReporter="true";let J=C0.attachShadow({mode:"open"}),z=document.createElement("style");z.textContent=`:host { all: initial; }
328
+ `,u1=(J)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${J}</svg>`,w6=u1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),y3=u1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),g3=u1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),v3=u1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),v=null,D0=null,p0=null;function h3(J,z,$){if(z.chatId)return $??z.ticketTitle;return J.replace("{key}",z.ticketKey).replace("{title}",z.ticketTitle)}var i0=()=>c(M().locale);function m3(){if(typeof document>"u")return null;if(v?.isConnected)return v.shadowRoot;v=document.createElement(f3),v.dataset.debugReporter="true",m1(v);let J=v.attachShadow({mode:"open"});return u0(J),document.body.append(v),J}function b1(J,z,$,j){let Q=document.createElement("button");return Q.type="button",Q.className=J,Q.innerHTML=z,Q.dataset.lwRing=$,Q.onclick=j,Q}var Y1=(J)=>{let z=document.createElement("span");return z.textContent=J,z.outerHTML};function g6(J,z,$,j,Q){let Z=i0();J.innerHTML="";let V=document.createElement("style");V.textContent=w3;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",Z.ringTitle),W.dataset.lwCallRing=z.id,W.dataset.lwRingMode=j;let U=document.createElement("div");U.className="head";let q=document.createElement("span");q.className="icon",q.innerHTML=w6;let C=document.createElement("div");C.className="words";let F=document.createElement("h2");F.textContent=Z.ringTitle;let _=document.createElement("p");_.className="about",_.textContent=h3(Z.ringAbout,z,Z.ringChat),_.title=_.textContent,C.append(F,_),U.append(q,C);let x=document.createElement("p");x.className="how",x.textContent=Q??(j==="frame"?Z.ringHint:Z.ringHow);let A=document.createElement("div");A.className="actions";let h=b1("decline",y3+Y1(Z.ringDecline),"decline",()=>$.decline());if(W.append(U,x),j==="frame"&&$.answer){if($.voice)W.append(b1("test",g3+Y1(Z.ringTest),"test",()=>$.voice?.()));let r=b1("answer",w6+Y1(Z.ringAnswer),"answer",()=>$.answer?.());A.append(h,r)}else A.append(h,b1("open",Y1(Z.ringOpen),"open",()=>$.open()));W.append(A),J.append(V,W)}function p1(J,z,$="portal"){if(D0===J.id&&v?.isConnected)return;let j=m3();if(!j)return;if(D0=J.id,g6(j,J,z,$),b3(),p0===null)p0=document.title,document.title=`${i0().ringTab} — ${p0}`}function v6(J){let z=v?.shadowRoot;if(!z||D0!==J)return;let $=z.querySelector(".answer");if($)$.innerHTML=v3+Y1(i0().ringAnswering),$.disabled=!0;let j=z.querySelector(".decline");if(j)j.disabled=!0}function h6(J,z){let $=v?.isConnected?v.shadowRoot:null;if(!$||D0!==J.id)return p1(J,z,"portal");v.style.display="",g6($,J,z,"portal",i0().ringFallback)}function i1(J){let z=v?.shadowRoot;if(!z)return;T2(),u6();let $=i0(),j=z.querySelector(".how"),Q=z.querySelector(".actions");if(j)if(j.textContent="",J){let Z=document.createElement("a");Z.href=J,Z.target="_blank",Z.rel="noopener",Z.textContent=$.ringBlocked,Z.dataset.lwRing="link",Z.onclick=()=>window.setTimeout(()=>i1(),0),j.append(Z)}else j.textContent=$.ringOpened;if(Q){Q.innerHTML="";let Z=document.createElement("button");Z.type="button",Z.className="close",Z.textContent=$.ringClose,Z.dataset.lwRing="close",Z.onclick=()=>d0(),Q.append(Z)}}function m6(J,z=!0){if(!v?.isConnected||D0!==J)return;let $=v;if(clearTimeout(y6),!z){$.style.display="",$.style.opacity="";return}$.style.transition="opacity 150ms ease-out",$.style.opacity="0",y6=setTimeout(()=>{if($.style.opacity==="0")$.style.display="none"},160)}var y6;function d0(J){if(J&&D0&&J!==D0)return;T2(),u6(),v?.remove(),v=null,D0=null}function b6(){return v?.isConnected?D0:null}function u6(){if(p0===null||typeof document>"u")return;if(document.title.startsWith(i0().ringTab))document.title=p0;p0=null}var I0=null,R2;function b3(){T2();let J=window,z=J.AudioContext??J.webkitAudioContext;if(!z)return;try{let j=I0??new z;I0=j,j.resume?.().catch(()=>{return})}catch{return}let $=()=>{if(!I0||I0.state!=="running")return;let j=I0.currentTime;for(let[Q,Z]of[660,880].entries()){let V=I0.createOscillator(),W=I0.createGain();V.frequency.value=Z,W.gain.setValueAtTime(0.0001,j+Q*0.22),W.gain.exponentialRampToValueAtTime(0.08,j+Q*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,j+Q*0.22+0.2),V.connect(W).connect(I0.destination),V.start(j+Q*0.22),V.stop(j+Q*0.22+0.21)}};$(),R2=setInterval($,2200)}function T2(){clearInterval(R2),R2=void 0}var u3=/^[A-Za-z0-9_-]{1,32}$/,p3=/^#[0-9a-fA-F]{6}$/,i3=["pen","rect","laser"],p6=(J)=>J<0?0:J>1?1:J;function i6(J,z){if(!Array.isArray(J)||J.length<z||J.length>64)return null;let $=[];for(let j of J){if(!Array.isArray(j)||j.length!==2)return null;let[Q,Z]=j;if(typeof Q!=="number"||typeof Z!=="number"||!Number.isFinite(Q)||!Number.isFinite(Z))return null;$.push([p6(Q),p6(Z)])}return $}function d1(J){if(!J||typeof J!=="object")return null;let z=J;if(z.op==="clear")return{op:"clear"};if(typeof z.id!=="string"||!u3.test(z.id))return null;if(z.op==="end")return{op:"end",id:z.id};if(z.op==="add"){let $=i6(z.pts,1);return $?{op:"add",id:z.id,pts:$}:null}if(z.op==="begin"){if(!i3.includes(z.kind)||typeof z.color!=="string"||!p3.test(z.color))return null;let $=i6(z.pts,1);return $?{op:"begin",id:z.id,kind:z.kind,color:z.color,pts:$}:null}return null}function A2(J,z){if(J.endedAt!==null)return J.endedAt;return z-J.lastAt>20000?J.lastAt:null}function d6(J,z,$){if(z===null)return 1;let j=$-z;if(J==="laser")return j>=900?0:1-j/900;if(j<=3500)return 1;return Math.max(0,1-(j-3500)/700)}class k2{marks=new Map;apply(J,z=Date.now()){if(J.op==="clear"){this.marks.clear();return}if(J.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete(J.id),this.marks.set(J.id,{kind:J.kind,color:J.color,pts:J.pts.map(([j,Q])=>({x:j,y:Q,t:z})),endedAt:null,lastAt:z});return}let $=this.marks.get(J.id);if(!$||A2($,z)!==null)return;if(J.op==="end"){$.endedAt=z;return}if($.lastAt=z,$.kind==="rect"){let[j,Q]=J.pts[J.pts.length-1];$.pts=[$.pts[0],{x:j,y:Q,t:z}];return}for(let[j,Q]of J.pts)$.pts.push({x:j,y:Q,t:z});if($.pts.length>4000)$.pts.splice(0,$.pts.length-4000)}alive(J=Date.now()){for(let[z,$]of this.marks)if(d6($.kind,A2($,J),J)<=0)this.marks.delete(z);return this.marks.size>0}get size(){return this.marks.size}draw(J,z,$,j=Date.now()){J.clearRect(0,0,z,$);let Q=Math.max(1,Math.min(z,$));for(let Z of this.marks.values()){let V=d6(Z.kind,A2(Z,j),j);if(V<=0||!Z.pts.length)continue;if(J.save(),J.lineCap="round",J.lineJoin="round",Z.kind==="pen")c3(J,Z,z,$,Math.max(3,Q*0.0045),V);else if(Z.kind==="rect")l3(J,Z,z,$,Math.max(2.5,Q*0.003),V);else o3(J,Z,z,$,Math.max(6,Q*0.008),V,j);J.restore()}}}function d3(J,z,$,j){if(J.beginPath(),J.moveTo(z[0].x*$,z[0].y*j),z.length===1){J.lineTo(z[0].x*$+0.01,z[0].y*j);return}for(let Z=1;Z<z.length-1;Z++){let V=z[Z],W=z[Z+1];J.quadraticCurveTo(V.x*$,V.y*j,(V.x+W.x)/2*$,(V.y+W.y)/2*j)}let Q=z[z.length-1];J.lineTo(Q.x*$,Q.y*j)}function c3(J,z,$,j,Q,Z){J.globalAlpha=Z,d3(J,z.pts,$,j),J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.stroke(),J.strokeStyle=z.color,J.lineWidth=Q,J.stroke()}function l3(J,z,$,j,Q,Z){let V=z.pts[0],W=z.pts[z.pts.length-1],U=Math.min(V.x,W.x)*$,q=Math.min(V.y,W.y)*j,C=Math.abs(W.x-V.x)*$,F=Math.abs(W.y-V.y)*j;J.globalAlpha=Z,J.fillStyle=z.color,J.globalAlpha=Z*0.14,J.fillRect(U,q,C,F),J.globalAlpha=Z,J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.strokeRect(U,q,C,F),J.strokeStyle=z.color,J.lineWidth=Q,J.strokeRect(U,q,C,F)}function o3(J,z,$,j,Q,Z,V){let W=z.pts.filter((q)=>V-q.t<=450);for(let q=1;q<W.length;q++){let C=W[q-1],F=W[q];J.globalAlpha=Z*Math.max(0,1-(V-F.t)/450)*0.7,J.strokeStyle=z.color,J.lineWidth=Q*0.9,J.beginPath(),J.moveTo(C.x*$,C.y*j),J.lineTo(F.x*$,F.y*j),J.stroke()}let U=z.pts[z.pts.length-1];J.globalAlpha=Z,J.shadowColor=z.color,J.shadowBlur=Q*2,J.fillStyle=z.color,J.beginPath(),J.arc(U.x*$,U.y*j,Q,0,Math.PI*2),J.fill(),J.shadowBlur=0,J.strokeStyle="rgba(255,255,255,0.95)",J.lineWidth=2,J.stroke()}function r3(J,z,$,j=typeof window>"u"?1:window.devicePixelRatio||1){let Q=Math.max(1,Math.round(z*j)),Z=Math.max(1,Math.round($*j));if(J.width!==Q)J.width=Q;if(J.height!==Z)J.height=Z;let V=J.getContext("2d");return V?.setTransform(j,0,0,j,0,0),V}class x2{canvas;scene;box;frame=0;constructor(J,z,$){this.canvas=J;this.scene=z;this.box=$}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let J=()=>{this.frame=0;let{w:z,h:$}=this.box(),j=r3(this.canvas,z,$),Q=Date.now(),Z=this.scene.alive(Q);if(j)this.scene.draw(j,z,$,Q);if(Z)this.frame=requestAnimationFrame(J)};this.frame=requestAnimationFrame(J)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var n3="lw-call-ink",C0=null,c1=null,K1=null;function s3(){if(C0?.isConnected&&K1)return;C0=document.createElement(n3),C0.dataset.debugReporter="true";let J=C0.attachShadow({mode:"open"}),z=document.createElement("style");z.textContent=`:host { all: initial; }
329
329
  canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483002; }`;let $=document.createElement("canvas");$.setAttribute("aria-hidden","true"),$.dataset.lwCallInk="",J.append(z,$),document.body.append(C0),c1=new k2,K1=new x2($,c1,()=>({w:window.innerWidth,h:window.innerHeight}))}function l1(J){if(typeof document>"u")return;if(J.op==="clear"&&!C0)return;s3(),c1.apply(J),K1.kick()}function o1(){K1?.stop(),C0?.remove(),C0=null,c1=null,K1=null}var a3="lw-call-frame",t3="lw-call",s=16,g2=368,W0=null,w=null,A0=null,s1="",U1=null,q1="card",v2={width:g2,height:0},h2,H1=!1,m2=null,l0={answer:!1,voice:!1},O0=null,l=null,E2="lw-call-frame-place";function c6(J,z,$,j){let Q=new URL("embed/call",J.endsWith("/")?J:`${J}/`);if(Q.searchParams.set("realm",z),$)Q.searchParams.set("token",$);else Q.searchParams.set("hand","1");return Q.searchParams.set("call",j),Q.toString()}function c0(J){w?.contentWindow?.postMessage({source:"lw-call-host",...J},s1)}function l6(J){if(A0!==J)return;if(l0.answer=!0,H1)c0({type:"answer"})}function o6(J){if(A0!==J)return;if(l0.voice=!0,H1)c0({type:"voice"})}function r6(J,z,$){return{x:Math.min(Math.max(J.x,s/2),Math.max(s/2,$.w-z.w-s/2)),y:Math.min(Math.max(J.y,s/2),Math.max(s/2,$.h-z.h-s/2))}}function e3(J,z){if(J.origin!==z.origin||J.source!==z.window)return null;let $=J.data;return $&&typeof $==="object"&&$.source===t3&&typeof $.type==="string"?$:null}function r0(){return W0?.isConnected?A0:null}function n6(J,z,$,j=15000,Q=null){if(typeof document>"u")return;if(A0===z&&W0?.isConnected)return;D1(),A0=z,U1=$,H1=!1,m2=Q,l0={answer:!1,voice:!1},q1="card",v2={width:g2,height:0},s1=new URL(J).origin;try{O0=JSON.parse(sessionStorage.getItem(E2)??"null")}catch{O0=null}W0=document.createElement(a3),W0.dataset.debugReporter="true";let Z=W0.attachShadow({mode:"open"}),V=document.createElement("style");V.textContent=`:host { all: initial; }
330
330
  iframe { position: fixed; z-index: 2147483003; border: 0; background: transparent; color-scheme: normal; visibility: hidden; }
331
- iframe.on { visibility: visible; }`,w=document.createElement("iframe"),w.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",w.title="สายจากทีมงาน",w.dataset.lwCallFrame=z,w.setAttribute("allowtransparency","true"),w.src=J,Z.append(V,w),document.body.append(W0),o0(),window.addEventListener("message",s6),window.addEventListener("resize",o0),b2(`lw-call:${z}`),h2=setTimeout(()=>{if(!H1)f2("timeout")},j)}function D1(){if(W0)b2(w2?.handle??null,w2?.readableBy);o1(),clearTimeout(h2),window.removeEventListener("message",s6),window.removeEventListener("resize",o0),r1(!1),W0?.remove(),W0=null,w=null,A0=null,U1=null,l=null,m2=null,l0={answer:!1,voice:!1}}function f2(J){let z=U1;D1(),z?.failed(J)}function s6(J){if(!w)return;let z=e3(J,{origin:s1,window:w.contentWindow});if(!z)return;switch(z.type){case"hello":m2?.then(($)=>{if(!w||A0===null)return;if($)c0({type:"token",token:$});else f2("no_token")});return;case"ready":if(H1=!0,clearTimeout(h2),w.classList.add("on"),U1?.ready(),l0.answer)c0({type:"answer"});if(l0.voice)c0({type:"voice"});return;case"size":if(typeof z.width==="number"&&typeof z.height==="number")v2={width:z.width,height:z.height};if(z.layout==="card"||z.layout==="full"){if(z.layout==="full"&&q1==="card")J9();q1=z.layout}return o0();case"drag":return y2(z);case"home":return O0=null,t6(),o0();case"done":{let $=U1;D1(),$?.done();return}case"failed":return f2(z.reason??"failed");case"ink":{let $=d1(z.op);if($)l1($);return}}}function b2(J,z=s1){let $=typeof navigator>"u"?void 0:navigator.mediaDevices;try{$?.setCaptureHandleConfig?.(J&&z?{handle:J,exposeOrigin:!1,permittedOrigins:[z]}:{})}catch{}}var w2=null;function a6(J,z){if(w2={handle:J,readableBy:z},!W0?.isConnected)b2(J,z)}function y2(J){if(!w||q1!=="card"||typeof J.x!=="number"||typeof J.y!=="number")return;if(J.phase==="start"){let z=w.getBoundingClientRect();l={sx:J.x,sy:J.y,x:z.left,y:z.top,lx:J.x,ly:J.y},r1(!0);return}if(!l)return;if(l.lx=J.x,l.ly=J.y,O0=r6({x:l.x+(J.x-l.sx),y:l.y+(J.y-l.sy)},e6(),n1()),o0(),J.phase==="end")l=null,r1(!1),t6()}var G1=null;function r1(J){if(G1){for(let z of["pointermove","pointerup","pointercancel"])window.removeEventListener(z,G1,!0);G1=null}if(!J)return;G1=(z)=>{if(!l)return r1(!1);if(z.type==="pointermove"&&z.buttons!==0)return y2({type:"drag",phase:"move",x:z.screenX,y:z.screenY});let $=z.type==="pointerup";y2({type:"drag",phase:"end",x:$?z.screenX:l.lx,y:$?z.screenY:l.ly})};for(let z of["pointermove","pointerup","pointercancel"])window.addEventListener(z,G1,!0)}function J9(){if(!w?.contentWindow)return;let J=w.getBoundingClientRect();c0({type:"corner",x:Math.round(J.left),y:Math.round(J.top),width:Math.round(J.width)})}function t6(){try{if(O0)sessionStorage.setItem(E2,JSON.stringify(O0));else sessionStorage.removeItem(E2)}catch{}}var n1=()=>({w:window.innerWidth,h:window.innerHeight});function e6(){let J=n1();return{w:Math.min(g2,J.w-s),h:Math.min(v2.height||0,J.h-s)}}function o0(){if(!w)return;let J=w.style;if(q1==="full"){Object.assign(J,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let z=e6(),$=n1().w<480;if(J.width=$?`calc(100vw - ${s}px)`:`${z.w}px`,J.height=`${z.h}px`,O0&&!$){let j=r6(O0,z,n1());Object.assign(J,{left:`${j.x}px`,top:`${j.y}px`,right:"",bottom:""})}else Object.assign(J,{left:$?`${s/2}px`:"",top:"",right:$?"":`${s/2}px`,bottom:`calc(${s/2}px + var(--lw-chat-lift, 0px))`})}var a1=[2000,5000,15000,30000,60000],J8=new Set(["ringing","active"]),z9=20000,z8=!1,n0=!1,$8=0,$9=5,u2=null,K8=0,p2,j8,Q8,G8=(J)=>J.endsWith("/")?J:`${J}/`;function j9(J,z){let $=new URL("api/presence/ws",G8(J));return $.protocol=$.protocol==="https:"?"wss:":"ws:",$.searchParams.set("t",z),$.toString()}function Q9(J){return`/me/tickets/${J.ticketId}?call=${J.id}`}function Z9(J){return J.status==="ringing"&&(J.side==="reporter"||J.side===void 0||J.side===null)}var i2=new Set;function U8(J){return i2.add(J),()=>i2.delete(J)}var Z8=()=>M().ring!==!1;async function k0(){let J=M().identity;if(!J)return null;try{return await J()??null}catch{return null}}async function o2(J,z){let $=M();return fetch(new URL(J,G8($.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":$.realmKey,authorization:`Bearer ${z}`},body:"{}"})}function r2(){if(z8||typeof window>"u"||typeof WebSocket>"u")return;let J=M();if(!J.identity||J.ring===!1&&!J.chat)return;z8=!0,n0=!1,V9(J.host);try{a6(`lw-tab:${H8()}`,new URL(J.host).origin)}catch{}q8()}function P1(J=!1){if(n0)return;let z=J?a1[a1.length-1]:a1[Math.min(K8++,a1.length-1)];clearTimeout(j8),j8=setTimeout(()=>void q8(),z)}async function q8(){if(n0)return;let J=await k0();if(!J){if(++$8>=$9){n0=!0;return}return P1(!0)}$8=0;let z;try{z=await o2(M().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",J)}catch{return P1()}if(z.status===401||z.status===404||z.status===403){n0=!0;return}if(!z.ok)return P1(z.status===429);let $;try{$=await z.json()}catch{return P1()}if(!$.ticket){n0=!0;return}if($.calls&&$.call&&Z8())Y8($.call);let j=new WebSocket(j9(M().host,$.ticket));u2=j,j.onopen=()=>{K8=0,j.send(JSON.stringify({type:"tab",id:H8()})),clearInterval(p2),p2=setInterval(()=>{if(j.readyState===WebSocket.OPEN)j.send(JSON.stringify({type:"ping"}))},z9)},j.onmessage=(Q)=>{try{let Z=JSON.parse(String(Q.data));if(Z.type==="chat-changed"||Z.type==="ticket-changed"||Z.type==="chat-seen"){for(let V of i2)V(Z);return}if(Z.type==="call-state"&&Z.call&&typeof Z.call==="object"){if(Z8())Y8(Z.call)}else if(Z.type==="call-ink"&&typeof Z.call==="string"){let V=d1(Z.op);if(V)l2=Z.call,l1(V)}}catch{}},j.onclose=()=>{if(clearInterval(p2),u2===j)u2=null;P1()}}var d2="lw-call-framed";function X9(){try{return sessionStorage.getItem(d2)}catch{return null}}function t1(J){try{if(J)sessionStorage.setItem(d2,J);else sessionStorage.removeItem(d2)}catch{}}var X8=!1;function V9(J){if(X8||typeof document>"u")return;X8=!0;try{let z=new URL(J).origin;for(let $ of["dns-prefetch","preconnect"]){let j=document.createElement("link");if(j.rel=$,j.href=z,$==="preconnect")j.crossOrigin="anonymous";j.dataset.debugReporter="true",document.head.append(j)}}catch{}}function V8(J){let z=M();if(z.callFrame===!1||r0()===J.id)return;t1(J.id),n6(c6(z.host,z.realmKey,null,J.id),J.id,{ready:()=>m6(J.id),done:()=>{t1(null),d0(J.id)},failed:()=>{t1(null),h6(J,c2(J))}},15000,k0())}var c2=(J)=>({open:()=>W9(J),decline:()=>void Y9(J)}),L0=null;function H8(){if(L0)return L0;try{L0=sessionStorage.getItem(W8)}catch{}if(!L0||!/^[A-Za-z0-9_-]{8,40}$/.test(L0)){let J=new Uint8Array(12);crypto.getRandomValues(J),L0=Array.from(J,(z)=>z.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(W8,L0)}catch{}}return L0}var W8="lw-tab-id",l2=null;function Y8(J){if(!J8.has(J.status)&&l2===J.id&&r0()!==J.id)l2=null,o1();if(!Z9(J)){if(d0(J.id),J.status==="active"&&X9()===J.id&&!r0())V8(J);if(!J8.has(J.status)&&r0()===J.id)setTimeout(()=>{if(r0()===J.id)D1(),t1(null)},12000);return}if(M().callFrame===!1)p1(J,c2(J),"portal");else p1(J,{...c2(J),answer:()=>{v6(J.id),l6(J.id)},voice:()=>o6(J.id)},"frame"),V8(J);clearTimeout(Q8);let z=new Date(J.ringUntil).getTime()-Date.now();Q8=setTimeout(()=>{if(b6()===J.id)d0(J.id)},Math.max(5000,z+5000))}function W9(J){let z=window.open("about:blank","_blank");(async()=>{let $=await k0();if($)o2(`ingest/calls/${J.id}/coming`,$).catch(()=>{return});let j;try{j=await E6(Q9(J))}catch{z?.close();return}if(z&&!z.closed){z.location.href=j;try{z.opener=null}catch{}i1()}else i1(j)})()}async function Y9(J){d0(J.id);let z=await k0();if(z)await o2(`ingest/calls/${J.id}/decline`,z).catch(()=>{return})}var K9="lw-support-chat",G9="lw-support-frame",U9="lw-support-host",$0=56,a0=12,q9='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',H9=`
331
+ iframe.on { visibility: visible; }`,w=document.createElement("iframe"),w.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",w.title="สายจากทีมงาน",w.dataset.lwCallFrame=z,w.setAttribute("allowtransparency","true"),w.src=J,Z.append(V,w),document.body.append(W0),o0(),window.addEventListener("message",s6),window.addEventListener("resize",o0),b2(`lw-call:${z}`),h2=setTimeout(()=>{if(!H1)f2("timeout")},j)}function D1(){if(W0)b2(w2?.handle??null,w2?.readableBy);o1(),clearTimeout(h2),window.removeEventListener("message",s6),window.removeEventListener("resize",o0),r1(!1),W0?.remove(),W0=null,w=null,A0=null,U1=null,l=null,m2=null,l0={answer:!1,voice:!1}}function f2(J){let z=U1;D1(),z?.failed(J)}function s6(J){if(!w)return;let z=e3(J,{origin:s1,window:w.contentWindow});if(!z)return;switch(z.type){case"hello":m2?.then(($)=>{if(!w||A0===null)return;if($)c0({type:"token",token:$});else f2("no_token")});return;case"ready":if(H1=!0,clearTimeout(h2),w.classList.add("on"),U1?.ready(),l0.answer)c0({type:"answer"});if(l0.voice)c0({type:"voice"});return;case"size":if(typeof z.width==="number"&&typeof z.height==="number")v2={width:z.width,height:z.height};if(z.layout==="card"||z.layout==="full"){if(z.layout==="full"&&q1==="card")J9();q1=z.layout}return o0();case"drag":return y2(z);case"home":return O0=null,t6(),o0();case"done":{let $=U1;D1(),$?.done();return}case"failed":return f2(z.reason??"failed");case"ink":{let $=d1(z.op);if($)l1($);return}}}function b2(J,z=s1){let $=typeof navigator>"u"?void 0:navigator.mediaDevices;try{$?.setCaptureHandleConfig?.(J&&z?{handle:J,exposeOrigin:!1,permittedOrigins:[z]}:{})}catch{}}var w2=null;function a6(J,z){if(w2={handle:J,readableBy:z},!W0?.isConnected)b2(J,z)}function y2(J){if(!w||q1!=="card"||typeof J.x!=="number"||typeof J.y!=="number")return;if(J.phase==="start"){let z=w.getBoundingClientRect();l={sx:J.x,sy:J.y,x:z.left,y:z.top,lx:J.x,ly:J.y},r1(!0);return}if(!l)return;if(l.lx=J.x,l.ly=J.y,O0=r6({x:l.x+(J.x-l.sx),y:l.y+(J.y-l.sy)},e6(),n1()),o0(),J.phase==="end")l=null,r1(!1),t6()}var G1=null;function r1(J){if(G1){for(let z of["pointermove","pointerup","pointercancel"])window.removeEventListener(z,G1,!0);G1=null}if(!J)return;G1=(z)=>{if(!l)return r1(!1);if(z.type==="pointermove"&&z.buttons!==0)return y2({type:"drag",phase:"move",x:z.screenX,y:z.screenY});let $=z.type==="pointerup";y2({type:"drag",phase:"end",x:$?z.screenX:l.lx,y:$?z.screenY:l.ly})};for(let z of["pointermove","pointerup","pointercancel"])window.addEventListener(z,G1,!0)}function J9(){if(!w?.contentWindow)return;let J=w.getBoundingClientRect();c0({type:"corner",x:Math.round(J.left),y:Math.round(J.top),width:Math.round(J.width)})}function t6(){try{if(O0)sessionStorage.setItem(E2,JSON.stringify(O0));else sessionStorage.removeItem(E2)}catch{}}var n1=()=>({w:window.innerWidth,h:window.innerHeight});function e6(){let J=n1();return{w:Math.min(g2,J.w-s),h:Math.min(v2.height||0,J.h-s)}}function o0(){if(!w)return;let J=w.style;if(q1==="full"){Object.assign(J,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let z=e6(),$=n1().w<480;if(J.width=$?`calc(100vw - ${s}px)`:`${z.w}px`,J.height=`${z.h}px`,O0&&!$){let j=r6(O0,z,n1());Object.assign(J,{left:`${j.x}px`,top:`${j.y}px`,right:"",bottom:""})}else Object.assign(J,{left:$?`${s/2}px`:"",top:"",right:$?"":`${s/2}px`,bottom:`calc(${s/2}px + var(--lw-chat-lift, 0px))`})}var a1=[2000,5000,15000,30000,60000],J8=new Set(["ringing","active"]),z9=20000,z8=!1,n0=!1,$8=0,$9=5,u2=null,K8=0,p2,j8,Q8,G8=(J)=>J.endsWith("/")?J:`${J}/`;function j9(J,z){let $=new URL("api/presence/ws",G8(J));return $.protocol=$.protocol==="https:"?"wss:":"ws:",$.searchParams.set("t",z),$.toString()}function Q9(J){if(J.chatId||!J.ticketId)return`/me/chat?call=${J.id}`;return`/me/tickets/${J.ticketId}?call=${J.id}`}function Z9(J){return J.status==="ringing"&&(J.side==="reporter"||J.side===void 0||J.side===null)}var i2=new Set;function U8(J){return i2.add(J),()=>i2.delete(J)}var Z8=()=>M().ring!==!1;async function k0(){let J=M().identity;if(!J)return null;try{return await J()??null}catch{return null}}async function o2(J,z){let $=M();return fetch(new URL(J,G8($.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":$.realmKey,authorization:`Bearer ${z}`},body:"{}"})}function r2(){if(z8||typeof window>"u"||typeof WebSocket>"u")return;let J=M();if(!J.identity||J.ring===!1&&!J.chat)return;z8=!0,n0=!1,V9(J.host);try{a6(`lw-tab:${H8()}`,new URL(J.host).origin)}catch{}q8()}function P1(J=!1){if(n0)return;let z=J?a1[a1.length-1]:a1[Math.min(K8++,a1.length-1)];clearTimeout(j8),j8=setTimeout(()=>void q8(),z)}async function q8(){if(n0)return;let J=await k0();if(!J){if(++$8>=$9){n0=!0;return}return P1(!0)}$8=0;let z;try{z=await o2(M().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",J)}catch{return P1()}if(z.status===401||z.status===404||z.status===403){n0=!0;return}if(!z.ok)return P1(z.status===429);let $;try{$=await z.json()}catch{return P1()}if(!$.ticket){n0=!0;return}if($.calls&&$.call&&Z8())Y8($.call);let j=new WebSocket(j9(M().host,$.ticket));u2=j,j.onopen=()=>{K8=0,j.send(JSON.stringify({type:"tab",id:H8()})),clearInterval(p2),p2=setInterval(()=>{if(j.readyState===WebSocket.OPEN)j.send(JSON.stringify({type:"ping"}))},z9)},j.onmessage=(Q)=>{try{let Z=JSON.parse(String(Q.data));if(Z.type==="chat-changed"||Z.type==="ticket-changed"||Z.type==="chat-seen"){for(let V of i2)V(Z);return}if(Z.type==="call-state"&&Z.call&&typeof Z.call==="object"){if(Z8())Y8(Z.call)}else if(Z.type==="call-ink"&&typeof Z.call==="string"){let V=d1(Z.op);if(V)l2=Z.call,l1(V)}}catch{}},j.onclose=()=>{if(clearInterval(p2),u2===j)u2=null;P1()}}var d2="lw-call-framed";function X9(){try{return sessionStorage.getItem(d2)}catch{return null}}function t1(J){try{if(J)sessionStorage.setItem(d2,J);else sessionStorage.removeItem(d2)}catch{}}var X8=!1;function V9(J){if(X8||typeof document>"u")return;X8=!0;try{let z=new URL(J).origin;for(let $ of["dns-prefetch","preconnect"]){let j=document.createElement("link");if(j.rel=$,j.href=z,$==="preconnect")j.crossOrigin="anonymous";j.dataset.debugReporter="true",document.head.append(j)}}catch{}}function V8(J){let z=M();if(z.callFrame===!1||r0()===J.id)return;t1(J.id),n6(c6(z.host,z.realmKey,null,J.id),J.id,{ready:()=>m6(J.id),done:()=>{t1(null),d0(J.id)},failed:()=>{t1(null),h6(J,c2(J))}},15000,k0())}var c2=(J)=>({open:()=>W9(J),decline:()=>void Y9(J)}),L0=null;function H8(){if(L0)return L0;try{L0=sessionStorage.getItem(W8)}catch{}if(!L0||!/^[A-Za-z0-9_-]{8,40}$/.test(L0)){let J=new Uint8Array(12);crypto.getRandomValues(J),L0=Array.from(J,(z)=>z.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(W8,L0)}catch{}}return L0}var W8="lw-tab-id",l2=null;function Y8(J){if(!J8.has(J.status)&&l2===J.id&&r0()!==J.id)l2=null,o1();if(!Z9(J)){if(d0(J.id),J.status==="active"&&X9()===J.id&&!r0())V8(J);if(!J8.has(J.status)&&r0()===J.id)setTimeout(()=>{if(r0()===J.id)D1(),t1(null)},12000);return}if(M().callFrame===!1)p1(J,c2(J),"portal");else p1(J,{...c2(J),answer:()=>{v6(J.id),l6(J.id)},voice:()=>o6(J.id)},"frame"),V8(J);clearTimeout(Q8);let z=new Date(J.ringUntil).getTime()-Date.now();Q8=setTimeout(()=>{if(b6()===J.id)d0(J.id)},Math.max(5000,z+5000))}function W9(J){let z=window.open("about:blank","_blank");(async()=>{let $=await k0();if($)o2(`ingest/calls/${J.id}/coming`,$).catch(()=>{return});let j;try{j=await E6(Q9(J))}catch{z?.close();return}if(z&&!z.closed){z.location.href=j;try{z.opener=null}catch{}i1()}else i1(j)})()}async function Y9(J){d0(J.id);let z=await k0();if(z)await o2(`ingest/calls/${J.id}/decline`,z).catch(()=>{return})}var K9="lw-support-chat",G9="lw-support-frame",U9="lw-support-host",$0=56,a0=12,q9='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',H9=`
332
332
  :host { all: initial; }
333
333
  .bubble {
334
334
  position: fixed; z-index: 2147483000; width: ${$0}px; height: ${$0}px; border-radius: 50%;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var m8=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(z,$)=>(typeof require<"u"?require:z)[$]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});function T1(J){if(!J)return null;let z=J===!0?{}:J,$=(j,Q)=>typeof j==="number"&&Number.isFinite(j)&&j>=0&&j<2000?j:Q;return{side:z.position==="left"?"left":"right",x:$(z.offset?.x,16),y:$(z.offset?.y,16)}}var u8={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},n=null;function p8(J){let z=[];if(!J.host?.trim())z.push("host");if(!J.realmKey?.trim())z.push("realmKey");if(!J.app?.name?.trim())z.push("app.name");if(typeof J.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");n=J}function M(){if(!n)throw Error("[debug-capture] configureDebugCapture() has not been called");return n}function Q1(){return n!==null}function Y0(){let J=M().app;return{name:J.name,version:J.version??"0.0.0",environment:J.environment??d8()}}function d8(){if(typeof window>"u")return"unknown";let J=window.location.hostname;if(J==="localhost"||J==="127.0.0.1"||J.endsWith(".local"))return"development";return"production"}function N0(J){let z=n?.capture?.[J];return typeof z==="number"?z:u8[J]}function k1(J){let z=n?.module;if(!z)return null;try{return z(J)??null}catch{return null}}function x1(){let J=n?.redact;return{headers:J?.headers??[],queryKeys:(J?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:(J?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function R4(){return n?.capture?.overlaySelectors??[]}var i8='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',c8="[data-lw-mask]",S4={fps:1,quality:0.5};function Z1(){let J=n?.replay;if(!J)return null;let z=J===!0?{}:J,$=(Z,X)=>typeof Z==="number"&&Z>0?Z:X,j=z.maskInputs!==!1,Q=z.recordCanvas?{fps:$(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,S4.fps),quality:$(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,S4.quality)}:null;return{seconds:$(z.seconds,60),maskInputs:j,maskTextSelector:z.maskTextSelector?.trim()||(j?i8:c8),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:$(z.maxBytes,4000000),canvas:Q}}function A4(J){if(typeof window>"u")return!1;let z;try{z=new URL(J,window.location.href)}catch{return!1}if(l8(z))return!1;if(z.origin===window.location.origin)return!0;return(n?.capture?.bodyOrigins??[]).some(($)=>{try{return new URL($).origin===z.origin}catch{return!1}})}function l8(J){if(!n?.host)return!1;try{if(new URL(n.host).origin!==J.origin)return!1}catch{return!1}return J.pathname.startsWith("/ingest/")}function o8(J){let z=Object.entries(J).map(([$,j])=>[$.replace(/\/+$/,"")||"/",j]).sort(($,j)=>j[0].length-$[0].length);return($)=>{let j=($||"/").replace(/\/+$/,"")||"/";for(let[Q,Z]of z)if(j===Q||j.startsWith(`${Q}/`))return{key:Q,label:Z};return null}}var u0="‹redacted›",r8=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,n8=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),s8=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,a8=/[\w.+-]+@[\w-]+\.[\w.-]+/g,t8=/\d(?:[\d\s-]{7,})\d/g;function p0(J){return J.replace(a8,u0).replace(t8,u0)}function e8(J){if(r8.test(J))return!0;return x1().headers.some(($)=>$.toLowerCase()===J.toLowerCase())}function d0(J){let z={};for(let[$,j]of Object.entries(J))z[$]=e8($)?u0:j;return z}function D0(J){try{let z=/^https?:\/\//i.test(J),$=new URL(J,z?void 0:"http://local.invalid"),j=!1;if($.searchParams.forEach((Q,Z)=>{if(n8.has(Z.toLowerCase())||x1().queryKeys.includes(Z.toLowerCase()))$.searchParams.set(Z,u0),j=!0}),!j)return J;return z?$.toString():`${$.pathname}${$.search}`}catch{return J}}function M2(J,z){if(z>6||J===null||typeof J!=="object")return J;if(Array.isArray(J))return J.map((j)=>M2(j,z+1));let $={};for(let[j,Q]of Object.entries(J)){let Z=s8.test(j)||x1().bodyKeys.some((X)=>j.toLowerCase().includes(X));$[j]=Z?u0:M2(Q,z+1)}return $}function i0(J,z){if(J==null)return null;let $=J,j=J.trim();if(j.startsWith("{")||j.startsWith("["))try{let Q=JSON.parse(j);$=JSON.stringify(M2(Q,0))}catch{}if($.length>z)return`${$.slice(0,z)}… [truncated ${$.length-z} chars]`;return $}var F2=120,B2=40,l0=(J,z)=>J.length>z?`${J.slice(0,z)}…`:J,N2=(J)=>{try{return decodeURIComponent(J)}catch{return J}},c0=[],T4=0,k4=!1;function X1(J,z,$,j){let Q=l0(z,F2),Z=c0[c0.length-1];if(J==="navigate"&&Z?.kind==="click"){let W=Q.replace(/^ไปที่\s*/,"");if(Z.detail.includes(`→ ${W}`))return Z.at=new Date().toISOString(),Z;let G=W.split(/[?#]/)[0]??W,D=Z.source?N2(Z.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(D&&(G===D||G.startsWith(D)))return Z.detail=l0(`${Z.detail} → ${W}`,F2),Z.source=void 0,Z.at=new Date().toISOString(),Z}if(Z&&Z.kind===J&&Z.detail===Q){if(Z.at=new Date().toISOString(),J!=="navigate")Z.count=(Z.count??1)+1;return Z}T4+=1;let X={id:`act_${T4}`,at:new Date().toISOString(),kind:J,detail:Q,count:1,source:$,html:f1(j)};c0.push(X);while(c0.length>N0("maxActions"))z3(c0.shift());return X}var J3=200000,V1=0;function f1(J){if(!J)return;if(V1+J.length>J3)return;return V1+=J.length,J}function z3(J){if(!J)return;if(V1-=(J.html?.length??0)+(J.afterHtml?.length??0),V1<0)V1=0}function _2(J){return J&&J>1?` (×${J})`:""}function E1(J){return J instanceof Element&&Boolean(J.closest("[data-debug-reporter]"))}var $3='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',j3={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},x4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function Q3(J){let z=J.getAttribute("role");if(z&&x4[z])return x4[z];return j3[J.tagName.toLowerCase()]??"ปุ่ม"}function Z3(J,z){try{let $=J,j=0;while($&&j<=z){let Q=v4($);if(Q&&typeof Q.memoizedProps?.onClick==="function")return $;$=$.parentElement,j+=1}}catch{}return null}function X3(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("title")?.trim();if($)return $;if(J instanceof HTMLInputElement||J instanceof HTMLTextAreaElement||J instanceof HTMLSelectElement)return(J.getAttribute("placeholder")||J.getAttribute("name")||"").trim();if(J instanceof HTMLImageElement)return(J.getAttribute("alt")||"").trim();let j=(J.textContent??"").replace(/\s+/g," ").trim();if(j)return j;if(J instanceof HTMLAnchorElement){let Q=J.getAttribute("href");if(Q?.startsWith("/"))return N2(Q)}return""}function V3(J){if(!(J instanceof Element))return null;let z=J.closest($3)??Z3(J,4);if(!z)return null;let $=z.tagName.toLowerCase();if($==="html"||$==="body")return null;return z}function W3(J){let z=p0(X3(J));if(!z)return null;return`${Q3(J)} “${l0(z,B2)}”`}var g4=6000,Y3=4000,K3=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function G3(J){J.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Q)=>Q.remove());let z=[J,...Array.from(J.querySelectorAll("*"))];for(let Q of z){for(let X of Array.from(Q.attributes)){let W=X.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))Q.removeAttribute(X.name)}if(Q instanceof HTMLAnchorElement)Q.setAttribute("href","#");if(Q instanceof HTMLImageElement)Q.removeAttribute("src");let Z=Q.getAttribute("class");if(Z){let X=Z.replace(K3," ").replace(/\s+/g," ").trim();if(X)Q.setAttribute("class",X);else Q.removeAttribute("class")}}let $=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),j=$.nextNode();while(j){if(j.nodeValue)j.nodeValue=p0(j.nodeValue);j=$.nextNode()}}function C2(J,z,$){try{let j=J.outerHTML;if(!j||j.length>z)return;let Q=J.cloneNode(!0);G3(Q);let Z=Q.outerHTML;return Z&&Z.length<=$?Z:void 0}catch{return}}var U3=(J)=>C2(J,g4,Y3),D3=150000,H3=40000,E4=(J)=>C2(J,D3,H3);function q3(J){if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLTextAreaElement)&&!(J instanceof HTMLSelectElement))return null;let z=J.name||J.id||J.getAttribute("aria-label")||J.getAttribute("placeholder")||J.tagName.toLowerCase();return`ช่อง “${p0(z)}”`}var f4=80;function v4(J){let z=Object.keys(J).find(($)=>$.startsWith("__reactFiber$")||$.startsWith("__reactInternalInstance$"));return z?J[z]:null}function P3(J){if(typeof J!=="function")return null;try{let z=Function.prototype.toString.call(J);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function w4(J){if(!J)return;return`→ ${J.length>f4?`${J.slice(0,f4)}…`:J}`}function M3(J){try{let z=J.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return w4(z);let $=v4(J),j=0;while($&&j<30){if(typeof $.memoizedProps?.onClick==="function")return w4(P3($.memoizedProps.onClick));$=$.return,j+=1}return}catch{return}}var F3='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function B3(){let J=R4();return J.length?J.join(", "):F3}function N3(J){let z=J.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function _3(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("aria-labelledby");if($){let Z=$.split(/\s+/).map((X)=>document.getElementById(X)?.textContent?.trim()??"").filter(Boolean).join(" ");if(Z)return Z}let Q=J.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Q)return Q;return(J.textContent??"").replace(/\s+/g," ").trim()}function b4(J){let z=p0(_3(J)),$=N3(J);return z?`เปิด ${$} “${l0(z,B2)}”`:`เปิด ${$}`}var C3='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',I3=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function O3(J){if(J.querySelector(C3))return!0;return I3.test(J.textContent??"")}var L3=400,S3=250,R3=8000;function A3(J,z){if(typeof MutationObserver>"u"){z.html=f1(E4(J));return}let $=Date.now(),j=!1,Q=()=>{j=!0,X.disconnect(),window.clearInterval(W),window.clearTimeout(G)},Z=()=>{if(j)return;if(Q(),!J.isConnected)return;z.detail=l0(b4(J),F2),z.html=f1(E4(J))},X=new MutationObserver(()=>{$=Date.now()});X.observe(J,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(j)return;if(!J.isConnected){Q();return}if(Date.now()-$>=L3&&!O3(J))Z()},S3),G=window.setTimeout(Z,R3)}function T3(J){if(E1(J))return;let z=X1("ui",b4(J));if(z)A3(J,z)}function k3(){if(typeof MutationObserver>"u")return;let J=new WeakSet;new MutationObserver(($)=>{for(let j of $)for(let Q of Array.from(j.addedNodes)){if(!(Q instanceof Element))continue;let Z=B3(),X=Q.matches(Z)?[Q]:Array.from(Q.querySelectorAll(Z));for(let W of X){if(J.has(W))continue;J.add(W),T3(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var x3=1600,E3=2500;function y4(J){return{disabled:J.hasAttribute("disabled")||J.getAttribute("aria-disabled")==="true",busy:J.getAttribute("aria-busy")==="true",text:l0((J.textContent??"").replace(/\s+/g," ").trim(),B2)}}function f3(J,z){if(!J.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!J.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if(J.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function w3(J,z){if(typeof MutationObserver>"u")return;let $=y4(J),j=!1,Q=(W,G)=>{if(j)return;if(j=!0,Z.disconnect(),window.clearTimeout(X),z.afterNote=W,G)z.afterHtml=f1(C2(J,g4,E3))},Z=new MutationObserver(()=>{if(!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=f3($,y4(J));if(W)Q(W,!0)});Z.observe(J,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let X=window.setTimeout(()=>{if(!j&&!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,Z.disconnect()},x3)}function h4(){if(k4||typeof window>"u")return;k4=!0,document.addEventListener("click",(j)=>{if(E1(j.target))return;let Q=V3(j.target);if(!Q)return;let Z=W3(Q);if(!Z)return;let X=X1("click",`คลิก ${Z}`,M3(Q),U3(Q));if(X)w3(Q,X)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(E1(j.target))return;let Q=q3(j.target);if(Q)X1("input",`แก้ไข ${Q}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(E1(j.target))return;X1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let J=()=>X1("navigate",`ไปที่ ${N2(D0(location.pathname+location.search))}`),z=history.pushState.bind(history),$=history.replaceState.bind(history);history.pushState=(...j)=>{let Q=z(...j);return J(),Q},history.replaceState=(...j)=>{let Q=$(...j);return J(),Q},window.addEventListener("popstate",J),k3()}function I2(){return c0.map((J)=>({...J}))}var m4=2000,w1=[],u4=0,p4=!1;function O2(J,z){u4+=1,w1.push({id:`log_${u4}`,at:new Date().toISOString(),level:J,message:z.length>m4?`${z.slice(0,m4)}…`:z});while(w1.length>N0("maxConsoleEntries"))w1.shift()}function y3(){let J=new WeakSet;return(z,$)=>{if(typeof $==="object"&&$!==null){if(J.has($))return"[Circular]";J.add($)}if(typeof $==="bigint")return $.toString();return $}}function d4(J){if(typeof J==="string")return J;if(J instanceof Error)return`${J.name}: ${J.message}`;try{let z=JSON.stringify(J,y3());if(z!==void 0)return z}catch{}try{return String(J)}catch{}try{return Object.prototype.toString.call(J)}catch{return`[${typeof J}]`}}function i4(){if(p4||typeof window>"u")return;p4=!0;let J=["log","info","warn","error","debug"];for(let z of J){let $=console[z].bind(console);console[z]=(...j)=>{O2(z,j.map(d4).join(" ")),$(...j)}}window.addEventListener("error",(z)=>{let $=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";O2("exception",`${z.message}${$}`)}),window.addEventListener("unhandledrejection",(z)=>{let $=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:d4(z.reason);O2("unhandledrejection",$)})}function L2(){return w1.map((J)=>({...J}))}var c4=new Set,l4=new Set;function o4(J,z){return J.add(z),()=>J.delete(z)}function r4(J,z){for(let $ of[...J])$(z)}function S2(J){return o4(c4,J)}function W1(J={type:"manual"}){r4(c4,J)}function R2(J){return o4(l4,J)}function A2(J){r4(l4,J)}var g3=15000,v3=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],n4=!1,s4=0;function b3(J){return v3.some((z)=>J.includes(z))}function a4(J){let z=J.message??"";if(!z||b3(z))return;let $=Date.now();if($-s4<g3)return;s4=$,A2({...J,message:z})}function t4(){if(n4||typeof window>"u")return;n4=!0,window.addEventListener("error",(J)=>{if(!J.message&&!J.error)return;let z=J.error instanceof Error?J.error:null;a4({type:"runtime-error",message:J.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",(J)=>{let z=J.reason;a4({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var $6=4000,h3=1e6,m3=1e7,y1=[],e4=0,J6=!1;function j6(J){y1.push(J);while(y1.length>N0("maxRequests"))y1.shift()}function Q6(){return e4+=1,`req_${e4}`}function z6(J){let z={};if(!J)return z;if(J instanceof Headers)J.forEach(($,j)=>{z[j]=$});else if(Array.isArray(J))for(let[$,j]of J)z[$]=j;else Object.assign(z,J);return z}function u3(J){let z={};return J.forEach(($,j)=>{z[j]=$}),z}function p3(J){if(J==null)return null;if(typeof J==="string")return J;if(J instanceof URLSearchParams)return J.toString();if(typeof FormData<"u"&&J instanceof FormData)return`[FormData: ${Array.from(J.keys()).join(", ")}]`;if(typeof Blob<"u"&&J instanceof Blob)return`[Blob ${J.size} bytes]`;if(J instanceof ArrayBuffer)return`[ArrayBuffer ${J.byteLength} bytes]`;return"[binary]"}function d3(J,z){let $="",j="GET",Q={},Z=null;if(typeof J==="string")$=J;else if(J instanceof URL)$=J.toString();else $=J.url,j=J.method||j,Q=z6(J.headers);if(z){if(z.method)j=z.method;if(z.headers)Q={...Q,...z6(z.headers)};if(z.body!==void 0)Z=p3(z.body)}return{method:j.toUpperCase(),url:$,headers:Q,body:Z}}function Z6(J){return!A4(J)}function i3(J,z){if(Z6(z.url)){z.responseSnippet="[body not captured for this origin]";return}let $=J.headers.get("content-type")??"",j=Number(J.headers.get("content-length")??"0"),Q=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test($)){z.responseSnippet=`[binary ${$||"unknown"}${Q}]`;return}if(j>h3){z.responseSnippet=`[response ${$||"text"}${Q} — omitted]`;return}try{J.clone().text().then((Z)=>{z.responseSnippet=i0(Z,N0("maxBodyChars"))}).catch(()=>{})}catch{}}function X6(J,z){if(/[?&]_rsc=/.test(J))return!0;for(let $ of Object.keys(z)){let j=$.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function c3(){if(typeof window>"u"||typeof window.fetch!=="function")return;let J=window.fetch.bind(window);window.fetch=Object.assign(async(z,$)=>{let j=d3(z,$);if(X6(j.url,j.headers))return J(z,$);let Q={id:Q6(),startedAt:new Date().toISOString(),method:j.method,url:D0(j.url),requestHeaders:d0(j.headers),requestBody:i0(j.body,$6),status:null,statusText:null,durationMs:null,via:"fetch"};j6(Q);let Z=performance.now();try{let X=await J(z,$);return Q.status=X.status,Q.statusText=X.statusText,Q.durationMs=Math.round(performance.now()-Z),Q.responseHeaders=d0(u3(X.headers)),i3(X,Q),X}catch(X){throw Q.durationMs=Math.round(performance.now()-Z),Q.error=X instanceof Error?`${X.name}: ${X.message}`:String(X),X}},J)}function l3(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let J=XMLHttpRequest.prototype,z=J.open,$=J.send,j=function(Z,X){let W=typeof X==="string"?X:X.toString();return this.__lwEntry=X6(W,{})?void 0:{id:Q6(),startedAt:"",method:(Z||"GET").toUpperCase(),url:D0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},Q=function(Z){let X=this.__lwEntry;if(X){X.startedAt=new Date().toISOString(),X.requestBody=typeof Z==="string"?i0(Z,$6):Z==null?null:"[non-string body]";let W=performance.now();j6(X),this.addEventListener("loadend",()=>{if(X.status=this.status||null,X.statusText=this.statusText||null,X.durationMs=Math.round(performance.now()-W),Z6(X.url))X.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{X.responseSnippet=i0(this.responseText||"",N0("maxBodyChars"))}catch{}else{let G=this.getResponseHeader("content-type")??this.responseType;X.responseSnippet=`[binary ${G}]`}})}return $.apply(this,arguments)};J.open=j,J.send=Q}function V6(){if(J6)return;J6=!0,c3(),l3()}function T2(){let J=y1.map(($)=>({...$})),z=0;for(let $=J.length-1;$>=0;$-=1){let j=J[$],Q=j?.responseSnippet;if(!j||typeof Q!=="string"||Q.length===0)continue;if(z+Q.length>m3)j.responseSnippet=`[response omitted — report size budget reached (${Q.length.toLocaleString()} chars)]`;else z+=Q.length}return J}var o3=4,W6=3,r3=4000,n3="[data-debug-reporter]",s3=()=>import("@rrweb/record");var s=[],o0=null,g1=!1;function Y6(){if(typeof window>"u"||o0||g1)return;let J=Z1();if(!J)return;g1=!0;let z=()=>void a3(J);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function a3(J){let z;try{z=(await s3()).record}catch($){g1=!1,console.warn("[debug-capture] session replay could not start:",$);return}if(o0)return;try{o0=z({emit:($)=>t3($),checkoutEveryNms:Math.max(1000,J.seconds*1000/2),checkoutEveryNth:r3,maskAllInputs:J.maskInputs,maskTextSelector:J.maskText?"*":J.maskTextSelector,blockSelector:`${J.blockSelector}, ${n3}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...J.canvas?{canvas:J.canvas.fps}:{}},recordCanvas:J.canvas!==null,...J.canvas?{dataURLOptions:{type:"image/webp",quality:J.canvas.quality}}:{},errorHandler:()=>!0})??null}catch($){console.warn("[debug-capture] session replay could not start:",$)}finally{g1=!1}}function t3(J){if(J.type===o3||s.length===0){if(s.push([]),s.length>W6)s=s.slice(-W6)}s[s.length-1].push(J)}function k2(J=Date.now()){let z=Z1();if(!z||!s.length)return null;let $=J-z.seconds*1000,j=s.length-1;while(j>0&&(s[j][0]?.timestamp??J)>$)j-=1;let Q=s.slice(j).flat(),Z=Q[0]?.timestamp,X=Q[Q.length-1]?.timestamp;if(Z===void 0||X===void 0)return null;return{events:Q,startedAt:new Date(Z).toISOString(),endedAt:new Date(X).toISOString(),durationMs:Math.max(0,X-Z)}}function e3(){return o0!==null}function J5(){o0?.(),o0=null,s=[]}var z5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},$5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function c(J){return J==="en"?$5:z5}var j5="lw-debug-toasts",Q5=6000,Z5=`
1
+ var m8=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(z,$)=>(typeof require<"u"?require:z)[$]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});function T1(J){if(!J)return null;let z=J===!0?{}:J,$=(j,Q)=>typeof j==="number"&&Number.isFinite(j)&&j>=0&&j<2000?j:Q;return{side:z.position==="left"?"left":"right",x:$(z.offset?.x,16),y:$(z.offset?.y,16)}}var u8={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},n=null;function p8(J){let z=[];if(!J.host?.trim())z.push("host");if(!J.realmKey?.trim())z.push("realmKey");if(!J.app?.name?.trim())z.push("app.name");if(typeof J.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");n=J}function M(){if(!n)throw Error("[debug-capture] configureDebugCapture() has not been called");return n}function Q1(){return n!==null}function Y0(){let J=M().app;return{name:J.name,version:J.version??"0.0.0",environment:J.environment??d8()}}function d8(){if(typeof window>"u")return"unknown";let J=window.location.hostname;if(J==="localhost"||J==="127.0.0.1"||J.endsWith(".local"))return"development";return"production"}function N0(J){let z=n?.capture?.[J];return typeof z==="number"?z:u8[J]}function k1(J){let z=n?.module;if(!z)return null;try{return z(J)??null}catch{return null}}function x1(){let J=n?.redact;return{headers:J?.headers??[],queryKeys:(J?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:(J?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function R4(){return n?.capture?.overlaySelectors??[]}var i8='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',c8="[data-lw-mask]",S4={fps:1,quality:0.5};function Z1(){let J=n?.replay;if(!J)return null;let z=J===!0?{}:J,$=(Z,X)=>typeof Z==="number"&&Z>0?Z:X,j=z.maskInputs!==!1,Q=z.recordCanvas?{fps:$(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,S4.fps),quality:$(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,S4.quality)}:null;return{seconds:$(z.seconds,60),maskInputs:j,maskTextSelector:z.maskTextSelector?.trim()||(j?i8:c8),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:$(z.maxBytes,4000000),canvas:Q}}function A4(J){if(typeof window>"u")return!1;let z;try{z=new URL(J,window.location.href)}catch{return!1}if(l8(z))return!1;if(z.origin===window.location.origin)return!0;return(n?.capture?.bodyOrigins??[]).some(($)=>{try{return new URL($).origin===z.origin}catch{return!1}})}function l8(J){if(!n?.host)return!1;try{if(new URL(n.host).origin!==J.origin)return!1}catch{return!1}return J.pathname.startsWith("/ingest/")}function o8(J){let z=Object.entries(J).map(([$,j])=>[$.replace(/\/+$/,"")||"/",j]).sort(($,j)=>j[0].length-$[0].length);return($)=>{let j=($||"/").replace(/\/+$/,"")||"/";for(let[Q,Z]of z)if(j===Q||j.startsWith(`${Q}/`))return{key:Q,label:Z};return null}}var u0="‹redacted›",r8=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,n8=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),s8=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,a8=/[\w.+-]+@[\w-]+\.[\w.-]+/g,t8=/\d(?:[\d\s-]{7,})\d/g;function p0(J){return J.replace(a8,u0).replace(t8,u0)}function e8(J){if(r8.test(J))return!0;return x1().headers.some(($)=>$.toLowerCase()===J.toLowerCase())}function d0(J){let z={};for(let[$,j]of Object.entries(J))z[$]=e8($)?u0:j;return z}function D0(J){try{let z=/^https?:\/\//i.test(J),$=new URL(J,z?void 0:"http://local.invalid"),j=!1;if($.searchParams.forEach((Q,Z)=>{if(n8.has(Z.toLowerCase())||x1().queryKeys.includes(Z.toLowerCase()))$.searchParams.set(Z,u0),j=!0}),!j)return J;return z?$.toString():`${$.pathname}${$.search}`}catch{return J}}function M2(J,z){if(z>6||J===null||typeof J!=="object")return J;if(Array.isArray(J))return J.map((j)=>M2(j,z+1));let $={};for(let[j,Q]of Object.entries(J)){let Z=s8.test(j)||x1().bodyKeys.some((X)=>j.toLowerCase().includes(X));$[j]=Z?u0:M2(Q,z+1)}return $}function i0(J,z){if(J==null)return null;let $=J,j=J.trim();if(j.startsWith("{")||j.startsWith("["))try{let Q=JSON.parse(j);$=JSON.stringify(M2(Q,0))}catch{}if($.length>z)return`${$.slice(0,z)}… [truncated ${$.length-z} chars]`;return $}var F2=120,B2=40,l0=(J,z)=>J.length>z?`${J.slice(0,z)}…`:J,N2=(J)=>{try{return decodeURIComponent(J)}catch{return J}},c0=[],T4=0,k4=!1;function X1(J,z,$,j){let Q=l0(z,F2),Z=c0[c0.length-1];if(J==="navigate"&&Z?.kind==="click"){let W=Q.replace(/^ไปที่\s*/,"");if(Z.detail.includes(`→ ${W}`))return Z.at=new Date().toISOString(),Z;let G=W.split(/[?#]/)[0]??W,D=Z.source?N2(Z.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(D&&(G===D||G.startsWith(D)))return Z.detail=l0(`${Z.detail} → ${W}`,F2),Z.source=void 0,Z.at=new Date().toISOString(),Z}if(Z&&Z.kind===J&&Z.detail===Q){if(Z.at=new Date().toISOString(),J!=="navigate")Z.count=(Z.count??1)+1;return Z}T4+=1;let X={id:`act_${T4}`,at:new Date().toISOString(),kind:J,detail:Q,count:1,source:$,html:f1(j)};c0.push(X);while(c0.length>N0("maxActions"))z3(c0.shift());return X}var J3=200000,V1=0;function f1(J){if(!J)return;if(V1+J.length>J3)return;return V1+=J.length,J}function z3(J){if(!J)return;if(V1-=(J.html?.length??0)+(J.afterHtml?.length??0),V1<0)V1=0}function _2(J){return J&&J>1?` (×${J})`:""}function E1(J){return J instanceof Element&&Boolean(J.closest("[data-debug-reporter]"))}var $3='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',j3={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},x4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function Q3(J){let z=J.getAttribute("role");if(z&&x4[z])return x4[z];return j3[J.tagName.toLowerCase()]??"ปุ่ม"}function Z3(J,z){try{let $=J,j=0;while($&&j<=z){let Q=v4($);if(Q&&typeof Q.memoizedProps?.onClick==="function")return $;$=$.parentElement,j+=1}}catch{}return null}function X3(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("title")?.trim();if($)return $;if(J instanceof HTMLInputElement||J instanceof HTMLTextAreaElement||J instanceof HTMLSelectElement)return(J.getAttribute("placeholder")||J.getAttribute("name")||"").trim();if(J instanceof HTMLImageElement)return(J.getAttribute("alt")||"").trim();let j=(J.textContent??"").replace(/\s+/g," ").trim();if(j)return j;if(J instanceof HTMLAnchorElement){let Q=J.getAttribute("href");if(Q?.startsWith("/"))return N2(Q)}return""}function V3(J){if(!(J instanceof Element))return null;let z=J.closest($3)??Z3(J,4);if(!z)return null;let $=z.tagName.toLowerCase();if($==="html"||$==="body")return null;return z}function W3(J){let z=p0(X3(J));if(!z)return null;return`${Q3(J)} “${l0(z,B2)}”`}var g4=6000,Y3=4000,K3=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function G3(J){J.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Q)=>Q.remove());let z=[J,...Array.from(J.querySelectorAll("*"))];for(let Q of z){for(let X of Array.from(Q.attributes)){let W=X.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))Q.removeAttribute(X.name)}if(Q instanceof HTMLAnchorElement)Q.setAttribute("href","#");if(Q instanceof HTMLImageElement)Q.removeAttribute("src");let Z=Q.getAttribute("class");if(Z){let X=Z.replace(K3," ").replace(/\s+/g," ").trim();if(X)Q.setAttribute("class",X);else Q.removeAttribute("class")}}let $=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),j=$.nextNode();while(j){if(j.nodeValue)j.nodeValue=p0(j.nodeValue);j=$.nextNode()}}function C2(J,z,$){try{let j=J.outerHTML;if(!j||j.length>z)return;let Q=J.cloneNode(!0);G3(Q);let Z=Q.outerHTML;return Z&&Z.length<=$?Z:void 0}catch{return}}var U3=(J)=>C2(J,g4,Y3),D3=150000,H3=40000,E4=(J)=>C2(J,D3,H3);function q3(J){if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLTextAreaElement)&&!(J instanceof HTMLSelectElement))return null;let z=J.name||J.id||J.getAttribute("aria-label")||J.getAttribute("placeholder")||J.tagName.toLowerCase();return`ช่อง “${p0(z)}”`}var f4=80;function v4(J){let z=Object.keys(J).find(($)=>$.startsWith("__reactFiber$")||$.startsWith("__reactInternalInstance$"));return z?J[z]:null}function P3(J){if(typeof J!=="function")return null;try{let z=Function.prototype.toString.call(J);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function w4(J){if(!J)return;return`→ ${J.length>f4?`${J.slice(0,f4)}…`:J}`}function M3(J){try{let z=J.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return w4(z);let $=v4(J),j=0;while($&&j<30){if(typeof $.memoizedProps?.onClick==="function")return w4(P3($.memoizedProps.onClick));$=$.return,j+=1}return}catch{return}}var F3='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function B3(){let J=R4();return J.length?J.join(", "):F3}function N3(J){let z=J.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function _3(J){let z=J.getAttribute("aria-label")?.trim();if(z)return z;let $=J.getAttribute("aria-labelledby");if($){let Z=$.split(/\s+/).map((X)=>document.getElementById(X)?.textContent?.trim()??"").filter(Boolean).join(" ");if(Z)return Z}let Q=J.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Q)return Q;return(J.textContent??"").replace(/\s+/g," ").trim()}function b4(J){let z=p0(_3(J)),$=N3(J);return z?`เปิด ${$} “${l0(z,B2)}”`:`เปิด ${$}`}var C3='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',I3=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function O3(J){if(J.querySelector(C3))return!0;return I3.test(J.textContent??"")}var L3=400,S3=250,R3=8000;function A3(J,z){if(typeof MutationObserver>"u"){z.html=f1(E4(J));return}let $=Date.now(),j=!1,Q=()=>{j=!0,X.disconnect(),window.clearInterval(W),window.clearTimeout(G)},Z=()=>{if(j)return;if(Q(),!J.isConnected)return;z.detail=l0(b4(J),F2),z.html=f1(E4(J))},X=new MutationObserver(()=>{$=Date.now()});X.observe(J,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(j)return;if(!J.isConnected){Q();return}if(Date.now()-$>=L3&&!O3(J))Z()},S3),G=window.setTimeout(Z,R3)}function T3(J){if(E1(J))return;let z=X1("ui",b4(J));if(z)A3(J,z)}function k3(){if(typeof MutationObserver>"u")return;let J=new WeakSet;new MutationObserver(($)=>{for(let j of $)for(let Q of Array.from(j.addedNodes)){if(!(Q instanceof Element))continue;let Z=B3(),X=Q.matches(Z)?[Q]:Array.from(Q.querySelectorAll(Z));for(let W of X){if(J.has(W))continue;J.add(W),T3(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var x3=1600,E3=2500;function y4(J){return{disabled:J.hasAttribute("disabled")||J.getAttribute("aria-disabled")==="true",busy:J.getAttribute("aria-busy")==="true",text:l0((J.textContent??"").replace(/\s+/g," ").trim(),B2)}}function f3(J,z){if(!J.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!J.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if(J.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function w3(J,z){if(typeof MutationObserver>"u")return;let $=y4(J),j=!1,Q=(W,G)=>{if(j)return;if(j=!0,Z.disconnect(),window.clearTimeout(X),z.afterNote=W,G)z.afterHtml=f1(C2(J,g4,E3))},Z=new MutationObserver(()=>{if(!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=f3($,y4(J));if(W)Q(W,!0)});Z.observe(J,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let X=window.setTimeout(()=>{if(!j&&!J.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,Z.disconnect()},x3)}function h4(){if(k4||typeof window>"u")return;k4=!0,document.addEventListener("click",(j)=>{if(E1(j.target))return;let Q=V3(j.target);if(!Q)return;let Z=W3(Q);if(!Z)return;let X=X1("click",`คลิก ${Z}`,M3(Q),U3(Q));if(X)w3(Q,X)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(E1(j.target))return;let Q=q3(j.target);if(Q)X1("input",`แก้ไข ${Q}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(E1(j.target))return;X1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let J=()=>X1("navigate",`ไปที่ ${N2(D0(location.pathname+location.search))}`),z=history.pushState.bind(history),$=history.replaceState.bind(history);history.pushState=(...j)=>{let Q=z(...j);return J(),Q},history.replaceState=(...j)=>{let Q=$(...j);return J(),Q},window.addEventListener("popstate",J),k3()}function I2(){return c0.map((J)=>({...J}))}var m4=2000,w1=[],u4=0,p4=!1;function O2(J,z){u4+=1,w1.push({id:`log_${u4}`,at:new Date().toISOString(),level:J,message:z.length>m4?`${z.slice(0,m4)}…`:z});while(w1.length>N0("maxConsoleEntries"))w1.shift()}function y3(){let J=new WeakSet;return(z,$)=>{if(typeof $==="object"&&$!==null){if(J.has($))return"[Circular]";J.add($)}if(typeof $==="bigint")return $.toString();return $}}function d4(J){if(typeof J==="string")return J;if(J instanceof Error)return`${J.name}: ${J.message}`;try{let z=JSON.stringify(J,y3());if(z!==void 0)return z}catch{}try{return String(J)}catch{}try{return Object.prototype.toString.call(J)}catch{return`[${typeof J}]`}}function i4(){if(p4||typeof window>"u")return;p4=!0;let J=["log","info","warn","error","debug"];for(let z of J){let $=console[z].bind(console);console[z]=(...j)=>{O2(z,j.map(d4).join(" ")),$(...j)}}window.addEventListener("error",(z)=>{let $=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";O2("exception",`${z.message}${$}`)}),window.addEventListener("unhandledrejection",(z)=>{let $=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:d4(z.reason);O2("unhandledrejection",$)})}function L2(){return w1.map((J)=>({...J}))}var c4=new Set,l4=new Set;function o4(J,z){return J.add(z),()=>J.delete(z)}function r4(J,z){for(let $ of[...J])$(z)}function S2(J){return o4(c4,J)}function W1(J={type:"manual"}){r4(c4,J)}function R2(J){return o4(l4,J)}function A2(J){r4(l4,J)}var g3=15000,v3=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],n4=!1,s4=0;function b3(J){return v3.some((z)=>J.includes(z))}function a4(J){let z=J.message??"";if(!z||b3(z))return;let $=Date.now();if($-s4<g3)return;s4=$,A2({...J,message:z})}function t4(){if(n4||typeof window>"u")return;n4=!0,window.addEventListener("error",(J)=>{if(!J.message&&!J.error)return;let z=J.error instanceof Error?J.error:null;a4({type:"runtime-error",message:J.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",(J)=>{let z=J.reason;a4({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var $6=4000,h3=1e6,m3=1e7,y1=[],e4=0,J6=!1;function j6(J){y1.push(J);while(y1.length>N0("maxRequests"))y1.shift()}function Q6(){return e4+=1,`req_${e4}`}function z6(J){let z={};if(!J)return z;if(J instanceof Headers)J.forEach(($,j)=>{z[j]=$});else if(Array.isArray(J))for(let[$,j]of J)z[$]=j;else Object.assign(z,J);return z}function u3(J){let z={};return J.forEach(($,j)=>{z[j]=$}),z}function p3(J){if(J==null)return null;if(typeof J==="string")return J;if(J instanceof URLSearchParams)return J.toString();if(typeof FormData<"u"&&J instanceof FormData)return`[FormData: ${Array.from(J.keys()).join(", ")}]`;if(typeof Blob<"u"&&J instanceof Blob)return`[Blob ${J.size} bytes]`;if(J instanceof ArrayBuffer)return`[ArrayBuffer ${J.byteLength} bytes]`;return"[binary]"}function d3(J,z){let $="",j="GET",Q={},Z=null;if(typeof J==="string")$=J;else if(J instanceof URL)$=J.toString();else $=J.url,j=J.method||j,Q=z6(J.headers);if(z){if(z.method)j=z.method;if(z.headers)Q={...Q,...z6(z.headers)};if(z.body!==void 0)Z=p3(z.body)}return{method:j.toUpperCase(),url:$,headers:Q,body:Z}}function Z6(J){return!A4(J)}function i3(J,z){if(Z6(z.url)){z.responseSnippet="[body not captured for this origin]";return}let $=J.headers.get("content-type")??"",j=Number(J.headers.get("content-length")??"0"),Q=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test($)){z.responseSnippet=`[binary ${$||"unknown"}${Q}]`;return}if(j>h3){z.responseSnippet=`[response ${$||"text"}${Q} — omitted]`;return}try{J.clone().text().then((Z)=>{z.responseSnippet=i0(Z,N0("maxBodyChars"))}).catch(()=>{})}catch{}}function X6(J,z){if(/[?&]_rsc=/.test(J))return!0;for(let $ of Object.keys(z)){let j=$.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function c3(){if(typeof window>"u"||typeof window.fetch!=="function")return;let J=window.fetch.bind(window);window.fetch=Object.assign(async(z,$)=>{let j=d3(z,$);if(X6(j.url,j.headers))return J(z,$);let Q={id:Q6(),startedAt:new Date().toISOString(),method:j.method,url:D0(j.url),requestHeaders:d0(j.headers),requestBody:i0(j.body,$6),status:null,statusText:null,durationMs:null,via:"fetch"};j6(Q);let Z=performance.now();try{let X=await J(z,$);return Q.status=X.status,Q.statusText=X.statusText,Q.durationMs=Math.round(performance.now()-Z),Q.responseHeaders=d0(u3(X.headers)),i3(X,Q),X}catch(X){throw Q.durationMs=Math.round(performance.now()-Z),Q.error=X instanceof Error?`${X.name}: ${X.message}`:String(X),X}},J)}function l3(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let J=XMLHttpRequest.prototype,z=J.open,$=J.send,j=function(Z,X){let W=typeof X==="string"?X:X.toString();return this.__lwEntry=X6(W,{})?void 0:{id:Q6(),startedAt:"",method:(Z||"GET").toUpperCase(),url:D0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},Q=function(Z){let X=this.__lwEntry;if(X){X.startedAt=new Date().toISOString(),X.requestBody=typeof Z==="string"?i0(Z,$6):Z==null?null:"[non-string body]";let W=performance.now();j6(X),this.addEventListener("loadend",()=>{if(X.status=this.status||null,X.statusText=this.statusText||null,X.durationMs=Math.round(performance.now()-W),Z6(X.url))X.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{X.responseSnippet=i0(this.responseText||"",N0("maxBodyChars"))}catch{}else{let G=this.getResponseHeader("content-type")??this.responseType;X.responseSnippet=`[binary ${G}]`}})}return $.apply(this,arguments)};J.open=j,J.send=Q}function V6(){if(J6)return;J6=!0,c3(),l3()}function T2(){let J=y1.map(($)=>({...$})),z=0;for(let $=J.length-1;$>=0;$-=1){let j=J[$],Q=j?.responseSnippet;if(!j||typeof Q!=="string"||Q.length===0)continue;if(z+Q.length>m3)j.responseSnippet=`[response omitted — report size budget reached (${Q.length.toLocaleString()} chars)]`;else z+=Q.length}return J}var o3=4,W6=3,r3=4000,n3="[data-debug-reporter]",s3=()=>import("@rrweb/record");var s=[],o0=null,g1=!1;function Y6(){if(typeof window>"u"||o0||g1)return;let J=Z1();if(!J)return;g1=!0;let z=()=>void a3(J);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function a3(J){let z;try{z=(await s3()).record}catch($){g1=!1,console.warn("[debug-capture] session replay could not start:",$);return}if(o0)return;try{o0=z({emit:($)=>t3($),checkoutEveryNms:Math.max(1000,J.seconds*1000/2),checkoutEveryNth:r3,maskAllInputs:J.maskInputs,maskTextSelector:J.maskText?"*":J.maskTextSelector,blockSelector:`${J.blockSelector}, ${n3}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...J.canvas?{canvas:J.canvas.fps}:{}},recordCanvas:J.canvas!==null,...J.canvas?{dataURLOptions:{type:"image/webp",quality:J.canvas.quality}}:{},errorHandler:()=>!0})??null}catch($){console.warn("[debug-capture] session replay could not start:",$)}finally{g1=!1}}function t3(J){if(J.type===o3||s.length===0){if(s.push([]),s.length>W6)s=s.slice(-W6)}s[s.length-1].push(J)}function k2(J=Date.now()){let z=Z1();if(!z||!s.length)return null;let $=J-z.seconds*1000,j=s.length-1;while(j>0&&(s[j][0]?.timestamp??J)>$)j-=1;let Q=s.slice(j).flat(),Z=Q[0]?.timestamp,X=Q[Q.length-1]?.timestamp;if(Z===void 0||X===void 0)return null;return{events:Q,startedAt:new Date(Z).toISOString(),endedAt:new Date(X).toISOString(),durationMs:Math.max(0,X-Z)}}function e3(){return o0!==null}function J5(){o0?.(),o0=null,s=[]}var z5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringChat:"จากแชทกับทีมงาน",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},$5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringChat:"From your chat with support",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function c(J){return J==="en"?$5:z5}var j5="lw-debug-toasts",Q5=6000,Z5=`
2
2
  :host { all: initial; }
3
3
  .stack {
4
4
  position: fixed; top: 16px; right: 16px; z-index: 2147483001;
@@ -333,10 +333,10 @@ h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: #1a1
333
333
  @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
334
334
  @keyframes spin { to { transform: rotate(360deg); } }
335
335
  @media (prefers-reduced-motion: reduce) { .card { animation: none; } .icon::after { animation: none; opacity: 0; } .spin { animation: none; } }
336
- `,s1=(J)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${J}</svg>`,u6=s1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),G9=s1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),U9=s1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),D9=s1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),b=null,q0=null,s0=null;function H9(J,z){return J.replace("{key}",z.ticketKey).replace("{title}",z.ticketTitle)}var a0=()=>c(M().locale);function q9(){if(typeof document>"u")return null;if(b?.isConnected)return b.shadowRoot;b=document.createElement(Y9),b.dataset.debugReporter="true",r1(b);let J=b.attachShadow({mode:"open"});return r0(J),document.body.append(b),J}function n1(J,z,$,j){let Q=document.createElement("button");return Q.type="button",Q.className=J,Q.innerHTML=z,Q.dataset.lwRing=$,Q.onclick=j,Q}var D1=(J)=>{let z=document.createElement("span");return z.textContent=J,z.outerHTML};function d6(J,z,$,j,Q){let Z=a0();J.innerHTML="";let X=document.createElement("style");X.textContent=K9;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",Z.ringTitle),W.dataset.lwCallRing=z.id,W.dataset.lwRingMode=j;let G=document.createElement("div");G.className="head";let D=document.createElement("span");D.className="icon",D.innerHTML=u6;let _=document.createElement("div");_.className="words";let F=document.createElement("h2");F.textContent=Z.ringTitle;let N=document.createElement("p");N.className="about",N.textContent=H9(Z.ringAbout,z),N.title=N.textContent,_.append(F,N),G.append(D,_);let x=document.createElement("p");x.className="how",x.textContent=Q??(j==="frame"?Z.ringHint:Z.ringHow);let R=document.createElement("div");R.className="actions";let y=n1("decline",G9+D1(Z.ringDecline),"decline",()=>$.decline());if(W.append(G,x),j==="frame"&&$.answer){if($.voice)W.append(n1("test",U9+D1(Z.ringTest),"test",()=>$.voice?.()));let h=n1("answer",u6+D1(Z.ringAnswer),"answer",()=>$.answer?.());R.append(y,h)}else R.append(y,n1("open",D1(Z.ringOpen),"open",()=>$.open()));W.append(R),J.append(X,W)}function a1(J,z,$="portal"){if(q0===J.id&&b?.isConnected)return;let j=q9();if(!j)return;if(q0=J.id,d6(j,J,z,$),P9(),s0===null)s0=document.title,document.title=`${a0().ringTab} — ${s0}`}function i6(J){let z=b?.shadowRoot;if(!z||q0!==J)return;let $=z.querySelector(".answer");if($)$.innerHTML=D9+D1(a0().ringAnswering),$.disabled=!0;let j=z.querySelector(".decline");if(j)j.disabled=!0}function c6(J,z){let $=b?.isConnected?b.shadowRoot:null;if(!$||q0!==J.id)return a1(J,z,"portal");b.style.display="",d6($,J,z,"portal",a0().ringFallback)}function t1(J){let z=b?.shadowRoot;if(!z)return;a2(),r6();let $=a0(),j=z.querySelector(".how"),Q=z.querySelector(".actions");if(j)if(j.textContent="",J){let Z=document.createElement("a");Z.href=J,Z.target="_blank",Z.rel="noopener",Z.textContent=$.ringBlocked,Z.dataset.lwRing="link",Z.onclick=()=>window.setTimeout(()=>t1(),0),j.append(Z)}else j.textContent=$.ringOpened;if(Q){Q.innerHTML="";let Z=document.createElement("button");Z.type="button",Z.className="close",Z.textContent=$.ringClose,Z.dataset.lwRing="close",Z.onclick=()=>x0(),Q.append(Z)}}function l6(J,z=!0){if(!b?.isConnected||q0!==J)return;let $=b;if(clearTimeout(p6),!z){$.style.display="",$.style.opacity="";return}$.style.transition="opacity 150ms ease-out",$.style.opacity="0",p6=setTimeout(()=>{if($.style.opacity==="0")$.style.display="none"},160)}var p6;function x0(J){if(J&&q0&&J!==q0)return;a2(),r6(),b?.remove(),b=null,q0=null}function o6(){return b?.isConnected?q0:null}function r6(){if(s0===null||typeof document>"u")return;if(document.title.startsWith(a0().ringTab))document.title=s0;s0=null}var C0=null,s2;function P9(){a2();let J=window,z=J.AudioContext??J.webkitAudioContext;if(!z)return;try{let j=C0??new z;C0=j,j.resume?.().catch(()=>{return})}catch{return}let $=()=>{if(!C0||C0.state!=="running")return;let j=C0.currentTime;for(let[Q,Z]of[660,880].entries()){let X=C0.createOscillator(),W=C0.createGain();X.frequency.value=Z,W.gain.setValueAtTime(0.0001,j+Q*0.22),W.gain.exponentialRampToValueAtTime(0.08,j+Q*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,j+Q*0.22+0.2),X.connect(W).connect(C0.destination),X.start(j+Q*0.22),X.stop(j+Q*0.22+0.21)}};$(),s2=setInterval($,2200)}function a2(){clearInterval(s2),s2=void 0}var M9=64,F9=3500,B9=700,N9=450,_9=900,C9=20000,t6={pen:"#ef4444",rect:"#f59e0b",laser:"#ef4444"};var I9=/^[A-Za-z0-9_-]{1,32}$/,O9=/^#[0-9a-fA-F]{6}$/,L9=["pen","rect","laser"],n6=(J)=>J<0?0:J>1?1:J;function s6(J,z){if(!Array.isArray(J)||J.length<z||J.length>64)return null;let $=[];for(let j of J){if(!Array.isArray(j)||j.length!==2)return null;let[Q,Z]=j;if(typeof Q!=="number"||typeof Z!=="number"||!Number.isFinite(Q)||!Number.isFinite(Z))return null;$.push([n6(Q),n6(Z)])}return $}function H1(J){if(!J||typeof J!=="object")return null;let z=J;if(z.op==="clear")return{op:"clear"};if(typeof z.id!=="string"||!I9.test(z.id))return null;if(z.op==="end")return{op:"end",id:z.id};if(z.op==="add"){let $=s6(z.pts,1);return $?{op:"add",id:z.id,pts:$}:null}if(z.op==="begin"){if(!L9.includes(z.kind)||typeof z.color!=="string"||!O9.test(z.color))return null;let $=s6(z.pts,1);return $?{op:"begin",id:z.id,kind:z.kind,color:z.color,pts:$}:null}return null}function t2(J,z){if(J.endedAt!==null)return J.endedAt;return z-J.lastAt>20000?J.lastAt:null}function e2(J,z,$){if(z===null)return 1;let j=$-z;if(J==="laser")return j>=900?0:1-j/900;if(j<=3500)return 1;return Math.max(0,1-(j-3500)/700)}class e1{marks=new Map;apply(J,z=Date.now()){if(J.op==="clear"){this.marks.clear();return}if(J.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete(J.id),this.marks.set(J.id,{kind:J.kind,color:J.color,pts:J.pts.map(([j,Q])=>({x:j,y:Q,t:z})),endedAt:null,lastAt:z});return}let $=this.marks.get(J.id);if(!$||t2($,z)!==null)return;if(J.op==="end"){$.endedAt=z;return}if($.lastAt=z,$.kind==="rect"){let[j,Q]=J.pts[J.pts.length-1];$.pts=[$.pts[0],{x:j,y:Q,t:z}];return}for(let[j,Q]of J.pts)$.pts.push({x:j,y:Q,t:z});if($.pts.length>4000)$.pts.splice(0,$.pts.length-4000)}alive(J=Date.now()){for(let[z,$]of this.marks)if(e2($.kind,t2($,J),J)<=0)this.marks.delete(z);return this.marks.size>0}get size(){return this.marks.size}draw(J,z,$,j=Date.now()){J.clearRect(0,0,z,$);let Q=Math.max(1,Math.min(z,$));for(let Z of this.marks.values()){let X=e2(Z.kind,t2(Z,j),j);if(X<=0||!Z.pts.length)continue;if(J.save(),J.lineCap="round",J.lineJoin="round",Z.kind==="pen")R9(J,Z,z,$,Math.max(3,Q*0.0045),X);else if(Z.kind==="rect")A9(J,Z,z,$,Math.max(2.5,Q*0.003),X);else T9(J,Z,z,$,Math.max(6,Q*0.008),X,j);J.restore()}}}function S9(J,z,$,j){if(J.beginPath(),J.moveTo(z[0].x*$,z[0].y*j),z.length===1){J.lineTo(z[0].x*$+0.01,z[0].y*j);return}for(let Z=1;Z<z.length-1;Z++){let X=z[Z],W=z[Z+1];J.quadraticCurveTo(X.x*$,X.y*j,(X.x+W.x)/2*$,(X.y+W.y)/2*j)}let Q=z[z.length-1];J.lineTo(Q.x*$,Q.y*j)}function R9(J,z,$,j,Q,Z){J.globalAlpha=Z,S9(J,z.pts,$,j),J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.stroke(),J.strokeStyle=z.color,J.lineWidth=Q,J.stroke()}function A9(J,z,$,j,Q,Z){let X=z.pts[0],W=z.pts[z.pts.length-1],G=Math.min(X.x,W.x)*$,D=Math.min(X.y,W.y)*j,_=Math.abs(W.x-X.x)*$,F=Math.abs(W.y-X.y)*j;J.globalAlpha=Z,J.fillStyle=z.color,J.globalAlpha=Z*0.14,J.fillRect(G,D,_,F),J.globalAlpha=Z,J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.strokeRect(G,D,_,F),J.strokeStyle=z.color,J.lineWidth=Q,J.strokeRect(G,D,_,F)}function T9(J,z,$,j,Q,Z,X){let W=z.pts.filter((D)=>X-D.t<=450);for(let D=1;D<W.length;D++){let _=W[D-1],F=W[D];J.globalAlpha=Z*Math.max(0,1-(X-F.t)/450)*0.7,J.strokeStyle=z.color,J.lineWidth=Q*0.9,J.beginPath(),J.moveTo(_.x*$,_.y*j),J.lineTo(F.x*$,F.y*j),J.stroke()}let G=z.pts[z.pts.length-1];J.globalAlpha=Z,J.shadowColor=z.color,J.shadowBlur=Q*2,J.fillStyle=z.color,J.beginPath(),J.arc(G.x*$,G.y*j,Q,0,Math.PI*2),J.fill(),J.shadowBlur=0,J.strokeStyle="rgba(255,255,255,0.95)",J.lineWidth=2,J.stroke()}function e6(J,z,$,j=typeof window>"u"?1:window.devicePixelRatio||1){let Q=Math.max(1,Math.round(z*j)),Z=Math.max(1,Math.round($*j));if(J.width!==Q)J.width=Q;if(J.height!==Z)J.height=Z;let X=J.getContext("2d");return X?.setTransform(j,0,0,j,0,0),X}class J2{canvas;scene;box;frame=0;constructor(J,z,$){this.canvas=J;this.scene=z;this.box=$}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let J=()=>{this.frame=0;let{w:z,h:$}=this.box(),j=e6(this.canvas,z,$),Q=Date.now(),Z=this.scene.alive(Q);if(j)this.scene.draw(j,z,$,Q);if(Z)this.frame=requestAnimationFrame(J)};this.frame=requestAnimationFrame(J)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var J8=33,J4=5000,a6=0.0012,k9=0,x9=()=>`${Date.now().toString(36)}${(k9++).toString(36)}${Math.random().toString(36).slice(2,6)}`.slice(0,32);class z8{send;scene;onChange;id=null;kind=null;pending=[];last=null;lastSent=0;timer;keep;constructor(J,z,$=()=>{return}){this.send=J;this.scene=z;this.onChange=$}get drawing(){return this.id?this.kind:null}begin(J,z){this.end(),this.id=x9(),this.kind=J,this.last=z,this.lastSent=Date.now();let $={op:"begin",id:this.id,kind:J,color:t6[J],pts:[z]};this.scene.apply($),this.send($),this.keep=setInterval(()=>this.stillHere(),J4),this.onChange()}stillHere(){if(!this.id||!this.last||Date.now()-this.lastSent<J4)return;this.flush();let J={op:"add",id:this.id,pts:[this.last]};this.scene.apply(J),this.send(J),this.lastSent=Date.now()}move(J){if(!this.id||!this.kind)return;if(Date.now()-this.lastSent>1e4)return this.begin(this.kind,J);if(this.last&&Math.abs(J[0]-this.last[0])<a6&&Math.abs(J[1]-this.last[1])<a6)return;if(this.last=J,this.scene.apply({op:"add",id:this.id,pts:[J]}),this.onChange(),this.kind==="rect")this.pending=[J];else this.pending.push(J);if(this.pending.length>=64)this.flush();else if(!this.timer)this.timer=setTimeout(()=>this.flush(),Math.max(0,J8-(Date.now()-this.lastSent)))}flush(){if(clearTimeout(this.timer),this.timer=void 0,!this.id||!this.pending.length)return;this.send({op:"add",id:this.id,pts:this.pending}),this.pending=[],this.lastSent=Date.now()}end(){if(!this.id)return;clearInterval(this.keep),this.keep=void 0,this.flush();let J={op:"end",id:this.id};this.scene.apply(J),this.send(J),this.id=null,this.kind=null,this.last=null,this.onChange()}clear(){this.end();let J={op:"clear"};this.scene.apply(J),this.send(J),this.onChange()}}var E9="lw-call-ink",I0=null,z2=null,q1=null;function f9(){if(I0?.isConnected&&q1)return;I0=document.createElement(E9),I0.dataset.debugReporter="true";let J=I0.attachShadow({mode:"open"}),z=document.createElement("style");z.textContent=`:host { all: initial; }
336
+ `,s1=(J)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${J}</svg>`,u6=s1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),G9=s1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),U9=s1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),D9=s1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),b=null,q0=null,s0=null;function H9(J,z,$){if(z.chatId)return $??z.ticketTitle;return J.replace("{key}",z.ticketKey).replace("{title}",z.ticketTitle)}var a0=()=>c(M().locale);function q9(){if(typeof document>"u")return null;if(b?.isConnected)return b.shadowRoot;b=document.createElement(Y9),b.dataset.debugReporter="true",r1(b);let J=b.attachShadow({mode:"open"});return r0(J),document.body.append(b),J}function n1(J,z,$,j){let Q=document.createElement("button");return Q.type="button",Q.className=J,Q.innerHTML=z,Q.dataset.lwRing=$,Q.onclick=j,Q}var D1=(J)=>{let z=document.createElement("span");return z.textContent=J,z.outerHTML};function d6(J,z,$,j,Q){let Z=a0();J.innerHTML="";let X=document.createElement("style");X.textContent=K9;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",Z.ringTitle),W.dataset.lwCallRing=z.id,W.dataset.lwRingMode=j;let G=document.createElement("div");G.className="head";let D=document.createElement("span");D.className="icon",D.innerHTML=u6;let _=document.createElement("div");_.className="words";let F=document.createElement("h2");F.textContent=Z.ringTitle;let N=document.createElement("p");N.className="about",N.textContent=H9(Z.ringAbout,z,Z.ringChat),N.title=N.textContent,_.append(F,N),G.append(D,_);let x=document.createElement("p");x.className="how",x.textContent=Q??(j==="frame"?Z.ringHint:Z.ringHow);let R=document.createElement("div");R.className="actions";let y=n1("decline",G9+D1(Z.ringDecline),"decline",()=>$.decline());if(W.append(G,x),j==="frame"&&$.answer){if($.voice)W.append(n1("test",U9+D1(Z.ringTest),"test",()=>$.voice?.()));let h=n1("answer",u6+D1(Z.ringAnswer),"answer",()=>$.answer?.());R.append(y,h)}else R.append(y,n1("open",D1(Z.ringOpen),"open",()=>$.open()));W.append(R),J.append(X,W)}function a1(J,z,$="portal"){if(q0===J.id&&b?.isConnected)return;let j=q9();if(!j)return;if(q0=J.id,d6(j,J,z,$),P9(),s0===null)s0=document.title,document.title=`${a0().ringTab} — ${s0}`}function i6(J){let z=b?.shadowRoot;if(!z||q0!==J)return;let $=z.querySelector(".answer");if($)$.innerHTML=D9+D1(a0().ringAnswering),$.disabled=!0;let j=z.querySelector(".decline");if(j)j.disabled=!0}function c6(J,z){let $=b?.isConnected?b.shadowRoot:null;if(!$||q0!==J.id)return a1(J,z,"portal");b.style.display="",d6($,J,z,"portal",a0().ringFallback)}function t1(J){let z=b?.shadowRoot;if(!z)return;a2(),r6();let $=a0(),j=z.querySelector(".how"),Q=z.querySelector(".actions");if(j)if(j.textContent="",J){let Z=document.createElement("a");Z.href=J,Z.target="_blank",Z.rel="noopener",Z.textContent=$.ringBlocked,Z.dataset.lwRing="link",Z.onclick=()=>window.setTimeout(()=>t1(),0),j.append(Z)}else j.textContent=$.ringOpened;if(Q){Q.innerHTML="";let Z=document.createElement("button");Z.type="button",Z.className="close",Z.textContent=$.ringClose,Z.dataset.lwRing="close",Z.onclick=()=>x0(),Q.append(Z)}}function l6(J,z=!0){if(!b?.isConnected||q0!==J)return;let $=b;if(clearTimeout(p6),!z){$.style.display="",$.style.opacity="";return}$.style.transition="opacity 150ms ease-out",$.style.opacity="0",p6=setTimeout(()=>{if($.style.opacity==="0")$.style.display="none"},160)}var p6;function x0(J){if(J&&q0&&J!==q0)return;a2(),r6(),b?.remove(),b=null,q0=null}function o6(){return b?.isConnected?q0:null}function r6(){if(s0===null||typeof document>"u")return;if(document.title.startsWith(a0().ringTab))document.title=s0;s0=null}var C0=null,s2;function P9(){a2();let J=window,z=J.AudioContext??J.webkitAudioContext;if(!z)return;try{let j=C0??new z;C0=j,j.resume?.().catch(()=>{return})}catch{return}let $=()=>{if(!C0||C0.state!=="running")return;let j=C0.currentTime;for(let[Q,Z]of[660,880].entries()){let X=C0.createOscillator(),W=C0.createGain();X.frequency.value=Z,W.gain.setValueAtTime(0.0001,j+Q*0.22),W.gain.exponentialRampToValueAtTime(0.08,j+Q*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,j+Q*0.22+0.2),X.connect(W).connect(C0.destination),X.start(j+Q*0.22),X.stop(j+Q*0.22+0.21)}};$(),s2=setInterval($,2200)}function a2(){clearInterval(s2),s2=void 0}var M9=64,F9=3500,B9=700,N9=450,_9=900,C9=20000,t6={pen:"#ef4444",rect:"#f59e0b",laser:"#ef4444"};var I9=/^[A-Za-z0-9_-]{1,32}$/,O9=/^#[0-9a-fA-F]{6}$/,L9=["pen","rect","laser"],n6=(J)=>J<0?0:J>1?1:J;function s6(J,z){if(!Array.isArray(J)||J.length<z||J.length>64)return null;let $=[];for(let j of J){if(!Array.isArray(j)||j.length!==2)return null;let[Q,Z]=j;if(typeof Q!=="number"||typeof Z!=="number"||!Number.isFinite(Q)||!Number.isFinite(Z))return null;$.push([n6(Q),n6(Z)])}return $}function H1(J){if(!J||typeof J!=="object")return null;let z=J;if(z.op==="clear")return{op:"clear"};if(typeof z.id!=="string"||!I9.test(z.id))return null;if(z.op==="end")return{op:"end",id:z.id};if(z.op==="add"){let $=s6(z.pts,1);return $?{op:"add",id:z.id,pts:$}:null}if(z.op==="begin"){if(!L9.includes(z.kind)||typeof z.color!=="string"||!O9.test(z.color))return null;let $=s6(z.pts,1);return $?{op:"begin",id:z.id,kind:z.kind,color:z.color,pts:$}:null}return null}function t2(J,z){if(J.endedAt!==null)return J.endedAt;return z-J.lastAt>20000?J.lastAt:null}function e2(J,z,$){if(z===null)return 1;let j=$-z;if(J==="laser")return j>=900?0:1-j/900;if(j<=3500)return 1;return Math.max(0,1-(j-3500)/700)}class e1{marks=new Map;apply(J,z=Date.now()){if(J.op==="clear"){this.marks.clear();return}if(J.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete(J.id),this.marks.set(J.id,{kind:J.kind,color:J.color,pts:J.pts.map(([j,Q])=>({x:j,y:Q,t:z})),endedAt:null,lastAt:z});return}let $=this.marks.get(J.id);if(!$||t2($,z)!==null)return;if(J.op==="end"){$.endedAt=z;return}if($.lastAt=z,$.kind==="rect"){let[j,Q]=J.pts[J.pts.length-1];$.pts=[$.pts[0],{x:j,y:Q,t:z}];return}for(let[j,Q]of J.pts)$.pts.push({x:j,y:Q,t:z});if($.pts.length>4000)$.pts.splice(0,$.pts.length-4000)}alive(J=Date.now()){for(let[z,$]of this.marks)if(e2($.kind,t2($,J),J)<=0)this.marks.delete(z);return this.marks.size>0}get size(){return this.marks.size}draw(J,z,$,j=Date.now()){J.clearRect(0,0,z,$);let Q=Math.max(1,Math.min(z,$));for(let Z of this.marks.values()){let X=e2(Z.kind,t2(Z,j),j);if(X<=0||!Z.pts.length)continue;if(J.save(),J.lineCap="round",J.lineJoin="round",Z.kind==="pen")R9(J,Z,z,$,Math.max(3,Q*0.0045),X);else if(Z.kind==="rect")A9(J,Z,z,$,Math.max(2.5,Q*0.003),X);else T9(J,Z,z,$,Math.max(6,Q*0.008),X,j);J.restore()}}}function S9(J,z,$,j){if(J.beginPath(),J.moveTo(z[0].x*$,z[0].y*j),z.length===1){J.lineTo(z[0].x*$+0.01,z[0].y*j);return}for(let Z=1;Z<z.length-1;Z++){let X=z[Z],W=z[Z+1];J.quadraticCurveTo(X.x*$,X.y*j,(X.x+W.x)/2*$,(X.y+W.y)/2*j)}let Q=z[z.length-1];J.lineTo(Q.x*$,Q.y*j)}function R9(J,z,$,j,Q,Z){J.globalAlpha=Z,S9(J,z.pts,$,j),J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.stroke(),J.strokeStyle=z.color,J.lineWidth=Q,J.stroke()}function A9(J,z,$,j,Q,Z){let X=z.pts[0],W=z.pts[z.pts.length-1],G=Math.min(X.x,W.x)*$,D=Math.min(X.y,W.y)*j,_=Math.abs(W.x-X.x)*$,F=Math.abs(W.y-X.y)*j;J.globalAlpha=Z,J.fillStyle=z.color,J.globalAlpha=Z*0.14,J.fillRect(G,D,_,F),J.globalAlpha=Z,J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=Q+3,J.strokeRect(G,D,_,F),J.strokeStyle=z.color,J.lineWidth=Q,J.strokeRect(G,D,_,F)}function T9(J,z,$,j,Q,Z,X){let W=z.pts.filter((D)=>X-D.t<=450);for(let D=1;D<W.length;D++){let _=W[D-1],F=W[D];J.globalAlpha=Z*Math.max(0,1-(X-F.t)/450)*0.7,J.strokeStyle=z.color,J.lineWidth=Q*0.9,J.beginPath(),J.moveTo(_.x*$,_.y*j),J.lineTo(F.x*$,F.y*j),J.stroke()}let G=z.pts[z.pts.length-1];J.globalAlpha=Z,J.shadowColor=z.color,J.shadowBlur=Q*2,J.fillStyle=z.color,J.beginPath(),J.arc(G.x*$,G.y*j,Q,0,Math.PI*2),J.fill(),J.shadowBlur=0,J.strokeStyle="rgba(255,255,255,0.95)",J.lineWidth=2,J.stroke()}function e6(J,z,$,j=typeof window>"u"?1:window.devicePixelRatio||1){let Q=Math.max(1,Math.round(z*j)),Z=Math.max(1,Math.round($*j));if(J.width!==Q)J.width=Q;if(J.height!==Z)J.height=Z;let X=J.getContext("2d");return X?.setTransform(j,0,0,j,0,0),X}class J2{canvas;scene;box;frame=0;constructor(J,z,$){this.canvas=J;this.scene=z;this.box=$}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let J=()=>{this.frame=0;let{w:z,h:$}=this.box(),j=e6(this.canvas,z,$),Q=Date.now(),Z=this.scene.alive(Q);if(j)this.scene.draw(j,z,$,Q);if(Z)this.frame=requestAnimationFrame(J)};this.frame=requestAnimationFrame(J)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var J8=33,J4=5000,a6=0.0012,k9=0,x9=()=>`${Date.now().toString(36)}${(k9++).toString(36)}${Math.random().toString(36).slice(2,6)}`.slice(0,32);class z8{send;scene;onChange;id=null;kind=null;pending=[];last=null;lastSent=0;timer;keep;constructor(J,z,$=()=>{return}){this.send=J;this.scene=z;this.onChange=$}get drawing(){return this.id?this.kind:null}begin(J,z){this.end(),this.id=x9(),this.kind=J,this.last=z,this.lastSent=Date.now();let $={op:"begin",id:this.id,kind:J,color:t6[J],pts:[z]};this.scene.apply($),this.send($),this.keep=setInterval(()=>this.stillHere(),J4),this.onChange()}stillHere(){if(!this.id||!this.last||Date.now()-this.lastSent<J4)return;this.flush();let J={op:"add",id:this.id,pts:[this.last]};this.scene.apply(J),this.send(J),this.lastSent=Date.now()}move(J){if(!this.id||!this.kind)return;if(Date.now()-this.lastSent>1e4)return this.begin(this.kind,J);if(this.last&&Math.abs(J[0]-this.last[0])<a6&&Math.abs(J[1]-this.last[1])<a6)return;if(this.last=J,this.scene.apply({op:"add",id:this.id,pts:[J]}),this.onChange(),this.kind==="rect")this.pending=[J];else this.pending.push(J);if(this.pending.length>=64)this.flush();else if(!this.timer)this.timer=setTimeout(()=>this.flush(),Math.max(0,J8-(Date.now()-this.lastSent)))}flush(){if(clearTimeout(this.timer),this.timer=void 0,!this.id||!this.pending.length)return;this.send({op:"add",id:this.id,pts:this.pending}),this.pending=[],this.lastSent=Date.now()}end(){if(!this.id)return;clearInterval(this.keep),this.keep=void 0,this.flush();let J={op:"end",id:this.id};this.scene.apply(J),this.send(J),this.id=null,this.kind=null,this.last=null,this.onChange()}clear(){this.end();let J={op:"clear"};this.scene.apply(J),this.send(J),this.onChange()}}var E9="lw-call-ink",I0=null,z2=null,q1=null;function f9(){if(I0?.isConnected&&q1)return;I0=document.createElement(E9),I0.dataset.debugReporter="true";let J=I0.attachShadow({mode:"open"}),z=document.createElement("style");z.textContent=`:host { all: initial; }
337
337
  canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483002; }`;let $=document.createElement("canvas");$.setAttribute("aria-hidden","true"),$.dataset.lwCallInk="",J.append(z,$),document.body.append(I0),z2=new e1,q1=new J2($,z2,()=>({w:window.innerWidth,h:window.innerHeight}))}function $2(J){if(typeof document>"u")return;if(J.op==="clear"&&!I0)return;f9(),z2.apply(J),q1.kick()}function j2(){q1?.stop(),I0?.remove(),I0=null,z2=null,q1=null}var w9="lw-call-frame",y9="lw-call",a=16,Z4=368,K0=null,w=null,E0=null,X2="",M1=null,F1="card",X4={width:Z4,height:0},V4,B1=!1,W4=null,e0={answer:!1,voice:!1},O0=null,o=null,z4="lw-call-frame-place";function $8(J,z,$,j){let Q=new URL("embed/call",J.endsWith("/")?J:`${J}/`);if(Q.searchParams.set("realm",z),$)Q.searchParams.set("token",$);else Q.searchParams.set("hand","1");return Q.searchParams.set("call",j),Q.toString()}function t0(J){w?.contentWindow?.postMessage({source:"lw-call-host",...J},X2)}function j8(J){if(E0!==J)return;if(e0.answer=!0,B1)t0({type:"answer"})}function Q8(J){if(E0!==J)return;if(e0.voice=!0,B1)t0({type:"voice"})}function Z8(J,z,$){return{x:Math.min(Math.max(J.x,a/2),Math.max(a/2,$.w-z.w-a/2)),y:Math.min(Math.max(J.y,a/2),Math.max(a/2,$.h-z.h-a/2))}}function g9(J,z){if(J.origin!==z.origin||J.source!==z.window)return null;let $=J.data;return $&&typeof $==="object"&&$.source===y9&&typeof $.type==="string"?$:null}function z1(){return K0?.isConnected?E0:null}function X8(J,z,$,j=15000,Q=null){if(typeof document>"u")return;if(E0===z&&K0?.isConnected)return;$1(),E0=z,M1=$,B1=!1,W4=Q,e0={answer:!1,voice:!1},F1="card",X4={width:Z4,height:0},X2=new URL(J).origin;try{O0=JSON.parse(sessionStorage.getItem(z4)??"null")}catch{O0=null}K0=document.createElement(w9),K0.dataset.debugReporter="true";let Z=K0.attachShadow({mode:"open"}),X=document.createElement("style");X.textContent=`:host { all: initial; }
338
338
  iframe { position: fixed; z-index: 2147483003; border: 0; background: transparent; color-scheme: normal; visibility: hidden; }
339
- iframe.on { visibility: visible; }`,w=document.createElement("iframe"),w.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",w.title="สายจากทีมงาน",w.dataset.lwCallFrame=z,w.setAttribute("allowtransparency","true"),w.src=J,Z.append(X,w),document.body.append(K0),J1(),window.addEventListener("message",V8),window.addEventListener("resize",J1),Y4(`lw-call:${z}`),V4=setTimeout(()=>{if(!B1)$4("timeout")},j)}function $1(){if(K0)Y4(j4?.handle??null,j4?.readableBy);j2(),clearTimeout(V4),window.removeEventListener("message",V8),window.removeEventListener("resize",J1),Q2(!1),K0?.remove(),K0=null,w=null,E0=null,M1=null,o=null,W4=null,e0={answer:!1,voice:!1}}function $4(J){let z=M1;$1(),z?.failed(J)}function V8(J){if(!w)return;let z=g9(J,{origin:X2,window:w.contentWindow});if(!z)return;switch(z.type){case"hello":W4?.then(($)=>{if(!w||E0===null)return;if($)t0({type:"token",token:$});else $4("no_token")});return;case"ready":if(B1=!0,clearTimeout(V4),w.classList.add("on"),M1?.ready(),e0.answer)t0({type:"answer"});if(e0.voice)t0({type:"voice"});return;case"size":if(typeof z.width==="number"&&typeof z.height==="number")X4={width:z.width,height:z.height};if(z.layout==="card"||z.layout==="full"){if(z.layout==="full"&&F1==="card")v9();F1=z.layout}return J1();case"drag":return Q4(z);case"home":return O0=null,Y8(),J1();case"done":{let $=M1;$1(),$?.done();return}case"failed":return $4(z.reason??"failed");case"ink":{let $=H1(z.op);if($)$2($);return}}}function Y4(J,z=X2){let $=typeof navigator>"u"?void 0:navigator.mediaDevices;try{$?.setCaptureHandleConfig?.(J&&z?{handle:J,exposeOrigin:!1,permittedOrigins:[z]}:{})}catch{}}var j4=null;function W8(J,z){if(j4={handle:J,readableBy:z},!K0?.isConnected)Y4(J,z)}function Q4(J){if(!w||F1!=="card"||typeof J.x!=="number"||typeof J.y!=="number")return;if(J.phase==="start"){let z=w.getBoundingClientRect();o={sx:J.x,sy:J.y,x:z.left,y:z.top,lx:J.x,ly:J.y},Q2(!0);return}if(!o)return;if(o.lx=J.x,o.ly=J.y,O0=Z8({x:o.x+(J.x-o.sx),y:o.y+(J.y-o.sy)},K8(),Z2()),J1(),J.phase==="end")o=null,Q2(!1),Y8()}var P1=null;function Q2(J){if(P1){for(let z of["pointermove","pointerup","pointercancel"])window.removeEventListener(z,P1,!0);P1=null}if(!J)return;P1=(z)=>{if(!o)return Q2(!1);if(z.type==="pointermove"&&z.buttons!==0)return Q4({type:"drag",phase:"move",x:z.screenX,y:z.screenY});let $=z.type==="pointerup";Q4({type:"drag",phase:"end",x:$?z.screenX:o.lx,y:$?z.screenY:o.ly})};for(let z of["pointermove","pointerup","pointercancel"])window.addEventListener(z,P1,!0)}function v9(){if(!w?.contentWindow)return;let J=w.getBoundingClientRect();t0({type:"corner",x:Math.round(J.left),y:Math.round(J.top),width:Math.round(J.width)})}function Y8(){try{if(O0)sessionStorage.setItem(z4,JSON.stringify(O0));else sessionStorage.removeItem(z4)}catch{}}var Z2=()=>({w:window.innerWidth,h:window.innerHeight});function K8(){let J=Z2();return{w:Math.min(Z4,J.w-a),h:Math.min(X4.height||0,J.h-a)}}function J1(){if(!w)return;let J=w.style;if(F1==="full"){Object.assign(J,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let z=K8(),$=Z2().w<480;if(J.width=$?`calc(100vw - ${a}px)`:`${z.w}px`,J.height=`${z.h}px`,O0&&!$){let j=Z8(O0,z,Z2());Object.assign(J,{left:`${j.x}px`,top:`${j.y}px`,right:"",bottom:""})}else Object.assign(J,{left:$?`${a/2}px`:"",top:"",right:$?"":`${a/2}px`,bottom:`calc(${a/2}px + var(--lw-chat-lift, 0px))`})}var V2=[2000,5000,15000,30000,60000],G8=new Set(["ringing","active"]),b9=20000,K4=!1,f0=!1,U8=0,h9=5,_1=null,F8=0,W2,G4,U4,B8=(J)=>J.endsWith("/")?J:`${J}/`;function m9(J,z){let $=new URL("api/presence/ws",B8(J));return $.protocol=$.protocol==="https:"?"wss:":"ws:",$.searchParams.set("t",z),$.toString()}function u9(J){return`/me/tickets/${J.ticketId}?call=${J.id}`}function p9(J){return J.status==="ringing"&&(J.side==="reporter"||J.side===void 0||J.side===null)}var D4=new Set;function N8(J){return D4.add(J),()=>D4.delete(J)}var D8=()=>M().ring!==!1;async function w0(){let J=M().identity;if(!J)return null;try{return await J()??null}catch{return null}}async function M4(J,z){let $=M();return fetch(new URL(J,B8($.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":$.realmKey,authorization:`Bearer ${z}`},body:"{}"})}function K2(){if(K4||typeof window>"u"||typeof WebSocket>"u")return;let J=M();if(!J.identity||J.ring===!1&&!J.chat)return;K4=!0,f0=!1,c9(J.host);try{W8(`lw-tab:${C8()}`,new URL(J.host).origin)}catch{}_8()}function d9(){f0=!0,K4=!1,clearTimeout(G4),clearInterval(W2),clearTimeout(U4);try{_1?.close(1000,"bye")}catch{}_1=null,x0(),$1()}function N1(J=!1){if(f0)return;let z=J?V2[V2.length-1]:V2[Math.min(F8++,V2.length-1)];clearTimeout(G4),G4=setTimeout(()=>void _8(),z)}async function _8(){if(f0)return;let J=await w0();if(!J){if(++U8>=h9){f0=!0;return}return N1(!0)}U8=0;let z;try{z=await M4(M().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",J)}catch{return N1()}if(z.status===401||z.status===404||z.status===403){f0=!0;return}if(!z.ok)return N1(z.status===429);let $;try{$=await z.json()}catch{return N1()}if(!$.ticket){f0=!0;return}if($.calls&&$.call&&D8())M8($.call);let j=new WebSocket(m9(M().host,$.ticket));_1=j,j.onopen=()=>{F8=0,j.send(JSON.stringify({type:"tab",id:C8()})),clearInterval(W2),W2=setInterval(()=>{if(j.readyState===WebSocket.OPEN)j.send(JSON.stringify({type:"ping"}))},b9)},j.onmessage=(Q)=>{try{let Z=JSON.parse(String(Q.data));if(Z.type==="chat-changed"||Z.type==="ticket-changed"||Z.type==="chat-seen"){for(let X of D4)X(Z);return}if(Z.type==="call-state"&&Z.call&&typeof Z.call==="object"){if(D8())M8(Z.call)}else if(Z.type==="call-ink"&&typeof Z.call==="string"){let X=H1(Z.op);if(X)P4=Z.call,$2(X)}}catch{}},j.onclose=()=>{if(clearInterval(W2),_1===j)_1=null;N1()}}var H4="lw-call-framed";function i9(){try{return sessionStorage.getItem(H4)}catch{return null}}function Y2(J){try{if(J)sessionStorage.setItem(H4,J);else sessionStorage.removeItem(H4)}catch{}}var H8=!1;function c9(J){if(H8||typeof document>"u")return;H8=!0;try{let z=new URL(J).origin;for(let $ of["dns-prefetch","preconnect"]){let j=document.createElement("link");if(j.rel=$,j.href=z,$==="preconnect")j.crossOrigin="anonymous";j.dataset.debugReporter="true",document.head.append(j)}}catch{}}function q8(J){let z=M();if(z.callFrame===!1||z1()===J.id)return;Y2(J.id),X8($8(z.host,z.realmKey,null,J.id),J.id,{ready:()=>l6(J.id),done:()=>{Y2(null),x0(J.id)},failed:()=>{Y2(null),c6(J,q4(J))}},15000,w0())}var q4=(J)=>({open:()=>l9(J),decline:()=>void o9(J)}),L0=null;function C8(){if(L0)return L0;try{L0=sessionStorage.getItem(P8)}catch{}if(!L0||!/^[A-Za-z0-9_-]{8,40}$/.test(L0)){let J=new Uint8Array(12);crypto.getRandomValues(J),L0=Array.from(J,(z)=>z.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(P8,L0)}catch{}}return L0}var P8="lw-tab-id",P4=null;function M8(J){if(!G8.has(J.status)&&P4===J.id&&z1()!==J.id)P4=null,j2();if(!p9(J)){if(x0(J.id),J.status==="active"&&i9()===J.id&&!z1())q8(J);if(!G8.has(J.status)&&z1()===J.id)setTimeout(()=>{if(z1()===J.id)$1(),Y2(null)},12000);return}if(M().callFrame===!1)a1(J,q4(J),"portal");else a1(J,{...q4(J),answer:()=>{i6(J.id),j8(J.id)},voice:()=>Q8(J.id)},"frame"),q8(J);clearTimeout(U4);let z=new Date(J.ringUntil).getTime()-Date.now();U4=setTimeout(()=>{if(o6()===J.id)x0(J.id)},Math.max(5000,z+5000))}function l9(J){let z=window.open("about:blank","_blank");(async()=>{let $=await w0();if($)M4(`ingest/calls/${J.id}/coming`,$).catch(()=>{return});let j;try{j=await m6(u9(J))}catch{z?.close();return}if(z&&!z.closed){z.location.href=j;try{z.opener=null}catch{}t1()}else t1(j)})()}async function o9(J){x0(J.id);let z=await w0();if(z)await M4(`ingest/calls/${J.id}/decline`,z).catch(()=>{return})}var r9="lw-support-chat",n9="lw-support-frame",s9="lw-support-host",e=56,g0=12,a9='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',t9=`
339
+ iframe.on { visibility: visible; }`,w=document.createElement("iframe"),w.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",w.title="สายจากทีมงาน",w.dataset.lwCallFrame=z,w.setAttribute("allowtransparency","true"),w.src=J,Z.append(X,w),document.body.append(K0),J1(),window.addEventListener("message",V8),window.addEventListener("resize",J1),Y4(`lw-call:${z}`),V4=setTimeout(()=>{if(!B1)$4("timeout")},j)}function $1(){if(K0)Y4(j4?.handle??null,j4?.readableBy);j2(),clearTimeout(V4),window.removeEventListener("message",V8),window.removeEventListener("resize",J1),Q2(!1),K0?.remove(),K0=null,w=null,E0=null,M1=null,o=null,W4=null,e0={answer:!1,voice:!1}}function $4(J){let z=M1;$1(),z?.failed(J)}function V8(J){if(!w)return;let z=g9(J,{origin:X2,window:w.contentWindow});if(!z)return;switch(z.type){case"hello":W4?.then(($)=>{if(!w||E0===null)return;if($)t0({type:"token",token:$});else $4("no_token")});return;case"ready":if(B1=!0,clearTimeout(V4),w.classList.add("on"),M1?.ready(),e0.answer)t0({type:"answer"});if(e0.voice)t0({type:"voice"});return;case"size":if(typeof z.width==="number"&&typeof z.height==="number")X4={width:z.width,height:z.height};if(z.layout==="card"||z.layout==="full"){if(z.layout==="full"&&F1==="card")v9();F1=z.layout}return J1();case"drag":return Q4(z);case"home":return O0=null,Y8(),J1();case"done":{let $=M1;$1(),$?.done();return}case"failed":return $4(z.reason??"failed");case"ink":{let $=H1(z.op);if($)$2($);return}}}function Y4(J,z=X2){let $=typeof navigator>"u"?void 0:navigator.mediaDevices;try{$?.setCaptureHandleConfig?.(J&&z?{handle:J,exposeOrigin:!1,permittedOrigins:[z]}:{})}catch{}}var j4=null;function W8(J,z){if(j4={handle:J,readableBy:z},!K0?.isConnected)Y4(J,z)}function Q4(J){if(!w||F1!=="card"||typeof J.x!=="number"||typeof J.y!=="number")return;if(J.phase==="start"){let z=w.getBoundingClientRect();o={sx:J.x,sy:J.y,x:z.left,y:z.top,lx:J.x,ly:J.y},Q2(!0);return}if(!o)return;if(o.lx=J.x,o.ly=J.y,O0=Z8({x:o.x+(J.x-o.sx),y:o.y+(J.y-o.sy)},K8(),Z2()),J1(),J.phase==="end")o=null,Q2(!1),Y8()}var P1=null;function Q2(J){if(P1){for(let z of["pointermove","pointerup","pointercancel"])window.removeEventListener(z,P1,!0);P1=null}if(!J)return;P1=(z)=>{if(!o)return Q2(!1);if(z.type==="pointermove"&&z.buttons!==0)return Q4({type:"drag",phase:"move",x:z.screenX,y:z.screenY});let $=z.type==="pointerup";Q4({type:"drag",phase:"end",x:$?z.screenX:o.lx,y:$?z.screenY:o.ly})};for(let z of["pointermove","pointerup","pointercancel"])window.addEventListener(z,P1,!0)}function v9(){if(!w?.contentWindow)return;let J=w.getBoundingClientRect();t0({type:"corner",x:Math.round(J.left),y:Math.round(J.top),width:Math.round(J.width)})}function Y8(){try{if(O0)sessionStorage.setItem(z4,JSON.stringify(O0));else sessionStorage.removeItem(z4)}catch{}}var Z2=()=>({w:window.innerWidth,h:window.innerHeight});function K8(){let J=Z2();return{w:Math.min(Z4,J.w-a),h:Math.min(X4.height||0,J.h-a)}}function J1(){if(!w)return;let J=w.style;if(F1==="full"){Object.assign(J,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let z=K8(),$=Z2().w<480;if(J.width=$?`calc(100vw - ${a}px)`:`${z.w}px`,J.height=`${z.h}px`,O0&&!$){let j=Z8(O0,z,Z2());Object.assign(J,{left:`${j.x}px`,top:`${j.y}px`,right:"",bottom:""})}else Object.assign(J,{left:$?`${a/2}px`:"",top:"",right:$?"":`${a/2}px`,bottom:`calc(${a/2}px + var(--lw-chat-lift, 0px))`})}var V2=[2000,5000,15000,30000,60000],G8=new Set(["ringing","active"]),b9=20000,K4=!1,f0=!1,U8=0,h9=5,_1=null,F8=0,W2,G4,U4,B8=(J)=>J.endsWith("/")?J:`${J}/`;function m9(J,z){let $=new URL("api/presence/ws",B8(J));return $.protocol=$.protocol==="https:"?"wss:":"ws:",$.searchParams.set("t",z),$.toString()}function u9(J){if(J.chatId||!J.ticketId)return`/me/chat?call=${J.id}`;return`/me/tickets/${J.ticketId}?call=${J.id}`}function p9(J){return J.status==="ringing"&&(J.side==="reporter"||J.side===void 0||J.side===null)}var D4=new Set;function N8(J){return D4.add(J),()=>D4.delete(J)}var D8=()=>M().ring!==!1;async function w0(){let J=M().identity;if(!J)return null;try{return await J()??null}catch{return null}}async function M4(J,z){let $=M();return fetch(new URL(J,B8($.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":$.realmKey,authorization:`Bearer ${z}`},body:"{}"})}function K2(){if(K4||typeof window>"u"||typeof WebSocket>"u")return;let J=M();if(!J.identity||J.ring===!1&&!J.chat)return;K4=!0,f0=!1,c9(J.host);try{W8(`lw-tab:${C8()}`,new URL(J.host).origin)}catch{}_8()}function d9(){f0=!0,K4=!1,clearTimeout(G4),clearInterval(W2),clearTimeout(U4);try{_1?.close(1000,"bye")}catch{}_1=null,x0(),$1()}function N1(J=!1){if(f0)return;let z=J?V2[V2.length-1]:V2[Math.min(F8++,V2.length-1)];clearTimeout(G4),G4=setTimeout(()=>void _8(),z)}async function _8(){if(f0)return;let J=await w0();if(!J){if(++U8>=h9){f0=!0;return}return N1(!0)}U8=0;let z;try{z=await M4(M().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",J)}catch{return N1()}if(z.status===401||z.status===404||z.status===403){f0=!0;return}if(!z.ok)return N1(z.status===429);let $;try{$=await z.json()}catch{return N1()}if(!$.ticket){f0=!0;return}if($.calls&&$.call&&D8())M8($.call);let j=new WebSocket(m9(M().host,$.ticket));_1=j,j.onopen=()=>{F8=0,j.send(JSON.stringify({type:"tab",id:C8()})),clearInterval(W2),W2=setInterval(()=>{if(j.readyState===WebSocket.OPEN)j.send(JSON.stringify({type:"ping"}))},b9)},j.onmessage=(Q)=>{try{let Z=JSON.parse(String(Q.data));if(Z.type==="chat-changed"||Z.type==="ticket-changed"||Z.type==="chat-seen"){for(let X of D4)X(Z);return}if(Z.type==="call-state"&&Z.call&&typeof Z.call==="object"){if(D8())M8(Z.call)}else if(Z.type==="call-ink"&&typeof Z.call==="string"){let X=H1(Z.op);if(X)P4=Z.call,$2(X)}}catch{}},j.onclose=()=>{if(clearInterval(W2),_1===j)_1=null;N1()}}var H4="lw-call-framed";function i9(){try{return sessionStorage.getItem(H4)}catch{return null}}function Y2(J){try{if(J)sessionStorage.setItem(H4,J);else sessionStorage.removeItem(H4)}catch{}}var H8=!1;function c9(J){if(H8||typeof document>"u")return;H8=!0;try{let z=new URL(J).origin;for(let $ of["dns-prefetch","preconnect"]){let j=document.createElement("link");if(j.rel=$,j.href=z,$==="preconnect")j.crossOrigin="anonymous";j.dataset.debugReporter="true",document.head.append(j)}}catch{}}function q8(J){let z=M();if(z.callFrame===!1||z1()===J.id)return;Y2(J.id),X8($8(z.host,z.realmKey,null,J.id),J.id,{ready:()=>l6(J.id),done:()=>{Y2(null),x0(J.id)},failed:()=>{Y2(null),c6(J,q4(J))}},15000,w0())}var q4=(J)=>({open:()=>l9(J),decline:()=>void o9(J)}),L0=null;function C8(){if(L0)return L0;try{L0=sessionStorage.getItem(P8)}catch{}if(!L0||!/^[A-Za-z0-9_-]{8,40}$/.test(L0)){let J=new Uint8Array(12);crypto.getRandomValues(J),L0=Array.from(J,(z)=>z.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(P8,L0)}catch{}}return L0}var P8="lw-tab-id",P4=null;function M8(J){if(!G8.has(J.status)&&P4===J.id&&z1()!==J.id)P4=null,j2();if(!p9(J)){if(x0(J.id),J.status==="active"&&i9()===J.id&&!z1())q8(J);if(!G8.has(J.status)&&z1()===J.id)setTimeout(()=>{if(z1()===J.id)$1(),Y2(null)},12000);return}if(M().callFrame===!1)a1(J,q4(J),"portal");else a1(J,{...q4(J),answer:()=>{i6(J.id),j8(J.id)},voice:()=>Q8(J.id)},"frame"),q8(J);clearTimeout(U4);let z=new Date(J.ringUntil).getTime()-Date.now();U4=setTimeout(()=>{if(o6()===J.id)x0(J.id)},Math.max(5000,z+5000))}function l9(J){let z=window.open("about:blank","_blank");(async()=>{let $=await w0();if($)M4(`ingest/calls/${J.id}/coming`,$).catch(()=>{return});let j;try{j=await m6(u9(J))}catch{z?.close();return}if(z&&!z.closed){z.location.href=j;try{z.opener=null}catch{}t1()}else t1(j)})()}async function o9(J){x0(J.id);let z=await w0();if(z)await M4(`ingest/calls/${J.id}/decline`,z).catch(()=>{return})}var r9="lw-support-chat",n9="lw-support-frame",s9="lw-support-host",e=56,g0=12,a9='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',t9=`
340
340
  :host { all: initial; }
341
341
  .bubble {
342
342
  position: fixed; z-index: 2147483000; width: ${e}px; height: ${e}px; border-radius: 50%;
package/dist/live.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export interface RingingCall {
2
2
  id: string;
3
- ticketId: string;
3
+ /** A เรื่อง's call — or a chat's (โทรจากแชท, 0.19.4): then `chatId`, and the key "แชท". */
4
+ ticketId: string | null;
5
+ chatId?: string | null;
4
6
  ticketKey: string;
5
7
  ticketTitle: string;
6
8
  status: string;
@@ -10,7 +12,7 @@ export interface RingingCall {
10
12
  /** `wss://support.example/api/presence/ws?t=…` — the support host's scheme, the socket's own path. Pure, for the tests. */
11
13
  export declare function liveSocketUrl(host: string, ticket: string): string;
12
14
  /** Where the card sends them: their request, with the call — the support host rings it there. Pure, for the tests. */
13
- export declare function answerPath(call: Pick<RingingCall, "id" | "ticketId">): string;
15
+ export declare function answerPath(call: Pick<RingingCall, "id" | "ticketId" | "chatId">): string;
14
16
  /** Is this a call ringing for the person at this widget? */
15
17
  export declare function ringsHere(call: Pick<RingingCall, "status" | "side">): boolean;
16
18
  type LiveFrame = {
package/dist/ui/ring.d.ts CHANGED
@@ -2,6 +2,8 @@ export interface RingCall {
2
2
  id: string;
3
3
  ticketKey: string;
4
4
  ticketTitle: string;
5
+ /** A chat's call (โทรจากแชท, 0.19.4) — said as แชทกับทีมงาน, never "เรื่อง แชท". */
6
+ chatId?: string | null;
5
7
  }
6
8
  export interface RingHandlers {
7
9
  /** The portal's way: runs INSIDE the press — a tab can be opened only there, before anything is awaited. */
@@ -14,8 +16,8 @@ export interface RingHandlers {
14
16
  }
15
17
  /** `frame`: the call's own card while its frame comes; `portal`: answer in a new tab (no frame, or it failed). */
16
18
  export type RingMode = "frame" | "portal";
17
- /** "เรื่อง CALL-12 · title" — the line under the card's title. Pure, for the tests. */
18
- export declare function ringAbout(template: string, call: RingCall): string;
19
+ /** "เรื่อง CALL-12 · title" — the line under the card's title; a chat's call, its own words (`chat`). Pure, for the tests. */
20
+ export declare function ringAbout(template: string, call: RingCall, chat?: string): string;
19
21
  /** Show the ring for this call — once; the same call again changes nothing. */
20
22
  export declare function showRing(call: RingCall, handlers: RingHandlers, mode?: RingMode): void;
21
23
  /** รับสาย pressed while the call's frame comes: said, and nothing more to press until it is there. */
@@ -106,6 +106,8 @@ export interface Strings {
106
106
  /** A call from the support team (ui/ring). `ringAbout` carries `{key}` and `{title}`. */
107
107
  ringTitle: string;
108
108
  ringAbout: string;
109
+ /** A call from the chat, not a เรื่อง (โทรจากแชท, 0.19.4) — the line under the card's title. */
110
+ ringChat: string;
109
111
  ringHow: string;
110
112
  ringOpen: string;
111
113
  ringDecline: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightworkai.official/debug-capture",
3
- "version": "0.19.3",
3
+ "version": "0.19.4",
4
4
  "description": "Report-a-problem widget: rolling network/console/action capture, optional rrweb session replay, annotated screenshot, and submission to a Lightwork Support host",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",
package/src/live.ts CHANGED
@@ -31,7 +31,9 @@ import { inkOnPage, removeInkLayer } from "./ui/inkOverlay";
31
31
 
32
32
  export interface RingingCall {
33
33
  id: string;
34
- ticketId: string;
34
+ /** A เรื่อง's call — or a chat's (โทรจากแชท, 0.19.4): then `chatId`, and the key "แชท". */
35
+ ticketId: string | null;
36
+ chatId?: string | null;
35
37
  ticketKey: string;
36
38
  ticketTitle: string;
37
39
  status: string;
@@ -65,7 +67,9 @@ export function liveSocketUrl(host: string, ticket: string): string {
65
67
  }
66
68
 
67
69
  /** Where the card sends them: their request, with the call — the support host rings it there. Pure, for the tests. */
68
- export function answerPath(call: Pick<RingingCall, "id" | "ticketId">): string {
70
+ export function answerPath(call: Pick<RingingCall, "id" | "ticketId" | "chatId">): string {
71
+ // A chat's call (0.19.4): their chat with the team, where it rings.
72
+ if (call.chatId || !call.ticketId) return `/me/chat?call=${call.id}`;
69
73
  return `/me/tickets/${call.ticketId}?call=${call.id}`;
70
74
  }
71
75
 
package/src/ui/ring.ts CHANGED
@@ -87,6 +87,8 @@ export interface RingCall {
87
87
  id: string;
88
88
  ticketKey: string;
89
89
  ticketTitle: string;
90
+ /** A chat's call (โทรจากแชท, 0.19.4) — said as แชทกับทีมงาน, never "เรื่อง แชท". */
91
+ chatId?: string | null;
90
92
  }
91
93
 
92
94
  export interface RingHandlers {
@@ -106,8 +108,9 @@ let host: HTMLElement | null = null;
106
108
  let shownId: string | null = null;
107
109
  let titleBefore: string | null = null;
108
110
 
109
- /** "เรื่อง CALL-12 · title" — the line under the card's title. Pure, for the tests. */
110
- export function ringAbout(template: string, call: RingCall): string {
111
+ /** "เรื่อง CALL-12 · title" — the line under the card's title; a chat's call, its own words (`chat`). Pure, for the tests. */
112
+ export function ringAbout(template: string, call: RingCall, chat?: string): string {
113
+ if (call.chatId) return chat ?? call.ticketTitle;
111
114
  return template.replace("{key}", call.ticketKey).replace("{title}", call.ticketTitle);
112
115
  }
113
116
 
@@ -164,7 +167,7 @@ function render(root: ShadowRoot, call: RingCall, handlers: RingHandlers, mode:
164
167
  h.textContent = s.ringTitle;
165
168
  const about = document.createElement("p");
166
169
  about.className = "about";
167
- about.textContent = ringAbout(s.ringAbout, call);
170
+ about.textContent = ringAbout(s.ringAbout, call, s.ringChat);
168
171
  about.title = about.textContent;
169
172
  words.append(h, about);
170
173
  head.append(icon, words);
package/src/ui/strings.ts CHANGED
@@ -111,6 +111,8 @@ export interface Strings {
111
111
  /** A call from the support team (ui/ring). `ringAbout` carries `{key}` and `{title}`. */
112
112
  ringTitle: string;
113
113
  ringAbout: string;
114
+ /** A call from the chat, not a เรื่อง (โทรจากแชท, 0.19.4) — the line under the card's title. */
115
+ ringChat: string;
114
116
  ringHow: string;
115
117
  ringOpen: string;
116
118
  ringDecline: string;
@@ -211,6 +213,7 @@ const th: Strings = {
211
213
  hours: "{n} ชั่วโมง",
212
214
  ringTitle: "ทีมงานกำลังโทรหาคุณ",
213
215
  ringAbout: "เรื่อง {key} · {title}",
216
+ ringChat: "จากแชทกับทีมงาน",
214
217
  ringHow: "รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",
215
218
  ringOpen: "เปิดเพื่อรับสาย",
216
219
  ringDecline: "ไม่รับ",
@@ -306,6 +309,7 @@ const en: Strings = {
306
309
  hours: "{n} hours",
307
310
  ringTitle: "The support team is calling you",
308
311
  ringAbout: "About {key} · {title}",
312
+ ringChat: "From your chat with support",
309
313
  ringHow: "Answer on your request's page — it opens in a new tab, already signed in",
310
314
  ringOpen: "Open to answer",
311
315
  ringDecline: "Decline",