"use strict";var f=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of P(t))!U.call(e,o)&&o!==n&&f(e,o,{get:()=>t[o],enumerable:!(i=I(t,o))||i.enumerable});return e};var j=e=>N(f({},"__esModule",{value:!0}),e);var ee={};_(ee,{getDarkMode:()=>Z,getToken:()=>V,listenDarkMode:()=>q});module.exports=j(ee);var a=null;function V(e=!1){if(e)return"dev-token";if(a!==null)return a;if(typeof window>"u"||typeof location>"u")throw new Error("getToken() is only available in browser environments");let t=location.hash.slice(1);if(!t)throw new Error("No token found in URL hash");let n=new URLSearchParams(t).get("mb_token");if(!n)throw new Error('Token "mb_token" not found in URL hash');return a=decodeURIComponent(n),a}var u=null,y=new Set;function Z(){return u}function q(e){if(y.add(e),u!==null)try{e(u)}catch{}return()=>{y.delete(e)}}function M(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function G(e){return M(e)&&e.type==="adapt-darkMode"&&typeof e.darkMode=="boolean"}function J(e){return M(e)&&e.type==="adapt-autoResizing"&&typeof e.autoResizing=="boolean"}function T(e){return Number.isFinite(e)&&e>=1}function K(e){return M(e)&&typeof e.postMessage=="function"}function c(){return typeof window<"u"&&typeof document<"u"&&typeof window.postMessage=="function"}function z(){if(!c())return!1;try{return window.self!==window.top}catch{return!0}}var l=-1,d=-1,m=-1,b=-1,p=null,Q=16,w=0,X=5;function L(){let{body:e,documentElement:t}=document;if(!e)return null;let n=getComputedStyle(e),i=parseFloat(n.marginTop)||0,o=parseFloat(n.marginBottom)||0,E=parseFloat(n.marginLeft)||0,B=parseFloat(n.marginRight)||0,r=getComputedStyle(t),F=parseFloat(r.paddingTop)||0,S=parseFloat(r.paddingBottom)||0,W=parseFloat(r.paddingLeft)||0,A=parseFloat(r.paddingRight)||0,x=parseFloat(r.borderTopWidth)||0,D=parseFloat(r.borderBottomWidth)||0,C=parseFloat(r.borderLeftWidth)||0,O=parseFloat(r.borderRightWidth)||0,h=Math.max(e.scrollHeight,e.offsetHeight),H=Math.max(e.scrollWidth,e.offsetWidth),k=h+i+o+F+S+x+D,R=H+E+B+W+A+C+O;return!T(R)||!T(k)||w>=X&&b>0&&Math.abs(h-d)<=2?null:(b=h,{width:R,height:k+1})}function s(){if(!c()||!z())return;let e=window.parent;if(!K(e))return;let t=document.body?Math.max(document.body.scrollWidth,document.body.offsetWidth):0;t!==m&&m!==-1&&(w=0,b=-1),m=t;let n=L();if(!n)return;let{width:i,height:o}=n;if(!(i===l&&o===d)){l=i,d=o,w++;try{e.postMessage({type:"adapt-resize",width:i,height:o},"*")}catch{}}}function g(){p===null&&(p=setTimeout(()=>{p=null,s()},Q))}function Y(){let e=L();if(!e){if(d>0)try{window.parent.postMessage({type:"adapt-resize",width:l,height:d},"*")}catch{}return}let{width:t,height:n}=e;l=t,d=n;try{window.parent.postMessage({type:"adapt-resize",width:t,height:n},"*")}catch{}}function $(e){let t;try{t=e.data}catch{return}if(G(t)){u=t.darkMode;for(let n of y)try{n(t.darkMode)}catch{}}J(t)&&t.autoResizing&&Y()}function v(){if(!c()||!z())return;let e=document.createElement("style");e.textContent=`
    html, body {
      box-sizing: border-box;
    }
    *, *::before, *::after {
      box-sizing: inherit;
    }
  `,document.head.appendChild(e),window.addEventListener("message",$);let t=new ResizeObserver(g);document.body&&t.observe(document.body),document.documentElement&&t.observe(document.documentElement),document.body&&new MutationObserver(g).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),document.addEventListener("load",g,!0),document.fonts?.ready?.then(()=>{s()}),document.readyState==="complete"?s():window.addEventListener("load",()=>{s()}),setTimeout(s,50),setTimeout(s,150)}c()&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v());0&&(module.exports={getDarkMode,getToken,listenDarkMode});
//# sourceMappingURL=browser.cjs.map
