@marketrix.ai/widget 3.2.175 → 3.2.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/chat/MessageContent.d.ts.map +1 -1
- package/dist/src/components/chat/MessageList.d.ts +2 -1
- package/dist/src/components/chat/MessageList.d.ts.map +1 -1
- package/dist/src/components/navigation/MessengerShell.d.ts.map +1 -1
- package/dist/src/components/views/ChatView.d.ts +1 -0
- package/dist/src/components/views/ChatView.d.ts.map +1 -1
- package/dist/src/components/views/HomeView.d.ts.map +1 -1
- package/dist/widget.mjs +19 -21
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/src/components/chat/WelcomeMessage.d.ts +0 -12
- package/dist/src/components/chat/WelcomeMessage.d.ts.map +0 -1
package/dist/widget.mjs
CHANGED
|
@@ -15,7 +15,7 @@ return f(ku,{className:"fixed",style:{zIndex:b,maxWidth:"420px",opacity:l?0:1,tr
|
|
|
15
15
|
return g(ku,{ref:A,className:`${H} ${W?"":G} ${E?"":"transition-transform duration-300 ease-in-out"}`,style:{zIndex:w,pointerEvents:e?"none":"auto",...Z,...W},children:[/* @__PURE__ */g(ku,{className:`\n group relative w-14 h-14 overflow-visible transition-all duration-300 ease-in-out\n ${e?"scale-0 opacity-0 pointer-events-none":"scale-100 opacity-100 hover:scale-110"}\n `,children:[k&&/* @__PURE__ */f(ku,{className:S,"aria-hidden":!0}),_&&!E&&/* @__PURE__ */f(lp,{type:"button",variant:"secondary",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),a?.()},className:"absolute top-1/2 z-20 -translate-y-1/2 rounded-full border border-white/25 bg-gray-900 px-2.5 py-1 text-[11px] font-semibold uppercase tracking-wide text-white shadow-lg opacity-0 transition-opacity duration-150 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto "+(b.includes("left")?"left-full ml-2":"right-full mr-2"),style:{border:"1px solid rgba(255,255,255,0.25)"},"aria-label":"Stop running task",children:"Stop"}),
|
|
16
16
|
/* @__PURE__ */f(lp,{type:"button",variant:"bare",onClick:()=>{Date.now()<L.current||s()},onDragStart:e=>e.preventDefault(),onPointerDown:t=>{e||(N.current={pointerId:t.pointerId,startX:t.clientX,startY:t.clientY,dragging:!1,lastX:0,lastY:0},t.currentTarget.setPointerCapture(t.pointerId))},onPointerMove:e=>{const t=N.current;if(t?.pointerId!==e.pointerId)return;const n=e.clientX-t.startX,r=e.clientY-t.startY;if(!t.dragging&&Math.hypot(n,r)>5&&(t.dragging=!0,T(!0),D.current=[],$.current=0,A.current&&(A.current.style.willChange="transform",A.current.style.transition="none")),!t.dragging)return;t.lastX=n,t.lastY=r;const i=Date.now();i-$.current>=10&&($.current=i,D.current=[...D.current.slice(-5),{x:e.clientX,y:e.clientY,t:i}]),null===P.current&&(P.current=window.requestAnimationFrame(()=>{P.current=null;const e=N.current,t=A.current;t&&e&&(t.style.transform=`translate3d(${e.lastX}px, ${e.lastY}px, 0)`)}))},onPointerUp:e=>{const t=N.current;if(t?.pointerId===e.pointerId){if(t.dragging){const n=(()=>{const e=D.current;if(e.length<2)return{x:0,y:0};const t=e[e.length-1].t-e[0].t;return t<=0?{x:0,y:0}:{x:(e[e.length-1].x-e[0].x)/t*1e3,y:(e[e.length-1].y-e[0].y)/t*1e3}})(),r=V(n.x),i=V(n.y),o={dx:t.lastX+r,dy:t.lastY+i};let s;if("undefined"!=typeof window&&A.current){const e=A.current.getBoundingClientRect();s=((e,t,n,r,i,o)=>{const s=["top_left","top_right","bottom_left","bottom_right"];let a=t,l=1/0;for(const c of s){const s=Cp(t,c,n,r,i,o),d=Math.hypot(e.dx-s.dx,e.dy-s.dy);d<l&&(l=d,a=c)}return a})(o,b,window.innerWidth,window.innerHeight,e.width,e.height)}else s=b;return((e,t,n)=>{if(!A.current||!W)return q(),v(e),void T(!1);null!==P.current&&(window.cancelAnimationFrame(P.current),P.current=null);const r=A.current,i=Sp(b,F,U,M.w,M.h),o=Sp(e,F,U,M.w,M.h);r.style.transition="none",r.style.transform="none",r.style.willChange="left, top",r.style.left=`${i.x+t}px`,r.style.top=`${i.y+n}px`,requestAnimationFrame(()=>{r.style.transition=`left 600ms ${Ip}, top 600ms ${Ip}`,r.style.left=`${o.x}px`,r.style.top=`${o.y}px`}),J(e,r)})(s,t.lastX,t.lastY),L.current=Date.now()+600,N.current=null,void e.currentTarget.releasePointerCapture(e.pointerId)}q(),N.current=null,T(!1),e.currentTarget.releasePointerCapture(e.pointerId)}},onPointerCancel:e=>{N.current?.pointerId===e.pointerId&&(q(),N.current=null,T(!1),e.currentTarget.releasePointerCapture(e.pointerId))},className:"relative z-10 w-14 h-14 min-w-14",style:{touchAction:"none",cursor:E?"grabbing":"grab",userSelect:"none",WebkitUserSelect:"none"},"aria-label":e?"Close":"Open","aria-live":"polite",children:/* @__PURE__ */f(cp,{className:"w-full h-full items-center justify-center relative",children:/* @__PURE__ */g(ku,{className:"\n relative w-12 h-12 overflow-hidden transition-[transform,opacity,background-color] duration-[167ms] ease-[cubic-bezier(0.33,0,0,1)]\n hover:scale-110 hover:duration-[250ms] active:scale-[0.85] active:duration-[134ms] active:ease-[cubic-bezier(0.45,0,0.2,1)]\n animate-launcher-entrance\n ",style:{borderRadius:h,backgroundColor:e?d:l,boxShadow:"0 2px 8px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04)"},children:[k&&/* @__PURE__ */f("svg",{className:C,viewBox:"0 0 54 54",fill:"none","aria-hidden":!0,children:/* @__PURE__ */f("rect",{x:"1.25",y:"1.25",width:"51.5",height:"51.5",rx:I+1,ry:I+1})}),
|
|
17
17
|
/* @__PURE__ */f(cp,{className:"absolute inset-0 items-center justify-center transition-[transform,opacity] duration-[160ms] linear",style:{transform:e?"rotate(30deg) scale(0)":"rotate(0deg) scale(1)",opacity:e?0:1,transitionProperty:"transform, opacity",transitionDuration:"0.16s, 0.08s",transitionTimingFunction:"linear"},"aria-hidden":e,children:/* @__PURE__ */f(Cu,{src:_u,alt:"",className:"relative z-10 w-full h-full object-contain",draggable:!1,onDragStart:e=>e.preventDefault(),style:{borderRadius:h,border:"none",outline:"none",backgroundColor:"transparent",pointerEvents:"none",userSelect:"none"}})}),
|
|
18
|
-
/* @__PURE__ */f(cp,{className:"absolute inset-0 items-center justify-center transition-[transform,opacity] duration-[160ms] linear",style:{transform:e?"rotate(0deg) scale(1)":"rotate(-30deg) scale(0)",opacity:e?1:0,transitionProperty:"transform, opacity",transitionDuration:"0.16s, 0.08s",transitionTimingFunction:"linear"},"aria-hidden":!e,children:/* @__PURE__ */f(up,{name:"chevronDown",size:24,className:"relative z-10 text-foreground pointer-events-none"})})]})})})]}),!e&&/* @__PURE__ */g(ku,{className:`absolute bottom-16 ${b.includes("left")?"left-0":"right-0"} mb-2 px-3 py-2 text-sm rounded-lg shadow-lg whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-200`,style:{backgroundColor:m,color:y},children:[/* @__PURE__ */f(vp,{as:"span",className:"text-inherit",children:"Support Agent"}),/* @__PURE__ */f(ku,{"aria-hidden":!0,className:`absolute top-full ${b.includes("left")?"left-4":"right-4"} w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent`,style:{borderTopColor:m}})]})]})},Tp="3.2.
|
|
18
|
+
/* @__PURE__ */f(cp,{className:"absolute inset-0 items-center justify-center transition-[transform,opacity] duration-[160ms] linear",style:{transform:e?"rotate(0deg) scale(1)":"rotate(-30deg) scale(0)",opacity:e?1:0,transitionProperty:"transform, opacity",transitionDuration:"0.16s, 0.08s",transitionTimingFunction:"linear"},"aria-hidden":!e,children:/* @__PURE__ */f(up,{name:"chevronDown",size:24,className:"relative z-10 text-foreground pointer-events-none"})})]})})})]}),!e&&/* @__PURE__ */g(ku,{className:`absolute bottom-16 ${b.includes("left")?"left-0":"right-0"} mb-2 px-3 py-2 text-sm rounded-lg shadow-lg whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-200`,style:{backgroundColor:m,color:y},children:[/* @__PURE__ */f(vp,{as:"span",className:"text-inherit",children:"Support Agent"}),/* @__PURE__ */f(ku,{"aria-hidden":!0,className:`absolute top-full ${b.includes("left")?"left-4":"right-4"} w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent`,style:{borderTopColor:m}})]})]})},Tp="3.2.177";function Ap(e){return Array.from(e.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent&&!e.hasAttribute("aria-hidden"))}function Mp(e){if(!e)return 360;const t=parseInt(e.replace(/px|rem|em/gi,""),10);return isNaN(t)?360:t}function zp(e,t,n){return Math.min(Math.max(e,t),n)}function Op(e,t,n,r,i){const o={"bottom-right":"nwse-resize","bottom-left":"nesw-resize","top-right":"nesw-resize","top-left":"nwse-resize"};switch(e){case"bottom-right":return{dx:r-t,dy:i-n,cursor:o[e]};case"bottom-left":return{dx:t-r,dy:i-n,cursor:o[e]};case"top-right":return{dx:r-t,dy:n-i,cursor:o[e]};case"top-left":return{dx:t-r,dy:n-i,cursor:o[e]}}}var Rp={live:"inline-flex items-center gap-1",status:"inline-flex items-center text-[9px] font-medium px-1.5 py-0.5 rounded"},Np=i(function({variant:e,className:t,style:n,children:r,...i},o){/* @__PURE__ */
|
|
19
19
|
return g("span",{...i,ref:o,className:yu(Rp[e],t),"data-variant":e,style:n,children:["live"===e&&/* @__PURE__ */g("span",{className:"relative flex h-1.5 w-1.5",children:[/* @__PURE__ */f("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-75"}),/* @__PURE__ */f("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),r]})});function Pp({defaultOpen:e=!1,onOpenChange:t,open:n}){const[r,i]=p(e),s=void 0!==n;return{isOpen:s?n:r,setIsOpen:o(e=>{s||i(e),t?.(e)},[s,t])}}var Lp=n(null);function Dp(e){const t=s(Lp);if(!t)throw new Error(`${e} must be used within Dialog`);return t}function $p({children:e,onOpenChange:t,open:n}){const{isOpen:r,setIsOpen:i}=Pp({onOpenChange:t,open:n}),o=l(),s=l(),a=l(),c=d(()=>({contentId:o,descriptionId:a,open:r,setOpen:i,titleId:s}),[o,a,r,i,s]);/* @__PURE__ */
|
|
20
20
|
return f(Lp.Provider,{value:c,children:e})}function jp({children:e,className:t,onKeyDown:n,...r}){const i=Dp("DialogContent");return a(()=>{if(!i.open)return;const e=e=>{"Escape"===e.key&&i.setOpen(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i]),i.open?/* @__PURE__ */f("div",{...r,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"aria-modal":"true",className:yu("fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[calc(var(--layer-dialog)+1)] flex flex-col w-full max-w-[500px] max-h-[85vh] overflow-auto bg-card rounded-lg shadow-xl p-6 animate-dialog-content-in",t),"data-state":"open",id:i.contentId,onKeyDown:e=>{n?.(e),e.defaultPrevented||"Escape"!==e.key||i.setOpen(!1)},role:"dialog",tabIndex:-1,children:e}):null}function Fp({className:e,...t}){const n=Dp("DialogTitle");/* @__PURE__ */
|
|
21
21
|
return f("h2",{...t,className:yu("text-lg font-semibold text-card-foreground mb-2",e),id:n.titleId})}function Up({className:e,...t}){const n=Dp("DialogDescription");/* @__PURE__ */
|
|
@@ -36,35 +36,33 @@ return g(lp,{role:"tab","aria-selected":r,"aria-controls":`view-${e.id}`,id:`tab
|
|
|
36
36
|
/* @__PURE__ */g(cp,{className:"gap-2 justify-end",children:[/* @__PURE__ */f(lp,{type:"button",variant:"secondary",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:"px-4 py-1.5 rounded-full text-sm font-medium border border-gray-200",children:a}),/* @__PURE__ */f(lp,{type:"button",variant:"primary",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),o?.()},className:"px-4 py-1.5 rounded-full text-sm font-medium",children:s})]})]}:{className:"bg-white rounded-md shadow-lg border border-gray-200 w-64 p-0",children:[/* @__PURE__ */g(cp,{className:"items-center justify-between px-3 py-1.5 border-b border-gray-100",children:[/* @__PURE__ */f(Fp,{className:"text-[11px] font-semibold text-gray-700 flex-1 text-center mb-0",children:r}),/* @__PURE__ */f(Bp,{className:"text-gray-400 hover:text-gray-600 -mr-1 static w-auto h-auto","aria-label":"Close",children:/* @__PURE__ */f(up,{name:"x",size:12})})]}),/* @__PURE__ */g(fp,{className:"px-3 py-1.5",children:[l.map(e=>/* @__PURE__ */g(cp,{className:"items-center justify-between py-[3px]",children:[/* @__PURE__ */f(vp,{as:"span",className:"text-[10px] text-gray-500",children:e.label}),/* @__PURE__ */g(cp,{className:"items-center gap-1",children:[/* @__PURE__ */f(vp,{as:"code",className:"text-[9px] text-gray-600 bg-gray-50 px-1 py-0.5 rounded max-w-[120px] truncate",children:e.value||"N/A"}),!0===e.copyable&&e.value&&/* @__PURE__ */f(lp,{type:"button",variant:"ghost",size:"sm",onClick:()=>{return t=e.value,void navigator.clipboard.writeText(t);var t},className:"text-[9px] text-blue-500 hover:text-blue-600 min-w-0 p-0 h-auto",children:"Copy"})]})]},e.label)),null!=c&&/* @__PURE__ */g(cp,{className:"items-center justify-between py-[3px]",children:[/* @__PURE__ */f(vp,{as:"span",className:"text-[10px] text-gray-500",children:"Status"}),/* @__PURE__ */f(Np,{variant:"status",className:ih[c.color],children:c.label})]})]})]})});function sh(e){return"registered"===e?"green":"connected"===e?"blue":"connecting"===e?"yellow":"gray"}var ah=({isOpen:e,onClose:t,diagnosticData:n})=>{const r=[{label:"Chat ID",value:n.chatId??"N/A",copyable:!!n.chatId},{label:"Stream Endpoint",value:n.streamEndpoint??"N/A",copyable:!!n.streamEndpoint},{label:"Application ID",value:n.applicationId?.toString()??"N/A",copyable:!!n.applicationId},{label:"Agent ID",value:n.agentId?.toString()??"N/A",copyable:!!n.agentId}],i={label:n.connectionStatus,color:sh(n.connectionStatus)},o="dev"===n.build?"dev":n.build.slice(0,7);/* @__PURE__ */
|
|
37
37
|
return f(oh,{variant:"info",open:e,onClose:t,title:`Widget v${n.version} (${o})`,rows:r,status:i})};function lh(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})}}var ch=t.forwardRef(function({value:e,onChange:t,onSubmit:n,modes:r=[],activeMode:i,onModeChange:s,disabled:l=!1,taskRunning:c=!1,onStop:d,placeholder:p="Ask anything"},h){const m=u(null);a(()=>{const e=m.current;if(e){e.style.height="auto";const t=e.scrollHeight,n=Math.min(t,66);e.style.height=`${n}px`,e.style.overflowY=t>66?"auto":"hidden"}},[e]);const y=o(e=>{t(e.target.value);const n=e.target;n.style.height="auto";const r=Math.min(n.scrollHeight,66);n.style.height=`${r}px`,n.style.overflowY=n.scrollHeight>66?"auto":"hidden"},[t]),w=o(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),n())},[n]),b=Boolean(e.trim())&&!l;/* @__PURE__ */
|
|
38
38
|
return g(fp,{className:"rounded-xl border border-border overflow-hidden focus-within:border-foreground-faint transition-colors",children:[/* @__PURE__ */f(eh,{ref:lh(m,h),value:e,onChange:y,onKeyDown:w,placeholder:p,disabled:l,rows:1,className:"w-full px-3 text-sm text-foreground placeholder:text-foreground-faint resize-none focus:outline-none focus:ring-0 border-none shadow-none disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"transparent",lineHeight:"20px",paddingTop:"4px",paddingBottom:"2px",minHeight:"unset"}}),/* @__PURE__ */g(cp,{className:"items-center justify-between px-1.5 pt-1 pb-1.5",children:[/* @__PURE__ */f(cp,{className:"items-center gap-1",children:r.map(e=>/* @__PURE__ */g(Kp,{active:i===e.id,size:"sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),s?.(e.id)},children:[/* @__PURE__ */f(up,{name:e.icon,size:12}),/* @__PURE__ */f(vp,{as:"span",className:"text-inherit",children:e.label})]},e.id))}),/* @__PURE__ */f(mp,{variant:c?"secondary":"primary",size:"sm",disabled:!c&&!b,label:c?"Stop task":"Send message",onClick:e=>{e.preventDefault(),e.stopPropagation(),c&&d?d():n()},children:/* @__PURE__ */f(up,c?{name:"stop",size:14}:{name:"send",size:16})})]})]})}),dh=({variant:e,message:t})=>{const n="error"===e,r="loading"===e;/* @__PURE__ */
|
|
39
|
-
return g(fp,{align:"center",justify:"center",gap:"lg",paddingY:"2xl",paddingX:"xl",role:r?"status":void 0,"aria-live":n?"assertive":"polite",style:n?{color:"var(--color-red-600, #dc2626)"}:void 0,children:[r&&/* @__PURE__ */f(Xp,{size:"lg"}),/* @__PURE__ */f(vp,{as:"p",size:"sm",align:"center",children:t})]})},uh=({content:e,status:t="pending",accentColor:n,hideIcon:r=!1,textStyle:i="default"})=>/* @__PURE__ */g(cp,{align:"start",gap:"md",children:[!r&&(()=>{switch(t){case"completed":/* @__PURE__ */return f(up,{name:"checkCircle",style:{color:n,marginTop:"2px",flexShrink:0},size:16});case"failed":/* @__PURE__ */return f(up,{name:"timesCircle",style:{opacity:.65,marginTop:"2px",flexShrink:0},size:16});case"canceled":/* @__PURE__ */return f(up,{name:"ban",style:{opacity:.5,marginTop:"2px",flexShrink:0},size:16});case"running":/* @__PURE__ */return f(Xp,{size:"sm",style:{color:n,marginTop:"2px"}});default:/* @__PURE__ */return f(up,{name:"circle",style:{opacity:.5,marginTop:"2px",flexShrink:0},size:16})}})(),/* @__PURE__ */f(vp,{as:"span",size:"xs",weight:"medium",style:{flex:1,whiteSpace:"pre-wrap",lineHeight:"tight",opacity:"muted"===i?.5:1},children:e})]}),ph=({isWaitingForUser:e,accentColor:t})=>/* @__PURE__ */g(cp,{align:"center",gap:"sm",paddingY:"xs",children:[/* @__PURE__ */f(Xp,{size:"sm",style:{color:t}}),/* @__PURE__ */f(vp,{as:"span",weight:"normal",style:{fontSize:"10px",opacity:.5},children:e?"Waiting for you to complete the action":"Thinking"})]}),hh=({message:e,isLastMessage:t,widgetState:n,accentColor:r})=>{const i="waiting-for-user"===(e.placeholderState||"thinking");return e.parts&&e.parts.length>0?/* @__PURE__ */g(fp,{gap:"sm",children:[e.parts.map((t,n)=>{if("text"===t.type){let e=(i=t.content,i.replace(/\n\n__THINKING__$/,"").replace(/__THINKING__/g,"")).trim();return e=e.replace(/\(Cancelled by cleanup\)/gi,"").replace(/\s+/g," ").trim(),e?/* @__PURE__ */f(vp,{as:"div",size:"xs",weight:"medium",style:{lineHeight:"tight",wordBreak:"break-word",whiteSpace:"pre-wrap",marginBottom:"4px"},children:e},`part-${n}`):null}return"progress"===t.type?"done"===t.toolName&&"done"===e.taskStatus?null:/* @__PURE__ */f(uh,{content:t.content,status:t.status||"running",accentColor:r,...void 0!==t.hideIcon?{hideIcon:t.hideIcon}:{},...void 0!==t.textStyle?{textStyle:t.textStyle}:{}},`part-${n}`):null;var i}),(e.isPlaceholder&&!e.parts.some(e=>"text"===e.type)||n.isTaskRunning&&t&&("show"===e.mode||"do"===e.mode))&&/* @__PURE__ */f(ph,{isWaitingForUser:i,accentColor:r})]}):e.isPlaceholder||n.isTaskRunning&&t&&("show"===e.mode||"do"===e.mode)?/* @__PURE__ */f(ph,{isWaitingForUser:i,accentColor:r}):/* @__PURE__ */f(ku,{})},mh=({status:e,accentColor:t})=>{switch(e){case"done":/* @__PURE__ */return f(up,{name:"checkCircle",style:{color:t,flexShrink:0},size:14});case"failed":/* @__PURE__ */return f(up,{name:"exclamationCircle",style:{color:k(t,.75),flexShrink:0},size:14});case"stopped":/* @__PURE__ */return f(up,{name:"circle",style:{color:k(t,.5),flexShrink:0},size:14});default:/* @__PURE__ */return f(Xp,{size:"sm",style:{color:t}})}},fh=({stream:e})=>{const t=u(null),n=u(null),[r,i]=p(!1),[o,s]=p(!1);if(a(()=>{if(t.current&&e){const r=t.current;i(!1),s(!1),n.current&&(n.current.catch(()=>{}),n.current=null),r.srcObject=e;const o=()=>{i(!0)},a=()=>{s(!0),i(!1)};r.addEventListener("loadedmetadata",o),r.addEventListener("error",a);const l=r.play();return n.current=l,l.then(()=>{i(!0)}).catch(e=>{e instanceof Error&&"AbortError"!==e.name&&s(!0),n.current=null}),()=>{r.removeEventListener("loadedmetadata",o),r.removeEventListener("error",a)}}return()=>{n.current&&(n.current.catch(()=>{}),n.current=null),t.current&&(t.current.srcObject=null),i(!1),s(!1)}},[e]),!e)return null;const l="8px";/* @__PURE__ */
|
|
39
|
+
return g(fp,{align:"center",justify:"center",gap:"lg",paddingY:"2xl",paddingX:"xl",role:r?"status":void 0,"aria-live":n?"assertive":"polite",style:n?{color:"var(--color-red-600, #dc2626)"}:void 0,children:[r&&/* @__PURE__ */f(Xp,{size:"lg"}),/* @__PURE__ */f(vp,{as:"p",size:"sm",align:"center",children:t})]})},uh=({content:e,status:t="pending",accentColor:n,hideIcon:r=!1,textStyle:i="default"})=>/* @__PURE__ */g(cp,{align:"start",gap:"md",children:[!r&&(()=>{switch(t){case"completed":/* @__PURE__ */return f(up,{name:"checkCircle",style:{color:n,marginTop:"2px",flexShrink:0},size:16});case"failed":/* @__PURE__ */return f(up,{name:"timesCircle",style:{opacity:.65,marginTop:"2px",flexShrink:0},size:16});case"canceled":/* @__PURE__ */return f(up,{name:"ban",style:{opacity:.5,marginTop:"2px",flexShrink:0},size:16});case"running":/* @__PURE__ */return f(Xp,{size:"sm",style:{color:n,marginTop:"2px"}});default:/* @__PURE__ */return f(up,{name:"circle",style:{opacity:.5,marginTop:"2px",flexShrink:0},size:16})}})(),/* @__PURE__ */f(vp,{as:"span",size:"xs",weight:"medium",style:{flex:1,whiteSpace:"pre-wrap",lineHeight:"tight",opacity:"muted"===i?.5:1},children:e})]}),ph=({isWaitingForUser:e,accentColor:t})=>/* @__PURE__ */g(cp,{align:"center",gap:"sm",paddingY:"xs",children:[/* @__PURE__ */f(Xp,{size:"sm",style:{color:t}}),/* @__PURE__ */f(vp,{as:"span",weight:"normal",style:{fontSize:"10px",opacity:.5},children:e?"Waiting for you to complete the action":"Thinking"})]}),hh=({message:e,isLastMessage:t,widgetState:n,accentColor:r})=>{const i="waiting-for-user"===(e.placeholderState||"thinking");return e.parts&&e.parts.length>0?/* @__PURE__ */g(fp,{gap:"sm",children:[e.parts.map((t,n)=>{if("text"===t.type){let e=(i=t.content,i.replace(/\n\n__THINKING__$/,"").replace(/__THINKING__/g,"")).trim();return e=e.replace(/\(Cancelled by cleanup\)/gi,"").replace(/\s+/g," ").trim(),e?/* @__PURE__ */f(vp,{as:"div",size:"xs",weight:"medium",style:{lineHeight:"tight",wordBreak:"break-word",whiteSpace:"pre-wrap",marginBottom:"4px"},children:e},`part-${n}`):null}return"progress"===t.type?"done"===t.toolName&&"done"===e.taskStatus?null:/* @__PURE__ */f(uh,{content:t.content,status:t.status||"running",accentColor:r,...void 0!==t.hideIcon?{hideIcon:t.hideIcon}:{},...void 0!==t.textStyle?{textStyle:t.textStyle}:{}},`part-${n}`):null;var i}),(e.isPlaceholder&&!e.parts.some(e=>"text"===e.type)||n.isTaskRunning&&t&&("show"===e.mode||"do"===e.mode))&&/* @__PURE__ */f(ph,{isWaitingForUser:i,accentColor:r})]}):e.isPlaceholder||n.isTaskRunning&&t&&("show"===e.mode||"do"===e.mode)?/* @__PURE__ */f(ph,{isWaitingForUser:i,accentColor:r}):e.content?/* @__PURE__ */f(vp,{as:"div",size:"xs",weight:"medium",style:{lineHeight:"tight",wordBreak:"break-word",whiteSpace:"pre-wrap"},children:e.content}):/* @__PURE__ */f(ku,{})},mh=({status:e,accentColor:t})=>{switch(e){case"done":/* @__PURE__ */return f(up,{name:"checkCircle",style:{color:t,flexShrink:0},size:14});case"failed":/* @__PURE__ */return f(up,{name:"exclamationCircle",style:{color:k(t,.75),flexShrink:0},size:14});case"stopped":/* @__PURE__ */return f(up,{name:"circle",style:{color:k(t,.5),flexShrink:0},size:14});default:/* @__PURE__ */return f(Xp,{size:"sm",style:{color:t}})}},fh=({stream:e})=>{const t=u(null),n=u(null),[r,i]=p(!1),[o,s]=p(!1);if(a(()=>{if(t.current&&e){const r=t.current;i(!1),s(!1),n.current&&(n.current.catch(()=>{}),n.current=null),r.srcObject=e;const o=()=>{i(!0)},a=()=>{s(!0),i(!1)};r.addEventListener("loadedmetadata",o),r.addEventListener("error",a);const l=r.play();return n.current=l,l.then(()=>{i(!0)}).catch(e=>{e instanceof Error&&"AbortError"!==e.name&&s(!0),n.current=null}),()=>{r.removeEventListener("loadedmetadata",o),r.removeEventListener("error",a)}}return()=>{n.current&&(n.current.catch(()=>{}),n.current=null),t.current&&(t.current.srcObject=null),i(!1),s(!1)}},[e]),!e)return null;const l="8px";/* @__PURE__ */
|
|
40
40
|
return g(ku,{width:"full",overflow:"hidden",position:"relative",style:{marginBottom:"4px",borderRadius:`${l} ${l} 0 0`,backgroundColor:"#000000",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)"},children:[!r&&!o&&/* @__PURE__ */f(cp,{position:"absolute",inset:"0",align:"center",justify:"center",style:{backgroundColor:"#111827",borderRadius:`${l} ${l} 0 0`,zIndex:10,transition:"opacity 300ms",opacity:r?0:1},children:/* @__PURE__ */g(cp,{direction:"column",align:"center",gap:"md",children:[/* @__PURE__ */g(ku,{position:"relative",style:{width:"32px",height:"32px"},children:[/* @__PURE__ */f(ku,{position:"absolute",inset:"0",rounded:"full",animate:"spin",style:{border:"2px solid white",borderTopColor:"transparent"}}),/* @__PURE__ */f(ku,{position:"absolute",inset:"0",rounded:"full",animate:"spin",style:{border:"2px solid transparent",borderRightColor:"white",animationDirection:"reverse",animationDuration:"0.8s"}})]}),/* @__PURE__ */f(vp,{as:"span",size:"xs",weight:"medium",style:{color:"rgba(255,255,255,0.7)"},children:"Loading stream..."})]})}),o&&/* @__PURE__ */f(cp,{position:"absolute",inset:"0",align:"center",justify:"center",style:{backgroundColor:"#111827",borderRadius:`${l} ${l} 0 0`,zIndex:10},children:/* @__PURE__ */g(cp,{direction:"column",align:"center",gap:"md",style:{textAlign:"center",paddingLeft:"16px",paddingRight:"16px"},children:[/* @__PURE__ */f(up,{name:"alertCircle",size:32,style:{color:"#9ca3af"}}),/* @__PURE__ */f(vp,{as:"span",size:"xs",weight:"medium",style:{color:"rgba(255,255,255,0.7)"},children:"Failed to load stream"})]})}),
|
|
41
41
|
/* @__PURE__ */f(th,{ref:t,autoPlay:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"auto",maxHeight:"192px",objectFit:"contain",borderRadius:`${l} ${l} 0 0`,transition:"opacity 500ms",opacity:r?1:0,minHeight:"120px",background:"linear-gradient(135deg, #111827 0%, #374151 100%)"}}),r&&!o&&/* @__PURE__ */g(cp,{position:"absolute",align:"center",gap:"sm",animate:"fadeIn",style:{top:"8px",right:"8px",padding:"4px 8px",borderRadius:"9999px",backgroundColor:"rgba(55,65,81,0.9)",backdropFilter:"blur(4px)",zIndex:20,boxShadow:"0 2px 8px rgba(31, 41, 55, 0.4)"},children:[/* @__PURE__ */g(cp,{position:"relative",align:"center",justify:"center",children:[/* @__PURE__ */f(ku,{position:"absolute",rounded:"full",animate:"ping",style:{width:"8px",height:"8px",backgroundColor:"white",opacity:.75}}),/* @__PURE__ */f(ku,{position:"relative",rounded:"full",style:{width:"6px",height:"6px",backgroundColor:"white"}})]}),/* @__PURE__ */f(vp,{as:"span",size:"xs",weight:"semibold",style:{color:"white",textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"10px"},children:"Live"})]}),
|
|
42
42
|
/* @__PURE__ */f(cp,{position:"absolute",inset:"0",align:"center",justify:"center",style:{borderRadius:`${l} ${l} 0 0`,backgroundColor:"rgba(0,0,0,0)",zIndex:30,pointerEvents:"none"},children:/* @__PURE__ */f(ku,{rounded:"lg",style:{padding:"4px 12px",backgroundColor:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:/* @__PURE__ */f(vp,{as:"div",size:"xs",weight:"medium",style:{color:"white"},children:"Screen Sharing Active"})})})]})},gh=({message:e,index:t,isLastMessage:n,widgetState:r,settings:i,onScreenAccessAllow:o,onScreenAccessDeny:s})=>{if(e.isSystemMessage)/* @__PURE__ */return f(cp,{justify:"center",align:"center",children:/* @__PURE__ */f(vp,{as:"span",variant:"faint",style:{fontSize:"10px",fontWeight:"normal"},children:e.content})},`message-${e.id}-${t}`);const a="user"===e.sender;/* @__PURE__ */
|
|
43
43
|
return g(fp,{style:{marginTop:"10px"},role:"article","aria-roledescription":"message","aria-label":a?"You said…":"Agent says…",animate:n?"fadeIn":void 0,children:[
|
|
44
|
-
/* @__PURE__ */g(cp,{align:"start",gap:"xs",width:"full",children:[/* @__PURE__ */f(cp,{shrink:!1,style:{width:"
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */f(ku,{
|
|
49
|
-
return g(fp,{height:"full",id:"view-chat",role:"tabpanel","aria-labelledby":"tab-chat",children:[z&&/* @__PURE__ */f(oh,{variant:"confirm",open:z,onClose:()=>{O(!1)},title:"Can I take a look at your screen?",description:"By allowing screen access, Marketrix can understand your current context to guide you better and complete tasks on your behalf.",onConfirm:async()=>{O(!1);try{const e=await Zc();I(!0),m?.(!0),l(Oc("show"));const t=Rc(e,"show");T(t.id),l(t)}catch(e){I(!1),m?.(!1)}},confirmLabel:"Yes",cancelLabel:"No"}),
|
|
50
|
-
/* @__PURE__ */f(ku,{grow:!0,overflow:"hidden",paddingY:"xs",style:{display:"flex",flexDirection:"column",minHeight:0},children:/* @__PURE__ */f(bh,{children:/* @__PURE__ */f(wh,{messages:t,messagesEndRef:_,config:e,onScreenAccessAllow:async()=>{try{const e=await Zc();I(!0),m?.(!0),A&&(c(A,{screenShareStatus:"allowed"}),M(null)),l(Oc("show"));const t=Rc(e,"show");if(T(t.id),l(t),R){const e=R;N(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}}catch(e){if(I(!1),m?.(!1),A&&(c(A,{screenShareStatus:"denied"}),M(null)),R){const e=R;N(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}}},onScreenAccessDeny:()=>{if(A&&(c(A,{screenShareStatus:"denied"}),M(null)),R){const e=R;N(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}}})})}),
|
|
44
|
+
/* @__PURE__ */g(cp,{align:"start",gap:"xs",width:"full",children:[/* @__PURE__ */f(cp,{shrink:!1,style:{width:"24px",height:"24px",backgroundColor:"transparent"},children:!a&&/* @__PURE__ */f(Cu,{src:"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20361%20360'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.1.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%20136)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20display:%20none;%20fill:%20none;%20stroke:%20%23cdc9c2;%20stroke-width:%201.3px;%20}%20.st1%20{%20fill:%20%23fff;%20}%20.st2,%20.st3%20{%20fill:%20%237cffa6;%20}%20.st3%20{%20stroke:%20%237cffa6;%20stroke-width:%20.38px;%20}%20.st4%20{%20fill:%20%23101828;%20}%20%3c/style%3e%3c/defs%3e%3crect%20class='st4'%20x='.5'%20width='360'%20height='360'/%3e%3cpath%20class='st2'%20d='M83.37,209.58c15.35,0,27.8-12.45,27.8-27.8s-12.44-27.79-27.8-27.79-27.8,12.44-27.8,27.79,12.44,27.8,27.8,27.8Z'/%3e%3cpath%20class='st1'%20d='M85.86,68.28l152.45,223.44h67.29l-70.62-113.77,68.13-109.67h-67.29l-41.12,65.31-41.54-65.31h-67.29Z'/%3e%3cpath%20class='st3'%20d='M176.61,249.83l-35.08-51-57.82,92.71h66.85l26.05-41.7Z'/%3e%3crect%20class='st0'%20x='1.25'%20y='.65'%20width='358.7'%20height='358.7'%20rx='43.35'%20ry='43.35'/%3e%3c/svg%3e",alt:"Marketrix AI",size:24,rounded:"theme",style:{border:"none",outline:"none",display:"block",objectFit:"cover",backgroundColor:"transparent"}})}),/* @__PURE__ */g(fp,{grow:!0,position:"relative",style:{padding:e.videoStream?"0":"8px 10px",borderRadius:a?"var(--radius) 0 var(--radius) var(--radius)":"var(--radius)",boxShadow:a?void 0:"0 1px 4px rgba(0,0,0,0.1)",border:a?"1px solid var(--primary)":"1px solid transparent",backgroundColor:a?"var(--primary)":void 0,color:a?"var(--primary-foreground)":"var(--foreground)",maxWidth:a?"calc(100% - 40px)":"280px"},children:[e.videoStream&&/* @__PURE__ */f(fh,{stream:e.videoStream}),!e.videoStream&&/* @__PURE__ */f(hh,{message:e,isLastMessage:n,widgetState:r,accentColor:i.widget_accent_color}),e.isScreenAccessRequest&&!e.screenShareStatus&&/* @__PURE__ */g(cp,{align:"center",gap:"md",style:{marginTop:"6px",paddingTop:"2px"},children:[/* @__PURE__ */f(lp,{type:"button",variant:"primary",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),o?.()},style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:500,height:"26px",minWidth:"65px",borderRadius:"22px",backgroundColor:"#111827",color:"#fff",border:"none"},children:"Yes"}),/* @__PURE__ */f(lp,{type:"button",variant:"secondary",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),s?.()},style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:500,height:"26px",minWidth:"65px",borderRadius:"22px",backgroundColor:"#f3f4f6",color:"#111827",border:"1px solid #e5e7eb"},children:"No"})]}),e.isScreenAccessRequest&&"allowed"===e.screenShareStatus&&/* @__PURE__ */f(vp,{as:"div",variant:"faint",size:"xs",weight:"medium",style:{marginTop:"2px",fontStyle:"italic"},children:"Sure"}),e.isScreenAccessRequest&&"denied"===e.screenShareStatus&&/* @__PURE__ */f(vp,{as:"div",variant:"faint",size:"xs",weight:"medium",style:{marginTop:"2px",fontStyle:"italic"},children:"Check HTML Instead"}),!a&&e.taskStatus&&/* @__PURE__ */f(cp,{position:"absolute",align:"center",justify:"center",style:{bottom:"4px",right:"4px"},children:/* @__PURE__ */f(mh,{status:e.taskStatus,accentColor:i.widget_accent_color})})]})]}),!a&&!e.isPlaceholder&&/* @__PURE__ */g(vp,{as:"div",variant:"muted",style:{fontSize:"11px",marginTop:"4px",marginLeft:"28px"},children:["Marketrix • AI Agent • ",S(e.timestamp)]}),!e.isPlaceholder&&a&&/* @__PURE__ */f(cp,{justify:"end",style:{marginTop:"2px",marginRight:"4px"},children:/* @__PURE__ */f(vp,{as:"span",variant:"faint",weight:"normal",style:{fontSize:"10px"},children:S(e.timestamp)})})]},`message-${e.id}-${t}`)},yh=({messages:e,messagesEndRef:t,config:n,onScreenAccessAllow:r,onScreenAccessDeny:i,onClearChat:o})=>{const{config:s,state:l,isPreviewMode:c}=Qc({config:n}),[d,h]=p(!1),[m,y]=p(!1),w=u(null),b=()=>{if(w.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=w.current;h(e>200),y(!(Math.abs(t-e-n)<50)&&t>n)}};return a(()=>{window.requestAnimationFrame(()=>{t.current&&(!c&&t.current.scrollIntoView({behavior:"auto"}),!c&&b())})},[e.length,c]),/* @__PURE__ */g(ku,{position:"relative",height:"full",children:[
|
|
45
|
+
/* @__PURE__ */g(ku,{ref:w,onScroll:b,role:"log","aria-relevant":"additions",height:"full",overflowY:"auto",paddingX:"lg",paddingY:"sm",style:{backgroundColor:s.widget_background_color.includes("gradient")?"transparent":s.widget_background_color,backgroundImage:s.widget_background_color.includes("gradient")?s.widget_background_color:`linear-gradient(135deg, ${s.widget_background_color} 0%, ${s.widget_background_color} 100%)`,scrollbarColor:`${k(s.widget_border_color,.3)} ${k(s.widget_border_color,.1)}`,scrollbarWidth:"thin"},children:[0===e.length&&l.isLoading&&/* @__PURE__ */f(dh,{variant:"loading",message:"Connecting…"}),[{id:"welcome",content:s.widget_body??"How can I help you today?",sender:"agent",timestamp:/* @__PURE__ */new Date,isPlaceholder:!1},...e].map((e,t,n)=>/* @__PURE__ */f(gh,{message:e,index:t,isLastMessage:t===n.length-1,widgetState:l,settings:{widget_accent_color:s.widget_accent_color},onScreenAccessAllow:r,onScreenAccessDeny:i},`message-${e.id}-${t}`)),e.length>0&&o&&/* @__PURE__ */f(cp,{justify:"center",style:{marginTop:"12px",marginBottom:"4px"},children:/* @__PURE__ */f(lp,{type:"button",variant:"bare",onClick:()=>{const e=o();e instanceof Promise&&e.catch(e=>{})},children:/* @__PURE__ */f(vp,{size:"xs",variant:"muted",style:{cursor:"pointer"},children:"Clear conversation"})})}),
|
|
46
|
+
/* @__PURE__ */f(ku,{ref:t},"scroll-anchor")]},"message-list-container"),d&&/* @__PURE__ */f(cp,{position:"absolute",justify:"center",style:{top:"8px",left:0,right:0,zIndex:10,pointerEvents:"none"},children:/* @__PURE__ */f(lp,{type:"button",variant:"secondary",size:"sm",onClick:()=>{w.current?.scrollTo({top:0,behavior:"smooth"})},style:{padding:"6px",borderRadius:"9999px",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1)",backgroundColor:"rgba(255,255,255,0.9)",border:"1px solid #e5e7eb",pointerEvents:"auto"},title:"Scroll to top","aria-label":"Scroll to top",children:/* @__PURE__ */f(up,{name:"arrowUp",size:10,style:{color:s.widget_accent_color}})})}),m&&/* @__PURE__ */f(cp,{position:"absolute",justify:"center",style:{bottom:"8px",left:0,right:0,zIndex:10,pointerEvents:"none"},children:/* @__PURE__ */f(lp,{type:"button",variant:"secondary",size:"sm",onClick:()=>{t.current&&!c&&t.current.scrollIntoView({behavior:"smooth"})},style:{padding:"6px",borderRadius:"9999px",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1)",backgroundColor:"rgba(255,255,255,0.9)",border:"1px solid #e5e7eb",pointerEvents:"auto"},title:"Scroll to bottom","aria-label":"Scroll to bottom",children:/* @__PURE__ */f(up,{name:"arrowDown",size:10,style:{color:s.widget_accent_color}})})})]})},wh=class extends t.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?/* @__PURE__ */f(vp,{as:"div",size:"xs",align:"center",style:{padding:"16px",color:"#6b7280"},children:"Something went wrong displaying messages. Please refresh."}):this.props.children}},bh={show:"mousePointerClick",tell:"chatBubble",do:"ticktick"},vh=["tell","show","do"];var xh=({config:e,messages:t,currentMode:n,isTaskRunning:r=!1,taskProgress:i=[],onSendMessage:o,onSetMode:s,onAddMessage:l,onUpdateMessage:c,onRemoveMessage:d,onStopTask:h,onClearChat:m,onScreenSharingChange:y,onStartScreenShareRef:w,onStopScreenShareRef:b,messageInputRef:v})=>{const[x,_]=p(""),S=u(null),[I,E]=p(!1),[T,A]=p(null),[M,z]=p(null),[O,R]=p(!1),[N,P]=p(null),L=u(I),D=u(T),$=u(l),j=u(d),F=u(y);a(()=>{L.current=I},[I]),a(()=>{D.current=T},[T]),a(()=>{$.current=l},[l]),a(()=>{j.current=d},[d]),a(()=>{F.current=y},[y]),a(()=>{const e=()=>{const e=Vc(),t=L.current,n=D.current;if(e!==t&&(L.current=e,E(e),F.current?.(e)),t&&!e&&n){j.current?.(n);const e=zc("Stopped screenshare","show","user","stopped-sharing");$.current(e),A(null)}};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]);const U=e=>{if(M)return;const t=function(e){const t="Can I take a look at your screen?";return{id:`screen-access-request-${Date.now()}`,content:t,sender:"agent",timestamp:/* @__PURE__ */new Date,mode:e,isScreenAccessRequest:!0,parts:[{type:"text",content:t}]}}(e);z(t.id),l(t)},B=()=>{R(!0)},W=()=>{Hc&&(Hc.getTracks().forEach(e=>e.stop()),Hc=null),E(!1),y?.(!1),T&&d&&d(T),l(zc("Stopped screenshare","show","user","stopped-sharing")),A(null)};a(()=>(w&&(w.current=B),b&&(b.current=W),()=>{w&&(w.current=null),b&&(b.current=null)}));const G=e;/* @__PURE__ */
|
|
47
|
+
return g(fp,{height:"full",id:"view-chat",role:"tabpanel","aria-labelledby":"tab-chat",children:[O&&/* @__PURE__ */f(oh,{variant:"confirm",open:O,onClose:()=>{R(!1)},title:"Can I take a look at your screen?",description:"By allowing screen access, Marketrix can understand your current context to guide you better and complete tasks on your behalf.",onConfirm:async()=>{R(!1);try{const e=await Zc();E(!0),y?.(!0),l(Oc("show"));const t=Rc(e,"show");A(t.id),l(t)}catch(e){E(!1),y?.(!1)}},confirmLabel:"Yes",cancelLabel:"No"}),
|
|
48
|
+
/* @__PURE__ */f(ku,{grow:!0,overflow:"hidden",paddingY:"xs",style:{display:"flex",flexDirection:"column",minHeight:0},children:/* @__PURE__ */f(wh,{children:/* @__PURE__ */f(yh,{messages:t,messagesEndRef:S,config:e,onScreenAccessAllow:async()=>{try{const e=await Zc();E(!0),y?.(!0),M&&(c(M,{screenShareStatus:"allowed"}),z(null)),l(Oc("show"));const t=Rc(e,"show");if(A(t.id),l(t),N){const e=N;P(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}}catch(e){if(E(!1),y?.(!1),M&&(c(M,{screenShareStatus:"denied"}),z(null)),N){const e=N;P(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}}},onScreenAccessDeny:()=>{if(M&&(c(M,{screenShareStatus:"denied"}),z(null)),N){const e=N;P(null),o(e.content,e.mode,e.applicationId,e.question,e.alreadyAdded)}},onClearChat:m})})}),
|
|
51
49
|
/* @__PURE__ */g(ku,{shrink:!1,rounded:"theme",margin:"md",style:{marginTop:"auto",backgroundColor:"#ffffff"},children:[r&&i.length>0&&/* @__PURE__ */g(ku,{rounded:!0,overflowY:"auto",style:{margin:"0 8px 8px",padding:"8px",maxHeight:"128px",backgroundColor:k(e.widget_background_color??"#fff",.8),borderColor:e.widget_border_color,borderWidth:"1px",borderStyle:"solid"},children:[/* @__PURE__ */g(vp,{as:"div",weight:"semibold",style:{marginBottom:"4px",color:e.widget_text_color},children:["Task Progress (",i.length," steps)"]}),/* @__PURE__ */f(fp,{gap:"xs",children:i.map((t,n)=>/* @__PURE__ */g(cp,{align:"start",gap:"sm",style:{fontSize:"12px",opacity:.8,color:e.widget_text_color},children:[
|
|
52
|
-
/* @__PURE__ */g(vp,{as:"span",weight:"medium",children:["Step ",t.step,":"]})," ",t.tool_name,t.tool_params&&Object.keys(t.tool_params).length>0&&/* @__PURE__ */g(vp,{as:"span",style:{opacity:.7,marginLeft:"4px"},children:["(",Object.keys(t.tool_params).join(", "),")"]})]},n))})]}),/* @__PURE__ */f(ku,{paddingY:"sm",paddingX:"md",style:{backgroundColor:"transparent"},children:/* @__PURE__ */f(ch,{ref:
|
|
53
|
-
return
|
|
54
|
-
/* @__PURE__ */g(ku,{style:{textAlign:"center",paddingTop:"8px"},children:[/* @__PURE__ */f(vp,{as:"h2",size:"lg",weight:"semibold",children:e.widget_greeting??"Hey There!"}),/* @__PURE__ */f(vp,{as:"p",variant:"muted",size:"sm",style:{marginTop:"
|
|
50
|
+
/* @__PURE__ */g(vp,{as:"span",weight:"medium",children:["Step ",t.step,":"]})," ",t.tool_name,t.tool_params&&Object.keys(t.tool_params).length>0&&/* @__PURE__ */g(vp,{as:"span",style:{opacity:.7,marginLeft:"4px"},children:["(",Object.keys(t.tool_params).join(", "),")"]})]},n))})]}),/* @__PURE__ */f(ku,{paddingY:"sm",paddingX:"md",style:{backgroundColor:"transparent"},children:/* @__PURE__ */f(ch,{ref:v,value:x,onChange:_,onSubmit:()=>{const r=t.some(e=>e.isPlaceholder);if(x.trim()&&!r){const t=x.trim();_(""),l(Ac(t,n)),!1===e.use_screenshare||"show"!==n&&"do"!==n||I||M?o(t,n,void 0,void 0,!0):(P({content:t,mode:n,alreadyAdded:!0}),U(n))}},modes:vh.filter(e=>function(e){return[...e.widget_feature_show?["show"]:[],...e.widget_feature_tell?["tell"]:[],...e.widget_feature_do?["do"]:[]]}(G).includes(e)).map(e=>({id:e,icon:bh[e],label:C(e)})),activeMode:n,onModeChange:e=>(e=>{e!==n&&(l(zc(`Switched to ${{show:"Show",tell:"Tell",do:"Do"}[e]} mode`,e,"agent","mode-change")),s(e))})(e),disabled:t.some(e=>e.isPlaceholder),taskRunning:r,onStop:()=>{qc.cleanup(),h?.()}})})]})]})},kh=[{id:"show-add-product",text:"Show me how to add a new product",icon:/* @__PURE__ */f(up,{name:"mousePointerClick",size:24}),type:"show",isShow:!0},{id:"show-login",text:"Show me how to login",icon:/* @__PURE__ */f(up,{name:"mousePointerClick",size:24}),type:"show",isShow:!0},{id:"do-login",text:"Do the login process for me",icon:/* @__PURE__ */f(up,{name:"ticktick",size:16}),type:"do",isShow:!1},{id:"show-revenue",text:"Show me the revenue metrics",icon:/* @__PURE__ */f(up,{name:"mousePointerClick",size:24}),type:"show",isShow:!0},{id:"tell-conversion-rate",text:"What does my conversion rate mean and how can I improve it?",icon:/* @__PURE__ */f(up,{name:"chatBubble",size:20}),type:"tell",isShow:!1}];function _h(e){switch(e){case"do":/* @__PURE__ */return f(up,{name:"ticktick",size:12});case"show":/* @__PURE__ */return f(up,{name:"mousePointerClick",size:12});default:/* @__PURE__ */return f(up,{name:"chatBubble",size:12})}}var Sh,Ch=({actions:e,settings:t,onActionClick:n})=>0===e.length?null:/* @__PURE__ */f(fp,{gap:"sm",children:e.map((e,r)=>/* @__PURE__ */f(lp,{variant:"ghost",size:"sm",full:!0,onClick:t=>n(e,t),className:"hover:bg-primary hover:text-primary-foreground hover:border-primary",style:{backgroundColor:"var(--secondary-bg)",color:t.widget_text_color},children:/* @__PURE__ */f(vp,{as:"span",weight:"normal",style:{lineHeight:1},children:"show"===e.type?/* @__PURE__ */g(m,{children:["Show me ",e.text.replace(/^Show me\s*/i,"")]}):"do"===e.type?/* @__PURE__ */g(m,{children:["Do ",e.text.replace(/^Do\s*/i,"")]}):e.text})},`welcome-chip-${e.id}-${r}`))}),Ih=({config:e,messages:t,onNavigateToChat:n,onChipClick:r})=>{const i=function(e){const t=e.widget_chips;if(t&&Array.isArray(t)&&t.length>0){const e=/* @__PURE__ */new Set;return t.map((t,n)=>{const r=t.chip_text||t.question||"",i=t.chip_mode||t.type||"tell",o="show"===i||"tell"===i||"do"===i?i:"tell",s=`chip-${r.replace(/\s+/g,"-").toLowerCase()}-${n}`;let a=s,l=0;for(;e.has(a);)l++,a=`${s}-${l}`;return e.add(a),{id:a,text:r,icon:_h(o),type:o,isShow:"show"===o}})}return kh}(e);/* @__PURE__ */
|
|
51
|
+
return g(fp,{height:"full",overflow:"hidden",id:"view-home",role:"tabpanel","aria-labelledby":"tab-home",children:[/* @__PURE__ */g(fp,{grow:!0,overflowY:"auto",padding:"lg",gap:"lg",children:[
|
|
52
|
+
/* @__PURE__ */g(ku,{style:{textAlign:"center",paddingTop:"8px"},children:[/* @__PURE__ */f(vp,{as:"h2",size:"lg",weight:"semibold",children:e.widget_greeting??"Hey There!"}),/* @__PURE__ */f(vp,{as:"p",variant:"muted",size:"sm",style:{marginTop:"2px"},children:e.widget_body??"How can I help you today?"})]}),
|
|
55
53
|
/* @__PURE__ */g(lp,{type:"button",variant:"primary",full:!0,onClick:n,"aria-label":"Ask a question",style:{justifyContent:"space-between",padding:"12px 16px",borderRadius:"var(--radius)",fontWeight:500},children:[/* @__PURE__ */g(cp,{align:"center",gap:"md",children:[/* @__PURE__ */f(up,{name:"chat",size:20}),"Ask a question"]}),/* @__PURE__ */f(up,{name:"chevronRight",size:16})]}),
|
|
56
|
-
/* @__PURE__ */f(
|
|
57
|
-
/* @__PURE__ */f(vp,{as:"p",size:"
|
|
54
|
+
/* @__PURE__ */f(Ch,{actions:i,settings:{widget_text_color:e.widget_text_color??"#1f2937"},onActionClick:async(e,t)=>{t.preventDefault(),t.stopPropagation(),n(),r(e)}})]}),t.length>0&&/* @__PURE__ */g(ku,{style:{padding:"10px 16px",margin:"0 12px 12px 12px",borderRadius:"var(--radius-xl, 12px)",border:"1px solid var(--border)"},children:[
|
|
55
|
+
/* @__PURE__ */f(vp,{as:"p",size:"xs",weight:"semibold",style:{marginBottom:"2px"},children:"Recent conversation"}),
|
|
58
56
|
/* @__PURE__ */f(vp,{as:"p",size:"xs",variant:"muted",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t[t.length-1].content||"Message"}),
|
|
59
|
-
/* @__PURE__ */f(
|
|
57
|
+
/* @__PURE__ */f(vp,{as:"p",size:"xs",variant:"muted",onClick:n,style:{marginTop:"4px",cursor:"pointer"},children:"Continue conversation →"})]})]})},Eh=({children:e,direction:t})=>/* @__PURE__ */f(ku,{"data-view-transition":!0,"data-direction":t,style:{width:"100%",height:"100%"},children:e}),Th=[{id:"home",icon:"home",label:"Home"},{id:"chat",icon:"chat",label:"Chat"},{id:"help",icon:"help",label:"Help"}],Ah=({config:e,isOpen:t,isMinimized:n,messages:r,currentMode:i,isTaskRunning:s=!1,taskProgress:l=[],activeView:c,onClose:h,onSendMessage:y,onSetMode:w,onAddMessage:b,onUpdateMessage:v,onRemoveMessage:x,onStopTask:k,onClearChat:_,onScreenSharingChange:S,setActiveView:C})=>{const{config:I,isPreviewMode:E}=Qc({config:e}),T=d(()=>e.mtxId??(null!=e.mtxApp?String(e.mtxApp):"default"),[e.mtxId,e.mtxApp]),{widthPx:A,heightPx:M,onResizeStart:z,containerRef:O}=function(e,t,n,r,i){const s=d(()=>`marketrix_widget_size_${n}`,[n]),a=u({width:360,height:450}),l=u(null),[c,h]=p(()=>{if("undefined"==typeof localStorage)return{width:Mp(e),height:Mp(t)};const n=localStorage.getItem(s);if(n)try{const e=JSON.parse(n);if("number"==typeof e.width&&"number"==typeof e.height){const t=zp(e.width,280,600),n=zp(e.height,320,Math.floor(.85*window.innerHeight));return a.current={width:t,height:n},{width:t,height:n}}}catch{}const r=Mp(e),i=Mp(t);return a.current={width:r,height:i},{width:r,height:i}});a.current=c;const m=o(e=>t=>{if(t.preventDefault(),t.stopPropagation(),r||i)return;const n=t.clientX,o=t.clientY,c=a.current.width,d=a.current.height,{cursor:u}=Op(e,n,o,n,o);l.current&&(l.current.dataset.resizing="true");const p=t=>{const{dx:r,dy:i}=Op(e,n,o,t.clientX,t.clientY),s=Math.floor(.85*window.innerHeight),u={width:zp(c+r,280,600),height:zp(d+i,320,s)};a.current=u,l.current&&(l.current.style.width=`${u.width}px`,l.current.style.height=`${u.height}px`)},m=()=>{if(document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m),document.body.style.cursor="",document.body.style.userSelect="",l.current&&delete l.current.dataset.resizing,h({...a.current}),!i&&"undefined"!=typeof localStorage){const{width:e,height:t}=a.current;localStorage.setItem(s,JSON.stringify({width:e,height:t}))}};document.body.style.cursor=u,document.body.style.userSelect="none",document.addEventListener("mousemove",p),document.addEventListener("mouseup",m)},[r,i,s]);return{width:c.width,height:c.height,widthPx:`${c.width}px`,heightPx:`${c.height}px`,onResizeStart:m,containerRef:l}}(I.widget_width,I.widget_height,T,n,E),R=u(null),[N,P]=p("forward"),L=u(c);a(()=>{L.current!==c&&(P("chat"===c?"forward":"back"),L.current=c)},[c]),function(e,t,n){const r=u(!1),i=u(null),s=o(()=>{const t=e.current;if(!t)return;const r=n?.focusTargetRef?.current;if(r)return void r.focus({preventScroll:!0});const i=Ap(t);i[0]&&i[0].focus({preventScroll:!0})},[e,n?.focusTargetRef]);a(()=>{if(!t)return r.current&&(i.current?.focus({preventScroll:!0}),i.current=null),void(r.current=!1);r.current||(i.current=document.activeElement||null),r.current=!0;const o=e.current;if(!o)return;s();const a=e=>{if("Escape"===e.key)return void n?.onEscape?.();if("Tab"!==e.key)return;const t=Ap(o);if(0===t.length)return;const r=document.activeElement,i=t.indexOf(r);-1!==i&&(e.shiftKey?0===i&&(e.preventDefault(),t[t.length-1].focus()):i===t.length-1&&(e.preventDefault(),t[0].focus()))};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[t,e,s,n?.onEscape])}(O,t,{onEscape:h,focusTargetRef:"chat"===c?R:void 0});const D=I.widget_position,$=I.widget_position_z_index??40,j=(e=>{const t="20px",n="20px";switch(e){case"bottom_right":default:return{bottom:t,right:n};case"bottom_left":return{bottom:t,left:n};case"top_right":return{top:t,right:n};case"top_left":return{top:t,left:n}}})(D),[F,U]=p(!1),[B,W]=p(!1),G=u(null),H=u(null),Z=o(e=>{W(e),S?.(e)},[S]);if(!t)return null;const V=I.widget_background_color.includes("gradient")?I.widget_background_color:`linear-gradient(135deg, ${I.widget_background_color} 0%, ${I.widget_background_color} 100%)`,q={width:A,height:n?"48px":M,fontSize:I.widget_font_size,backgroundImage:V,zIndex:$},J=E?"absolute":"fixed",Y=E?D.includes("top")?{top:"20px",...D.includes("right")?{right:"20px"}:{left:"20px"}}:{bottom:"20px",...D.includes("right")?{right:"20px"}:{left:"20px"}}:{},K=`${D.includes("top")?"top":"bottom"} ${D.includes("right")?"right":"left"}`,Q="chat"===c&&!1!==e.use_screenshare?()=>{B?H.current?.():G.current?.()}:void 0;/* @__PURE__ */
|
|
60
58
|
return g(fp,{ref:O,position:J,rounded:"theme",border:!0,overflow:"hidden",style:{zIndex:$,backgroundImage:V,transformOrigin:K,...q,...E?Y:j,pointerEvents:"auto",scrollbarWidth:"thin",animation:"messenger-entrance 300ms cubic-bezier(0, 1.2, 1, 1)",boxShadow:"0 12px 40px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.08)"},children:[
|
|
61
|
-
/* @__PURE__ */f(nh,{title:e.agent_name??"AI Agent",subtitle:n?void 0:e.agent_description??"How can I help?",minimized:n,screenSharing:B,onScreenShare:
|
|
59
|
+
/* @__PURE__ */f(nh,{title:e.agent_name??"AI Agent",subtitle:n?void 0:e.agent_description??"How can I help?",minimized:n,screenSharing:B,onScreenShare:Q,onClose:h}),!n&&/* @__PURE__ */g(m,{children:[/* @__PURE__ */f(ku,{grow:!0,overflow:"hidden",style:{display:"flex",flexDirection:"column",minHeight:0},children:/* @__PURE__ */g(Eh,{direction:N,children:["home"===c&&/* @__PURE__ */f(Ih,{config:e,messages:r,onNavigateToChat:()=>{P("forward"),C("chat")},onChipClick:e=>{b(Ac(e.text,e.type,"chip-message")),w(e.type),y(e.text,e.type,void 0,void 0,!0)}}),"chat"===c&&/* @__PURE__ */f(xh,{config:e,messages:r,currentMode:i,isTaskRunning:s,taskProgress:l,onSendMessage:y,onSetMode:w,onAddMessage:b,onUpdateMessage:v,onRemoveMessage:x,onStopTask:k,onClearChat:_,onScreenSharingChange:Z,onStartScreenShareRef:G,onStopScreenShareRef:H,messageInputRef:R}),"help"===c&&/* @__PURE__ */g(fp,{id:"view-help",role:"tabpanel","aria-labelledby":"tab-help",height:"full",padding:"lg",children:[/* @__PURE__ */g(fp,{grow:!0,align:"center",justify:"center",gap:"sm",children:[/* @__PURE__ */f(up,{name:"help",size:32,className:"text-foreground-faint"}),/* @__PURE__ */f(vp,{size:"sm",variant:"muted",children:"Help – coming soon"})]}),/* @__PURE__ */f(ku,{style:{padding:"10px 16px",borderRadius:"var(--radius-xl, 12px)",border:"1px solid var(--border)"},children:/* @__PURE__ */g(vp,{size:"xs",variant:"faint",style:{textAlign:"center",display:"block"},children:[e.agent_name??"AI Agent"," • v",Tp]})})]}),"news"===c&&/* @__PURE__ */g(fp,{id:"view-news",role:"tabpanel","aria-labelledby":"tab-news",height:"full",align:"center",justify:"center",gap:"sm",padding:"lg",children:[/* @__PURE__ */f(up,{name:"info",size:32,className:"text-foreground-faint"}),/* @__PURE__ */f(vp,{size:"sm",variant:"muted",children:"News – coming soon"})]})]},c)}),/* @__PURE__ */f(rh,{tabs:Th,active:c,onChange:e=>{C(e)}})]}),!n&&!E&&["top-left","top-right","bottom-left","bottom-right"].map(e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r={position:"absolute",width:"20px",height:"20px",padding:"4px",touchAction:"none",zIndex:10,display:"flex",alignItems:t?"flex-start":"flex-end",justifyContent:n?"flex-start":"flex-end",cursor:t&&n||!t&&!n?"nwse-resize":"nesw-resize",top:t?0:void 0,bottom:t?void 0:0,left:n?0:void 0,right:n?void 0:0};/* @__PURE__ */
|
|
62
60
|
return f("div",{role:"separator","aria-label":`Resize widget from ${e.replace("-"," ")}`,title:"Drag to resize",style:r,onMouseDown:z(e)},e)}),
|
|
63
|
-
/* @__PURE__ */f(ah,{isOpen:F,onClose:()=>U(!1),diagnosticData:{chatId:Pc.getChatId(),streamEndpoint:(()=>{const t=$c.getConfig()?.mtxApiHost||e.mtxApiHost;return t?`${t.replace(/\/$/,"")}/widget/stream`:null})(),connectionStatus:(()=>{try{return Lc.getInstance().getStatus()}catch{return"disconnected"}})(),applicationId:$c.getConfig()?.mtxApp,agentId:$c.getConfig()?.mtxAgent,version:Tp,build:"dev"}})]})},
|
|
61
|
+
/* @__PURE__ */f(ah,{isOpen:F,onClose:()=>U(!1),diagnosticData:{chatId:Pc.getChatId(),streamEndpoint:(()=>{const t=$c.getConfig()?.mtxApiHost||e.mtxApiHost;return t?`${t.replace(/\/$/,"")}/widget/stream`:null})(),connectionStatus:(()=>{try{return Lc.getInstance().getStatus()}catch{return"disconnected"}})(),applicationId:$c.getConfig()?.mtxApp,agentId:$c.getConfig()?.mtxAgent,version:Tp,build:"dev"}})]})},Mh=class extends t.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){}render(){return this.state.hasError?null:this.props.children}},zh=({config:e})=>{const[t,n]=p(!1),{state:r,actions:i,config:o,shouldShow:s,isPreviewMode:l,configValid:c}=Qc({config:e});var u;u=r.isOpen,a(()=>{if(!u)return;if(!window.matchMedia("(max-width: 767px)").matches)return;const e=document.documentElement,t=document.body,n=e.style.overflow,r=t.style.overflow;return e.style.overflow="hidden",t.style.overflow="hidden",()=>{e.style.overflow=n,t.style.overflow=r}},[u]);const[h,m]=p(e.widget_position??"bottom_right"),b=d(()=>`marketrix_widget_position_${e.mtxId??(null!=e.mtxApp?String(e.mtxApp):"default")}`,[e.mtxApp,e.mtxId]);a(()=>{m(o.widget_position??"bottom_right")},[o.widget_position]),a(()=>{if(l||"undefined"==typeof localStorage)return;const e=o.widget_position??"bottom_right",t=localStorage.getItem(b);"bottom_left"!==t&&"bottom_right"!==t&&"top_left"!==t&&"top_right"!==t?(localStorage.setItem(b,e),m(e)):m(t)},[l,b,o.widget_position]),a(()=>{if(r.isOpen||l||"default"!==o.widget_appearance)return void n(!1);const e=setTimeout(()=>n(!0),2e3);return()=>clearTimeout(e)},[r.isOpen,l,o.widget_appearance]);if(!c)return null;if(!(l?e.widget_enabled??o.widget_enabled:s&&o.widget_enabled&&!1!==e.show_widget))return null;const v=(S=function(e={}){return E({...I,widget_background_color:e.widget_background_color??I.widget_background_color,widget_text_color:e.widget_text_color??I.widget_text_color,widget_border_color:e.widget_border_color??I.widget_border_color,widget_accent_color:e.widget_accent_color??I.widget_accent_color,widget_secondary_color:e.widget_secondary_color??I.widget_secondary_color,widget_border_radius:e.widget_border_radius??I.widget_border_radius,widget_font_size:e.widget_font_size??I.widget_font_size,widget_width:e.widget_width??I.widget_width,widget_height:e.widget_height??I.widget_height,widget_shadow:e.widget_shadow??I.widget_shadow,widget_animation_duration:e.widget_animation_duration??I.widget_animation_duration,widget_fade_duration:e.widget_fade_duration??I.widget_fade_duration})}(o),{"--background":S.color.background,"--foreground":S.color.foreground,"--card":S.color.background,"--card-foreground":S.color.foreground,"--popover":S.color.background,"--popover-foreground":S.color.foreground,"--primary":S.color.primary,"--foreground-muted":S.color.foregroundMuted,"--foreground-faint":S.color.foregroundFaint,"--border-muted":S.color.borderMuted,"--primary-foreground":S.color.primaryForeground,"--primary-hover":S.color.primaryHover,"--primary-muted":S.color.primaryMuted,"--secondary":S.color.secondary,"--secondary-foreground":S.color.secondaryForeground,"--secondary-bg":S.color.secondaryBg,"--secondary-hover":S.color.secondaryHover,"--muted":S.color.border,"--muted-foreground":S.color.secondary,"--accent":S.color.background,"--accent-foreground":S.color.foreground,"--border":S.color.border,"--input":S.color.border,"--ring":S.color.primary,"--radius":S.radius,"--shadow":S.shadow,"--duration-animation":S.motion.durationAnimation,"--duration-fade":S.motion.durationFade,"--widget-width":S.size.widgetWidth,"--widget-height":S.size.widgetHeight});var S;const C=Math.max(o.widget_position_z_index??0,y),T={...o,widget_position:h,widget_position_z_index:C,show_widget:e.show_widget,use_screenshare:e.use_screenshare},A=r.isLoading||r.isTaskRunning,M={...v,"--widget-z-index":C};/* @__PURE__ */
|
|
64
62
|
return g(ku,{"data-marketrix-widget":!0,position:"relative",style:{...M,...l&&{width:"100%",height:"100%"}},"data-widget-mode":o?.widget_feature_human?"hybrid":"ai",children:[A&&/* @__PURE__ */f(ku,{"data-screen-edge-glow":!0,position:"fixed",inset:"0",style:{boxShadow:`inset 0 0 22px 2px ${k(o.widget_accent_color,.72)}, inset 0 0 46px 10px ${k(o.widget_accent_color,.28)}`,pointerEvents:"none",zIndex:w}}),
|
|
65
|
-
/* @__PURE__ */f(
|
|
66
|
-
/* @__PURE__ */f(Ep,{open:r.isOpen,processing:r.isLoading,error:!!r.error,taskRunning:r.isTaskRunning,onClick:i.toggleWidget,onStop:i.stopTask,accentColor:T.widget_accent_color,backgroundColor:T.widget_background_color,borderRadius:T.widget_border_radius,tooltipBgColor:_(T.widget_accent_color,.3),tooltipTextColor:x(_(T.widget_accent_color,.3)),zIndex:T.widget_position_z_index??50,position:h,onDrag:e=>{m(e),l||"undefined"==typeof localStorage||localStorage.setItem(b,e)},isPreviewMode:l}),r.error&&/* @__PURE__ */f(kp,{tone:"error",title:r.error,onDismiss:()=>i.clearError(),onRetry:()=>i.clearError(),position:h.includes("top")?"bottom-center":"above-fab"}),t&&!r.error&&o.widget_greeting&&/* @__PURE__ */f(kp,{tone:"info",title:o.widget_greeting,body:o.widget_body,onDismiss:()=>n(!1),position:"bottom-center"})]})},Rh=Object.defineProperty,Nh=(e,t,n)=>((e,t,n)=>t in e?Rh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Ph=Object.defineProperty,Lh=(e,t,n)=>((e,t,n)=>t in e?Ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Dh=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Dh||{}),$h={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fh={};function Uh(e){if(Fh[e])return Fh[e];const t=globalThis[e],n=t.prototype,r=e in $h?$h[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in jh?jh[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return Fh[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?Fh[e]=o:n}catch{return n}}var Bh={};function Wh(e,t,n){var r;const i=`${e}.${String(n)}`;if(Bh[i])return Bh[i].call(t);const o=Uh(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Bh[i]=s,s.call(t)):t[n]}var Gh={};function Hh(e,t,n){const r=`${e}.${String(n)}`;if(Gh[r])return Gh[r].bind(t);const i=Uh(e)[n];return"function"!=typeof i?t[n]:(Gh[r]=i,i.bind(t))}var Zh={ownerDocument:function(e){return Wh("Node",e,"ownerDocument")},childNodes:function(e){return Wh("Node",e,"childNodes")},parentNode:function(e){return Wh("Node",e,"parentNode")},parentElement:function(e){return Wh("Node",e,"parentElement")},textContent:function(e){return Wh("Node",e,"textContent")},contains:function(e,t){return Hh("Node",e,"contains")(t)},getRootNode:function(e){return Hh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Wh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Wh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Wh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Wh("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Uh("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}};function Vh(e){return e.nodeType===e.ELEMENT_NODE}function qh(e){const t=e&&"host"in e&&"mode"in e&&Zh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Zh.shadowRoot(t)===e)}function Jh(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Yh(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(t=Array.from(n,e=>Kh(e,r)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function Kh(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Yh(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?lm(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?lm(n,t):n}}var Qh=class{constructor(){Lh(this,"idNodeMap",/* @__PURE__ */new Map),Lh(this,"nodeMetaMap",/* @__PURE__ */new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=/* @__PURE__ */new Map,this.nodeMetaMap=/* @__PURE__ */new WeakMap}};function Xh({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&em(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function em(e){return e.toLowerCase()}var tm="__rrweb_original__";function nm(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?em(t):null}function rm(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(i){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}var im=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,om=/^(?:[a-z+]+:)?\/\//i,sm=/^www\..*/i,am=/^(data:)([^,]*),(.*)/i;function lm(e,t){return(e||"").replace(im,(e,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return e;if(om.test(a)||sm.test(a))return`url(${l}${a}${l})`;if(am.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),d=a.split("/");c.pop();for(const t of d){if("."===t)continue;".."===t?c.pop():c.push(t)}return`url(${l}${c.join("/")}${l})`})}function cm(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function dm(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),i=[];let o=0;if(r.length>1&&e&&"string"==typeof e){let t=cm(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const l=cm(r[a].textContent,n),c=100;let d=3;for(;d<l.length&&(l[d].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,d),1));d++);for(;d<l.length;d++){let u=l.substring(0,d),p=t.split(u),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[a-1].textContent)h=t.indexOf(u,1);else if(1===p.length){if(u=u.substring(0,u.length-1),p=t.split(u),p.length<=1)return i.push(e),i;d=c+1}else d===l.length-1&&(h=t.indexOf(u));if(p.length>=2&&d>c){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=cm(e).length;h=t.indexOf(u,n)}-1===h&&(h=p[0].length)}if(-1!==h){let a=Math.floor(h/s);for(;a>0&&a<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;const l=cm(e.substring(0,a),n);if(l.length===h){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(h);break}l.length<h?a+=Math.max(1,Math.floor((h-l.length)/s)):a-=Math.max(1,Math.floor((l.length-h)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}var um,pm,hm=1,mm=/* @__PURE__ */new RegExp("[^a-z0-9-_:]");function fm(){return hm++}var gm=/^[^ \t\n\r\u000c]+/,ym=/^[, \t\n\r\u000c]+/;var wm=/* @__PURE__ */new WeakMap;function bm(e,t){return t&&""!==t.trim()?xm(e,t):t}function vm(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function xm(e,t){let n=wm.get(e);if(n||(n=e.createElement("a"),wm.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function km(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?bm(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(ym),!(n>=t.length);){let o=r(gm);if(","===o.slice(-1))o=bm(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=bm(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?lm(r,xm(e)):"object"===t&&"data"===n?bm(e,r):r:r}function _m(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function Sm(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Sm(Zh.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&Sm(Zh.parentNode(e),t,n)}function Cm(e,t,n,r){let i;if(Vh(e)){if(i=e,!Zh.childNodes(i).length)return!1}else{if(null===Zh.parentElement(e))return!1;i=Zh.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Sm(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(o){}return!1}function Im(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:d,dataURLOptions:u={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Dh.Document,childNodes:[],compatMode:e.compatMode}:{type:Dh.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Dh.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:h}=t,m=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,i),f=function(e){if(e instanceof HTMLFormElement)return"form";const t=em(e.tagName);return mm.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let v=0;v<y;v++){const t=e.attributes[v];_m(f,t.name,t.value)||(g[t.name]=km(n,f,em(t.name),t.value))}if("link"===f&&o){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Yh(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===f&&e.sheet){let t=Yh(e.sheet);t&&(e.childNodes.length>1&&(t=dm(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(f)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Xh({element:e,type:nm(e),tagName:f,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===f&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===f&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===f&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const i=t.getImageData,o=tm in i?i[tm]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===f&&c){um||(um=n.createElement("canvas"),pm=um.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),i=()=>{t.removeEventListener("load",i);try{um.width=t.naturalWidth,um.height=t.naturalHeight,pm.drawImage(t,0,0),g.rr_dataURL=um.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(f)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==f||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(f)&&(w=!0)}catch(b){}return{type:Dh.Element,tagName:f,attributes:g,childNodes:[],isSVG:vm(e)||void 0,needBlock:m,rootId:h,isCustom:w}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:u,inlineImages:p,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Zh.parentNode(e),a=s&&s.tagName;let l="";const c="STYLE"===a||void 0,d="SCRIPT"===a||void 0;d?l="SCRIPT_PLACEHOLDER":o||(l=Zh.textContent(e),c&&l&&(l=lm(l,xm(t.doc))));!c&&!d&&l&&n&&(l=r?r(l,Zh.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Dh.Text,textContent:l||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Dh.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Dh.Comment,textContent:Zh.textContent(e)||"",rootId:y};default:return!1}}function Em(e){return null==e?"":e.toLowerCase()}function Tm(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function Am(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:_=!1,cssCaptured:S=!1}=t;let{needsMask:C}=t,{preserveWhiteSpace:I=!0}=t;C||(C=Cm(e,s,a,void 0===C));const E=Im(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,keepIframeSrcFn:k,newlyAddedElement:_,cssCaptured:S});if(!E)return null;let T;T=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Dh.Comment)return!0;if(e.type===Dh.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===rm(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Em(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Em(e.attributes.name)||"icon"===Em(e.attributes.rel)||"apple-touch-icon"===Em(e.attributes.rel)||"shortcut icon"===Em(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Em(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Em(e.attributes.property).match(/^(og|twitter|fb):/)||Em(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Em(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Em(e.attributes.name)||"googlebot"===Em(e.attributes.name)||"bingbot"===Em(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Em(e.attributes.name)||"generator"===Em(e.attributes.name)||"framework"===Em(e.attributes.name)||"publisher"===Em(e.attributes.name)||"progid"===Em(e.attributes.name)||Em(e.attributes.property).match(/^article:/)||Em(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Em(e.attributes.name)||"yandex-verification"===Em(e.attributes.name)||"csrf-token"===Em(e.attributes.name)||"p:domain_verify"===Em(e.attributes.name)||"verify-v1"===Em(e.attributes.name)||"verification"===Em(e.attributes.name)||"shopify-checkout-api-token"===Em(e.attributes.name)))return!0}}return!1}(E,h)||!I&&E.type===Dh.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:fm();const A=Object.assign(E,{id:T});if(r.add(e,A),-2===T)return null;y&&y(e);let M=!l;if(A.type===Dh.Element){M=M&&!A.needBlock,delete A.needBlock;const t=Zh.shadowRoot(e);t&&Jh(t)&&(A.isShadowHost=!0)}if((A.type===Dh.Document||A.type===Dh.Element)&&M){h.headWhitespace&&A.type===Dh.Element&&"head"===A.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k,cssCaptured:!1};if(A.type===Dh.Element&&"textarea"===A.tagName&&void 0!==A.attributes.value);else{A.type===Dh.Element&&void 0!==A.attributes._cssText&&"string"==typeof A.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Zh.childNodes(e))){const e=Am(n,t);e&&A.childNodes.push(e)}}let _=null;if(Vh(e)&&(_=Zh.shadowRoot(e)))for(const e of Array.from(Zh.childNodes(_))){const n=Am(e,t);n&&(Jh(_)&&(n.isShadow=!0),A.childNodes.push(n))}}const z=Zh.parentNode(e);return z&&qh(z)&&Jh(z)&&(A.isShadow=!0),A.type===Dh.Element&&"iframe"===A.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(a){return}if("complete"!==i){const r=setTimeout(()=>{o||(t(),o=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const n=Am(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k});n&&w(e,n)}},b),A.type===Dh.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===rm(A.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(s){return}if(r)return;const o=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(v){const t=Am(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k});t&&v(e,t)}},x),A}function Mm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zm(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Om={exports:{}},Rm=String,Nm=function(){return{isColorSupported:!1,reset:Rm,bold:Rm,dim:Rm,italic:Rm,underline:Rm,inverse:Rm,hidden:Rm,strikethrough:Rm,black:Rm,red:Rm,green:Rm,yellow:Rm,blue:Rm,magenta:Rm,cyan:Rm,white:Rm,gray:Rm,bgBlack:Rm,bgRed:Rm,bgGreen:Rm,bgYellow:Rm,bgBlue:Rm,bgMagenta:Rm,bgCyan:Rm,bgWhite:Rm}};Om.exports=Nm(),Om.exports.createColors=Nm;var Pm=Om.exports,Lm=/* @__PURE__ */zm(/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Dm=Pm,$m=Lm,jm=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Dm.isColorSupported),$m&&e&&(t=$m(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Dm.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}},Fm=jm;jm.default=jm;var Um={};Um.isClean=Symbol("isClean"),Um.my=Symbol("my");var Bm={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Wm=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Bm[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=Bm[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},Gm=Wm;Wm.default=Wm;var Hm=Gm;function Zm(e,t){new Hm(t).stringify(e)}var Vm=Zm;Zm.default=Zm;var{isClean:qm,my:Jm}=Um,Ym=Fm,Km=Gm,Qm=Vm;function Xm(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>Xm(e,n)):("object"===o&&null!==i&&(i=Xm(i)),n[r]=i)}return n}var ef=class{constructor(e={}){this.raws={},this[qm]=!1,this[Jm]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Xm(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new Ym(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[qm]){this[qm]=!1;let e=this;for(;e=e.parent;)e[qm]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new Km).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||/* @__PURE__ */new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Qm){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}},tf=ef;ef.default=ef;var nf=tf,rf=class extends nf{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},of=rf;rf.default=rf;var sf={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},{SourceMapConsumer:af,SourceMapGenerator:lf}=Lm,{existsSync:cf,readFileSync:df}=Lm,{dirname:uf,join:pf}=Lm;var hf=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=uf(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new af(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=uf(e),cf(e))return this.mapFile=e,df(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof af)return lf.fromSourceMap(t).toString();if(t instanceof lf)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=pf(uf(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},mf=hf;hf.default=hf;var{SourceMapConsumer:ff,SourceMapGenerator:gf}=Lm,{fileURLToPath:yf,pathToFileURL:wf}=Lm,{isAbsolute:bf,resolve:vf}=Lm,{nanoid:xf}=sf,kf=Lm,_f=Fm,Sf=mf,Cf=Symbol("fromOffsetCache"),If=Boolean(ff&&gf),Ef=Boolean(vf&&bf),Tf=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ef||/^\w+:\/\//.test(t.from)||bf(t.from)?this.file=t.from:this.file=vf(t.from)),Ef&&If){let e=new Sf(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+xf(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new _f(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new _f(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(wf&&(i.input.url=wf(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Cf])n=this[Cf];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Cf]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:vf(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=bf(a.source)?wf(a.source):new URL(a.source,this.map.consumer().sourceRoot||wf(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!yf)throw new Error("file: protocol is not available in this PostCSS build");l.file=yf(o)}let c=s.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},Af=Tf;Tf.default=Tf,kf&&kf.registerInput&&kf.registerInput(Tf);var{SourceMapConsumer:Mf,SourceMapGenerator:zf}=Lm,{dirname:Of,relative:Rf,resolve:Nf,sep:Pf}=Lm,{pathToFileURL:Lf}=Lm,Df=Af,$f=Boolean(Mf&&zf),jf=Boolean(Of&&Nf&&Rf&&Pf),Ff=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=/* @__PURE__ */new Map,this.memoizedPaths=/* @__PURE__ */new Map,this.memoizedURLs=/* @__PURE__ */new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||Of(e.file);!1===this.mapOpts.sourcesContent?(t=new Mf(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),jf&&$f&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=zf.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new zf({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new zf({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type&&("atrule"!==a.type||a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?Of(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Of(Nf(n,this.mapOpts.annotation)));let r=Rf(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Df(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Lf){let t=Lf(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Pf&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}},Uf=tf,Bf=class extends Uf{constructor(e){super(e),this.type="comment"}},Wf=Bf;Bf.default=Bf;var Gf,Hf,Zf,Vf,{isClean:qf,my:Jf}=Um,Yf=of,Kf=Wf,Qf=tf;function Xf(e){return e.map(e=>(e.nodes&&(e.nodes=Xf(e.nodes)),delete e.source,e))}function eg(e){if(e[qf]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)eg(t)}var tg=class e extends Qf{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Xf(Gf(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Yf(t)]}else if(t.selector)t=[new Hf(t)];else if(t.name)t=[new Zf(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Kf(t)]}return t.map(t=>(t[Jf]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[qf]&&eg(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};tg.registerParse=e=>{Gf=e},tg.registerRule=e=>{Hf=e},tg.registerAtRule=e=>{Zf=e},tg.registerRoot=e=>{Vf=e};var ng=tg;tg.default=tg,tg.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Zf.prototype):"rule"===e.type?Object.setPrototypeOf(e,Hf.prototype):"decl"===e.type?Object.setPrototypeOf(e,Yf.prototype):"comment"===e.type?Object.setPrototypeOf(e,Kf.prototype):"root"===e.type&&Object.setPrototypeOf(e,Vf.prototype),e[Jf]=!0,e.nodes&&e.nodes.forEach(e=>{tg.rebuild(e)})};var rg,ig,og=ng,sg=class extends og{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new rg(new ig,this,e).stringify()}};sg.registerLazyResult=e=>{rg=e},sg.registerProcessor=e=>{ig=e};var ag=sg;sg.default=sg;var lg=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},cg=lg;lg.default=lg;var dg=cg,ug=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new dg(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},pg=ug;ug.default=ug;var hg="'".charCodeAt(0),mg='"'.charCodeAt(0),fg="\\".charCodeAt(0),gg="/".charCodeAt(0),yg="\n".charCodeAt(0),wg=" ".charCodeAt(0),bg="\f".charCodeAt(0),vg="\t".charCodeAt(0),xg="\r".charCodeAt(0),kg="[".charCodeAt(0),_g="]".charCodeAt(0),Sg="(".charCodeAt(0),Cg=")".charCodeAt(0),Ig="{".charCodeAt(0),Eg="}".charCodeAt(0),Tg=";".charCodeAt(0),Ag="*".charCodeAt(0),Mg=":".charCodeAt(0),zg="@".charCodeAt(0),Og=/[\t\n\f\r "#'()/;[\\\]{}]/g,Rg=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ng=/.[\r\n"'(/\\]/,Pg=/[\da-f]/i,Lg=ng,Dg=class extends Lg{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},$g=Dg;Dg.default=Dg,Lg.registerAtRule(Dg);var jg,Fg,Ug=ng,Bg=class extends Ug{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new jg(new Fg,this,e).stringify()}};Bg.registerLazyResult=e=>{jg=e},Bg.registerProcessor=e=>{Fg=e};var Wg=Bg;Bg.default=Bg,Ug.registerRoot(Bg);var Gg={comma:e=>Gg.split(e,[","],!0),space:e=>Gg.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let d of e)c?c=!1:"\\"===d?c=!0:a?d===l&&(a=!1):'"'===d||"'"===d?(a=!0,l=d):"("===d?s+=1:")"===d?s>0&&(s-=1):0===s&&t.includes(d)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=d;return(n||""!==i)&&r.push(i.trim()),r}},Hg=Gg;Gg.default=Gg;var Zg=ng,Vg=Hg,qg=class extends Zg{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Vg.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},Jg=qg;qg.default=qg,Zg.registerRule(qg);var Yg=of,Kg=function(e,t={}){let n,r,i,o,s,a,l,c,d,u,p=e.css.valueOf(),h=t.ignoreErrors,m=p.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(f),n){case yg:case wg:case vg:case xg:case bg:r=f;do{r+=1,n=p.charCodeAt(r)}while(n===wg||n===yg||n===vg||n===xg||n===bg);u=["space",p.slice(f,r)],f=r-1;break;case kg:case _g:case Ig:case Eg:case Mg:case Tg:case Cg:{let e=String.fromCharCode(n);u=[e,e,f];break}case Sg:if(c=g.length?g.pop()[1]:"",d=p.charCodeAt(f+1),"url"===c&&d!==hg&&d!==mg&&d!==wg&&d!==yg&&d!==vg&&d!==bg&&d!==xg){r=f;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(h||t){r=f;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===fg;)l-=1,a=!a}while(a);u=["brackets",p.slice(f,r+1),f,r],f=r}else r=p.indexOf(")",f+1),o=p.slice(f,r+1),-1===r||Ng.test(o)?u=["(","(",f]:(u=["brackets",o,f,r],f=r);break;case hg:case mg:i=n===hg?"'":'"',r=f;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(h||t){r=f+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===fg;)l-=1,a=!a}while(a);u=["string",p.slice(f,r+1),f,r],f=r;break;case zg:Og.lastIndex=f+1,Og.test(p),r=0===Og.lastIndex?p.length-1:Og.lastIndex-2,u=["at-word",p.slice(f,r+1),f,r],f=r;break;case fg:for(r=f,s=!0;p.charCodeAt(r+1)===fg;)r+=1,s=!s;if(n=p.charCodeAt(r+1),s&&n!==gg&&n!==wg&&n!==yg&&n!==vg&&n!==xg&&n!==bg&&(r+=1,Pg.test(p.charAt(r)))){for(;Pg.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===wg&&(r+=1)}u=["word",p.slice(f,r+1),f,r],f=r;break;default:n===gg&&p.charCodeAt(f+1)===Ag?(r=p.indexOf("*/",f+2)+1,0===r&&(h||t?r=p.length:w("comment")),u=["comment",p.slice(f,r+1),f,r],f=r):(Rg.lastIndex=f+1,Rg.test(p),r=0===Rg.lastIndex?p.length-1:Rg.lastIndex-2,u=["word",p.slice(f,r+1),f,r],g.push(u),f=r)}return f++,u},position:function(){return f}}},Qg=Wf,Xg=$g,ey=Wg,ty=Jg,ny={empty:!0,space:!0};var ry=ng,iy=class{constructor(e){this.input=e,this.root=new ey,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new Xg;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Qg;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Kg(this.input)}decl(e,t){let n=new Yg;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let n=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==n)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ty;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,c="",d=!0;for(let u=0;u<l;u+=1)i=n[u],o=i[0],"space"!==o||u!==l-1||r?"comment"===o?(a=n[u-1]?n[u-1][0]:"empty",s=n[u+1]?n[u+1][0]:"empty",ny[a]||ny[s]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new ty;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},oy=Af;function sy(e,t){let n=new iy(new oy(e,t));try{n.parse()}catch(r){throw r}return n.root}var ay=sy;sy.default=sy,ry.registerParse(sy);var{isClean:ly,my:cy}=Um,dy=Ff,uy=Vm,py=ng,hy=ag,my=pg,fy=ay,gy=Wg,yy={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wy={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},by={Once:!0,postcssPlugin:!0,prepare:!0};function vy(e){return"object"==typeof e&&"function"==typeof e.then}function xy(e){let t=!1,n=yy[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function ky(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:xy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function _y(e){return e[ly]=!1,e.nodes&&e.nodes.forEach(e=>_y(e)),e}var Sy={},Cy=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof my)i=_y(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=fy;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(o){this.processed=!0,this.error=o}i&&!i[cy]&&py.rebuild(i)}else i=_y(n);this.result=new my(t,i,r),this.helpers={...Sy,postcss:Sy,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!wy[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!by[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(vy(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ly];){e[ly]=!0;let n=[ky(e)];for(;n.length>0;){let e=this.visitTick(n);if(vy(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return vy(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=uy;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new dy(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(vy(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ly];)e[ly]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(vy(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(o){throw this.handleError(o,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[ly])return r[ly]=!0,void e.push(ky(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[ly]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ly]=!0;let t=xy(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[ly]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Cy.registerPostcss=e=>{Sy=e};var Iy=Cy;Cy.default=Cy,gy.registerLazyResult(Cy),hy.registerLazyResult(Cy);var Ey=Ff,Ty=Vm,Ay=ay,My=pg,zy=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=Ty;this.result=new My(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Ey(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Ay;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},Oy=zy;zy.default=zy;var Ry=Oy,Ny=Iy,Py=ag,Ly=Wg,Dy=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ny(this,e,t):new Ry(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},$y=Dy;Dy.default=Dy,Ly.registerProcessor(Dy),Py.registerProcessor(Dy);var jy=of,Fy=mf,Uy=Wf,By=$g,Wy=Af,Gy=Wg,Hy=Jg;function Zy(e,t){if(Array.isArray(e))return e.map(e=>Zy(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Wy.prototype};n.map&&(n.map={...n.map,__proto__:Fy.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Zy(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Gy(r);if("decl"===r.type)return new jy(r);if("rule"===r.type)return new Hy(r);if("comment"===r.type)return new Uy(r);if("atrule"===r.type)return new By(r);throw new Error("Unknown node type: "+e.type)}var Vy=Zy;Zy.default=Zy;var qy=Fm,Jy=of,Yy=Iy,Ky=ng,Qy=$y,Xy=Vm,ew=Vy,tw=ag,nw=cg,rw=Wf,iw=$g,ow=pg,sw=Af,aw=ay,lw=Hg,cw=Jg,dw=Wg,uw=tf;function pw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Qy(e)}pw.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{}.LANG&&{}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new Qy).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return pw([i(n)]).process(e,t)},i},pw.stringify=Xy,pw.parse=aw,pw.fromJSON=ew,pw.list=lw,pw.comment=e=>new rw(e),pw.atRule=e=>new iw(e),pw.decl=e=>new Jy(e),pw.rule=e=>new cw(e),pw.root=e=>new dw(e),pw.document=e=>new tw(e),pw.CssSyntaxError=qy,pw.Declaration=Jy,pw.Container=Ky,pw.Processor=Qy,pw.Document=tw,pw.Comment=rw,pw.Warning=nw,pw.AtRule=iw,pw.Result=ow,pw.Input=sw,pw.Rule=cw,pw.Root=dw,pw.Node=uw,Yy.registerPostcss(pw);var hw=pw;pw.default=pw;var mw=/* @__PURE__ */Mm(hw);mw.stringify,mw.fromJSON,mw.plugin,mw.parse,mw.list,mw.document,mw.comment,mw.atRule,mw.rule,mw.decl,mw.root,mw.CssSyntaxError,mw.Declaration,mw.Container,mw.Processor,mw.Document,mw.Comment,mw.Warning,mw.AtRule,mw.Result,mw.Input,mw.Rule,mw.Root,mw.Node;var fw=Object.defineProperty,gw=(e,t,n)=>((e,t,n)=>t in e?fw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function yw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ww(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var bw={exports:{}},vw=String,xw=function(){return{isColorSupported:!1,reset:vw,bold:vw,dim:vw,italic:vw,underline:vw,inverse:vw,hidden:vw,strikethrough:vw,black:vw,red:vw,green:vw,yellow:vw,blue:vw,magenta:vw,cyan:vw,white:vw,gray:vw,bgBlack:vw,bgRed:vw,bgGreen:vw,bgYellow:vw,bgBlue:vw,bgMagenta:vw,bgCyan:vw,bgWhite:vw}};bw.exports=xw(),bw.exports.createColors=xw;var kw=bw.exports,_w=/* @__PURE__ */ww(/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Sw=kw,Cw=_w,Iw=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Sw.isColorSupported),Cw&&e&&(t=Cw(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Sw.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}},Ew=Iw;Iw.default=Iw;var Tw={};Tw.isClean=Symbol("isClean"),Tw.my=Symbol("my");var Aw={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Mw=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Aw[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=Aw[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},zw=Mw;Mw.default=Mw;var Ow=zw;function Rw(e,t){new Ow(t).stringify(e)}var Nw=Rw;Rw.default=Rw;var{isClean:Pw,my:Lw}=Tw,Dw=Ew,$w=zw,jw=Nw;function Fw(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>Fw(e,n)):("object"===o&&null!==i&&(i=Fw(i)),n[r]=i)}return n}var Uw=class{constructor(e={}){this.raws={},this[Pw]=!1,this[Lw]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Fw(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new Dw(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Pw]){this[Pw]=!1;let e=this;for(;e=e.parent;)e[Pw]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new $w).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||/* @__PURE__ */new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=jw){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}},Bw=Uw;Uw.default=Uw;var Ww=Bw,Gw=class extends Ww{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},Hw=Gw;Gw.default=Gw;var Zw={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},{SourceMapConsumer:Vw,SourceMapGenerator:qw}=_w,{existsSync:Jw,readFileSync:Yw}=_w,{dirname:Kw,join:Qw}=_w;var Xw=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Kw(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Vw(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=Kw(e),Jw(e))return this.mapFile=e,Yw(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Vw)return qw.fromSourceMap(t).toString();if(t instanceof qw)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Qw(Kw(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},eb=Xw;Xw.default=Xw;var{SourceMapConsumer:tb,SourceMapGenerator:nb}=_w,{fileURLToPath:rb,pathToFileURL:ib}=_w,{isAbsolute:ob,resolve:sb}=_w,{nanoid:ab}=Zw,lb=_w,cb=Ew,db=eb,ub=Symbol("fromOffsetCache"),pb=Boolean(tb&&nb),hb=Boolean(sb&&ob),mb=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hb||/^\w+:\/\//.test(t.from)||ob(t.from)?this.file=t.from:this.file=sb(t.from)),hb&&pb){let e=new db(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+ab(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new cb(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new cb(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(ib&&(i.input.url=ib(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[ub])n=this[ub];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[ub]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:sb(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=ob(a.source)?ib(a.source):new URL(a.source,this.map.consumer().sourceRoot||ib(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!rb)throw new Error("file: protocol is not available in this PostCSS build");l.file=rb(o)}let c=s.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},fb=mb;mb.default=mb,lb&&lb.registerInput&&lb.registerInput(mb);var{SourceMapConsumer:gb,SourceMapGenerator:yb}=_w,{dirname:wb,relative:bb,resolve:vb,sep:xb}=_w,{pathToFileURL:kb}=_w,_b=fb,Sb=Boolean(gb&&yb),Cb=Boolean(wb&&vb&&bb&&xb),Ib=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=/* @__PURE__ */new Map,this.memoizedPaths=/* @__PURE__ */new Map,this.memoizedURLs=/* @__PURE__ */new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||wb(e.file);!1===this.mapOpts.sourcesContent?(t=new gb(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Cb&&Sb&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=yb.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new yb({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new yb({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type&&("atrule"!==a.type||a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?wb(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=wb(vb(n,this.mapOpts.annotation)));let r=bb(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new _b(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(kb){let t=kb(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===xb&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}},Eb=Bw,Tb=class extends Eb{constructor(e){super(e),this.type="comment"}},Ab=Tb;Tb.default=Tb;var Mb,zb,Ob,Rb,{isClean:Nb,my:Pb}=Tw,Lb=Hw,Db=Ab,$b=Bw;function jb(e){return e.map(e=>(e.nodes&&(e.nodes=jb(e.nodes)),delete e.source,e))}function Fb(e){if(e[Nb]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Fb(t)}var Ub=class e extends $b{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=jb(Mb(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Lb(t)]}else if(t.selector)t=[new zb(t)];else if(t.name)t=[new Ob(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Db(t)]}return t.map(t=>(t[Pb]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Nb]&&Fb(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ub.registerParse=e=>{Mb=e},Ub.registerRule=e=>{zb=e},Ub.registerAtRule=e=>{Ob=e},Ub.registerRoot=e=>{Rb=e};var Bb=Ub;Ub.default=Ub,Ub.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ob.prototype):"rule"===e.type?Object.setPrototypeOf(e,zb.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lb.prototype):"comment"===e.type?Object.setPrototypeOf(e,Db.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rb.prototype),e[Pb]=!0,e.nodes&&e.nodes.forEach(e=>{Ub.rebuild(e)})};var Wb,Gb,Hb=Bb,Zb=class extends Hb{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Wb(new Gb,this,e).stringify()}};Zb.registerLazyResult=e=>{Wb=e},Zb.registerProcessor=e=>{Gb=e};var Vb=Zb;Zb.default=Zb;var qb=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Jb=qb;qb.default=qb;var Yb=Jb,Kb=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Yb(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},Qb=Kb;Kb.default=Kb;var Xb="'".charCodeAt(0),ev='"'.charCodeAt(0),tv="\\".charCodeAt(0),nv="/".charCodeAt(0),rv="\n".charCodeAt(0),iv=" ".charCodeAt(0),ov="\f".charCodeAt(0),sv="\t".charCodeAt(0),av="\r".charCodeAt(0),lv="[".charCodeAt(0),cv="]".charCodeAt(0),dv="(".charCodeAt(0),uv=")".charCodeAt(0),pv="{".charCodeAt(0),hv="}".charCodeAt(0),mv=";".charCodeAt(0),fv="*".charCodeAt(0),gv=":".charCodeAt(0),yv="@".charCodeAt(0),wv=/[\t\n\f\r "#'()/;[\\\]{}]/g,bv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,vv=/.[\r\n"'(/\\]/,xv=/[\da-f]/i,kv=Bb,_v=class extends kv{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Sv=_v;_v.default=_v,kv.registerAtRule(_v);var Cv,Iv,Ev=Bb,Tv=class extends Ev{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Cv(new Iv,this,e).stringify()}};Tv.registerLazyResult=e=>{Cv=e},Tv.registerProcessor=e=>{Iv=e};var Av=Tv;Tv.default=Tv,Ev.registerRoot(Tv);var Mv={comma:e=>Mv.split(e,[","],!0),space:e=>Mv.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let d of e)c?c=!1:"\\"===d?c=!0:a?d===l&&(a=!1):'"'===d||"'"===d?(a=!0,l=d):"("===d?s+=1:")"===d?s>0&&(s-=1):0===s&&t.includes(d)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=d;return(n||""!==i)&&r.push(i.trim()),r}},zv=Mv;Mv.default=Mv;var Ov=Bb,Rv=zv,Nv=class extends Ov{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Rv.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},Pv=Nv;Nv.default=Nv,Ov.registerRule(Nv);var Lv=Hw,Dv=function(e,t={}){let n,r,i,o,s,a,l,c,d,u,p=e.css.valueOf(),h=t.ignoreErrors,m=p.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(f),n){case rv:case iv:case sv:case av:case ov:r=f;do{r+=1,n=p.charCodeAt(r)}while(n===iv||n===rv||n===sv||n===av||n===ov);u=["space",p.slice(f,r)],f=r-1;break;case lv:case cv:case pv:case hv:case gv:case mv:case uv:{let e=String.fromCharCode(n);u=[e,e,f];break}case dv:if(c=g.length?g.pop()[1]:"",d=p.charCodeAt(f+1),"url"===c&&d!==Xb&&d!==ev&&d!==iv&&d!==rv&&d!==sv&&d!==ov&&d!==av){r=f;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(h||t){r=f;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);u=["brackets",p.slice(f,r+1),f,r],f=r}else r=p.indexOf(")",f+1),o=p.slice(f,r+1),-1===r||vv.test(o)?u=["(","(",f]:(u=["brackets",o,f,r],f=r);break;case Xb:case ev:i=n===Xb?"'":'"',r=f;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(h||t){r=f+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);u=["string",p.slice(f,r+1),f,r],f=r;break;case yv:wv.lastIndex=f+1,wv.test(p),r=0===wv.lastIndex?p.length-1:wv.lastIndex-2,u=["at-word",p.slice(f,r+1),f,r],f=r;break;case tv:for(r=f,s=!0;p.charCodeAt(r+1)===tv;)r+=1,s=!s;if(n=p.charCodeAt(r+1),s&&n!==nv&&n!==iv&&n!==rv&&n!==sv&&n!==av&&n!==ov&&(r+=1,xv.test(p.charAt(r)))){for(;xv.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===iv&&(r+=1)}u=["word",p.slice(f,r+1),f,r],f=r;break;default:n===nv&&p.charCodeAt(f+1)===fv?(r=p.indexOf("*/",f+2)+1,0===r&&(h||t?r=p.length:w("comment")),u=["comment",p.slice(f,r+1),f,r],f=r):(bv.lastIndex=f+1,bv.test(p),r=0===bv.lastIndex?p.length-1:bv.lastIndex-2,u=["word",p.slice(f,r+1),f,r],g.push(u),f=r)}return f++,u},position:function(){return f}}},$v=Ab,jv=Sv,Fv=Av,Uv=Pv,Bv={empty:!0,space:!0};var Wv=Bb,Gv=class{constructor(e){this.input=e,this.root=new Fv,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new jv;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new $v;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Dv(this.input)}decl(e,t){let n=new Lv;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let n=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==n)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Uv;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,c="",d=!0;for(let u=0;u<l;u+=1)i=n[u],o=i[0],"space"!==o||u!==l-1||r?"comment"===o?(a=n[u-1]?n[u-1][0]:"empty",s=n[u+1]?n[u+1][0]:"empty",Bv[a]||Bv[s]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new Uv;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Hv=fb;function Zv(e,t){let n=new Gv(new Hv(e,t));try{n.parse()}catch(r){throw r}return n.root}var Vv=Zv;Zv.default=Zv,Wv.registerParse(Zv);var{isClean:qv,my:Jv}=Tw,Yv=Ib,Kv=Nw,Qv=Bb,Xv=Vb,ex=Qb,tx=Vv,nx=Av,rx={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ix={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ox={Once:!0,postcssPlugin:!0,prepare:!0};function sx(e){return"object"==typeof e&&"function"==typeof e.then}function ax(e){let t=!1,n=rx[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function lx(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ax(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cx(e){return e[qv]=!1,e.nodes&&e.nodes.forEach(e=>cx(e)),e}var dx={},ux=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof ex)i=cx(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=tx;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Jv]&&Qv.rebuild(i)}else i=cx(n);this.result=new ex(t,i,r),this.helpers={...dx,postcss:dx,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!ix[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ox[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(sx(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];){e[qv]=!0;let n=[lx(e)];for(;n.length>0;){let e=this.visitTick(n);if(sx(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return sx(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Kv;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Yv(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(sx(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];)e[qv]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(sx(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(o){throw this.handleError(o,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[qv])return r[qv]=!0,void e.push(lx(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[qv]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qv]=!0;let t=ax(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[qv]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ux.registerPostcss=e=>{dx=e};var px=ux;ux.default=ux,nx.registerLazyResult(ux),Xv.registerLazyResult(ux);var hx=Ib,mx=Nw,fx=Vv,gx=Qb,yx=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=mx;this.result=new gx(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new hx(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=fx;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},wx=yx;yx.default=yx;var bx=wx,vx=px,xx=Vb,kx=Av,_x=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new vx(this,e,t):new bx(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Sx=_x;_x.default=_x,kx.registerProcessor(_x),xx.registerProcessor(_x);var Cx=Hw,Ix=eb,Ex=Ab,Tx=Sv,Ax=fb,Mx=Av,zx=Pv;function Ox(e,t){if(Array.isArray(e))return e.map(e=>Ox(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Ax.prototype};n.map&&(n.map={...n.map,__proto__:Ix.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Ox(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Mx(r);if("decl"===r.type)return new Cx(r);if("rule"===r.type)return new zx(r);if("comment"===r.type)return new Ex(r);if("atrule"===r.type)return new Tx(r);throw new Error("Unknown node type: "+e.type)}var Rx=Ox;Ox.default=Ox;var Nx=Ew,Px=Hw,Lx=px,Dx=Bb,$x=Sx,jx=Nw,Fx=Rx,Ux=Vb,Bx=Jb,Wx=Ab,Gx=Sv,Hx=Qb,Zx=fb,Vx=Vv,qx=zv,Jx=Pv,Yx=Av,Kx=Bw;function Qx(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $x(e)}Qx.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{}.LANG&&{}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new $x).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return Qx([i(n)]).process(e,t)},i},Qx.stringify=jx,Qx.parse=Vx,Qx.fromJSON=Fx,Qx.list=qx,Qx.comment=e=>new Wx(e),Qx.atRule=e=>new Gx(e),Qx.decl=e=>new Px(e),Qx.rule=e=>new Jx(e),Qx.root=e=>new Yx(e),Qx.document=e=>new Ux(e),Qx.CssSyntaxError=Nx,Qx.Declaration=Px,Qx.Container=Dx,Qx.Processor=$x,Qx.Document=Ux,Qx.Comment=Wx,Qx.Warning=Bx,Qx.AtRule=Gx,Qx.Result=Hx,Qx.Input=Zx,Qx.Rule=Jx,Qx.Root=Yx,Qx.Node=Kx,Lx.registerPostcss(Qx);var Xx=Qx;Qx.default=Qx;var ek=/* @__PURE__ */yw(Xx);ek.stringify,ek.fromJSON,ek.plugin,ek.parse,ek.list,ek.document,ek.comment,ek.atRule,ek.rule,ek.decl,ek.root,ek.CssSyntaxError,ek.Declaration,ek.Container,ek.Processor,ek.Document,ek.Comment,ek.Warning,ek.AtRule,ek.Result,ek.Input,ek.Rule,ek.Root,ek.Node;var tk=class e{constructor(...e){gw(this,"parentElement",null),gw(this,"parentNode",null),gw(this,"ownerDocument"),gw(this,"firstChild",null),gw(this,"lastChild",null),gw(this,"previousSibling",null),gw(this,"nextSibling",null),gw(this,"ELEMENT_NODE",1),gw(this,"TEXT_NODE",3),gw(this,"nodeType"),gw(this,"nodeName"),gw(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},nk={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},rk={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ik={};function ok(e){if(ik[e])return ik[e];const t=globalThis[e],n=t.prototype,r=e in nk?nk[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in rk?rk[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return ik[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?ik[e]=o:n}catch{return n}}var sk={};function ak(e,t,n){var r;const i=`${e}.${String(n)}`;if(sk[i])return sk[i].call(t);const o=ok(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(sk[i]=s,s.call(t)):t[n]}var lk={};function ck(e,t,n){const r=`${e}.${String(n)}`;if(lk[r])return lk[r].bind(t);const i=ok(e)[n];return"function"!=typeof i?t[n]:(lk[r]=i,i.bind(t))}function dk(){return ok("MutationObserver").constructor}function uk(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var pk={ownerDocument:function(e){return ak("Node",e,"ownerDocument")},childNodes:function(e){return ak("Node",e,"childNodes")},parentNode:function(e){return ak("Node",e,"parentNode")},parentElement:function(e){return ak("Node",e,"parentElement")},textContent:function(e){return ak("Node",e,"textContent")},contains:function(e,t){return ck("Node",e,"contains")(t)},getRootNode:function(e){return ck("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ak("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ak("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ak("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ak("Element",e,"querySelectorAll")(t)},mutationObserver:dk,patch:uk};function hk(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var mk={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function fk(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function gk(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>gk(e,t,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mk=new Proxy(mk,{get:(e,t,n)=>Reflect.get(e,t,n)}));var yk=Date.now;function wk(e){var t,n,r,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=pk.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=pk.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function bk(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function vk(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function xk(e){return e?e.nodeType===e.ELEMENT_NODE?e:pk.parentElement(e):null}function kk(e,t,n,r){if(!e)return!1;const i=xk(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(Sm(i,t,r))return!0}catch(o){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function _k(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function Sk(e,t){if(qh(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=pk.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Sk(r,t))}function Ck(e){return Boolean(e.changedTouches)}function Ik(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ek(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Tk(e){return!!e&&(e instanceof tk&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pk.shadowRoot(e)))}/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())||(yk=()=>/* @__PURE__ */(new Date).getTime());var Ak=class{constructor(){Nh(this,"id",1),Nh(this,"styleIDMap",/* @__PURE__ */new WeakMap),Nh(this,"idStyleMap",/* @__PURE__ */new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=/* @__PURE__ */new WeakMap,this.idStyleMap=/* @__PURE__ */new Map,this.id=1}generateId(){return this.id++}};function Mk(e){var t;let n=null;return"getRootNode"in e&&(null==(t=pk.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pk.host(pk.getRootNode(e))&&(n=pk.host(pk.getRootNode(e))),n}function zk(e){const t=pk.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Mk(n);)n=t;return n}(e);return pk.contains(t,n)}function Ok(e){const t=pk.ownerDocument(e);return!!t&&(pk.contains(t,e)||zk(e))}var Rk=/* @__PURE__ */(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Rk||{}),Nk=/* @__PURE__ */(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Nk||{}),Pk=/* @__PURE__ */(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Pk||{}),Lk=/* @__PURE__ */(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Lk||{}),Dk=/* @__PURE__ */(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Dk||{}),$k=/* @__PURE__ */(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))($k||{}),jk=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(jk||{});function Fk(e){return"__ln"in e}var Uk,Bk=class{constructor(){Nh(this,"length",0),Nh(this,"head",null),Nh(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Fk(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Fk(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Wk=(e,t)=>`${e}@${t}`,Gk=class{constructor(){Nh(this,"frozen",!1),Nh(this,"locked",!1),Nh(this,"texts",[]),Nh(this,"attributes",[]),Nh(this,"attributeMap",/* @__PURE__ */new WeakMap),Nh(this,"removes",[]),Nh(this,"mapRemoves",[]),Nh(this,"movedMap",{}),Nh(this,"addedSet",/* @__PURE__ */new Set),Nh(this,"movedSet",/* @__PURE__ */new Set),Nh(this,"droppedSet",/* @__PURE__ */new Set),Nh(this,"removesSubTreeCache",/* @__PURE__ */new Set),Nh(this,"mutationCb"),Nh(this,"blockClass"),Nh(this,"blockSelector"),Nh(this,"maskTextClass"),Nh(this,"maskTextSelector"),Nh(this,"inlineStylesheet"),Nh(this,"maskInputOptions"),Nh(this,"maskTextFn"),Nh(this,"maskInputFn"),Nh(this,"keepIframeSrcFn"),Nh(this,"recordCanvas"),Nh(this,"inlineImages"),Nh(this,"slimDOMOptions"),Nh(this,"dataURLOptions"),Nh(this,"doc"),Nh(this,"mirror"),Nh(this,"iframeManager"),Nh(this,"stylesheetManager"),Nh(this,"shadowDomManager"),Nh(this,"canvasManager"),Nh(this,"processedNodeManager"),Nh(this,"unattachedDoc"),Nh(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Nh(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=/* @__PURE__ */new Set,n=new Bk,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{const o=pk.parentNode(i);if(!o||!Ok(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=qh(o)?this.mirror.getId(Mk(i)):this.mirror.getId(o),l=r(i);if(-1===a||-1===l)return n.addNode(i);const c=Am(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Ik(e,this.mirror)&&this.iframeManager.addIframe(e),Ek(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Tk(i)&&this.shadowDomManager.addShadowRoot(pk.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Zk(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(pk.parentNode(a))||i(a);for(const a of this.addedSet)Vk(this.droppedSet,a)||Zk(this.removesSubTreeCache,a,this.mirror)?Vk(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(pk.parentNode(o.value)),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(pk.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=pk.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=pk.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=pk.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=/* @__PURE__ */new WeakMap,this.removes=[],this.addedSet=/* @__PURE__ */new Set,this.movedSet=/* @__PURE__ */new Set,this.droppedSet=/* @__PURE__ */new Set,this.removesSubTreeCache=/* @__PURE__ */new Set,this.movedMap={},this.mutationCb(s))}),Nh(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(pk.childNodes(e),e=>pk.textContent(e)||"").join("");t.attributes.value=Xh({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:nm(e),value:n,maskInputFn:this.maskInputFn})}),Nh(this,"processMutation",e=>{if(!_k(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=pk.textContent(e.target);kk(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Cm(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,xk(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const e=nm(n);i=Xh({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(kk(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!_m(n.tagName,r))if(o.attributes[r]=km(this.doc,em(n.tagName),em(r),i),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?t:[t,i]:o._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(kk(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=qh(e.target)?this.mirror.getId(pk.host(e.target)):this.mirror.getId(e.target);kk(e.target,this.blockClass,this.blockSelector,!1)||_k(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Hk(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Sk(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Wk(n,r)]?Hk(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!qh(e.target)||!Jh(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),pk.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Nh(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(_k(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Wk(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);kk(e,this.blockClass,this.blockSelector,!1)||(pk.childNodes(e).forEach(e=>this.genAdds(e)),Tk(e)&&pk.childNodes(pk.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Hk(e,t){e.delete(t),pk.childNodes(t).forEach(t=>Hk(e,t))}function Zk(e,t,n){return 0!==e.size&&function(e,t){const n=pk.parentNode(t);return!!n&&e.has(n)}(e,t)}function Vk(e,t){return 0!==e.size&&qk(e,t)}function qk(e,t){const n=pk.parentNode(t);return!!n&&(!!e.has(n)||qk(e,n))}var Jk=e=>{if(!Uk)return e;return(...t)=>{try{return e(...t)}catch(n){if(Uk&&!0===Uk(n))return;throw n}}},Yk=[];function Kk(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Qk(e,t){const n=new Gk;Yk.push(n),n.init(e);const r=new(dk())(Jk(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Xk({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Pk).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=em(o);const c=(t=>o=>{const s=Kk(o);if(kk(s,r,i,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Lk.Mouse;break;case"touch":a=Lk.Touch;break;case"pen":a=Lk.Pen}a===Lk.Touch?Pk[t]===Pk.MouseDown?c="TouchStart":Pk[t]===Pk.MouseUp&&(c="TouchEnd"):Lk.Pen}else Ck(o)&&(a=Lk.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Lk.Touch||c.startsWith("Mouse")&&a===Lk.Mouse)&&(a=null)):Pk[t]===Pk.Click&&(a=l,l=null);const d=Ck(o)?o.changedTouches[0]:o;if(!d)return;const u=n.getId(s),{clientX:p,clientY:h}=d;Jk(e)({type:Pk[c],id:u,x:p,y:h,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Pk[o]){case Pk.MouseDown:case Pk.MouseUp:s=s.replace("mouse","pointer");break;case Pk.TouchStart:case Pk.TouchEnd:return}a.push(hk(s,c,t))}),Jk(()=>{a.forEach(e=>e())})}function e_({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return hk("scroll",Jk(fk(Jk(o=>{const s=Kk(o);if(!s||kk(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=wk(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}var t_=["INPUT","TEXTAREA","SELECT"],n_=/* @__PURE__ */new WeakMap;function r_(e){return function(e,t){if(a_("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||a_("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||a_("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||a_("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function i_(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function o_({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(pk.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(o=null==(i=n.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(i){}return r}}),Jk(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function s_(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}(e,t),e.recordDOM&&(r=Qk(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=fk(Jk(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),c=Jk(fk(Jk(e=>{const t=Kk(e),{clientX:n,clientY:i}=Ck(e)?e.changedTouches[0]:e;s||(s=yk()),a.push({x:n,y:i,id:r.getId(t),timeOffset:yk()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Nk.Drag:e instanceof MouseEvent?Nk.MouseMove:Nk.TouchMove)}),i,{trailing:!1})),d=[hk("mousemove",c,n),hk("touchmove",c,n),hk("drag",c,n)];return Jk(()=>{d.forEach(e=>e())})}(e),o=Xk(e),s=e_(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return hk("resize",Jk(fk(Jk(()=>{const t=bk(),i=vk();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:d}){function u(e){let n=Kk(e);const c=e.isTrusted,u=n&&n.tagName;if(n&&"OPTION"===u&&(n=pk.parentElement(n)),!n||!u||t_.indexOf(u)<0||kk(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let h=n.value,m=!1;const f=nm(n)||"";"radio"===f||"checkbox"===f?m=n.checked:(a[u.toLowerCase()]||a[f])&&(h=Xh({element:n,maskInputOptions:a,tagName:u,type:f,value:h,maskInputFn:l})),p(n,d?{text:h,isChecked:m,userTriggered:c}:{text:h,isChecked:m});const g=n.name;"radio"===f&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;p(e,d?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function p(t,r){const i=n_.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){n_.set(t,r);const i=n.getId(t);Jk(e)({...r,id:i})}}const h=("last"===c.input?["change"]:["input","change"]).map(e=>hk(e,Jk(u),t)),m=t.defaultView;if(!m)return()=>{h.forEach(e=>e())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&h.push(...g.map(e=>gk(e[0],e[1],{set(){Jk(u)({target:this,isTrusted:!1})}},!1,m))),Jk(()=>{h.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Jk(o=>fk(Jk(i=>{const s=Kk(i);if(!s||kk(s,t,n,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d,loop:u}=s;e({type:o,id:r.getId(s),currentTime:a,volume:l,muted:c,playbackRate:d,loop:u})}),i.media||500)),a=[hk("play",s($k.Play),o),hk("pause",s($k.Pause),o),hk("seeked",s($k.Seeked),o),hk("volumechange",s($k.VolumeChange),o),hk("ratechange",s($k.RateChange),o)];return Jk(()=>{a.forEach(e=>e())})}(e);let d=()=>{},u=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Jk((r,i,o)=>{const[s,a]=o,{id:l,styleId:c}=i_(i,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:s,index:a}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Jk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=i_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Jk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=i_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Jk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=i_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),r.apply(i,o)})}));const l={};l_("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(l_("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),l_("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),l_("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,i])=>{c[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Jk((r,i,o)=>{const[s,a]=o,{id:l,styleId:c}=i_(i.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:s,index:[...r_(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Jk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=i_(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...r_(i),s]}]}),r.apply(i,o)})})}),Jk(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:n}),u=o_(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Jk((i,s,a)=>{var l;const[c,d,u]=a;if(n.has(c))return o.apply(s,[c,d,u]);const{id:p,styleId:h}=i_(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:c,value:d,priority:u},index:r_(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Jk((i,o,a)=>{var l;const[c]=a;if(n.has(c))return s.apply(o,[c]);const{id:d,styleId:u}=i_(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||u&&-1!==u)&&e({id:d,styleId:u,remove:{property:c},index:r_(o.parentRule)}),i.apply(o,a)})}),Jk(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=/* @__PURE__ */new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=uk(t.fonts,"add",function(t){return function(n){return setTimeout(Jk(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),Jk(()=>{r.forEach(e=>e())})}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Jk(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:c}=e.getRangeAt(t);kk(o,r,i,!0)||kk(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:c})}o({ranges:a})});return a(),hk("selectionchange",a)}(e),f=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?uk(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(o){}return e.apply(this,[n,r,i])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,n,y.options));return Jk(()=>{Yk.forEach(e=>e.reset()),r?.disconnect(),i(),o(),s(),a(),l(),c(),d(),u(),p(),h(),m(),f(),g.forEach(e=>e())})}function a_(e){return void 0!==window[e]}function l_(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var c_=class{constructor(e){Nh(this,"iframeIdToRemoteIdMap",/* @__PURE__ */new WeakMap),Nh(this,"iframeRemoteIdToIdMap",/* @__PURE__ */new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=/* @__PURE__ */new WeakMap,void(this.iframeRemoteIdToIdMap=/* @__PURE__ */new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},d_=class{constructor(e){Nh(this,"iframes",/* @__PURE__ */new WeakMap),Nh(this,"crossOriginIframeMap",/* @__PURE__ */new WeakMap),Nh(this,"crossOriginIframeMirror",new c_(fm)),Nh(this,"crossOriginIframeStyleMirror"),Nh(this,"crossOriginIframeRootIdMap",/* @__PURE__ */new WeakMap),Nh(this,"mirror"),Nh(this,"mutationCb"),Nh(this,"wrappedEmit"),Nh(this,"loadListener"),Nh(this,"stylesheetManager"),Nh(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new c_(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Rk.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Rk.IncrementalSnapshot,data:{source:Nk.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Rk.Meta:case Rk.Load:case Rk.DomContentLoaded:return!1;case Rk.Plugin:return t;case Rk.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Rk.IncrementalSnapshot:switch(t.data.source){case Nk.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Nk.Drag:case Nk.TouchMove:case Nk.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Nk.ViewportResize:return!1;case Nk.MediaInteraction:case Nk.MouseInteraction:case Nk.Scroll:case Nk.CanvasMutation:case Nk.Input:return this.replaceIds(t.data,e,["id"]),t;case Nk.StyleSheetRule:case Nk.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Nk.Font:return t;case Nk.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Nk.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===jk.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},u_=class{constructor(e){Nh(this,"shadowDoms",/* @__PURE__ */new WeakSet),Nh(this,"mutationCb"),Nh(this,"scrollCb"),Nh(this,"bypassOptions"),Nh(this,"mirror"),Nh(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Jh(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Qk({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(e_({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(pk.host(e))),this.restoreHandlers.push(o_({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(uk(e.prototype,"attachShadow",function(e){return function(r){const i=e.call(this,r),o=pk.shadowRoot(this);return o&&Ok(this)&&n.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=/* @__PURE__ */new WeakSet}},p_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),m_=0;m_<64;m_++)h_[p_.charCodeAt(m_)]=m_;var f_=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=p_[n[t]>>2],i+=p_[(3&n[t])<<4|n[t+1]>>4],i+=p_[(15&n[t+1])<<2|n[t+2]>>6],i+=p_[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},g_=/* @__PURE__ */new Map;var y_=(e,t,n)=>{if(!e||!v_(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=g_.get(e);return n||(n=/* @__PURE__ */new Map,g_.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function w_(e,t,n){if(e instanceof Array)return e.map(e=>w_(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:f_(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[w_(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[w_(e.data,t,n),e.width,e.height]}:v_(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:y_(e,t,n)}:e}var b_=(e,t,n)=>e.map(e=>w_(e,t,n)),v_=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function x_(e,t,n,r){const i=[];try{const o=uk(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!kk(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch{}return()=>{i.forEach(e=>e())}}function k_(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=uk(e,l,function(e){return function(...s){const a=e.apply(this,s);if(y_(a,o,this),"tagName"in this.canvas&&!kk(this.canvas,r,i,!0)){const e={type:t,property:l,args:b_(s,o,this)};n(this.canvas,e)}return a}});s.push(a)}catch{const r=gk(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}var __="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",S_="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(__)],{type:"text/javascript;charset=utf-8"});function C_(e){let t;try{if(t=S_&&(window.URL||window.webkitURL).createObjectURL(S_),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(n){return new Worker("data:text/javascript;base64,"+__,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var I_,E_,T_,A_=class{constructor(e){Nh(this,"pendingCanvasMutations",/* @__PURE__ */new Map),Nh(this,"rafStamps",{latestId:0,invokeId:null}),Nh(this,"mirror"),Nh(this,"mutationCb"),Nh(this,"resetObservers"),Nh(this,"frozen",!1),Nh(this,"locked",!1),Nh(this,"processMutation",(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,i){const o=x_(t,n,r,!0),s=/* @__PURE__ */new Map,a=new C_;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:Dk["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{kk(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=x_(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=uk(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return kk(this.canvas,n,r,!0)||setTimeout(()=>{const n=b_(o,t,this);e(this.canvas,{type:Dk["2D"],property:s,args:n})},0),i.apply(this,o)}});i.push(o)}catch{const n=gk(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Dk["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const i=[];return i.push(...k_(t.WebGLRenderingContext.prototype,Dk.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...k_(t.WebGL2RenderingContext.prototype,Dk.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},M_=class{constructor(e){Nh(this,"trackedLinkElements",/* @__PURE__ */new WeakSet),Nh(this,"mutationCb"),Nh(this,"adoptedStyleSheetCb"),Nh(this,"styleMirror",new Ak),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const i of e){let e;this.styleMirror.has(i)?e=this.styleMirror.getId(i):(e=this.styleMirror.add(i),r.push({styleId:e,rules:Array.from(i.rules||CSSRule,(e,t)=>({rule:Kh(e,i.href),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=/* @__PURE__ */new WeakSet}trackStylesheetInLinkElement(e){}},z_=class{constructor(){Nh(this,"nodeMap",/* @__PURE__ */new WeakMap),Nh(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=/* @__PURE__ */new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||/* @__PURE__ */new Set).add(t))}destroy(){}},O_=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Ch=e.contentWindow)?void 0:Ch.Array.from)||Array.from,document.body.removeChild(e)}}catch(zS){}var R_,N_,P_=new Qh;function L_(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:k=!1,recordCrossOriginIframes:_=!1,recordAfter:S=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:I=!1,inlineImages:E=!1,plugins:T,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:M=/* @__PURE__ */new Set([]),errorHandler:z}=e;Uk=z;const O=!_||window.parent===window;let R=!1;if(!O)try{window.parent.document&&(R=!1)}catch(Z){R=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!R)return()=>{};void 0!==v&&void 0===w.mousemove&&(w.mousemove=v),P_.reset();const N=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},P=Tm(h);let L;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const $=e=>{for(const t of T||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!R&&(e=y(e)),e};I_=(e,i)=>{var o;const s=e;if(s.timestamp=yk(),!(null==(o=Yk[0])?void 0:o.isFrozen())||s.type===Rk.FullSnapshot||s.type===Rk.IncrementalSnapshot&&s.data.source===Nk.Mutation||Yk.forEach(e=>e.unfreeze()),O)t?.($(s),i);else if(R){const e={type:"rrweb",event:$(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===Rk.FullSnapshot)L=s,D=0;else if(s.type===Rk.IncrementalSnapshot){if(s.data.source===Nk.Mutation&&s.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&s.timestamp-L.timestamp>n;(e||t)&&E_(!0)}};const j=e=>{I_({type:Rk.IncrementalSnapshot,data:{source:Nk.Mutation,...e}})},F=e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.Scroll,...e}}),U=e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.CanvasMutation,...e}}),B=new M_({mutationCb:j,adoptedStyleSheetCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.AdoptedStyleSheet,...e}})}),W=new d_({mirror:P_,mutationCb:j,stylesheetManager:B,recordCrossOriginIframes:_,wrappedEmit:I_});for(const q of T||[])q.getMirror&&q.getMirror({nodeMirror:P_,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const G=new z_;T_=new A_({recordCanvas:k,mutationCb:U,win:window,blockClass:i,blockSelector:o,mirror:P_,sampling:w.canvas,dataURLOptions:b});const H=new u_({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:N,dataURLOptions:b,maskTextFn:f,maskInputFn:m,recordCanvas:k,inlineImages:E,sampling:w,slimDOMOptions:P,iframeManager:W,stylesheetManager:B,canvasManager:T_,keepIframeSrcFn:A,processedNodeManager:G},mirror:P_});E_=(e=!1)=>{if(!x)return;I_({type:Rk.Meta,data:{href:window.location.href,width:vk(),height:bk()}},e),B.reset(),H.init(),Yk.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Qh,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:u,maskInputFn:p,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:x=()=>!1}=t||{};return Am(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:Tm(h),dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:x,newlyAddedElement:!1})}(document,{mirror:P_,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:N,maskTextFn:f,maskInputFn:m,slimDOM:P,dataURLOptions:b,recordCanvas:k,inlineImages:E,onSerialize:e=>{Ik(e,P_)&&W.addIframe(e),Ek(e,P_)&&B.trackLinkElement(e),Tk(e)&&H.addShadowRoot(pk.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:A});t&&(I_({type:Rk.FullSnapshot,data:{node:t,initialOffset:wk(window)}},e),Yk.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,P_.getId(document)))};try{const e=[],t=e=>{var t;return Jk(s_)({mutationCb:j,mousemoveCb:(e,t)=>I_({type:Rk.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.MouseInteraction,...e}}),scrollCb:F,viewportResizeCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.ViewportResize,...e}}),inputCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.Input,...e}}),mediaInteractionCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.MediaInteraction,...e}}),styleSheetRuleCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.StyleSheetRule,...e}}),styleDeclarationCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>I_({type:Rk.IncrementalSnapshot,data:{source:Nk.Font,...e}}),selectionCb:e=>{I_({type:Rk.IncrementalSnapshot,data:{source:Nk.Selection,...e}})},customElementCb:e=>{I_({type:Rk.IncrementalSnapshot,data:{source:Nk.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:N,inlineStylesheet:d,sampling:w,recordDOM:x,recordCanvas:k,inlineImages:E,userTriggeredOnInput:C,collectFonts:I,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:P,dataURLOptions:b,mirror:P_,iframeManager:W,stylesheetManager:B,shadowDomManager:H,processedNodeManager:G,canvasManager:T_,ignoreCSSAttributes:M,plugins:(null==(t=null==T?void 0:T.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>I_({type:Rk.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};W.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(r){}});const n=()=>{E_(),e.push(t(document)),O_=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(hk("DOMContentLoaded",()=>{I_({type:Rk.DomContentLoaded,data:{}}),"DOMContentLoaded"===S&&n()})),e.push(hk("load",()=>{I_({type:Rk.Load,data:{}}),"load"===S&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")}}),G.destroy(),O_=!1,Uk=void 0}}catch(V){}}L_.addCustomEvent=(e,t)=>{if(!O_)throw new Error("please add custom event after start recording");I_({type:Rk.Custom,data:{tag:e,payload:t}})},L_.freezePage=()=>{Yk.forEach(e=>e.freeze())},L_.takeFullSnapshot=e=>{if(!O_)throw new Error("please take full snapshot after start recording");E_(e)},L_.mirror=P_,(N_=R_||(R_={}))[N_.NotStarted=0]="NotStarted",N_[N_.Running=1]="Running",N_[N_.Stopped=2]="Stopped";var D_=mc("SessionRecorder"),$_=500,j_=5e5,F_=class{eventQueue=[];estimatedQueueBytes=0;sessionId;stopRecording=null;isRecording=!1;chatId;applicationId;metadataSent=!1;startPromise=null;stopRequested=!1;flushTimer=null;consecutiveFailures=0;constructor(e,t){if(!e||""===e.trim())throw new Error("chatId is required for SessionRecorder");if(!t||t<=0)throw new Error("applicationId (mtxApp) is required for SessionRecorder");D_.info("Constructor called with chatId:",e,"applicationId:",t),this.chatId=e,this.applicationId=t,this.sessionId=e,D_.info("Initialized with sessionId:",this.sessionId)}async sendMetadata(){this.metadataSent?D_.warn("Metadata already sent, skipping"):(D_.info("Sending rrweb/metadata via POST"),await rc.widgetMessage({chat_id:this.chatId,command:{type:"rrweb/metadata",session_id:this.sessionId,chat_id:this.chatId,application_id:this.applicationId,url:window.location.href,user_agent:navigator.userAgent,timestamp:Date.now()}}),this.metadataSent=!0,D_.info("✅ rrweb/metadata sent successfully"))}bufferEvent(e){if(this.eventQueue.push(e),this.estimatedQueueBytes+=JSON.stringify(e).length,this.eventQueue.length>$_){const e=this.eventQueue.length-$_,t=this.eventQueue.splice(0,e);for(const n of t)this.estimatedQueueBytes-=JSON.stringify(n).length;D_.warn(`⚠️ Event queue exceeded 500, dropped ${e} oldest events`)}this.estimatedQueueBytes>=5e4?this.flush():this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},500))}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),0===this.eventQueue.length)return;let e,t;if(this.estimatedQueueBytes<=j_)e=this.eventQueue,t=this.estimatedQueueBytes,this.eventQueue=[],this.estimatedQueueBytes=0;else{for(e=[],t=0;this.eventQueue.length>0;){const n=this.eventQueue[0];if(void 0===n)break;const r=JSON.stringify(n).length;if(t+r>j_&&e.length>0)break;const i=this.eventQueue.shift();void 0!==i&&e.push(i),t+=r,this.estimatedQueueBytes-=r}this.eventQueue.length>0&&!this.flushTimer&&(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},0))}D_.debug(`Flushing ${e.length} events (~${t} bytes)`),rc.widgetMessage({chat_id:this.chatId,command:{type:"rrweb/events",session_id:this.sessionId,events:e}}).then(()=>{this.consecutiveFailures=0}).catch(n=>{const r=null!=n&&"object"==typeof n&&"status"in n?n.status:null;if("number"==typeof r&&r>=400&&r<500)return D_.error(`Dropping ${e.length} events after permanent ${String(r)} error:`,n),void(this.consecutiveFailures=0);if(this.consecutiveFailures++,this.consecutiveFailures>5)return D_.error(`Dropping ${e.length} events after 5 consecutive failures:`,n),void(this.consecutiveFailures=0);if(D_.error(`Failed to flush events (attempt ${this.consecutiveFailures}/5), re-queuing:`,n),this.eventQueue=e.concat(this.eventQueue),this.estimatedQueueBytes+=t,this.eventQueue.length>$_){const e=this.eventQueue.length-$_,t=this.eventQueue.splice(0,e);for(const n of t)this.estimatedQueueBytes-=JSON.stringify(n).length;D_.warn(`⚠️ Event queue exceeded 500 after re-queue, dropped ${e} oldest events`)}})}async start(){if(this.isRecording)D_.warn("Recording already started");else{if(this.startPromise)return this.startPromise;this.startPromise=this.doStart();try{await this.startPromise}finally{this.startPromise=null}}}async doStart(){this.stopRequested=!1;try{if(D_.info("🚀 start() called"),await this.sendMetadata(),this.stopRequested)throw new Error("Recording stopped during startup");this.stopRecording=L_({emit:e=>{this.bufferEvent(e)},recordCanvas:!1,recordCrossOriginIframes:!1,maskAllInputs:!1,collectFonts:!1,inlineStylesheet:!0,blockClass:"rr-block",ignoreClass:"rr-ignore"}),this.isRecording=!0,D_.info("Recording started with chatId:",this.sessionId)}catch(e){throw D_.error("Failed to start recording:",e),e}}stop(){this.stopRequested=!0,this.stopRecording&&(this.stopRecording(),this.stopRecording=null),(this.isRecording||this.eventQueue.length>0)&&this.flush(),this.isRecording=!1,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.metadataSent=!1,D_.info("Recording stopped")}getSessionId(){return this.sessionId}isActive(){return this.isRecording}},U_=class{config;async validateConfig(e){return this.config=e,e.mtxId&&e.mtxKey?this.validateByMarketrixId(e.mtxId,e.mtxKey):e.mtxApp&&e.mtxAgent?this.validateByAgentAndApplication(e.mtxApp,e.mtxAgent):{isValid:!1,error:"Please provide either (mtxId + mtxKey) OR (mtxApp + mtxAgent)"}}async validateByMarketrixId(e,t){try{const{items:r}=await rc.widgetSearch({marketrix_id:e,marketrix_key:t});if(!r||0===r.length)return{isValid:!1,error:"Widget not found or invalid credentials"};const i=r.find(e=>"widget"===e.type&&"active"===e.status);if(!i){const e=r.filter(e=>"widget"===e.type);return e.length>0?{isValid:!1,error:`Found widget(s) but none are active. Current status(es): ${e.map(e=>e.status).join(", ")}. Please activate the widget in the dashboard.`}:0===r.length?{isValid:!1,error:"No widgets found for the provided marketrix_id and marketrix_key. Please verify your credentials."}:{isValid:!1,error:`No widget found. Found widget type(s): ${r.map(e=>e.type).join(", ")}. Please create a widget.`}}if(!i.agent_id)return{isValid:!1,error:"Widget missing agent_id",widget:i};try{const e=await rc.agentGet({agent_id:i.agent_id});if(!i.application_id)return{isValid:!1,error:"Widget missing application_id",widget:i,agent:e};return{isValid:!0,widget:i,agent:e,application:await rc.applicationGet({application_id:i.application_id})}}catch(n){return{isValid:!1,error:`Failed to validate agent: ${oc(n)}`,widget:i}}}catch(r){return sc(r,"Widget validation",this.config)}}async validateByAgentAndApplication(e,t){try{const n=await rc.applicationGet({application_id:e}),r=await rc.agentGet({agent_id:t});return r.application_id!==e?{isValid:!1,error:`Agent ID ${t} belongs to application ID ${r.application_id}, but provided application ID is ${e}. Please verify the application ID matches the agent's application_id.`,application:n,agent:r}:{isValid:!0,application:n,agent:r}}catch(n){return sc(n,"Agent and application validation",this.config)}}},B_=null,W_=class{mtxId;mtxKey;mtxApp;constructor(e,t,n){this.mtxId=e,this.mtxKey=t,this.mtxApp=n}async fetchWidgetSettings(){if(!this.mtxId&&!this.mtxKey&&!this.mtxApp)return null;try{B_||(B_=await rc.widgetGetDefaults({type:"widget"}));const e=B_;if(!e){throw new Error("Failed to fetch default widget settings from API. The API must return widget settings.")}let t=null;if(this.mtxId&&this.mtxKey)t=(await rc.widgetSearch({type:"widget",marketrix_id:this.mtxId,marketrix_key:this.mtxKey})).items;else{if(!this.mtxApp)return null;t=(await rc.widgetSearch({type:"widget",application_id:this.mtxApp})).items}const n=t?.find(e=>"active"===e.status&&"widget"===e.type)||null;if(n?.settings){const t=this.getWidgetSettings(n);if(t){const r={...e,...t};return{...n,settings:r}}}const r=/* @__PURE__ */new Date;return{id:0,application_id:this.mtxApp||0,agent_id:0,type:"widget",settings:e,status:"active",marketrix_id:this.mtxId||"",marketrix_key:this.mtxKey||"",created_at:r,updated_at:r}}catch(e){const t=e instanceof Error?e.message:"Unknown error",n=/* @__PURE__ */new Error(`Failed to fetch widget settings from API: ${t}`);throw n.cause=e,n}}getWidgetSettings(e){if(!e?.settings)return null;const t=e.settings;return function(e){return"object"==typeof e&&null!==e}(n=t)&&Fc(n,"widget_enabled")&&"boolean"==typeof n.widget_enabled&&Fc(n,"widget_appearance")&&"string"==typeof n.widget_appearance&&Fc(n,"widget_position")&&"string"==typeof n.widget_position?t:null;var n}},G_="#6b7280",H_="#1f2937",Z_="rgba(255, 255, 255, 0.95)",V_="rgba(255, 255, 255, 0.2)",q_="rgba(0, 0, 0, 0.15)",J_=({message:e="Loading widget settings..."})=>{const[t,n]=p(!1),r=e?.includes("marketrix_id")||e?.includes("marketrix_key");return t?null:/* @__PURE__ */g(ku,{position:"fixed",style:{bottom:"20px",left:"50%",transform:"translateX(-50%)",maxWidth:"420px",backgroundColor:Z_,borderRadius:r?"18px":"999px",boxShadow:`0 2px 12px ${q_}`,display:"flex",flexDirection:"column",alignItems:"stretch",gap:"8px",padding:"10px 12px",border:`1px solid ${V_}`,zIndex:9999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[/* @__PURE__ */g(cp,{align:"center",style:{gap:"10px"},children:[
|
|
63
|
+
/* @__PURE__ */f(Mh,{children:/* @__PURE__ */f(Ah,{config:T,isOpen:r.isOpen,isMinimized:r.isMinimized,messages:r.messages,currentMode:r.currentMode,isTaskRunning:r.isTaskRunning,taskProgress:r.taskProgress,activeView:r.activeView,onClose:i.closeWidget,onSendMessage:i.sendMessage,onSetMode:i.setMode,onAddMessage:i.addMessage,onUpdateMessage:i.updateMessage,onRemoveMessage:i.removeMessage,onStopTask:i.stopTask,onClearChat:i.clearChatHistory,setActiveView:i.setActiveView})}),
|
|
64
|
+
/* @__PURE__ */f(Ep,{open:r.isOpen,processing:r.isLoading,error:!!r.error,taskRunning:r.isTaskRunning,onClick:i.toggleWidget,onStop:i.stopTask,accentColor:T.widget_accent_color,backgroundColor:T.widget_background_color,borderRadius:T.widget_border_radius,tooltipBgColor:_(T.widget_accent_color,.3),tooltipTextColor:x(_(T.widget_accent_color,.3)),zIndex:T.widget_position_z_index??50,position:h,onDrag:e=>{m(e),l||"undefined"==typeof localStorage||localStorage.setItem(b,e)},isPreviewMode:l}),r.error&&/* @__PURE__ */f(kp,{tone:"error",title:r.error,onDismiss:()=>i.clearError(),onRetry:()=>i.clearError(),position:h.includes("top")?"bottom-center":"above-fab"}),t&&!r.error&&o.widget_greeting&&/* @__PURE__ */f(kp,{tone:"info",title:o.widget_greeting,body:o.widget_body,onDismiss:()=>n(!1),position:"bottom-center"})]})},Oh=Object.defineProperty,Rh=(e,t,n)=>((e,t,n)=>t in e?Oh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Nh=Object.defineProperty,Ph=(e,t,n)=>((e,t,n)=>t in e?Nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Lh=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Lh||{}),Dh={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jh={};function Fh(e){if(jh[e])return jh[e];const t=globalThis[e],n=t.prototype,r=e in Dh?Dh[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in $h?$h[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return jh[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?jh[e]=o:n}catch{return n}}var Uh={};function Bh(e,t,n){var r;const i=`${e}.${String(n)}`;if(Uh[i])return Uh[i].call(t);const o=Fh(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Uh[i]=s,s.call(t)):t[n]}var Wh={};function Gh(e,t,n){const r=`${e}.${String(n)}`;if(Wh[r])return Wh[r].bind(t);const i=Fh(e)[n];return"function"!=typeof i?t[n]:(Wh[r]=i,i.bind(t))}var Hh={ownerDocument:function(e){return Bh("Node",e,"ownerDocument")},childNodes:function(e){return Bh("Node",e,"childNodes")},parentNode:function(e){return Bh("Node",e,"parentNode")},parentElement:function(e){return Bh("Node",e,"parentElement")},textContent:function(e){return Bh("Node",e,"textContent")},contains:function(e,t){return Gh("Node",e,"contains")(t)},getRootNode:function(e){return Gh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Bh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Bh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Bh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Bh("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Fh("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}};function Zh(e){return e.nodeType===e.ELEMENT_NODE}function Vh(e){const t=e&&"host"in e&&"mode"in e&&Hh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Hh.shadowRoot(t)===e)}function qh(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Jh(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(t=Array.from(n,e=>Yh(e,r)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function Yh(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Jh(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?am(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?am(n,t):n}}var Kh=class{constructor(){Ph(this,"idNodeMap",/* @__PURE__ */new Map),Ph(this,"nodeMetaMap",/* @__PURE__ */new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=/* @__PURE__ */new Map,this.nodeMetaMap=/* @__PURE__ */new WeakMap}};function Qh({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&Xh(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function Xh(e){return e.toLowerCase()}var em="__rrweb_original__";function tm(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Xh(t):null}function nm(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(i){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}var rm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,im=/^(?:[a-z+]+:)?\/\//i,om=/^www\..*/i,sm=/^(data:)([^,]*),(.*)/i;function am(e,t){return(e||"").replace(rm,(e,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return e;if(im.test(a)||om.test(a))return`url(${l}${a}${l})`;if(sm.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),d=a.split("/");c.pop();for(const t of d){if("."===t)continue;".."===t?c.pop():c.push(t)}return`url(${l}${c.join("/")}${l})`})}function lm(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function cm(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),i=[];let o=0;if(r.length>1&&e&&"string"==typeof e){let t=lm(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const l=lm(r[a].textContent,n),c=100;let d=3;for(;d<l.length&&(l[d].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,d),1));d++);for(;d<l.length;d++){let u=l.substring(0,d),p=t.split(u),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[a-1].textContent)h=t.indexOf(u,1);else if(1===p.length){if(u=u.substring(0,u.length-1),p=t.split(u),p.length<=1)return i.push(e),i;d=c+1}else d===l.length-1&&(h=t.indexOf(u));if(p.length>=2&&d>c){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=lm(e).length;h=t.indexOf(u,n)}-1===h&&(h=p[0].length)}if(-1!==h){let a=Math.floor(h/s);for(;a>0&&a<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;const l=lm(e.substring(0,a),n);if(l.length===h){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(h);break}l.length<h?a+=Math.max(1,Math.floor((h-l.length)/s)):a-=Math.max(1,Math.floor((l.length-h)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}var dm,um,pm=1,hm=/* @__PURE__ */new RegExp("[^a-z0-9-_:]");function mm(){return pm++}var fm=/^[^ \t\n\r\u000c]+/,gm=/^[, \t\n\r\u000c]+/;var ym=/* @__PURE__ */new WeakMap;function wm(e,t){return t&&""!==t.trim()?vm(e,t):t}function bm(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function vm(e,t){let n=ym.get(e);if(n||(n=e.createElement("a"),ym.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function xm(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?wm(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(gm),!(n>=t.length);){let o=r(fm);if(","===o.slice(-1))o=wm(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=wm(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?am(r,vm(e)):"object"===t&&"data"===n?wm(e,r):r:r}function km(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function _m(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&_m(Hh.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&_m(Hh.parentNode(e),t,n)}function Sm(e,t,n,r){let i;if(Zh(e)){if(i=e,!Hh.childNodes(i).length)return!1}else{if(null===Hh.parentElement(e))return!1;i=Hh.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(_m(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(o){}return!1}function Cm(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:d,dataURLOptions:u={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Lh.Document,childNodes:[],compatMode:e.compatMode}:{type:Lh.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Lh.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:h}=t,m=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,i),f=function(e){if(e instanceof HTMLFormElement)return"form";const t=Xh(e.tagName);return hm.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let v=0;v<y;v++){const t=e.attributes[v];km(f,t.name,t.value)||(g[t.name]=xm(n,f,Xh(t.name),t.value))}if("link"===f&&o){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Jh(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===f&&e.sheet){let t=Jh(e.sheet);t&&(e.childNodes.length>1&&(t=cm(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(f)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Qh({element:e,type:tm(e),tagName:f,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===f&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===f&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===f&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const i=t.getImageData,o=em in i?i[em]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===f&&c){dm||(dm=n.createElement("canvas"),um=dm.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),i=()=>{t.removeEventListener("load",i);try{dm.width=t.naturalWidth,dm.height=t.naturalHeight,um.drawImage(t,0,0),g.rr_dataURL=dm.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(f)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==f||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(f)&&(w=!0)}catch(b){}return{type:Lh.Element,tagName:f,attributes:g,childNodes:[],isSVG:bm(e)||void 0,needBlock:m,rootId:h,isCustom:w}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:u,inlineImages:p,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Hh.parentNode(e),a=s&&s.tagName;let l="";const c="STYLE"===a||void 0,d="SCRIPT"===a||void 0;d?l="SCRIPT_PLACEHOLDER":o||(l=Hh.textContent(e),c&&l&&(l=am(l,vm(t.doc))));!c&&!d&&l&&n&&(l=r?r(l,Hh.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Lh.Text,textContent:l||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Lh.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Lh.Comment,textContent:Hh.textContent(e)||"",rootId:y};default:return!1}}function Im(e){return null==e?"":e.toLowerCase()}function Em(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function Tm(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:_=!1,cssCaptured:S=!1}=t;let{needsMask:C}=t,{preserveWhiteSpace:I=!0}=t;C||(C=Sm(e,s,a,void 0===C));const E=Cm(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,keepIframeSrcFn:k,newlyAddedElement:_,cssCaptured:S});if(!E)return null;let T;T=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Lh.Comment)return!0;if(e.type===Lh.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===nm(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Im(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Im(e.attributes.name)||"icon"===Im(e.attributes.rel)||"apple-touch-icon"===Im(e.attributes.rel)||"shortcut icon"===Im(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Im(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Im(e.attributes.property).match(/^(og|twitter|fb):/)||Im(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Im(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Im(e.attributes.name)||"googlebot"===Im(e.attributes.name)||"bingbot"===Im(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Im(e.attributes.name)||"generator"===Im(e.attributes.name)||"framework"===Im(e.attributes.name)||"publisher"===Im(e.attributes.name)||"progid"===Im(e.attributes.name)||Im(e.attributes.property).match(/^article:/)||Im(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Im(e.attributes.name)||"yandex-verification"===Im(e.attributes.name)||"csrf-token"===Im(e.attributes.name)||"p:domain_verify"===Im(e.attributes.name)||"verify-v1"===Im(e.attributes.name)||"verification"===Im(e.attributes.name)||"shopify-checkout-api-token"===Im(e.attributes.name)))return!0}}return!1}(E,h)||!I&&E.type===Lh.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:mm();const A=Object.assign(E,{id:T});if(r.add(e,A),-2===T)return null;y&&y(e);let M=!l;if(A.type===Lh.Element){M=M&&!A.needBlock,delete A.needBlock;const t=Hh.shadowRoot(e);t&&qh(t)&&(A.isShadowHost=!0)}if((A.type===Lh.Document||A.type===Lh.Element)&&M){h.headWhitespace&&A.type===Lh.Element&&"head"===A.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k,cssCaptured:!1};if(A.type===Lh.Element&&"textarea"===A.tagName&&void 0!==A.attributes.value);else{A.type===Lh.Element&&void 0!==A.attributes._cssText&&"string"==typeof A.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Hh.childNodes(e))){const e=Tm(n,t);e&&A.childNodes.push(e)}}let _=null;if(Zh(e)&&(_=Hh.shadowRoot(e)))for(const e of Array.from(Hh.childNodes(_))){const n=Tm(e,t);n&&(qh(_)&&(n.isShadow=!0),A.childNodes.push(n))}}const z=Hh.parentNode(e);return z&&Vh(z)&&qh(z)&&(A.isShadow=!0),A.type===Lh.Element&&"iframe"===A.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(a){return}if("complete"!==i){const r=setTimeout(()=>{o||(t(),o=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const n=Tm(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k});n&&w(e,n)}},b),A.type===Lh.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===nm(A.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(s){return}if(r)return;const o=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(v){const t=Tm(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:I,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:k});t&&v(e,t)}},x),A}function Am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mm(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var zm={exports:{}},Om=String,Rm=function(){return{isColorSupported:!1,reset:Om,bold:Om,dim:Om,italic:Om,underline:Om,inverse:Om,hidden:Om,strikethrough:Om,black:Om,red:Om,green:Om,yellow:Om,blue:Om,magenta:Om,cyan:Om,white:Om,gray:Om,bgBlack:Om,bgRed:Om,bgGreen:Om,bgYellow:Om,bgBlue:Om,bgMagenta:Om,bgCyan:Om,bgWhite:Om}};zm.exports=Rm(),zm.exports.createColors=Rm;var Nm=zm.exports,Pm=/* @__PURE__ */Mm(/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Lm=Nm,Dm=Pm,$m=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Lm.isColorSupported),Dm&&e&&(t=Dm(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Lm.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}},jm=$m;$m.default=$m;var Fm={};Fm.isClean=Symbol("isClean"),Fm.my=Symbol("my");var Um={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Bm=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Um[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=Um[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},Wm=Bm;Bm.default=Bm;var Gm=Wm;function Hm(e,t){new Gm(t).stringify(e)}var Zm=Hm;Hm.default=Hm;var{isClean:Vm,my:qm}=Fm,Jm=jm,Ym=Wm,Km=Zm;function Qm(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>Qm(e,n)):("object"===o&&null!==i&&(i=Qm(i)),n[r]=i)}return n}var Xm=class{constructor(e={}){this.raws={},this[Vm]=!1,this[qm]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Qm(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new Jm(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Vm]){this[Vm]=!1;let e=this;for(;e=e.parent;)e[Vm]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new Ym).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||/* @__PURE__ */new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Km){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}},ef=Xm;Xm.default=Xm;var tf=ef,nf=class extends tf{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},rf=nf;nf.default=nf;var of={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},{SourceMapConsumer:sf,SourceMapGenerator:af}=Pm,{existsSync:lf,readFileSync:cf}=Pm,{dirname:df,join:uf}=Pm;var pf=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=df(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new sf(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=df(e),lf(e))return this.mapFile=e,cf(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof sf)return af.fromSourceMap(t).toString();if(t instanceof af)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=uf(df(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},hf=pf;pf.default=pf;var{SourceMapConsumer:mf,SourceMapGenerator:ff}=Pm,{fileURLToPath:gf,pathToFileURL:yf}=Pm,{isAbsolute:wf,resolve:bf}=Pm,{nanoid:vf}=of,xf=Pm,kf=jm,_f=hf,Sf=Symbol("fromOffsetCache"),Cf=Boolean(mf&&ff),If=Boolean(bf&&wf),Ef=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!If||/^\w+:\/\//.test(t.from)||wf(t.from)?this.file=t.from:this.file=bf(t.from)),If&&Cf){let e=new _f(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+vf(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new kf(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new kf(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yf&&(i.input.url=yf(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Sf])n=this[Sf];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Sf]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:bf(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=wf(a.source)?yf(a.source):new URL(a.source,this.map.consumer().sourceRoot||yf(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!gf)throw new Error("file: protocol is not available in this PostCSS build");l.file=gf(o)}let c=s.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},Tf=Ef;Ef.default=Ef,xf&&xf.registerInput&&xf.registerInput(Ef);var{SourceMapConsumer:Af,SourceMapGenerator:Mf}=Pm,{dirname:zf,relative:Of,resolve:Rf,sep:Nf}=Pm,{pathToFileURL:Pf}=Pm,Lf=Tf,Df=Boolean(Af&&Mf),$f=Boolean(zf&&Rf&&Of&&Nf),jf=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=/* @__PURE__ */new Map,this.memoizedPaths=/* @__PURE__ */new Map,this.memoizedURLs=/* @__PURE__ */new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||zf(e.file);!1===this.mapOpts.sourcesContent?(t=new Af(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),$f&&Df&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Mf.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Mf({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Mf({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type&&("atrule"!==a.type||a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?zf(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=zf(Rf(n,this.mapOpts.annotation)));let r=Of(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Lf(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Pf){let t=Pf(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Nf&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}},Ff=ef,Uf=class extends Ff{constructor(e){super(e),this.type="comment"}},Bf=Uf;Uf.default=Uf;var Wf,Gf,Hf,Zf,{isClean:Vf,my:qf}=Fm,Jf=rf,Yf=Bf,Kf=ef;function Qf(e){return e.map(e=>(e.nodes&&(e.nodes=Qf(e.nodes)),delete e.source,e))}function Xf(e){if(e[Vf]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xf(t)}var eg=class e extends Kf{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Qf(Wf(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Jf(t)]}else if(t.selector)t=[new Gf(t)];else if(t.name)t=[new Hf(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Yf(t)]}return t.map(t=>(t[qf]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Vf]&&Xf(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};eg.registerParse=e=>{Wf=e},eg.registerRule=e=>{Gf=e},eg.registerAtRule=e=>{Hf=e},eg.registerRoot=e=>{Zf=e};var tg=eg;eg.default=eg,eg.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Hf.prototype):"rule"===e.type?Object.setPrototypeOf(e,Gf.prototype):"decl"===e.type?Object.setPrototypeOf(e,Jf.prototype):"comment"===e.type?Object.setPrototypeOf(e,Yf.prototype):"root"===e.type&&Object.setPrototypeOf(e,Zf.prototype),e[qf]=!0,e.nodes&&e.nodes.forEach(e=>{eg.rebuild(e)})};var ng,rg,ig=tg,og=class extends ig{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ng(new rg,this,e).stringify()}};og.registerLazyResult=e=>{ng=e},og.registerProcessor=e=>{rg=e};var sg=og;og.default=og;var ag=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},lg=ag;ag.default=ag;var cg=lg,dg=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new cg(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},ug=dg;dg.default=dg;var pg="'".charCodeAt(0),hg='"'.charCodeAt(0),mg="\\".charCodeAt(0),fg="/".charCodeAt(0),gg="\n".charCodeAt(0),yg=" ".charCodeAt(0),wg="\f".charCodeAt(0),bg="\t".charCodeAt(0),vg="\r".charCodeAt(0),xg="[".charCodeAt(0),kg="]".charCodeAt(0),_g="(".charCodeAt(0),Sg=")".charCodeAt(0),Cg="{".charCodeAt(0),Ig="}".charCodeAt(0),Eg=";".charCodeAt(0),Tg="*".charCodeAt(0),Ag=":".charCodeAt(0),Mg="@".charCodeAt(0),zg=/[\t\n\f\r "#'()/;[\\\]{}]/g,Og=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rg=/.[\r\n"'(/\\]/,Ng=/[\da-f]/i,Pg=tg,Lg=class extends Pg{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Dg=Lg;Lg.default=Lg,Pg.registerAtRule(Lg);var $g,jg,Fg=tg,Ug=class extends Fg{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new $g(new jg,this,e).stringify()}};Ug.registerLazyResult=e=>{$g=e},Ug.registerProcessor=e=>{jg=e};var Bg=Ug;Ug.default=Ug,Fg.registerRoot(Ug);var Wg={comma:e=>Wg.split(e,[","],!0),space:e=>Wg.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let d of e)c?c=!1:"\\"===d?c=!0:a?d===l&&(a=!1):'"'===d||"'"===d?(a=!0,l=d):"("===d?s+=1:")"===d?s>0&&(s-=1):0===s&&t.includes(d)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=d;return(n||""!==i)&&r.push(i.trim()),r}},Gg=Wg;Wg.default=Wg;var Hg=tg,Zg=Gg,Vg=class extends Hg{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Zg.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},qg=Vg;Vg.default=Vg,Hg.registerRule(Vg);var Jg=rf,Yg=function(e,t={}){let n,r,i,o,s,a,l,c,d,u,p=e.css.valueOf(),h=t.ignoreErrors,m=p.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(f),n){case gg:case yg:case bg:case vg:case wg:r=f;do{r+=1,n=p.charCodeAt(r)}while(n===yg||n===gg||n===bg||n===vg||n===wg);u=["space",p.slice(f,r)],f=r-1;break;case xg:case kg:case Cg:case Ig:case Ag:case Eg:case Sg:{let e=String.fromCharCode(n);u=[e,e,f];break}case _g:if(c=g.length?g.pop()[1]:"",d=p.charCodeAt(f+1),"url"===c&&d!==pg&&d!==hg&&d!==yg&&d!==gg&&d!==bg&&d!==wg&&d!==vg){r=f;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(h||t){r=f;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===mg;)l-=1,a=!a}while(a);u=["brackets",p.slice(f,r+1),f,r],f=r}else r=p.indexOf(")",f+1),o=p.slice(f,r+1),-1===r||Rg.test(o)?u=["(","(",f]:(u=["brackets",o,f,r],f=r);break;case pg:case hg:i=n===pg?"'":'"',r=f;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(h||t){r=f+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===mg;)l-=1,a=!a}while(a);u=["string",p.slice(f,r+1),f,r],f=r;break;case Mg:zg.lastIndex=f+1,zg.test(p),r=0===zg.lastIndex?p.length-1:zg.lastIndex-2,u=["at-word",p.slice(f,r+1),f,r],f=r;break;case mg:for(r=f,s=!0;p.charCodeAt(r+1)===mg;)r+=1,s=!s;if(n=p.charCodeAt(r+1),s&&n!==fg&&n!==yg&&n!==gg&&n!==bg&&n!==vg&&n!==wg&&(r+=1,Ng.test(p.charAt(r)))){for(;Ng.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===yg&&(r+=1)}u=["word",p.slice(f,r+1),f,r],f=r;break;default:n===fg&&p.charCodeAt(f+1)===Tg?(r=p.indexOf("*/",f+2)+1,0===r&&(h||t?r=p.length:w("comment")),u=["comment",p.slice(f,r+1),f,r],f=r):(Og.lastIndex=f+1,Og.test(p),r=0===Og.lastIndex?p.length-1:Og.lastIndex-2,u=["word",p.slice(f,r+1),f,r],g.push(u),f=r)}return f++,u},position:function(){return f}}},Kg=Bf,Qg=Dg,Xg=Bg,ey=qg,ty={empty:!0,space:!0};var ny=tg,ry=class{constructor(e){this.input=e,this.root=new Xg,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new Qg;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Kg;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Yg(this.input)}decl(e,t){let n=new Jg;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let n=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==n)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ey;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,c="",d=!0;for(let u=0;u<l;u+=1)i=n[u],o=i[0],"space"!==o||u!==l-1||r?"comment"===o?(a=n[u-1]?n[u-1][0]:"empty",s=n[u+1]?n[u+1][0]:"empty",ty[a]||ty[s]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new ey;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},iy=Tf;function oy(e,t){let n=new ry(new iy(e,t));try{n.parse()}catch(r){throw r}return n.root}var sy=oy;oy.default=oy,ny.registerParse(oy);var{isClean:ay,my:ly}=Fm,cy=jf,dy=Zm,uy=tg,py=sg,hy=ug,my=sy,fy=Bg,gy={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},yy={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},wy={Once:!0,postcssPlugin:!0,prepare:!0};function by(e){return"object"==typeof e&&"function"==typeof e.then}function vy(e){let t=!1,n=gy[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function xy(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:vy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ky(e){return e[ay]=!1,e.nodes&&e.nodes.forEach(e=>ky(e)),e}var _y={},Sy=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof hy)i=ky(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=my;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(o){this.processed=!0,this.error=o}i&&!i[ly]&&uy.rebuild(i)}else i=ky(n);this.result=new hy(t,i,r),this.helpers={..._y,postcss:_y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!yy[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!wy[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(by(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ay];){e[ay]=!0;let n=[xy(e)];for(;n.length>0;){let e=this.visitTick(n);if(by(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return by(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=dy;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new cy(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(by(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ay];)e[ay]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(by(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(o){throw this.handleError(o,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[ay])return r[ay]=!0,void e.push(xy(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[ay]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ay]=!0;let t=vy(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[ay]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Sy.registerPostcss=e=>{_y=e};var Cy=Sy;Sy.default=Sy,fy.registerLazyResult(Sy),py.registerLazyResult(Sy);var Iy=jf,Ey=Zm,Ty=sy,Ay=ug,My=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=Ey;this.result=new Ay(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Iy(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Ty;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},zy=My;My.default=My;var Oy=zy,Ry=Cy,Ny=sg,Py=Bg,Ly=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ry(this,e,t):new Oy(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Dy=Ly;Ly.default=Ly,Py.registerProcessor(Ly),Ny.registerProcessor(Ly);var $y=rf,jy=hf,Fy=Bf,Uy=Dg,By=Tf,Wy=Bg,Gy=qg;function Hy(e,t){if(Array.isArray(e))return e.map(e=>Hy(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:By.prototype};n.map&&(n.map={...n.map,__proto__:jy.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Hy(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Wy(r);if("decl"===r.type)return new $y(r);if("rule"===r.type)return new Gy(r);if("comment"===r.type)return new Fy(r);if("atrule"===r.type)return new Uy(r);throw new Error("Unknown node type: "+e.type)}var Zy=Hy;Hy.default=Hy;var Vy=jm,qy=rf,Jy=Cy,Yy=tg,Ky=Dy,Qy=Zm,Xy=Zy,ew=sg,tw=lg,nw=Bf,rw=Dg,iw=ug,ow=Tf,sw=sy,aw=Gg,lw=qg,cw=Bg,dw=ef;function uw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Ky(e)}uw.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{}.LANG&&{}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new Ky).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return uw([i(n)]).process(e,t)},i},uw.stringify=Qy,uw.parse=sw,uw.fromJSON=Xy,uw.list=aw,uw.comment=e=>new nw(e),uw.atRule=e=>new rw(e),uw.decl=e=>new qy(e),uw.rule=e=>new lw(e),uw.root=e=>new cw(e),uw.document=e=>new ew(e),uw.CssSyntaxError=Vy,uw.Declaration=qy,uw.Container=Yy,uw.Processor=Ky,uw.Document=ew,uw.Comment=nw,uw.Warning=tw,uw.AtRule=rw,uw.Result=iw,uw.Input=ow,uw.Rule=lw,uw.Root=cw,uw.Node=dw,Jy.registerPostcss(uw);var pw=uw;uw.default=uw;var hw=/* @__PURE__ */Am(pw);hw.stringify,hw.fromJSON,hw.plugin,hw.parse,hw.list,hw.document,hw.comment,hw.atRule,hw.rule,hw.decl,hw.root,hw.CssSyntaxError,hw.Declaration,hw.Container,hw.Processor,hw.Document,hw.Comment,hw.Warning,hw.AtRule,hw.Result,hw.Input,hw.Rule,hw.Root,hw.Node;var mw=Object.defineProperty,fw=(e,t,n)=>((e,t,n)=>t in e?mw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function gw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yw(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var ww={exports:{}},bw=String,vw=function(){return{isColorSupported:!1,reset:bw,bold:bw,dim:bw,italic:bw,underline:bw,inverse:bw,hidden:bw,strikethrough:bw,black:bw,red:bw,green:bw,yellow:bw,blue:bw,magenta:bw,cyan:bw,white:bw,gray:bw,bgBlack:bw,bgRed:bw,bgGreen:bw,bgYellow:bw,bgBlue:bw,bgMagenta:bw,bgCyan:bw,bgWhite:bw}};ww.exports=vw(),ww.exports.createColors=vw;var xw=ww.exports,kw=/* @__PURE__ */yw(/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),_w=xw,Sw=kw,Cw=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=_w.isColorSupported),Sw&&e&&(t=Sw(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=_w.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}},Iw=Cw;Cw.default=Cw;var Ew={};Ew.isClean=Symbol("isClean"),Ew.my=Symbol("my");var Tw={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Aw=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Tw[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=Tw[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},Mw=Aw;Aw.default=Aw;var zw=Mw;function Ow(e,t){new zw(t).stringify(e)}var Rw=Ow;Ow.default=Ow;var{isClean:Nw,my:Pw}=Ew,Lw=Iw,Dw=Mw,$w=Rw;function jw(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>jw(e,n)):("object"===o&&null!==i&&(i=jw(i)),n[r]=i)}return n}var Fw=class{constructor(e={}){this.raws={},this[Nw]=!1,this[Pw]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=jw(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new Lw(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Nw]){this[Nw]=!1;let e=this;for(;e=e.parent;)e[Nw]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new Dw).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||/* @__PURE__ */new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=$w){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}},Uw=Fw;Fw.default=Fw;var Bw=Uw,Ww=class extends Bw{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},Gw=Ww;Ww.default=Ww;var Hw={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},{SourceMapConsumer:Zw,SourceMapGenerator:Vw}=kw,{existsSync:qw,readFileSync:Jw}=kw,{dirname:Yw,join:Kw}=kw;var Qw=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Yw(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Zw(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=Yw(e),qw(e))return this.mapFile=e,Jw(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zw)return Vw.fromSourceMap(t).toString();if(t instanceof Vw)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Kw(Yw(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Xw=Qw;Qw.default=Qw;var{SourceMapConsumer:eb,SourceMapGenerator:tb}=kw,{fileURLToPath:nb,pathToFileURL:rb}=kw,{isAbsolute:ib,resolve:ob}=kw,{nanoid:sb}=Hw,ab=kw,lb=Iw,cb=Xw,db=Symbol("fromOffsetCache"),ub=Boolean(eb&&tb),pb=Boolean(ob&&ib),hb=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!pb||/^\w+:\/\//.test(t.from)||ib(t.from)?this.file=t.from:this.file=ob(t.from)),pb&&ub){let e=new cb(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+sb(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new lb(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new lb(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(rb&&(i.input.url=rb(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[db])n=this[db];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[db]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ob(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=ib(a.source)?rb(a.source):new URL(a.source,this.map.consumer().sourceRoot||rb(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!nb)throw new Error("file: protocol is not available in this PostCSS build");l.file=nb(o)}let c=s.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},mb=hb;hb.default=hb,ab&&ab.registerInput&&ab.registerInput(hb);var{SourceMapConsumer:fb,SourceMapGenerator:gb}=kw,{dirname:yb,relative:wb,resolve:bb,sep:vb}=kw,{pathToFileURL:xb}=kw,kb=mb,_b=Boolean(fb&&gb),Sb=Boolean(yb&&bb&&wb&&vb),Cb=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=/* @__PURE__ */new Map,this.memoizedPaths=/* @__PURE__ */new Map,this.memoizedURLs=/* @__PURE__ */new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||yb(e.file);!1===this.mapOpts.sourcesContent?(t=new fb(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Sb&&_b&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=gb.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gb({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new gb({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type&&("atrule"!==a.type||a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?yb(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=yb(bb(n,this.mapOpts.annotation)));let r=wb(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new kb(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(xb){let t=xb(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===vb&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}},Ib=Uw,Eb=class extends Ib{constructor(e){super(e),this.type="comment"}},Tb=Eb;Eb.default=Eb;var Ab,Mb,zb,Ob,{isClean:Rb,my:Nb}=Ew,Pb=Gw,Lb=Tb,Db=Uw;function $b(e){return e.map(e=>(e.nodes&&(e.nodes=$b(e.nodes)),delete e.source,e))}function jb(e){if(e[Rb]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)jb(t)}var Fb=class e extends Db{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=$b(Ab(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Pb(t)]}else if(t.selector)t=[new Mb(t)];else if(t.name)t=[new zb(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Lb(t)]}return t.map(t=>(t[Nb]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Rb]&&jb(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Fb.registerParse=e=>{Ab=e},Fb.registerRule=e=>{Mb=e},Fb.registerAtRule=e=>{zb=e},Fb.registerRoot=e=>{Ob=e};var Ub=Fb;Fb.default=Fb,Fb.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,zb.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mb.prototype):"decl"===e.type?Object.setPrototypeOf(e,Pb.prototype):"comment"===e.type?Object.setPrototypeOf(e,Lb.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ob.prototype),e[Nb]=!0,e.nodes&&e.nodes.forEach(e=>{Fb.rebuild(e)})};var Bb,Wb,Gb=Ub,Hb=class extends Gb{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bb(new Wb,this,e).stringify()}};Hb.registerLazyResult=e=>{Bb=e},Hb.registerProcessor=e=>{Wb=e};var Zb=Hb;Hb.default=Hb;var Vb=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},qb=Vb;Vb.default=Vb;var Jb=qb,Yb=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Jb(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},Kb=Yb;Yb.default=Yb;var Qb="'".charCodeAt(0),Xb='"'.charCodeAt(0),ev="\\".charCodeAt(0),tv="/".charCodeAt(0),nv="\n".charCodeAt(0),rv=" ".charCodeAt(0),iv="\f".charCodeAt(0),ov="\t".charCodeAt(0),sv="\r".charCodeAt(0),av="[".charCodeAt(0),lv="]".charCodeAt(0),cv="(".charCodeAt(0),dv=")".charCodeAt(0),uv="{".charCodeAt(0),pv="}".charCodeAt(0),hv=";".charCodeAt(0),mv="*".charCodeAt(0),fv=":".charCodeAt(0),gv="@".charCodeAt(0),yv=/[\t\n\f\r "#'()/;[\\\]{}]/g,wv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bv=/.[\r\n"'(/\\]/,vv=/[\da-f]/i,xv=Ub,kv=class extends xv{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},_v=kv;kv.default=kv,xv.registerAtRule(kv);var Sv,Cv,Iv=Ub,Ev=class extends Iv{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Sv(new Cv,this,e).stringify()}};Ev.registerLazyResult=e=>{Sv=e},Ev.registerProcessor=e=>{Cv=e};var Tv=Ev;Ev.default=Ev,Iv.registerRoot(Ev);var Av={comma:e=>Av.split(e,[","],!0),space:e=>Av.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let d of e)c?c=!1:"\\"===d?c=!0:a?d===l&&(a=!1):'"'===d||"'"===d?(a=!0,l=d):"("===d?s+=1:")"===d?s>0&&(s-=1):0===s&&t.includes(d)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=d;return(n||""!==i)&&r.push(i.trim()),r}},Mv=Av;Av.default=Av;var zv=Ub,Ov=Mv,Rv=class extends zv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ov.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},Nv=Rv;Rv.default=Rv,zv.registerRule(Rv);var Pv=Gw,Lv=function(e,t={}){let n,r,i,o,s,a,l,c,d,u,p=e.css.valueOf(),h=t.ignoreErrors,m=p.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(f),n){case nv:case rv:case ov:case sv:case iv:r=f;do{r+=1,n=p.charCodeAt(r)}while(n===rv||n===nv||n===ov||n===sv||n===iv);u=["space",p.slice(f,r)],f=r-1;break;case av:case lv:case uv:case pv:case fv:case hv:case dv:{let e=String.fromCharCode(n);u=[e,e,f];break}case cv:if(c=g.length?g.pop()[1]:"",d=p.charCodeAt(f+1),"url"===c&&d!==Qb&&d!==Xb&&d!==rv&&d!==nv&&d!==ov&&d!==iv&&d!==sv){r=f;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(h||t){r=f;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===ev;)l-=1,a=!a}while(a);u=["brackets",p.slice(f,r+1),f,r],f=r}else r=p.indexOf(")",f+1),o=p.slice(f,r+1),-1===r||bv.test(o)?u=["(","(",f]:(u=["brackets",o,f,r],f=r);break;case Qb:case Xb:i=n===Qb?"'":'"',r=f;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(h||t){r=f+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===ev;)l-=1,a=!a}while(a);u=["string",p.slice(f,r+1),f,r],f=r;break;case gv:yv.lastIndex=f+1,yv.test(p),r=0===yv.lastIndex?p.length-1:yv.lastIndex-2,u=["at-word",p.slice(f,r+1),f,r],f=r;break;case ev:for(r=f,s=!0;p.charCodeAt(r+1)===ev;)r+=1,s=!s;if(n=p.charCodeAt(r+1),s&&n!==tv&&n!==rv&&n!==nv&&n!==ov&&n!==sv&&n!==iv&&(r+=1,vv.test(p.charAt(r)))){for(;vv.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===rv&&(r+=1)}u=["word",p.slice(f,r+1),f,r],f=r;break;default:n===tv&&p.charCodeAt(f+1)===mv?(r=p.indexOf("*/",f+2)+1,0===r&&(h||t?r=p.length:w("comment")),u=["comment",p.slice(f,r+1),f,r],f=r):(wv.lastIndex=f+1,wv.test(p),r=0===wv.lastIndex?p.length-1:wv.lastIndex-2,u=["word",p.slice(f,r+1),f,r],g.push(u),f=r)}return f++,u},position:function(){return f}}},Dv=Tb,$v=_v,jv=Tv,Fv=Nv,Uv={empty:!0,space:!0};var Bv=Ub,Wv=class{constructor(e){this.input=e,this.root=new jv,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new $v;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Dv;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Lv(this.input)}decl(e,t){let n=new Pv;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let n=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==n)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Fv;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,c="",d=!0;for(let u=0;u<l;u+=1)i=n[u],o=i[0],"space"!==o||u!==l-1||r?"comment"===o?(a=n[u-1]?n[u-1][0]:"empty",s=n[u+1]?n[u+1][0]:"empty",Uv[a]||Uv[s]||","===c.slice(-1)?d=!1:c+=i[1]):c+=i[1]:d=!1;if(!d){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new Fv;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gv=mb;function Hv(e,t){let n=new Wv(new Gv(e,t));try{n.parse()}catch(r){throw r}return n.root}var Zv=Hv;Hv.default=Hv,Bv.registerParse(Hv);var{isClean:Vv,my:qv}=Ew,Jv=Cb,Yv=Rw,Kv=Ub,Qv=Zb,Xv=Kb,ex=Zv,tx=Tv,nx={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rx={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ix={Once:!0,postcssPlugin:!0,prepare:!0};function ox(e){return"object"==typeof e&&"function"==typeof e.then}function sx(e){let t=!1,n=nx[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function ax(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:sx(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function lx(e){return e[Vv]=!1,e.nodes&&e.nodes.forEach(e=>lx(e)),e}var cx={},dx=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof Xv)i=lx(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=ex;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(o){this.processed=!0,this.error=o}i&&!i[qv]&&Kv.rebuild(i)}else i=lx(n);this.result=new Xv(t,i,r),this.helpers={...cx,postcss:cx,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!rx[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ix[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(ox(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vv];){e[Vv]=!0;let n=[ax(e)];for(;n.length>0;){let e=this.visitTick(n);if(ox(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ox(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Yv;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Jv(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(ox(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vv];)e[Vv]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ox(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(o){throw this.handleError(o,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[Vv])return r[Vv]=!0,void e.push(ax(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Vv]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Vv]=!0;let t=sx(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Vv]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};dx.registerPostcss=e=>{cx=e};var ux=dx;dx.default=dx,tx.registerLazyResult(dx),Qv.registerLazyResult(dx);var px=Cb,hx=Rw,mx=Zv,fx=Kb,gx=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=hx;this.result=new fx(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new px(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=mx;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},yx=gx;gx.default=gx;var wx=yx,bx=ux,vx=Zb,xx=Tv,kx=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new bx(this,e,t):new wx(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},_x=kx;kx.default=kx,xx.registerProcessor(kx),vx.registerProcessor(kx);var Sx=Gw,Cx=Xw,Ix=Tb,Ex=_v,Tx=mb,Ax=Tv,Mx=Nv;function zx(e,t){if(Array.isArray(e))return e.map(e=>zx(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Tx.prototype};n.map&&(n.map={...n.map,__proto__:Cx.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>zx(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Ax(r);if("decl"===r.type)return new Sx(r);if("rule"===r.type)return new Mx(r);if("comment"===r.type)return new Ix(r);if("atrule"===r.type)return new Ex(r);throw new Error("Unknown node type: "+e.type)}var Ox=zx;zx.default=zx;var Rx=Iw,Nx=Gw,Px=ux,Lx=Ub,Dx=_x,$x=Rw,jx=Ox,Fx=Zb,Ux=qb,Bx=Tb,Wx=_v,Gx=Kb,Hx=mb,Zx=Zv,Vx=Mv,qx=Nv,Jx=Tv,Yx=Uw;function Kx(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Dx(e)}Kx.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{}.LANG&&{}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new Dx).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return Kx([i(n)]).process(e,t)},i},Kx.stringify=$x,Kx.parse=Zx,Kx.fromJSON=jx,Kx.list=Vx,Kx.comment=e=>new Bx(e),Kx.atRule=e=>new Wx(e),Kx.decl=e=>new Nx(e),Kx.rule=e=>new qx(e),Kx.root=e=>new Jx(e),Kx.document=e=>new Fx(e),Kx.CssSyntaxError=Rx,Kx.Declaration=Nx,Kx.Container=Lx,Kx.Processor=Dx,Kx.Document=Fx,Kx.Comment=Bx,Kx.Warning=Ux,Kx.AtRule=Wx,Kx.Result=Gx,Kx.Input=Hx,Kx.Rule=qx,Kx.Root=Jx,Kx.Node=Yx,Px.registerPostcss(Kx);var Qx=Kx;Kx.default=Kx;var Xx=/* @__PURE__ */gw(Qx);Xx.stringify,Xx.fromJSON,Xx.plugin,Xx.parse,Xx.list,Xx.document,Xx.comment,Xx.atRule,Xx.rule,Xx.decl,Xx.root,Xx.CssSyntaxError,Xx.Declaration,Xx.Container,Xx.Processor,Xx.Document,Xx.Comment,Xx.Warning,Xx.AtRule,Xx.Result,Xx.Input,Xx.Rule,Xx.Root,Xx.Node;var ek=class e{constructor(...e){fw(this,"parentElement",null),fw(this,"parentNode",null),fw(this,"ownerDocument"),fw(this,"firstChild",null),fw(this,"lastChild",null),fw(this,"previousSibling",null),fw(this,"nextSibling",null),fw(this,"ELEMENT_NODE",1),fw(this,"TEXT_NODE",3),fw(this,"nodeType"),fw(this,"nodeName"),fw(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},tk={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},nk={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rk={};function ik(e){if(rk[e])return rk[e];const t=globalThis[e],n=t.prototype,r=e in tk?tk[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in nk?nk[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return rk[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?rk[e]=o:n}catch{return n}}var ok={};function sk(e,t,n){var r;const i=`${e}.${String(n)}`;if(ok[i])return ok[i].call(t);const o=ik(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(ok[i]=s,s.call(t)):t[n]}var ak={};function lk(e,t,n){const r=`${e}.${String(n)}`;if(ak[r])return ak[r].bind(t);const i=ik(e)[n];return"function"!=typeof i?t[n]:(ak[r]=i,i.bind(t))}function ck(){return ik("MutationObserver").constructor}function dk(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var uk={ownerDocument:function(e){return sk("Node",e,"ownerDocument")},childNodes:function(e){return sk("Node",e,"childNodes")},parentNode:function(e){return sk("Node",e,"parentNode")},parentElement:function(e){return sk("Node",e,"parentElement")},textContent:function(e){return sk("Node",e,"textContent")},contains:function(e,t){return lk("Node",e,"contains")(t)},getRootNode:function(e){return lk("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?sk("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?sk("Element",e,"shadowRoot"):null},querySelector:function(e,t){return sk("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return sk("Element",e,"querySelectorAll")(t)},mutationObserver:ck,patch:dk};function pk(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var hk={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function mk(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function fk(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>fk(e,t,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hk=new Proxy(hk,{get:(e,t,n)=>Reflect.get(e,t,n)}));var gk=Date.now;function yk(e){var t,n,r,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=uk.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=uk.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function wk(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function bk(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function vk(e){return e?e.nodeType===e.ELEMENT_NODE?e:uk.parentElement(e):null}function xk(e,t,n,r){if(!e)return!1;const i=vk(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(_m(i,t,r))return!0}catch(o){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function kk(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function _k(e,t){if(Vh(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=uk.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||_k(r,t))}function Sk(e){return Boolean(e.changedTouches)}function Ck(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ik(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ek(e){return!!e&&(e instanceof ek&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(uk.shadowRoot(e)))}/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())||(gk=()=>/* @__PURE__ */(new Date).getTime());var Tk=class{constructor(){Rh(this,"id",1),Rh(this,"styleIDMap",/* @__PURE__ */new WeakMap),Rh(this,"idStyleMap",/* @__PURE__ */new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=/* @__PURE__ */new WeakMap,this.idStyleMap=/* @__PURE__ */new Map,this.id=1}generateId(){return this.id++}};function Ak(e){var t;let n=null;return"getRootNode"in e&&(null==(t=uk.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&uk.host(uk.getRootNode(e))&&(n=uk.host(uk.getRootNode(e))),n}function Mk(e){const t=uk.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Ak(n);)n=t;return n}(e);return uk.contains(t,n)}function zk(e){const t=uk.ownerDocument(e);return!!t&&(uk.contains(t,e)||Mk(e))}var Ok=/* @__PURE__ */(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Ok||{}),Rk=/* @__PURE__ */(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Rk||{}),Nk=/* @__PURE__ */(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Nk||{}),Pk=/* @__PURE__ */(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pk||{}),Lk=/* @__PURE__ */(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Lk||{}),Dk=/* @__PURE__ */(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Dk||{}),$k=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($k||{});function jk(e){return"__ln"in e}var Fk,Uk=class{constructor(){Rh(this,"length",0),Rh(this,"head",null),Rh(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&jk(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&jk(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Bk=(e,t)=>`${e}@${t}`,Wk=class{constructor(){Rh(this,"frozen",!1),Rh(this,"locked",!1),Rh(this,"texts",[]),Rh(this,"attributes",[]),Rh(this,"attributeMap",/* @__PURE__ */new WeakMap),Rh(this,"removes",[]),Rh(this,"mapRemoves",[]),Rh(this,"movedMap",{}),Rh(this,"addedSet",/* @__PURE__ */new Set),Rh(this,"movedSet",/* @__PURE__ */new Set),Rh(this,"droppedSet",/* @__PURE__ */new Set),Rh(this,"removesSubTreeCache",/* @__PURE__ */new Set),Rh(this,"mutationCb"),Rh(this,"blockClass"),Rh(this,"blockSelector"),Rh(this,"maskTextClass"),Rh(this,"maskTextSelector"),Rh(this,"inlineStylesheet"),Rh(this,"maskInputOptions"),Rh(this,"maskTextFn"),Rh(this,"maskInputFn"),Rh(this,"keepIframeSrcFn"),Rh(this,"recordCanvas"),Rh(this,"inlineImages"),Rh(this,"slimDOMOptions"),Rh(this,"dataURLOptions"),Rh(this,"doc"),Rh(this,"mirror"),Rh(this,"iframeManager"),Rh(this,"stylesheetManager"),Rh(this,"shadowDomManager"),Rh(this,"canvasManager"),Rh(this,"processedNodeManager"),Rh(this,"unattachedDoc"),Rh(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Rh(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=/* @__PURE__ */new Set,n=new Uk,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{const o=uk.parentNode(i);if(!o||!zk(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=Vh(o)?this.mirror.getId(Ak(i)):this.mirror.getId(o),l=r(i);if(-1===a||-1===l)return n.addNode(i);const c=Tm(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Ck(e,this.mirror)&&this.iframeManager.addIframe(e),Ik(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ek(i)&&this.shadowDomManager.addShadowRoot(uk.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Hk(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(uk.parentNode(a))||i(a);for(const a of this.addedSet)Zk(this.droppedSet,a)||Hk(this.removesSubTreeCache,a,this.mirror)?Zk(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(uk.parentNode(o.value)),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(uk.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=uk.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=uk.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=uk.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=/* @__PURE__ */new WeakMap,this.removes=[],this.addedSet=/* @__PURE__ */new Set,this.movedSet=/* @__PURE__ */new Set,this.droppedSet=/* @__PURE__ */new Set,this.removesSubTreeCache=/* @__PURE__ */new Set,this.movedMap={},this.mutationCb(s))}),Rh(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(uk.childNodes(e),e=>uk.textContent(e)||"").join("");t.attributes.value=Qh({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:tm(e),value:n,maskInputFn:this.maskInputFn})}),Rh(this,"processMutation",e=>{if(!kk(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=uk.textContent(e.target);xk(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Sm(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,vk(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const e=tm(n);i=Qh({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(xk(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!km(n.tagName,r))if(o.attributes[r]=xm(this.doc,Xh(n.tagName),Xh(r),i),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?t:[t,i]:o._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(xk(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=Vh(e.target)?this.mirror.getId(uk.host(e.target)):this.mirror.getId(e.target);xk(e.target,this.blockClass,this.blockSelector,!1)||kk(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Gk(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||_k(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Bk(n,r)]?Gk(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Vh(e.target)||!qh(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),uk.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Rh(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(kk(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Bk(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xk(e,this.blockClass,this.blockSelector,!1)||(uk.childNodes(e).forEach(e=>this.genAdds(e)),Ek(e)&&uk.childNodes(uk.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Gk(e,t){e.delete(t),uk.childNodes(t).forEach(t=>Gk(e,t))}function Hk(e,t,n){return 0!==e.size&&function(e,t){const n=uk.parentNode(t);return!!n&&e.has(n)}(e,t)}function Zk(e,t){return 0!==e.size&&Vk(e,t)}function Vk(e,t){const n=uk.parentNode(t);return!!n&&(!!e.has(n)||Vk(e,n))}var qk=e=>{if(!Fk)return e;return(...t)=>{try{return e(...t)}catch(n){if(Fk&&!0===Fk(n))return;throw n}}},Jk=[];function Yk(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Kk(e,t){const n=new Wk;Jk.push(n),n.init(e);const r=new(ck())(qk(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Qk({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Nk).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=Xh(o);const c=(t=>o=>{const s=Yk(o);if(xk(s,r,i,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Pk.Mouse;break;case"touch":a=Pk.Touch;break;case"pen":a=Pk.Pen}a===Pk.Touch?Nk[t]===Nk.MouseDown?c="TouchStart":Nk[t]===Nk.MouseUp&&(c="TouchEnd"):Pk.Pen}else Sk(o)&&(a=Pk.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Pk.Touch||c.startsWith("Mouse")&&a===Pk.Mouse)&&(a=null)):Nk[t]===Nk.Click&&(a=l,l=null);const d=Sk(o)?o.changedTouches[0]:o;if(!d)return;const u=n.getId(s),{clientX:p,clientY:h}=d;qk(e)({type:Nk[c],id:u,x:p,y:h,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Nk[o]){case Nk.MouseDown:case Nk.MouseUp:s=s.replace("mouse","pointer");break;case Nk.TouchStart:case Nk.TouchEnd:return}a.push(pk(s,c,t))}),qk(()=>{a.forEach(e=>e())})}function Xk({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return pk("scroll",qk(mk(qk(o=>{const s=Yk(o);if(!s||xk(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=yk(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}var e_=["INPUT","TEXTAREA","SELECT"],t_=/* @__PURE__ */new WeakMap;function n_(e){return function(e,t){if(s_("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||s_("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||s_("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||s_("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function r_(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function i_({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(uk.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(o=null==(i=n.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(i){}return r}}),qk(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function o_(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}(e,t),e.recordDOM&&(r=Kk(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=mk(qk(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),c=qk(mk(qk(e=>{const t=Yk(e),{clientX:n,clientY:i}=Sk(e)?e.changedTouches[0]:e;s||(s=gk()),a.push({x:n,y:i,id:r.getId(t),timeOffset:gk()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Rk.Drag:e instanceof MouseEvent?Rk.MouseMove:Rk.TouchMove)}),i,{trailing:!1})),d=[pk("mousemove",c,n),pk("touchmove",c,n),pk("drag",c,n)];return qk(()=>{d.forEach(e=>e())})}(e),o=Qk(e),s=Xk(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return pk("resize",qk(mk(qk(()=>{const t=wk(),i=bk();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:d}){function u(e){let n=Yk(e);const c=e.isTrusted,u=n&&n.tagName;if(n&&"OPTION"===u&&(n=uk.parentElement(n)),!n||!u||e_.indexOf(u)<0||xk(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let h=n.value,m=!1;const f=tm(n)||"";"radio"===f||"checkbox"===f?m=n.checked:(a[u.toLowerCase()]||a[f])&&(h=Qh({element:n,maskInputOptions:a,tagName:u,type:f,value:h,maskInputFn:l})),p(n,d?{text:h,isChecked:m,userTriggered:c}:{text:h,isChecked:m});const g=n.name;"radio"===f&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;p(e,d?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function p(t,r){const i=t_.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){t_.set(t,r);const i=n.getId(t);qk(e)({...r,id:i})}}const h=("last"===c.input?["change"]:["input","change"]).map(e=>pk(e,qk(u),t)),m=t.defaultView;if(!m)return()=>{h.forEach(e=>e())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&h.push(...g.map(e=>fk(e[0],e[1],{set(){qk(u)({target:this,isTrusted:!1})}},!1,m))),qk(()=>{h.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=qk(o=>mk(qk(i=>{const s=Yk(i);if(!s||xk(s,t,n,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d,loop:u}=s;e({type:o,id:r.getId(s),currentTime:a,volume:l,muted:c,playbackRate:d,loop:u})}),i.media||500)),a=[pk("play",s(Dk.Play),o),pk("pause",s(Dk.Pause),o),pk("seeked",s(Dk.Seeked),o),pk("volumechange",s(Dk.VolumeChange),o),pk("ratechange",s(Dk.RateChange),o)];return qk(()=>{a.forEach(e=>e())})}(e);let d=()=>{},u=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:qk((r,i,o)=>{const[s,a]=o,{id:l,styleId:c}=r_(i,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:s,index:a}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:qk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=r_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:qk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=r_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:qk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=r_(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),r.apply(i,o)})}));const l={};a_("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(a_("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),a_("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),a_("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,i])=>{c[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(c[r].insertRule,{apply:qk((r,i,o)=>{const[s,a]=o,{id:l,styleId:c}=r_(i.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:s,index:[...n_(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:qk((r,i,o)=>{const[s]=o,{id:a,styleId:l}=r_(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...n_(i),s]}]}),r.apply(i,o)})})}),qk(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:n}),u=i_(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:qk((i,s,a)=>{var l;const[c,d,u]=a;if(n.has(c))return o.apply(s,[c,d,u]);const{id:p,styleId:h}=r_(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:c,value:d,priority:u},index:n_(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:qk((i,o,a)=>{var l;const[c]=a;if(n.has(c))return s.apply(o,[c]);const{id:d,styleId:u}=r_(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||u&&-1!==u)&&e({id:d,styleId:u,remove:{property:c},index:n_(o.parentRule)}),i.apply(o,a)})}),qk(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=/* @__PURE__ */new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=dk(t.fonts,"add",function(t){return function(n){return setTimeout(qk(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),qk(()=>{r.forEach(e=>e())})}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=qk(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:c}=e.getRangeAt(t);xk(o,r,i,!0)||xk(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:c})}o({ranges:a})});return a(),pk("selectionchange",a)}(e),f=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?dk(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(o){}return e.apply(this,[n,r,i])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,n,y.options));return qk(()=>{Jk.forEach(e=>e.reset()),r?.disconnect(),i(),o(),s(),a(),l(),c(),d(),u(),p(),h(),m(),f(),g.forEach(e=>e())})}function s_(e){return void 0!==window[e]}function a_(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var l_=class{constructor(e){Rh(this,"iframeIdToRemoteIdMap",/* @__PURE__ */new WeakMap),Rh(this,"iframeRemoteIdToIdMap",/* @__PURE__ */new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=/* @__PURE__ */new WeakMap,void(this.iframeRemoteIdToIdMap=/* @__PURE__ */new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},c_=class{constructor(e){Rh(this,"iframes",/* @__PURE__ */new WeakMap),Rh(this,"crossOriginIframeMap",/* @__PURE__ */new WeakMap),Rh(this,"crossOriginIframeMirror",new l_(mm)),Rh(this,"crossOriginIframeStyleMirror"),Rh(this,"crossOriginIframeRootIdMap",/* @__PURE__ */new WeakMap),Rh(this,"mirror"),Rh(this,"mutationCb"),Rh(this,"wrappedEmit"),Rh(this,"loadListener"),Rh(this,"stylesheetManager"),Rh(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new l_(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Ok.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Ok.IncrementalSnapshot,data:{source:Rk.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ok.Meta:case Ok.Load:case Ok.DomContentLoaded:return!1;case Ok.Plugin:return t;case Ok.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ok.IncrementalSnapshot:switch(t.data.source){case Rk.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Rk.Drag:case Rk.TouchMove:case Rk.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Rk.ViewportResize:return!1;case Rk.MediaInteraction:case Rk.MouseInteraction:case Rk.Scroll:case Rk.CanvasMutation:case Rk.Input:return this.replaceIds(t.data,e,["id"]),t;case Rk.StyleSheetRule:case Rk.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Rk.Font:return t;case Rk.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Rk.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===$k.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},d_=class{constructor(e){Rh(this,"shadowDoms",/* @__PURE__ */new WeakSet),Rh(this,"mutationCb"),Rh(this,"scrollCb"),Rh(this,"bypassOptions"),Rh(this,"mirror"),Rh(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!qh(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Kk({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Xk({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(uk.host(e))),this.restoreHandlers.push(i_({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(dk(e.prototype,"attachShadow",function(e){return function(r){const i=e.call(this,r),o=uk.shadowRoot(this);return o&&zk(this)&&n.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=/* @__PURE__ */new WeakSet}},u_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h_=0;h_<64;h_++)p_[u_.charCodeAt(h_)]=h_;var m_=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=u_[n[t]>>2],i+=u_[(3&n[t])<<4|n[t+1]>>4],i+=u_[(15&n[t+1])<<2|n[t+2]>>6],i+=u_[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},f_=/* @__PURE__ */new Map;var g_=(e,t,n)=>{if(!e||!b_(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=f_.get(e);return n||(n=/* @__PURE__ */new Map,f_.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function y_(e,t,n){if(e instanceof Array)return e.map(e=>y_(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:m_(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[y_(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[y_(e.data,t,n),e.width,e.height]}:b_(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:g_(e,t,n)}:e}var w_=(e,t,n)=>e.map(e=>y_(e,t,n)),b_=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function v_(e,t,n,r){const i=[];try{const o=dk(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!xk(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch{}return()=>{i.forEach(e=>e())}}function x_(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=dk(e,l,function(e){return function(...s){const a=e.apply(this,s);if(g_(a,o,this),"tagName"in this.canvas&&!xk(this.canvas,r,i,!0)){const e={type:t,property:l,args:w_(s,o,this)};n(this.canvas,e)}return a}});s.push(a)}catch{const r=fk(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}var k_="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",__="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(k_)],{type:"text/javascript;charset=utf-8"});function S_(e){let t;try{if(t=__&&(window.URL||window.webkitURL).createObjectURL(__),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(n){return new Worker("data:text/javascript;base64,"+k_,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var C_,I_,E_,T_=class{constructor(e){Rh(this,"pendingCanvasMutations",/* @__PURE__ */new Map),Rh(this,"rafStamps",{latestId:0,invokeId:null}),Rh(this,"mirror"),Rh(this,"mutationCb"),Rh(this,"resetObservers"),Rh(this,"frozen",!1),Rh(this,"locked",!1),Rh(this,"processMutation",(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,i){const o=v_(t,n,r,!0),s=/* @__PURE__ */new Map,a=new S_;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:Lk["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{xk(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=v_(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=dk(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return xk(this.canvas,n,r,!0)||setTimeout(()=>{const n=w_(o,t,this);e(this.canvas,{type:Lk["2D"],property:s,args:n})},0),i.apply(this,o)}});i.push(o)}catch{const n=fk(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Lk["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const i=[];return i.push(...x_(t.WebGLRenderingContext.prototype,Lk.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...x_(t.WebGL2RenderingContext.prototype,Lk.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},A_=class{constructor(e){Rh(this,"trackedLinkElements",/* @__PURE__ */new WeakSet),Rh(this,"mutationCb"),Rh(this,"adoptedStyleSheetCb"),Rh(this,"styleMirror",new Tk),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const i of e){let e;this.styleMirror.has(i)?e=this.styleMirror.getId(i):(e=this.styleMirror.add(i),r.push({styleId:e,rules:Array.from(i.rules||CSSRule,(e,t)=>({rule:Yh(e,i.href),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=/* @__PURE__ */new WeakSet}trackStylesheetInLinkElement(e){}},M_=class{constructor(){Rh(this,"nodeMap",/* @__PURE__ */new WeakMap),Rh(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=/* @__PURE__ */new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||/* @__PURE__ */new Set).add(t))}destroy(){}},z_=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Sh=e.contentWindow)?void 0:Sh.Array.from)||Array.from,document.body.removeChild(e)}}catch(MS){}var O_,R_,N_=new Kh;function P_(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:k=!1,recordCrossOriginIframes:_=!1,recordAfter:S=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:I=!1,inlineImages:E=!1,plugins:T,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:M=/* @__PURE__ */new Set([]),errorHandler:z}=e;Fk=z;const O=!_||window.parent===window;let R=!1;if(!O)try{window.parent.document&&(R=!1)}catch(Z){R=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!R)return()=>{};void 0!==v&&void 0===w.mousemove&&(w.mousemove=v),N_.reset();const N=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},P=Em(h);let L;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const $=e=>{for(const t of T||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!R&&(e=y(e)),e};C_=(e,i)=>{var o;const s=e;if(s.timestamp=gk(),!(null==(o=Jk[0])?void 0:o.isFrozen())||s.type===Ok.FullSnapshot||s.type===Ok.IncrementalSnapshot&&s.data.source===Rk.Mutation||Jk.forEach(e=>e.unfreeze()),O)t?.($(s),i);else if(R){const e={type:"rrweb",event:$(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===Ok.FullSnapshot)L=s,D=0;else if(s.type===Ok.IncrementalSnapshot){if(s.data.source===Rk.Mutation&&s.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&s.timestamp-L.timestamp>n;(e||t)&&I_(!0)}};const j=e=>{C_({type:Ok.IncrementalSnapshot,data:{source:Rk.Mutation,...e}})},F=e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.Scroll,...e}}),U=e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.CanvasMutation,...e}}),B=new A_({mutationCb:j,adoptedStyleSheetCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.AdoptedStyleSheet,...e}})}),W=new c_({mirror:N_,mutationCb:j,stylesheetManager:B,recordCrossOriginIframes:_,wrappedEmit:C_});for(const q of T||[])q.getMirror&&q.getMirror({nodeMirror:N_,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const G=new M_;E_=new T_({recordCanvas:k,mutationCb:U,win:window,blockClass:i,blockSelector:o,mirror:N_,sampling:w.canvas,dataURLOptions:b});const H=new d_({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:N,dataURLOptions:b,maskTextFn:f,maskInputFn:m,recordCanvas:k,inlineImages:E,sampling:w,slimDOMOptions:P,iframeManager:W,stylesheetManager:B,canvasManager:E_,keepIframeSrcFn:A,processedNodeManager:G},mirror:N_});I_=(e=!1)=>{if(!x)return;C_({type:Ok.Meta,data:{href:window.location.href,width:bk(),height:wk()}},e),B.reset(),H.init(),Jk.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Kh,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:u,maskInputFn:p,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:x=()=>!1}=t||{};return Tm(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:Em(h),dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:x,newlyAddedElement:!1})}(document,{mirror:N_,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:N,maskTextFn:f,maskInputFn:m,slimDOM:P,dataURLOptions:b,recordCanvas:k,inlineImages:E,onSerialize:e=>{Ck(e,N_)&&W.addIframe(e),Ik(e,N_)&&B.trackLinkElement(e),Ek(e)&&H.addShadowRoot(uk.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:A});t&&(C_({type:Ok.FullSnapshot,data:{node:t,initialOffset:yk(window)}},e),Jk.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,N_.getId(document)))};try{const e=[],t=e=>{var t;return qk(o_)({mutationCb:j,mousemoveCb:(e,t)=>C_({type:Ok.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.MouseInteraction,...e}}),scrollCb:F,viewportResizeCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.ViewportResize,...e}}),inputCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.Input,...e}}),mediaInteractionCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.MediaInteraction,...e}}),styleSheetRuleCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.StyleSheetRule,...e}}),styleDeclarationCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>C_({type:Ok.IncrementalSnapshot,data:{source:Rk.Font,...e}}),selectionCb:e=>{C_({type:Ok.IncrementalSnapshot,data:{source:Rk.Selection,...e}})},customElementCb:e=>{C_({type:Ok.IncrementalSnapshot,data:{source:Rk.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:N,inlineStylesheet:d,sampling:w,recordDOM:x,recordCanvas:k,inlineImages:E,userTriggeredOnInput:C,collectFonts:I,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:P,dataURLOptions:b,mirror:N_,iframeManager:W,stylesheetManager:B,shadowDomManager:H,processedNodeManager:G,canvasManager:E_,ignoreCSSAttributes:M,plugins:(null==(t=null==T?void 0:T.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>C_({type:Ok.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};W.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(r){}});const n=()=>{I_(),e.push(t(document)),z_=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(pk("DOMContentLoaded",()=>{C_({type:Ok.DomContentLoaded,data:{}}),"DOMContentLoaded"===S&&n()})),e.push(pk("load",()=>{C_({type:Ok.Load,data:{}}),"load"===S&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")}}),G.destroy(),z_=!1,Fk=void 0}}catch(V){}}P_.addCustomEvent=(e,t)=>{if(!z_)throw new Error("please add custom event after start recording");C_({type:Ok.Custom,data:{tag:e,payload:t}})},P_.freezePage=()=>{Jk.forEach(e=>e.freeze())},P_.takeFullSnapshot=e=>{if(!z_)throw new Error("please take full snapshot after start recording");I_(e)},P_.mirror=N_,(R_=O_||(O_={}))[R_.NotStarted=0]="NotStarted",R_[R_.Running=1]="Running",R_[R_.Stopped=2]="Stopped";var L_=mc("SessionRecorder"),D_=500,$_=5e5,j_=class{eventQueue=[];estimatedQueueBytes=0;sessionId;stopRecording=null;isRecording=!1;chatId;applicationId;metadataSent=!1;startPromise=null;stopRequested=!1;flushTimer=null;consecutiveFailures=0;constructor(e,t){if(!e||""===e.trim())throw new Error("chatId is required for SessionRecorder");if(!t||t<=0)throw new Error("applicationId (mtxApp) is required for SessionRecorder");L_.info("Constructor called with chatId:",e,"applicationId:",t),this.chatId=e,this.applicationId=t,this.sessionId=e,L_.info("Initialized with sessionId:",this.sessionId)}async sendMetadata(){this.metadataSent?L_.warn("Metadata already sent, skipping"):(L_.info("Sending rrweb/metadata via POST"),await rc.widgetMessage({chat_id:this.chatId,command:{type:"rrweb/metadata",session_id:this.sessionId,chat_id:this.chatId,application_id:this.applicationId,url:window.location.href,user_agent:navigator.userAgent,timestamp:Date.now()}}),this.metadataSent=!0,L_.info("✅ rrweb/metadata sent successfully"))}bufferEvent(e){if(this.eventQueue.push(e),this.estimatedQueueBytes+=JSON.stringify(e).length,this.eventQueue.length>D_){const e=this.eventQueue.length-D_,t=this.eventQueue.splice(0,e);for(const n of t)this.estimatedQueueBytes-=JSON.stringify(n).length;L_.warn(`⚠️ Event queue exceeded 500, dropped ${e} oldest events`)}this.estimatedQueueBytes>=5e4?this.flush():this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},500))}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),0===this.eventQueue.length)return;let e,t;if(this.estimatedQueueBytes<=$_)e=this.eventQueue,t=this.estimatedQueueBytes,this.eventQueue=[],this.estimatedQueueBytes=0;else{for(e=[],t=0;this.eventQueue.length>0;){const n=this.eventQueue[0];if(void 0===n)break;const r=JSON.stringify(n).length;if(t+r>$_&&e.length>0)break;const i=this.eventQueue.shift();void 0!==i&&e.push(i),t+=r,this.estimatedQueueBytes-=r}this.eventQueue.length>0&&!this.flushTimer&&(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},0))}L_.debug(`Flushing ${e.length} events (~${t} bytes)`),rc.widgetMessage({chat_id:this.chatId,command:{type:"rrweb/events",session_id:this.sessionId,events:e}}).then(()=>{this.consecutiveFailures=0}).catch(n=>{const r=null!=n&&"object"==typeof n&&"status"in n?n.status:null;if("number"==typeof r&&r>=400&&r<500)return L_.error(`Dropping ${e.length} events after permanent ${String(r)} error:`,n),void(this.consecutiveFailures=0);if(this.consecutiveFailures++,this.consecutiveFailures>5)return L_.error(`Dropping ${e.length} events after 5 consecutive failures:`,n),void(this.consecutiveFailures=0);if(L_.error(`Failed to flush events (attempt ${this.consecutiveFailures}/5), re-queuing:`,n),this.eventQueue=e.concat(this.eventQueue),this.estimatedQueueBytes+=t,this.eventQueue.length>D_){const e=this.eventQueue.length-D_,t=this.eventQueue.splice(0,e);for(const n of t)this.estimatedQueueBytes-=JSON.stringify(n).length;L_.warn(`⚠️ Event queue exceeded 500 after re-queue, dropped ${e} oldest events`)}})}async start(){if(this.isRecording)L_.warn("Recording already started");else{if(this.startPromise)return this.startPromise;this.startPromise=this.doStart();try{await this.startPromise}finally{this.startPromise=null}}}async doStart(){this.stopRequested=!1;try{if(L_.info("🚀 start() called"),await this.sendMetadata(),this.stopRequested)throw new Error("Recording stopped during startup");this.stopRecording=P_({emit:e=>{this.bufferEvent(e)},recordCanvas:!1,recordCrossOriginIframes:!1,maskAllInputs:!1,collectFonts:!1,inlineStylesheet:!0,blockClass:"rr-block",ignoreClass:"rr-ignore"}),this.isRecording=!0,L_.info("Recording started with chatId:",this.sessionId)}catch(e){throw L_.error("Failed to start recording:",e),e}}stop(){this.stopRequested=!0,this.stopRecording&&(this.stopRecording(),this.stopRecording=null),(this.isRecording||this.eventQueue.length>0)&&this.flush(),this.isRecording=!1,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.metadataSent=!1,L_.info("Recording stopped")}getSessionId(){return this.sessionId}isActive(){return this.isRecording}},F_=class{config;async validateConfig(e){return this.config=e,e.mtxId&&e.mtxKey?this.validateByMarketrixId(e.mtxId,e.mtxKey):e.mtxApp&&e.mtxAgent?this.validateByAgentAndApplication(e.mtxApp,e.mtxAgent):{isValid:!1,error:"Please provide either (mtxId + mtxKey) OR (mtxApp + mtxAgent)"}}async validateByMarketrixId(e,t){try{const{items:r}=await rc.widgetSearch({marketrix_id:e,marketrix_key:t});if(!r||0===r.length)return{isValid:!1,error:"Widget not found or invalid credentials"};const i=r.find(e=>"widget"===e.type&&"active"===e.status);if(!i){const e=r.filter(e=>"widget"===e.type);return e.length>0?{isValid:!1,error:`Found widget(s) but none are active. Current status(es): ${e.map(e=>e.status).join(", ")}. Please activate the widget in the dashboard.`}:0===r.length?{isValid:!1,error:"No widgets found for the provided marketrix_id and marketrix_key. Please verify your credentials."}:{isValid:!1,error:`No widget found. Found widget type(s): ${r.map(e=>e.type).join(", ")}. Please create a widget.`}}if(!i.agent_id)return{isValid:!1,error:"Widget missing agent_id",widget:i};try{const e=await rc.agentGet({agent_id:i.agent_id});if(!i.application_id)return{isValid:!1,error:"Widget missing application_id",widget:i,agent:e};return{isValid:!0,widget:i,agent:e,application:await rc.applicationGet({application_id:i.application_id})}}catch(n){return{isValid:!1,error:`Failed to validate agent: ${oc(n)}`,widget:i}}}catch(r){return sc(r,"Widget validation",this.config)}}async validateByAgentAndApplication(e,t){try{const n=await rc.applicationGet({application_id:e}),r=await rc.agentGet({agent_id:t});return r.application_id!==e?{isValid:!1,error:`Agent ID ${t} belongs to application ID ${r.application_id}, but provided application ID is ${e}. Please verify the application ID matches the agent's application_id.`,application:n,agent:r}:{isValid:!0,application:n,agent:r}}catch(n){return sc(n,"Agent and application validation",this.config)}}},U_=null,B_=class{mtxId;mtxKey;mtxApp;constructor(e,t,n){this.mtxId=e,this.mtxKey=t,this.mtxApp=n}async fetchWidgetSettings(){if(!this.mtxId&&!this.mtxKey&&!this.mtxApp)return null;try{U_||(U_=await rc.widgetGetDefaults({type:"widget"}));const e=U_;if(!e){throw new Error("Failed to fetch default widget settings from API. The API must return widget settings.")}let t=null;if(this.mtxId&&this.mtxKey)t=(await rc.widgetSearch({type:"widget",marketrix_id:this.mtxId,marketrix_key:this.mtxKey})).items;else{if(!this.mtxApp)return null;t=(await rc.widgetSearch({type:"widget",application_id:this.mtxApp})).items}const n=t?.find(e=>"active"===e.status&&"widget"===e.type)||null;if(n?.settings){const t=this.getWidgetSettings(n);if(t){const r={...e,...t};return{...n,settings:r}}}const r=/* @__PURE__ */new Date;return{id:0,application_id:this.mtxApp||0,agent_id:0,type:"widget",settings:e,status:"active",marketrix_id:this.mtxId||"",marketrix_key:this.mtxKey||"",created_at:r,updated_at:r}}catch(e){const t=e instanceof Error?e.message:"Unknown error",n=/* @__PURE__ */new Error(`Failed to fetch widget settings from API: ${t}`);throw n.cause=e,n}}getWidgetSettings(e){if(!e?.settings)return null;const t=e.settings;return function(e){return"object"==typeof e&&null!==e}(n=t)&&Fc(n,"widget_enabled")&&"boolean"==typeof n.widget_enabled&&Fc(n,"widget_appearance")&&"string"==typeof n.widget_appearance&&Fc(n,"widget_position")&&"string"==typeof n.widget_position?t:null;var n}},W_="#6b7280",G_="#1f2937",H_="rgba(255, 255, 255, 0.95)",Z_="rgba(255, 255, 255, 0.2)",V_="rgba(0, 0, 0, 0.15)",q_=({message:e="Loading widget settings..."})=>{const[t,n]=p(!1),r=e?.includes("marketrix_id")||e?.includes("marketrix_key");return t?null:/* @__PURE__ */g(ku,{position:"fixed",style:{bottom:"20px",left:"50%",transform:"translateX(-50%)",maxWidth:"420px",backgroundColor:H_,borderRadius:r?"18px":"999px",boxShadow:`0 2px 12px ${V_}`,display:"flex",flexDirection:"column",alignItems:"stretch",gap:"8px",padding:"10px 12px",border:`1px solid ${Z_}`,zIndex:9999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[/* @__PURE__ */g(cp,{align:"center",style:{gap:"10px"},children:[
|
|
67
65
|
/* @__PURE__ */f(Cu,{src:_u,alt:"",size:28,style:{borderRadius:"50%",overflow:"hidden",flexShrink:0}}),
|
|
68
|
-
/* @__PURE__ */f(vp,{as:"span",style:{fontSize:"13px",color:
|
|
69
|
-
/* @__PURE__ */f(mp,{label:"Dismiss",onClick:()=>n(!0),style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:G_,borderRadius:"50%",width:"20px",height:"20px",minWidth:"unset"},children:/* @__PURE__ */f(up,{name:"closeSmall",size:12})})]}),r?/* @__PURE__ */f(vp,{as:"p",style:{fontSize:"12px",color:G_,textAlign:"left",margin:0},children:"Please configure marketrix_id and marketrix_key"}):null]})},Y_='/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-normal:0em;--tracking-wide:.025em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--shadow-2xs:var(--shadow-2xs);--shadow-xs:var(--shadow-xs);--shadow-sm:var(--shadow-sm);--shadow-md:var(--shadow-md);--shadow-lg:var(--shadow-lg);--shadow-xl:var(--shadow-xl);--shadow-2xl:var(--shadow-2xl);--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow:var(--shadow);--color-background:var(--background);--color-primary:var(--primary)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-2{inset:calc(var(--spacing) * 2)}.inset-3{inset:calc(var(--spacing) * 3)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-5{top:calc(var(--spacing) * 5)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-1\\/4{right:25%}.right-4{right:calc(var(--spacing) * 4)}.right-5{right:calc(var(--spacing) * 5)}.right-full{right:100%}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-16{bottom:calc(var(--spacing) * 16)}.left-0{left:calc(var(--spacing) * 0)}.left-1\\/2{left:50%}.left-1\\/4{left:25%}.left-4{left:calc(var(--spacing) * 4)}.left-5{left:calc(var(--spacing) * 5)}.left-full{left:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-\\[calc\\(var\\(--layer-dialog\\)\\+1\\)\\]{z-index:calc(var(--layer-dialog) + 1)}.z-\\[var\\(--layer-popover\\)\\]{z-index:var(--layer-popover)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.m-2{margin:calc(var(--spacing) * 2)}.m-32{margin:calc(var(--spacing) * 32)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.my-0\\.5{margin-block:calc(var(--spacing) * .5)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.h-0{height:calc(var(--spacing) * 0)}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[85vh\\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-20{min-height:calc(var(--spacing) * 20)}.w-0{width:calc(var(--spacing) * 0)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-64{width:calc(var(--spacing) * 64)}.w-auto{width:auto}.w-full{width:100%}.max-w-\\[120px\\]{max-width:120px}.max-w-\\[500px\\]{max-width:500px}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-14{min-width:calc(var(--spacing) * 14)}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-dialog-content-in{animation:dialog-content-in var(--duration-animation) ease-out}.animate-fade-in{animation:.5s ease-out fade-in}.animate-menu-in{animation:menu-in var(--duration-fade) ease-out}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-4{gap:calc(var(--spacing) * 4)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-\\[var\\(--radius\\)\\]{border-radius:var(--radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-4{border-right-style:var(--tw-border-style);border-right-width:4px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-none{--tw-border-style:none;border-style:none}.border-border{border-color:var(--border)}.border-current{border-color:currentColor}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-white\\/25{border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.border-white\\/25{border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.border-t-transparent{border-top-color:#0000}.bg-background{background-color:var(--background)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-card{background-color:var(--card)}.bg-current{background-color:currentColor}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-secondary-bg{background-color:var(--secondary-bg)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-100{background-color:var(--color-yellow-100)}.object-contain{object-fit:contain}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-\\[3px\\]{padding-block:3px}.pt-1{padding-top:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-card-foreground{color:var(--card-foreground)}.text-foreground{color:var(--foreground)}.text-foreground-faint{color:var(--foreground-faint)}.text-foreground-muted{color:var(--foreground-muted)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.text-yellow-700{color:var(--color-yellow-700)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow,.shadow-\\[var\\(--shadow\\)\\]{--tw-shadow:var(--shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:var(--shadow-lg);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:var(--shadow-sm);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:var(--shadow-xl);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,opacity\\]{transition-property:color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\,background-color\\]{transition-property:transform,opacity,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-\\[160ms\\]{--tw-duration:.16s;transition-duration:.16s}.duration-\\[167ms\\]{--tw-duration:.167s;transition-duration:.167s}.ease-\\[cubic-bezier\\(0\\.33\\,0\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.33,0,0,1);transition-timing-function:cubic-bezier(.33,0,0,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.group-focus-within\\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\\:text-foreground-faint::placeholder{color:var(--foreground-faint)}.focus-within\\:border-foreground-faint:focus-within{border-color:var(--foreground-faint)}@media (hover:hover){.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:border-muted-foreground:hover{border-color:var(--muted-foreground)}.hover\\:border-primary:hover{border-color:var(--primary)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-primary:hover{background-color:var(--primary)}.hover\\:bg-primary-hover:hover{background-color:var(--primary-hover)}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-secondary-hover:hover{background-color:var(--secondary-hover)}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\\:bg-transparent:hover{background-color:#0000}.hover\\:text-blue-600:hover{color:var(--color-blue-600)}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\\:opacity-100:hover{opacity:1}.hover\\:duration-\\[250ms\\]:hover{--tw-duration:.25s;transition-duration:.25s}}.focus\\:border-ring:focus{border-color:var(--ring)}.focus\\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-3:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-ring:focus-visible{outline-color:var(--ring)}.active\\:scale-\\[0\\.85\\]:active{scale:.85}.active\\:duration-\\[134ms\\]:active{--tw-duration:.134s;transition-duration:.134s}.active\\:ease-\\[cubic-bezier\\(0\\.45\\,0\\,0\\.2\\,1\\)\\]:active{--tw-ease:cubic-bezier(.45,0,.2,1);transition-timing-function:cubic-bezier(.45,0,.2,1)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-muted:disabled{background-color:var(--muted)}.disabled\\:opacity-50:disabled{opacity:.5}}:root,:host{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(100% 0 0);--success:oklch(60% .2 145);--success-foreground:oklch(100% 0 0);--warning:oklch(75% .18 85);--warning-foreground:oklch(20% 0 0);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(81% .1 252);--chart-2:oklch(62% .19 260);--chart-3:oklch(55% .22 263);--chart-4:oklch(49% .22 264);--chart-5:oklch(42% .18 266);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--foreground-muted:#1f293799;--foreground-faint:#1f293766;--border-muted:#e5e7eb4d;--primary-hover:#3b82f6d9;--primary-muted:#3b82f64d;--secondary-bg:#6b728033;--secondary-hover:#6b72804d;--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--radius:.625rem;--shadow-x:0;--shadow-y:1px;--shadow-blur:3px;--shadow-spread:0px;--shadow-opacity:.1;--shadow-color:oklch(0% 0 0);--shadow-2xs:0 1px 3px 0px #0000000d;--shadow-xs:0 1px 3px 0px #0000000d;--shadow-sm:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow-md:0 1px 3px 0px #0000001a, 0 2px 4px -1px #0000001a;--shadow-lg:0 1px 3px 0px #0000001a, 0 4px 6px -1px #0000001a;--shadow-xl:0 1px 3px 0px #0000001a, 0 8px 10px -1px #0000001a;--shadow-2xl:0 1px 3px 0px #00000040;--tracking-normal:0em;--spacing:.25rem;--duration-animation:.3s;--duration-fade:.2s;--widget-width:400px;--widget-height:520px;--layer-tooltip:1000;--layer-popover:1050;--layer-dialog:1100;--layer-toast:1200}.dark,:host(.dark){--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(26.9% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(37.1% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(55% .2 145);--success-foreground:oklch(100% 0 0);--warning:oklch(70% .18 85);--warning-foreground:oklch(20% 0 0);--border:oklch(27.5% 0 0);--input:oklch(32.5% 0 0);--ring:oklch(55.6% 0 0);--chart-1:oklch(81% .1 252);--chart-2:oklch(62% .19 260);--chart-3:oklch(55% .22 263);--chart-4:oklch(49% .22 264);--chart-5:oklch(42% .18 266);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(27.5% 0 0);--sidebar-ring:oklch(43.9% 0 0);--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--radius:.625rem;--shadow-x:0;--shadow-y:1px;--shadow-blur:3px;--shadow-spread:0px;--shadow-opacity:.1;--shadow-color:oklch(0% 0 0);--shadow-2xs:0 1px 3px 0px #0000000d;--shadow-xs:0 1px 3px 0px #0000000d;--shadow-sm:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow-md:0 1px 3px 0px #0000001a, 0 2px 4px -1px #0000001a;--shadow-lg:0 1px 3px 0px #0000001a, 0 4px 6px -1px #0000001a;--shadow-xl:0 1px 3px 0px #0000001a, 0 8px 10px -1px #0000001a;--shadow-2xl:0 1px 3px 0px #00000040}@media (prefers-reduced-motion:reduce){:root{--duration-animation:0s;--duration-fade:0s}}@keyframes dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes dialog-content-in{0%{opacity:0;scale:.96}to{opacity:1;scale:1}}@keyframes menu-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes popover-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes tooltip-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes toast-in{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-30px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(30px)}to{opacity:1;transform:translate(0)}}.marketrix-widget,[data-marketrix-widget]{font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.marketrix-widget-container{z-index:var(--widget-z-index,1210);pointer-events:auto;position:fixed}.marketrix-widget,.marketrix-widget *,[data-marketrix-widget],[data-marketrix-widget] *{pointer-events:auto;box-sizing:border-box;transition:color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out,box-shadow .2s ease-in-out,transform .2s ease-in-out}.marketrix-widget button,.marketrix-widget input,.marketrix-widget textarea,.marketrix-widget select,[data-marketrix-widget] button,[data-marketrix-widget] input,[data-marketrix-widget] textarea,[data-marketrix-widget] select{font:inherit}[data-resizing=true],[data-resizing=true] *{transition:none!important}.gradient-border{border:2px solid;border-image:linear-gradient(to right, var(--foreground), var(--foreground)) 1}.marketrix-widget ::-webkit-scrollbar{width:6px;height:6px}.marketrix-widget * ::-webkit-scrollbar{width:6px;height:6px}.marketrix-widget ::-webkit-scrollbar-track{background:var(--muted);border-radius:3px}.marketrix-widget * ::-webkit-scrollbar-track{background:var(--muted);border-radius:3px}.marketrix-widget ::-webkit-scrollbar-thumb{background:var(--muted-foreground);border-radius:3px}.marketrix-widget * ::-webkit-scrollbar-thumb{background:var(--muted-foreground);border-radius:3px}.marketrix-widget ::-webkit-scrollbar-thumb:hover{background:var(--foreground)}.marketrix-widget * ::-webkit-scrollbar-thumb:hover{background:var(--foreground)}.marketrix-widget{scrollbar-color:var(--muted) var(--muted-foreground);scrollbar-width:thin}.marketrix-widget ::-webkit-scrollbar-button{width:0;height:0;display:none!important}.marketrix-widget * ::-webkit-scrollbar-button{width:0;height:0;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:start:decrement{display:none!important}.marketrix-widget ::-webkit-scrollbar-button:end:increment{display:none!important}.marketrix-widget * ::-webkit-scrollbar-button:start:decrement{display:none!important}.marketrix-widget * ::-webkit-scrollbar-button:end:increment{display:none!important}.marketrix-widget ::-webkit-scrollbar-corner{display:none!important}.marketrix-widget * ::-webkit-scrollbar-corner{display:none!important}.marketrix-widget ::-webkit-scrollbar-button:vertical:start:decrement{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:vertical:end:increment{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:horizontal:start:decrement{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:horizontal:end:increment{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button{background:0 0!important;border:none!important;width:0!important;height:0!important;display:none!important}@keyframes glow-border-pulse{0%,to{border-color:#fff9;box-shadow:0 0 #ffffff4d,0 0 #1f293766}50%{border-color:#fff;box-shadow:0 0 0 2px #fff9,0 0 0 4px #1f29374d}}@keyframes marketrix-screen-edge-pulse{0%,to{opacity:.55}50%{opacity:1}}.marketrix-screen-edge-glow,[data-screen-edge-glow]{animation:1.6s ease-in-out infinite marketrix-screen-edge-pulse}.marketrix-widget-button-processing-glow,.marketrix-widget-button-error-glow{pointer-events:none;filter:blur(14px);will-change:transform, opacity;border-radius:50%;width:140%;height:140%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}@keyframes widget-activity-dash-travel{0%{stroke-dashoffset:0;opacity:.5}18%{stroke-dashoffset:-112px;opacity:1}35%{stroke-dashoffset:-160px;opacity:.65}60%{stroke-dashoffset:-160px;opacity:.45}82%{stroke-dashoffset:-272px;opacity:1}to{stroke-dashoffset:-320px;opacity:.6}}.marketrix-widget-button-processing-activity-ring,.marketrix-widget-button-error-activity-ring{pointer-events:none;z-index:0;position:absolute;inset:-3px;overflow:visible}.marketrix-widget-button-processing-activity-ring rect,.marketrix-widget-button-error-activity-ring rect{fill:none;stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:40 120;animation:1.9s cubic-bezier(.4,0,.2,1) infinite widget-activity-dash-travel}.marketrix-widget-button-processing-activity-ring rect{stroke:#31d06d;filter:drop-shadow(0 0 3px #31d06db3)}.marketrix-widget-button-error-activity-ring rect{stroke:#d0342c;filter:drop-shadow(0 0 3px #d0342cb3)}@keyframes widget-glow-green{0%,to{opacity:.72;background:radial-gradient(circle,#31d06d00 38%,#31d06d61 58%,#31d06d3d 68%,#0000 78%);transform:translate(-50%,-50%)scale(1)}50%{opacity:1;background:radial-gradient(circle,#31d06d00 34%,#31d06d8c 56%,#31d06d54 68%,#0000 80%);transform:translate(-50%,-50%)scale(1.1)}}.marketrix-widget-button-processing-glow{animation:2s ease-in-out infinite widget-glow-green}@keyframes widget-glow-red{0%,to{opacity:.65;background:radial-gradient(circle,#d0342c00 38%,#d0342c57 58%,#d0342c38 68%,#0000 78%);transform:translate(-50%,-50%)scale(1)}50%{opacity:.95;background:radial-gradient(circle,#d0342c00 34%,#d0342c80 56%,#d0342c4d 68%,#0000 80%);transform:translate(-50%,-50%)scale(1.1)}}.marketrix-widget-button-error-glow{animation:1.5s ease-in-out infinite widget-glow-red}@keyframes launcher-entrance{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.animate-launcher-entrance{animation:.25s ease-out forwards launcher-entrance}@keyframes messenger-entrance{0%{opacity:0;transform:scale(0)}40%{opacity:1}to{transform:scale(1)}}@keyframes messenger-exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)translateY(8px)}}.animate-messenger-entrance{animation:.3s cubic-bezier(0,1.2,1,1) messenger-entrance}.animate-messenger-exit{animation:.2s cubic-bezier(.4,0,.2,1) forwards messenger-exit}@keyframes message-enter{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.animate-message-enter{animation:.2s ease-out message-enter}.view-slide-enter.forward{opacity:0;transform:translate(20px)}.view-slide-enter.back{opacity:0;transform:translate(-20px)}.view-slide-enter-active{opacity:1;transition:transform .15s .15s,opacity .15s .15s;transform:translate(0)}.view-slide-enter-active.forward,.view-slide-enter-active.back{opacity:1;transform:translate(0)}.view-slide-exit-active.forward{opacity:0;transition:transform .15s,opacity .15s;transform:translate(-20px)}.view-slide-exit-active.back{opacity:0;transition:transform .15s,opacity .15s;transform:translate(20px)}[data-view-transition][data-direction=forward]{animation:.3s both viewSlideForward}[data-view-transition][data-direction=back]{animation:.3s both viewSlideBack}@keyframes viewSlideForward{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes viewSlideBack{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@media print{.marketrix-widget{display:none!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}',K_=null,Q_=null,X_=null,eS=!1,tS=!1,nS=0,rS=(e,t)=>{const n=t||"marketrix-widget-container-"+ ++nS;let r;if(e){if(e.querySelector(`#${n}`))throw new Error(`Widget container with ID ${n} already exists`);r=document.createElement("div"),r.id=n,r.className="marketrix-widget-container",r.style.width="100%",r.style.height="100%",r.style.position="relative",r.style.overflow="visible",e.appendChild(r)}else{if(document.getElementById(n))throw new Error(`Widget container with ID ${n} already exists`);r=document.createElement("div"),r.id=n,r.className="marketrix-widget-container",document.body.appendChild(r)}if(r.style.pointerEvents="auto",!Uc(r))throw new Error("Container is not an HTMLElement");if(r.shadowRoot)throw new Error("Container already has a shadow root");const i=r.attachShadow({mode:"closed"}),o=document.createElement("style");if(o.textContent=Y_,i.appendChild(o),i.querySelector("#marketrix-widget-root"))throw new Error("Mount element already exists in shadow root");const s=document.createElement("div");return s.id="marketrix-widget-root",s.style.pointerEvents="auto",s.style.width="100%",s.style.height="100%",s.style.position="relative",i.appendChild(s),{container:r,shadowRoot:i,mountEl:s}},iS=(e,n,r=!1)=>{const i=h(e);return i.render(/* @__PURE__ */f(t.StrictMode,{children:/* @__PURE__ */f(Kc,{previewMode:r,children:/* @__PURE__ */f(Oh,{config:n})})})),i},oS=e=>{if(!e)throw new Error("Container is required");e.remove()},sS=()=>Q_,aS=()=>null!==K_,lS=e=>{eS=e},cS=()=>eS,dS=()=>tS,uS=e=>{if("undefined"==typeof window||"undefined"==typeof document)return;if(X_){const e=document.getElementById("marketrix-widget-loader-container");e&&e.remove(),X_.unmount(),X_=null}if(document.getElementById("marketrix-widget-loader-container"))throw new Error("Widget loader container already exists");const n=document.createElement("div");n.id="marketrix-widget-loader-container",n.className="marketrix-widget-loader-container",document.body.appendChild(n);const r=n.attachShadow({mode:"closed"}),i=document.createElement("style");i.textContent=Y_,r.appendChild(i);const o=document.createElement("div");o.id="marketrix-widget-loader-root",r.appendChild(o);const s=h(o);X_=s,s.render(/* @__PURE__ */f(t.StrictMode,{children:/* @__PURE__ */f(J_,{message:e})}))},pS=()=>{if(X_){X_.unmount(),X_=null;const e=document.getElementById("marketrix-widget-loader-container");e&&e.remove()}},hS=null,mS=(e=0)=>{if("undefined"==typeof window||"undefined"==typeof document)return;if(window.__mtx?.state)return;const t=[0,100,500,1e3,2e3];if(!hS)return;const n=document.querySelectorAll("script[mtx-id], script[mtx-app], script[marketrix-id]"),r=(void 0!==document.currentScript&&null!=document.currentScript&&Bc(document.currentScript)&&(document.currentScript.hasAttribute("mtx-id")||document.currentScript.hasAttribute("mtx-app")||document.currentScript.hasAttribute("marketrix-id"))?document.currentScript:null)??n[n.length-1];if(!r||!Bc(r)){if(0===n.length)return void(aS()||cS());if(e<5){return void setTimeout(()=>mS(e+1),t[e]||2e3)}if(aS()||cS())return;return void uS("Please configure mtx-id and mtx-key, or mtx-app and mtx-agent")}const i=r,o=i.getAttribute("mtx-id")||i.getAttribute("marketrix-id"),s=i.getAttribute("mtx-key")||i.getAttribute("marketrix-key"),a=i.getAttribute("mtx-api-host"),l=i.getAttribute("mtx-app"),c=i.getAttribute("mtx-agent"),d=i.getAttribute("mtx-use-screenshare");if(o&&s){const e={mtxId:o,mtxKey:s};a&&(e.mtxApiHost=a),"false"===d&&(e.use_screenshare=!1),hS(e).catch(e=>{})}else if(l&&c){const e=Number.parseInt(l),t=Number.parseInt(c);if(isNaN(e)||isNaN(t))return void uS("Invalid mtx-app or mtx-agent values");const n={mtxApp:e,mtxAgent:t};a&&(n.mtxApiHost=a),"false"===d&&(n.use_screenshare=!1),hS(n).catch(e=>{})}else{if(aS()||cS())return;uS("Please configure mtx-id and mtx-key, or mtx-app and mtx-agent")}},fS=null,gS=!1,yS=null,wS=null,bS=null;async function vS(e,t){if(lS(!0),aS())return void lS(!1);if(dS())return void lS(!1);window.__mtx={state:"initializing"},e.mtxApiHost&&tc(e.mtxApiHost),uS("Validating widget configuration...");const n=await(new U_).validateConfig(e);if(!n.isValid)return uS(n.error||"Widget validation failed. Please check your configuration."),lS(!1),void(window.__mtx=void 0);let r;try{r=await async function(e,t){if(!t.isValid)throw new Error(t.error||"Widget validation failed");uS("Loading widget settings...");try{const t=new W_(e.mtxId,e.mtxKey,e.mtxApp),n=await t.fetchWidgetSettings(),r=n?t.getWidgetSettings(n):null;if(!r)throw new Error("WidgetService did not return widget settings");const i=["widget_enabled","widget_appearance","widget_position","widget_device","widget_header","widget_body","widget_greeting","widget_feature_tell","widget_feature_show","widget_feature_do","widget_feature_human","widget_background_color","widget_text_color","widget_border_color","widget_accent_color","widget_secondary_color","widget_border_radius","widget_font_size","widget_width","widget_height","widget_shadow","widget_animation_duration","widget_fade_duration","widget_bounce_effect","widget_chips"].filter(e=>void 0===r[e]);if(i.length>0)throw new Error(`Widget settings are incomplete. Missing required fields: ${i.join(", ")}. The API must return all widget settings.`);return jc(r,e)}catch(zS){throw zS}finally{pS()}}(e,n)}catch(s){return uS(s instanceof Error?s.message:"Failed to initialize widget"),lS(!1),void(window.__mtx=void 0)}(e=>{Q_=e})(r);const{mountEl:i}=rS(t,`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);var o;o=iS(i,r),K_=o,tS=!0,lS(!1),window.__mtx={state:"active"};try{if(fS&&gS)return;fS&&(fS.stop(),fS=null,gS=!1),bS=new AbortController;const t=(e,t)=>{if(fS&&gS)return;fS=new F_(t,e),gS=!0;const n=fS;yS=n.start().catch(e=>{fS===n&&(gS=!1)}).finally(()=>{fS===n&&(yS=null)})},n=e=>{const n=Ec.getChatId();n?t(e,n):window.addEventListener("marketrix:chatid",()=>{const n=Ec.getChatId();n&&t(e,n)},{once:!0,signal:bS?.signal})},i=r.mtxApp??e.mtxApp;if(i)n(i);else{const e=Lc.getInstance(),t={onRegistered:r=>{r&&n(r),e.removeCallbacks(t)}};e.addCallbacks(t)}}catch(s){gS=!1}}var xS=!1,kS=async(e,t)=>{if(!window.__mtx?.state){if(wS)return wS;if(xS&&wS)return wS;if(xS)return Promise.resolve();if(!aS()&&!dS()){wS=vS(e,t),xS=!0;try{await wS}finally{wS=null,xS=!1}}}},_S=()=>{if(K_){K_.unmount(),K_=null,Q_=null,tS=!1;const e=document.querySelector(".marketrix-widget-container");e&&oS(e)}bS?.abort(),bS=null,fS&&(fS.stop(),fS=null,gS=!1,yS=null),wS=null,window.__mtx=void 0,pS()},SS=()=>{fS&&fS.stop()},CS=async()=>{if(!fS)throw new Error("Session recording not available. Ensure the widget is initialized with mtxApiHost and mtxApp.");if(yS&&(await yS.catch(()=>{}),fS?.isActive()))return;if(fS.isActive())return;const e=fS.start();yS=e;try{await e}finally{yS===e&&(yS=null)}},IS=()=>fS?.isActive()??!1,ES=async e=>{if(aS()){const t=sS();if(!t)throw new Error("Widget not initialized");const n={...t,...e};_S(),await kS(n)}},TS=({settings:e,container:t,mtxId:n,mtxKey:r,mtxApiHost:i})=>{const o=u(null),s=u(null),l=u(null),c=u(null);return a(()=>{const a=t??o?.current?.parentElement??document.body;if(!a||!Uc(a))return;c.current||(c.current=`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);const{container:d,mountEl:u}=rS(a,c.current);l.current=d;const p={...jc(e,{mtxId:n,mtxKey:r,mtxApiHost:i}),isPreviewMode:!0,widget_enabled:e.widget_enabled??!0};s.current&&(s.current.unmount(),s.current=null);const m=h(u);return s.current=m,m.render(/* @__PURE__ */f(Kc,{previewMode:!0,children:/* @__PURE__ */f(Oh,{config:p})})),()=>{s.current&&(s.current.unmount(),s.current=null),l.current&&(oS(l.current),l.current=null,c.current=null)}},[e,t]),t?null:/* @__PURE__ */f("div",{ref:o,style:{width:"100%",height:"100%",position:"relative"}})},AS=async e=>{lS(!0);const t=e.container;if("settings"in e&&void 0!==e.settings){const{settings:n,container:r,...i}=e,o={...jc(n,i),isPreviewMode:!0},{mountEl:s}=rS(t,`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);iS(s,o,!0),lS(!1)}else if("mtxId"in e&&void 0!==e.mtxId&&void 0!==e.mtxKey){const{mtxId:n,mtxKey:r,container:i,...o}=e;await kS({mtxId:n,mtxKey:r,...o},t)}else{if(!("mtxApp"in e)||void 0===e.mtxApp||void 0===e.mtxAgent)throw lS(!1),new Error("Invalid configuration: provide either settings (preview), mtxId+mtxKey (production), or mtxApp+mtxAgent (dev)");{const{mtxApp:n,mtxAgent:r,container:i,...o}=e;await kS({mtxApp:n,mtxAgent:r,...o},t)}}};"undefined"!=typeof window&&setTimeout(()=>{try{(e=>{"function"==typeof e&&(hS=e,mS())})(kS)}catch(e){}},0);var MS={MarketrixWidget:TS,mountWidget:AS,initWidget:kS,unmountWidget:_S,updateMarketrixConfig:ES,getCurrentConfig:sS,startRecording:CS,stopRecording:SS,getRecordingState:IS};export{TS as MarketrixWidget,MS as default,sS as getCurrentConfig,IS as getRecordingState,kS as initWidget,AS as mountWidget,CS as startRecording,SS as stopRecording,_S as unmountWidget,ES as updateMarketrixConfig};
|
|
66
|
+
/* @__PURE__ */f(vp,{as:"span",style:{fontSize:"13px",color:G_,fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:e}),
|
|
67
|
+
/* @__PURE__ */f(mp,{label:"Dismiss",onClick:()=>n(!0),style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:W_,borderRadius:"50%",width:"20px",height:"20px",minWidth:"unset"},children:/* @__PURE__ */f(up,{name:"closeSmall",size:12})})]}),r?/* @__PURE__ */f(vp,{as:"p",style:{fontSize:"12px",color:W_,textAlign:"left",margin:0},children:"Please configure marketrix_id and marketrix_key"}):null]})},J_='/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-normal:0em;--tracking-wide:.025em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) + 4px);--shadow-2xs:var(--shadow-2xs);--shadow-xs:var(--shadow-xs);--shadow-sm:var(--shadow-sm);--shadow-md:var(--shadow-md);--shadow-lg:var(--shadow-lg);--shadow-xl:var(--shadow-xl);--shadow-2xl:var(--shadow-2xl);--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow:var(--shadow)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-2{inset:calc(var(--spacing) * 2)}.inset-3{inset:calc(var(--spacing) * 3)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-5{top:calc(var(--spacing) * 5)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-1\\/4{right:25%}.right-4{right:calc(var(--spacing) * 4)}.right-5{right:calc(var(--spacing) * 5)}.right-full{right:100%}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-16{bottom:calc(var(--spacing) * 16)}.left-0{left:calc(var(--spacing) * 0)}.left-1\\/2{left:50%}.left-1\\/4{left:25%}.left-4{left:calc(var(--spacing) * 4)}.left-5{left:calc(var(--spacing) * 5)}.left-full{left:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-\\[calc\\(var\\(--layer-dialog\\)\\+1\\)\\]{z-index:calc(var(--layer-dialog) + 1)}.z-\\[var\\(--layer-popover\\)\\]{z-index:var(--layer-popover)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.m-2{margin:calc(var(--spacing) * 2)}.m-32{margin:calc(var(--spacing) * 32)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.my-0\\.5{margin-block:calc(var(--spacing) * .5)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.h-0{height:calc(var(--spacing) * 0)}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[85vh\\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-20{min-height:calc(var(--spacing) * 20)}.w-0{width:calc(var(--spacing) * 0)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-64{width:calc(var(--spacing) * 64)}.w-auto{width:auto}.w-full{width:100%}.max-w-\\[120px\\]{max-width:120px}.max-w-\\[500px\\]{max-width:500px}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-14{min-width:calc(var(--spacing) * 14)}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-dialog-content-in{animation:dialog-content-in var(--duration-animation) ease-out}.animate-fade-in{animation:.5s ease-out fade-in}.animate-menu-in{animation:menu-in var(--duration-fade) ease-out}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-4{gap:calc(var(--spacing) * 4)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-\\[var\\(--radius\\)\\]{border-radius:var(--radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-4{border-right-style:var(--tw-border-style);border-right-width:4px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-none{--tw-border-style:none;border-style:none}.border-border{border-color:var(--border)}.border-current{border-color:currentColor}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-white\\/25{border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.border-white\\/25{border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.border-t-transparent{border-top-color:#0000}.bg-background{background-color:var(--background)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-card{background-color:var(--card)}.bg-current{background-color:currentColor}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-secondary-bg{background-color:var(--secondary-bg)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-100{background-color:var(--color-yellow-100)}.object-contain{object-fit:contain}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-\\[3px\\]{padding-block:3px}.pt-1{padding-top:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-card-foreground{color:var(--card-foreground)}.text-foreground{color:var(--foreground)}.text-foreground-faint{color:var(--foreground-faint)}.text-foreground-muted{color:var(--foreground-muted)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.text-yellow-700{color:var(--color-yellow-700)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow,.shadow-\\[var\\(--shadow\\)\\]{--tw-shadow:var(--shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:var(--shadow-lg);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:var(--shadow-sm);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:var(--shadow-xl);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,opacity\\]{transition-property:color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\,background-color\\]{transition-property:transform,opacity,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-\\[160ms\\]{--tw-duration:.16s;transition-duration:.16s}.duration-\\[167ms\\]{--tw-duration:.167s;transition-duration:.167s}.ease-\\[cubic-bezier\\(0\\.33\\,0\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.33,0,0,1);transition-timing-function:cubic-bezier(.33,0,0,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.group-focus-within\\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\\:text-foreground-faint::placeholder{color:var(--foreground-faint)}.focus-within\\:border-foreground-faint:focus-within{border-color:var(--foreground-faint)}@media (hover:hover){.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:border-muted-foreground:hover{border-color:var(--muted-foreground)}.hover\\:border-primary:hover{border-color:var(--primary)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-primary:hover{background-color:var(--primary)}.hover\\:bg-primary-hover:hover{background-color:var(--primary-hover)}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-secondary-hover:hover{background-color:var(--secondary-hover)}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\\:bg-transparent:hover{background-color:#0000}.hover\\:text-blue-600:hover{color:var(--color-blue-600)}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\\:opacity-100:hover{opacity:1}.hover\\:duration-\\[250ms\\]:hover{--tw-duration:.25s;transition-duration:.25s}}.focus\\:border-ring:focus{border-color:var(--ring)}.focus\\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-3:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-ring:focus-visible{outline-color:var(--ring)}.active\\:scale-\\[0\\.85\\]:active{scale:.85}.active\\:duration-\\[134ms\\]:active{--tw-duration:.134s;transition-duration:.134s}.active\\:ease-\\[cubic-bezier\\(0\\.45\\,0\\,0\\.2\\,1\\)\\]:active{--tw-ease:cubic-bezier(.45,0,.2,1);transition-timing-function:cubic-bezier(.45,0,.2,1)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-muted:disabled{background-color:var(--muted)}.disabled\\:opacity-50:disabled{opacity:.5}}:root,:host{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(100% 0 0);--success:oklch(60% .2 145);--success-foreground:oklch(100% 0 0);--warning:oklch(75% .18 85);--warning-foreground:oklch(20% 0 0);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(81% .1 252);--chart-2:oklch(62% .19 260);--chart-3:oklch(55% .22 263);--chart-4:oklch(49% .22 264);--chart-5:oklch(42% .18 266);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--foreground-muted:#1f293799;--foreground-faint:#1f293766;--border-muted:#e5e7eb4d;--primary-hover:#3b82f6d9;--primary-muted:#3b82f64d;--secondary-bg:#6b728033;--secondary-hover:#6b72804d;--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--radius:.625rem;--shadow-x:0;--shadow-y:1px;--shadow-blur:3px;--shadow-spread:0px;--shadow-opacity:.1;--shadow-color:oklch(0% 0 0);--shadow-2xs:0 1px 3px 0px #0000000d;--shadow-xs:0 1px 3px 0px #0000000d;--shadow-sm:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow-md:0 1px 3px 0px #0000001a, 0 2px 4px -1px #0000001a;--shadow-lg:0 1px 3px 0px #0000001a, 0 4px 6px -1px #0000001a;--shadow-xl:0 1px 3px 0px #0000001a, 0 8px 10px -1px #0000001a;--shadow-2xl:0 1px 3px 0px #00000040;--tracking-normal:0em;--spacing:.25rem;--duration-animation:.3s;--duration-fade:.2s;--widget-width:400px;--widget-height:520px;--layer-tooltip:1000;--layer-popover:1050;--layer-dialog:1100;--layer-toast:1200}.dark,:host(.dark){--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(26.9% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(37.1% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(55% .2 145);--success-foreground:oklch(100% 0 0);--warning:oklch(70% .18 85);--warning-foreground:oklch(20% 0 0);--border:oklch(27.5% 0 0);--input:oklch(32.5% 0 0);--ring:oklch(55.6% 0 0);--chart-1:oklch(81% .1 252);--chart-2:oklch(62% .19 260);--chart-3:oklch(55% .22 263);--chart-4:oklch(49% .22 264);--chart-5:oklch(42% .18 266);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(27.5% 0 0);--sidebar-ring:oklch(43.9% 0 0);--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--radius:.625rem;--shadow-x:0;--shadow-y:1px;--shadow-blur:3px;--shadow-spread:0px;--shadow-opacity:.1;--shadow-color:oklch(0% 0 0);--shadow-2xs:0 1px 3px 0px #0000000d;--shadow-xs:0 1px 3px 0px #0000000d;--shadow-sm:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow:0 1px 3px 0px #0000001a, 0 1px 2px -1px #0000001a;--shadow-md:0 1px 3px 0px #0000001a, 0 2px 4px -1px #0000001a;--shadow-lg:0 1px 3px 0px #0000001a, 0 4px 6px -1px #0000001a;--shadow-xl:0 1px 3px 0px #0000001a, 0 8px 10px -1px #0000001a;--shadow-2xl:0 1px 3px 0px #00000040}@media (prefers-reduced-motion:reduce){:root{--duration-animation:0s;--duration-fade:0s}}@keyframes dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes dialog-content-in{0%{opacity:0;scale:.96}to{opacity:1;scale:1}}@keyframes menu-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes popover-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes tooltip-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes toast-in{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-30px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(30px)}to{opacity:1;transform:translate(0)}}.marketrix-widget,[data-marketrix-widget]{font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.marketrix-widget-container{z-index:var(--widget-z-index,1210);pointer-events:auto;position:fixed}.marketrix-widget,.marketrix-widget *,[data-marketrix-widget],[data-marketrix-widget] *{pointer-events:auto;box-sizing:border-box;transition:color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out,box-shadow .2s ease-in-out,transform .2s ease-in-out}.marketrix-widget button,.marketrix-widget input,.marketrix-widget textarea,.marketrix-widget select,[data-marketrix-widget] button,[data-marketrix-widget] input,[data-marketrix-widget] textarea,[data-marketrix-widget] select{font:inherit}[data-resizing=true],[data-resizing=true] *{transition:none!important}.gradient-border{border:2px solid;border-image:linear-gradient(to right, var(--foreground), var(--foreground)) 1}.marketrix-widget ::-webkit-scrollbar{width:6px;height:6px}.marketrix-widget * ::-webkit-scrollbar{width:6px;height:6px}.marketrix-widget ::-webkit-scrollbar-track{background:var(--muted);border-radius:3px}.marketrix-widget * ::-webkit-scrollbar-track{background:var(--muted);border-radius:3px}.marketrix-widget ::-webkit-scrollbar-thumb{background:var(--muted-foreground);border-radius:3px}.marketrix-widget * ::-webkit-scrollbar-thumb{background:var(--muted-foreground);border-radius:3px}.marketrix-widget ::-webkit-scrollbar-thumb:hover{background:var(--foreground)}.marketrix-widget * ::-webkit-scrollbar-thumb:hover{background:var(--foreground)}.marketrix-widget{scrollbar-color:var(--muted) var(--muted-foreground);scrollbar-width:thin}.marketrix-widget ::-webkit-scrollbar-button{width:0;height:0;display:none!important}.marketrix-widget * ::-webkit-scrollbar-button{width:0;height:0;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:start:decrement{display:none!important}.marketrix-widget ::-webkit-scrollbar-button:end:increment{display:none!important}.marketrix-widget * ::-webkit-scrollbar-button:start:decrement{display:none!important}.marketrix-widget * ::-webkit-scrollbar-button:end:increment{display:none!important}.marketrix-widget ::-webkit-scrollbar-corner{display:none!important}.marketrix-widget * ::-webkit-scrollbar-corner{display:none!important}.marketrix-widget ::-webkit-scrollbar-button:vertical:start:decrement{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:vertical:end:increment{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:horizontal:start:decrement{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button:horizontal:end:increment{width:0!important;height:0!important;display:none!important}.marketrix-widget ::-webkit-scrollbar-button{background:0 0!important;border:none!important;width:0!important;height:0!important;display:none!important}@keyframes glow-border-pulse{0%,to{border-color:#fff9;box-shadow:0 0 #ffffff4d,0 0 #1f293766}50%{border-color:#fff;box-shadow:0 0 0 2px #fff9,0 0 0 4px #1f29374d}}@keyframes marketrix-screen-edge-pulse{0%,to{opacity:.55}50%{opacity:1}}.marketrix-screen-edge-glow,[data-screen-edge-glow]{animation:1.6s ease-in-out infinite marketrix-screen-edge-pulse}.marketrix-widget-button-processing-glow,.marketrix-widget-button-error-glow{pointer-events:none;filter:blur(14px);will-change:transform, opacity;border-radius:50%;width:140%;height:140%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}@keyframes widget-activity-dash-travel{0%{stroke-dashoffset:0;opacity:.5}18%{stroke-dashoffset:-112px;opacity:1}35%{stroke-dashoffset:-160px;opacity:.65}60%{stroke-dashoffset:-160px;opacity:.45}82%{stroke-dashoffset:-272px;opacity:1}to{stroke-dashoffset:-320px;opacity:.6}}.marketrix-widget-button-processing-activity-ring,.marketrix-widget-button-error-activity-ring{pointer-events:none;z-index:0;position:absolute;inset:-3px;overflow:visible}.marketrix-widget-button-processing-activity-ring rect,.marketrix-widget-button-error-activity-ring rect{fill:none;stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:40 120;animation:1.9s cubic-bezier(.4,0,.2,1) infinite widget-activity-dash-travel}.marketrix-widget-button-processing-activity-ring rect{stroke:#31d06d;filter:drop-shadow(0 0 3px #31d06db3)}.marketrix-widget-button-error-activity-ring rect{stroke:#d0342c;filter:drop-shadow(0 0 3px #d0342cb3)}@keyframes widget-glow-green{0%,to{opacity:.72;background:radial-gradient(circle,#31d06d00 38%,#31d06d61 58%,#31d06d3d 68%,#0000 78%);transform:translate(-50%,-50%)scale(1)}50%{opacity:1;background:radial-gradient(circle,#31d06d00 34%,#31d06d8c 56%,#31d06d54 68%,#0000 80%);transform:translate(-50%,-50%)scale(1.1)}}.marketrix-widget-button-processing-glow{animation:2s ease-in-out infinite widget-glow-green}@keyframes widget-glow-red{0%,to{opacity:.65;background:radial-gradient(circle,#d0342c00 38%,#d0342c57 58%,#d0342c38 68%,#0000 78%);transform:translate(-50%,-50%)scale(1)}50%{opacity:.95;background:radial-gradient(circle,#d0342c00 34%,#d0342c80 56%,#d0342c4d 68%,#0000 80%);transform:translate(-50%,-50%)scale(1.1)}}.marketrix-widget-button-error-glow{animation:1.5s ease-in-out infinite widget-glow-red}@keyframes launcher-entrance{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.animate-launcher-entrance{animation:.25s ease-out forwards launcher-entrance}@keyframes messenger-entrance{0%{opacity:0;transform:scale(0)}40%{opacity:1}to{transform:scale(1)}}@keyframes messenger-exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)translateY(8px)}}.animate-messenger-entrance{animation:.3s cubic-bezier(0,1.2,1,1) messenger-entrance}.animate-messenger-exit{animation:.2s cubic-bezier(.4,0,.2,1) forwards messenger-exit}@keyframes message-enter{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.animate-message-enter{animation:.2s ease-out message-enter}.view-slide-enter.forward{opacity:0;transform:translate(20px)}.view-slide-enter.back{opacity:0;transform:translate(-20px)}.view-slide-enter-active{opacity:1;transition:transform .15s .15s,opacity .15s .15s;transform:translate(0)}.view-slide-enter-active.forward,.view-slide-enter-active.back{opacity:1;transform:translate(0)}.view-slide-exit-active.forward{opacity:0;transition:transform .15s,opacity .15s;transform:translate(-20px)}.view-slide-exit-active.back{opacity:0;transition:transform .15s,opacity .15s;transform:translate(20px)}[data-view-transition][data-direction=forward]{animation:.3s both viewSlideForward}[data-view-transition][data-direction=back]{animation:.3s both viewSlideBack}@keyframes viewSlideForward{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes viewSlideBack{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@media print{.marketrix-widget{display:none!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}',Y_=null,K_=null,Q_=null,X_=!1,eS=!1,tS=0,nS=(e,t)=>{const n=t||"marketrix-widget-container-"+ ++tS;let r;if(e){if(e.querySelector(`#${n}`))throw new Error(`Widget container with ID ${n} already exists`);r=document.createElement("div"),r.id=n,r.className="marketrix-widget-container",r.style.width="100%",r.style.height="100%",r.style.position="relative",r.style.overflow="visible",e.appendChild(r)}else{if(document.getElementById(n))throw new Error(`Widget container with ID ${n} already exists`);r=document.createElement("div"),r.id=n,r.className="marketrix-widget-container",document.body.appendChild(r)}if(r.style.pointerEvents="auto",!Uc(r))throw new Error("Container is not an HTMLElement");if(r.shadowRoot)throw new Error("Container already has a shadow root");const i=r.attachShadow({mode:"closed"}),o=document.createElement("style");if(o.textContent=J_,i.appendChild(o),i.querySelector("#marketrix-widget-root"))throw new Error("Mount element already exists in shadow root");const s=document.createElement("div");return s.id="marketrix-widget-root",s.style.pointerEvents="auto",s.style.width="100%",s.style.height="100%",s.style.position="relative",i.appendChild(s),{container:r,shadowRoot:i,mountEl:s}},rS=(e,n,r=!1)=>{const i=h(e);return i.render(/* @__PURE__ */f(t.StrictMode,{children:/* @__PURE__ */f(Kc,{previewMode:r,children:/* @__PURE__ */f(zh,{config:n})})})),i},iS=e=>{if(!e)throw new Error("Container is required");e.remove()},oS=()=>K_,sS=()=>null!==Y_,aS=e=>{X_=e},lS=()=>X_,cS=()=>eS,dS=e=>{if("undefined"==typeof window||"undefined"==typeof document)return;if(Q_){const e=document.getElementById("marketrix-widget-loader-container");e&&e.remove(),Q_.unmount(),Q_=null}if(document.getElementById("marketrix-widget-loader-container"))throw new Error("Widget loader container already exists");const n=document.createElement("div");n.id="marketrix-widget-loader-container",n.className="marketrix-widget-loader-container",document.body.appendChild(n);const r=n.attachShadow({mode:"closed"}),i=document.createElement("style");i.textContent=J_,r.appendChild(i);const o=document.createElement("div");o.id="marketrix-widget-loader-root",r.appendChild(o);const s=h(o);Q_=s,s.render(/* @__PURE__ */f(t.StrictMode,{children:/* @__PURE__ */f(q_,{message:e})}))},uS=()=>{if(Q_){Q_.unmount(),Q_=null;const e=document.getElementById("marketrix-widget-loader-container");e&&e.remove()}},pS=null,hS=(e=0)=>{if("undefined"==typeof window||"undefined"==typeof document)return;if(window.__mtx?.state)return;const t=[0,100,500,1e3,2e3];if(!pS)return;const n=document.querySelectorAll("script[mtx-id], script[mtx-app], script[marketrix-id]"),r=(void 0!==document.currentScript&&null!=document.currentScript&&Bc(document.currentScript)&&(document.currentScript.hasAttribute("mtx-id")||document.currentScript.hasAttribute("mtx-app")||document.currentScript.hasAttribute("marketrix-id"))?document.currentScript:null)??n[n.length-1];if(!r||!Bc(r)){if(0===n.length)return void(sS()||lS());if(e<5){return void setTimeout(()=>hS(e+1),t[e]||2e3)}if(sS()||lS())return;return void dS("Please configure mtx-id and mtx-key, or mtx-app and mtx-agent")}const i=r,o=i.getAttribute("mtx-id")||i.getAttribute("marketrix-id"),s=i.getAttribute("mtx-key")||i.getAttribute("marketrix-key"),a=i.getAttribute("mtx-api-host"),l=i.getAttribute("mtx-app"),c=i.getAttribute("mtx-agent"),d=i.getAttribute("mtx-use-screenshare");if(o&&s){const e={mtxId:o,mtxKey:s};a&&(e.mtxApiHost=a),"false"===d&&(e.use_screenshare=!1),pS(e).catch(e=>{})}else if(l&&c){const e=Number.parseInt(l),t=Number.parseInt(c);if(isNaN(e)||isNaN(t))return void dS("Invalid mtx-app or mtx-agent values");const n={mtxApp:e,mtxAgent:t};a&&(n.mtxApiHost=a),"false"===d&&(n.use_screenshare=!1),pS(n).catch(e=>{})}else{if(sS()||lS())return;dS("Please configure mtx-id and mtx-key, or mtx-app and mtx-agent")}},mS=null,fS=!1,gS=null,yS=null,wS=null;async function bS(e,t){if(aS(!0),sS())return void aS(!1);if(cS())return void aS(!1);window.__mtx={state:"initializing"},e.mtxApiHost&&tc(e.mtxApiHost),dS("Validating widget configuration...");const n=await(new F_).validateConfig(e);if(!n.isValid)return dS(n.error||"Widget validation failed. Please check your configuration."),aS(!1),void(window.__mtx=void 0);let r;try{r=await async function(e,t){if(!t.isValid)throw new Error(t.error||"Widget validation failed");dS("Loading widget settings...");try{const t=new B_(e.mtxId,e.mtxKey,e.mtxApp),n=await t.fetchWidgetSettings(),r=n?t.getWidgetSettings(n):null;if(!r)throw new Error("WidgetService did not return widget settings");const i=["widget_enabled","widget_appearance","widget_position","widget_device","widget_header","widget_body","widget_greeting","widget_feature_tell","widget_feature_show","widget_feature_do","widget_feature_human","widget_background_color","widget_text_color","widget_border_color","widget_accent_color","widget_secondary_color","widget_border_radius","widget_font_size","widget_width","widget_height","widget_shadow","widget_animation_duration","widget_fade_duration","widget_bounce_effect","widget_chips"].filter(e=>void 0===r[e]);if(i.length>0)throw new Error(`Widget settings are incomplete. Missing required fields: ${i.join(", ")}. The API must return all widget settings.`);return jc(r,e)}catch(MS){throw MS}finally{uS()}}(e,n)}catch(s){return dS(s instanceof Error?s.message:"Failed to initialize widget"),aS(!1),void(window.__mtx=void 0)}(e=>{K_=e})(r);const{mountEl:i}=nS(t,`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);var o;o=rS(i,r),Y_=o,eS=!0,aS(!1),window.__mtx={state:"active"};try{if(mS&&fS)return;mS&&(mS.stop(),mS=null,fS=!1),wS=new AbortController;const t=(e,t)=>{if(mS&&fS)return;mS=new j_(t,e),fS=!0;const n=mS;gS=n.start().catch(e=>{mS===n&&(fS=!1)}).finally(()=>{mS===n&&(gS=null)})},n=e=>{const n=Ec.getChatId();n?t(e,n):window.addEventListener("marketrix:chatid",()=>{const n=Ec.getChatId();n&&t(e,n)},{once:!0,signal:wS?.signal})},i=r.mtxApp??e.mtxApp;if(i)n(i);else{const e=Lc.getInstance(),t={onRegistered:r=>{r&&n(r),e.removeCallbacks(t)}};e.addCallbacks(t)}}catch(s){fS=!1}}var vS=!1,xS=async(e,t)=>{if(!window.__mtx?.state){if(yS)return yS;if(vS&&yS)return yS;if(vS)return Promise.resolve();if(!sS()&&!cS()){yS=bS(e,t),vS=!0;try{await yS}finally{yS=null,vS=!1}}}},kS=()=>{if(Y_){Y_.unmount(),Y_=null,K_=null,eS=!1;const e=document.querySelector(".marketrix-widget-container");e&&iS(e)}wS?.abort(),wS=null,mS&&(mS.stop(),mS=null,fS=!1,gS=null),yS=null,window.__mtx=void 0,uS()},_S=()=>{mS&&mS.stop()},SS=async()=>{if(!mS)throw new Error("Session recording not available. Ensure the widget is initialized with mtxApiHost and mtxApp.");if(gS&&(await gS.catch(()=>{}),mS?.isActive()))return;if(mS.isActive())return;const e=mS.start();gS=e;try{await e}finally{gS===e&&(gS=null)}},CS=()=>mS?.isActive()??!1,IS=async e=>{if(sS()){const t=oS();if(!t)throw new Error("Widget not initialized");const n={...t,...e};kS(),await xS(n)}},ES=({settings:e,container:t,mtxId:n,mtxKey:r,mtxApiHost:i})=>{const o=u(null),s=u(null),l=u(null),c=u(null);return a(()=>{const a=t??o?.current?.parentElement??document.body;if(!a||!Uc(a))return;c.current||(c.current=`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);const{container:d,mountEl:u}=nS(a,c.current);l.current=d;const p={...jc(e,{mtxId:n,mtxKey:r,mtxApiHost:i}),isPreviewMode:!0,widget_enabled:e.widget_enabled??!0};s.current&&(s.current.unmount(),s.current=null);const m=h(u);return s.current=m,m.render(/* @__PURE__ */f(Kc,{previewMode:!0,children:/* @__PURE__ */f(zh,{config:p})})),()=>{s.current&&(s.current.unmount(),s.current=null),l.current&&(iS(l.current),l.current=null,c.current=null)}},[e,t]),t?null:/* @__PURE__ */f("div",{ref:o,style:{width:"100%",height:"100%",position:"relative"}})},TS=async e=>{aS(!0);const t=e.container;if("settings"in e&&void 0!==e.settings){const{settings:n,container:r,...i}=e,o={...jc(n,i),isPreviewMode:!0},{mountEl:s}=nS(t,`marketrix-widget-${Date.now()}-${Math.random().toString(36).slice(2,11)}`);rS(s,o,!0),aS(!1)}else if("mtxId"in e&&void 0!==e.mtxId&&void 0!==e.mtxKey){const{mtxId:n,mtxKey:r,container:i,...o}=e;await xS({mtxId:n,mtxKey:r,...o},t)}else{if(!("mtxApp"in e)||void 0===e.mtxApp||void 0===e.mtxAgent)throw aS(!1),new Error("Invalid configuration: provide either settings (preview), mtxId+mtxKey (production), or mtxApp+mtxAgent (dev)");{const{mtxApp:n,mtxAgent:r,container:i,...o}=e;await xS({mtxApp:n,mtxAgent:r,...o},t)}}};"undefined"!=typeof window&&setTimeout(()=>{try{(e=>{"function"==typeof e&&(pS=e,hS())})(xS)}catch(e){}},0);var AS={MarketrixWidget:ES,mountWidget:TS,initWidget:xS,unmountWidget:kS,updateMarketrixConfig:IS,getCurrentConfig:oS,startRecording:SS,stopRecording:_S,getRecordingState:CS};export{ES as MarketrixWidget,AS as default,oS as getCurrentConfig,CS as getRecordingState,xS as initWidget,TS as mountWidget,SS as startRecording,_S as stopRecording,kS as unmountWidget,IS as updateMarketrixConfig};
|
|
70
68
|
//# sourceMappingURL=widget.mjs.map
|