function a(){let r=document.getElementById("vscode-markdown-preview-data");if(r){let e=r.getAttribute("data-strings");if(e)return JSON.parse(e)}throw new Error("Could not load strings")}var i=class{constructor(e){this._settingsManager=e;this._didShow=!1;this._didHaveCspWarning=!1;document.addEventListener("securitypolicyviolation",()=>{this._onCspWarning()}),window.addEventListener("message",t=>{t&&t.data&&t.data.name==="vscode-did-block-svg"&&this._onCspWarning()})}setPoster(e){this._messaging=e,this._didHaveCspWarning&&this._showCspWarning()}_onCspWarning(){this._didHaveCspWarning=!0,this._showCspWarning()}_showCspWarning(){let e=a(),t=this._settingsManager.settings;if(this._didShow||t.disableSecurityWarnings||!this._messaging)return;this._didShow=!0;let s=document.createElement("a");s.innerText=e.cspAlertMessageText,s.setAttribute("id","code-csp-warning"),s.setAttribute("title",e.cspAlertMessageTitle),s.setAttribute("role","button"),s.setAttribute("aria-label",e.cspAlertMessageLabel),s.onclick=()=>{this._messaging.postMessage("showPreviewSecuritySelector",{source:t.source})},document.body.appendChild(s)}};var n=class{constructor(){this._unloadedStyles=[];this._finishedLoading=!1;let e=t=>{let s=t.target.dataset.source;this._unloadedStyles.push(s)};window.addEventListener("DOMContentLoaded",()=>{for(let t of document.getElementsByClassName("code-user-style"))t.dataset.source&&(t.onerror=e)}),window.addEventListener("load",()=>{this._unloadedStyles.length&&(this._finishedLoading=!0,this._poster?.postMessage("previewStyleLoadError",{unloadedStyles:this._unloadedStyles}))})}setPoster(e){this._poster=e,this._finishedLoading&&e.postMessage("previewStyleLoadError",{unloadedStyles:this._unloadedStyles})}};function d(r){let e=document.getElementById("vscode-markdown-preview-data");if(e){let t=e.getAttribute(r);if(t)return JSON.parse(t)}throw new Error(`Could not load data for ${r}`)}var o=class{constructor(){this._settings=d("data-settings")}get settings(){return this._settings}updateSettings(e){this._settings=e}};window.cspAlerter=new i(new o);window.styleLoadingMonitor=new n;
