12 |
- mergeInto(LibraryManager.library,{$VuplexWebViewImplementation:{},$VuplexWebViewImplementation__postset:`if(typeof Object.assign!="function"){Object.defineProperty(Object,"assign",{value:function e(t){"use strict";if(t==null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(t);for(var i=1;i<arguments.length;i++){var r=arguments[i];if(r!=null){for(var o in r){if(Object.prototype.hasOwnProperty.call(r,o)){n[o]=r[o]}}}}return n},writable:true,configurable:true})}var _vuplexSystem;(function(e){var a={};var u={};function t(e,t,n){u[e]={deps:t,factory:n}}e.register=t;function n(e,t){a[e]=t}e.registerExternal=n;function l(e){if(e in a)return a[e];return i(e)}e.require=l;function c(e){var t=l(e);return Promise.resolve(t)}function i(e){if(!(e in u))throw new Error("Cannot resolve '"+e+"'");var t=u[e];var n={};a[e]=n;function i(e,t){n[e]=t}var r=t.factory(i,{id:e,import:c});for(var o=0;o<t.deps.length;o++){var s=t.deps[o];r.setters[o](l(s))}r.execute();return n}})(_vuplexSystem||(_vuplexSystem={}));var __spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e};var __extends=this&&this.__extends||function(){var i=function(e,t){i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return i(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();_vuplexSystem.register("src/Logger",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){n=function(){function e(){}e.error=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}console.error.apply(console,__spreadArray([this._formatMessage(e)],t))};e.info=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}console.log.apply(console,__spreadArray([this._formatMessage(e)],t))};e.warn=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}console.warn.apply(console,__spreadArray([this._formatMessage(e)],t))};e._formatMessage=function(e){return"[3D WebView] "+e};return e}();e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/IBridge",[],function(e,t){"use strict";var n=t&&t.id;return{setters:[],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/utils/EventEmitter",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){n=function(){function e(){this._listeners={}}e.prototype.addListener=function(e,t){if(!this._listeners[e]){this._listeners[e]=[]}if(this._listeners[e].indexOf(t)===-1){this._listeners[e].push(t)}};e.prototype.emit=function(t){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}if(!this._listeners[t]){return}for(var i=0,r=this._listeners[t];i<r.length;i++){var o=r[i];try{o.apply(void 0,e)}catch(e){console.error("An error occurred while invoking the '"+t+"' event handler.",e)}}};e.prototype.removeListener=function(e,t){if(!this._listeners[e]){return}var n=this._listeners[e].indexOf(t);if(n!==-1){this._listeners[e].splice(n,1)}};return e}();e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/BaseBridge",["libs/browser-agent/src/utils/EventEmitter"],function(e,t){"use strict";var n,i;var r=t&&t.id;return{setters:[function(e){n=e}],execute:function(){i=function(){function e(){this._eventEmitter=new n.default;this._eventResponseResolveFunctions={}}e.prototype.addEventListener=function(e,t){this._eventEmitter.addListener(e,t)};e.prototype.removeEventListener=function(e,t){this._eventEmitter.removeListener(e,t)};e.prototype.postMessageWithResponse=function(n){var i=this;var r;do{r=Math.random().toString()}while(r in this._eventResponseResolveFunctions);return new window.Promise(function(e,t){i._eventResponseResolveFunctions[r]=e;n=Object.assign({responseId:r},n);setTimeout(t,1e3);i.postMessage(n)}).then(function(e){delete i._eventResponseResolveFunctions[r];return e}).catch(function(){delete i._eventResponseResolveFunctions[r];throw new Error("The native module didn't respond to the event in time.")})};e.prototype._emit=function(e,t){this._eventEmitter.emit(e,t)};e.prototype._respondToEvent=function(e){var t=e.responseId,n=e.value;var i=this._eventResponseResolveFunctions[t];if(i){i(n)}};return e}();e("default",i)}}});_vuplexSystem.register("libs/browser-agent/src/IFrameBridge",["libs/browser-agent/src/BaseBridge"],function(e,t){"use strict";var n,i;var r=t&&t.id;return{setters:[function(e){n=e}],execute:function(){i=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.postMessage=function(e){};return t}(n.default);e("default",i)}}});_vuplexSystem.register("libs/browser-agent/src/MessageType",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){(function(e){e["FocusedInputFieldChanged"]="vuplex.webview.focusedInputFieldChanged";e["PageTransparencyDetermined"]="vuplex.webview.pageTransparencyDetermined";e["TitleChanged"]="vuplex.webview.titleChanged";e["TransparencyBlockedWarning"]="vuplex.webview.transparencyBlockedWarning";e["UrlChanged"]="vuplex.webview.urlChanged"})(n||(n={}));e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/utils/flattenPrototypes",[],function(e,t){"use strict";var n=t&&t.id;function i(e,t){var n,i;while(t.constructor.name!=="Object"){for(var r=0,o=Object.getOwnPropertyNames(t);r<o.length;r++){var s=o[r];var a=Object.getOwnPropertyDescriptor(t,s);if(a.get||a.set){(n=a.get)===null||n===void 0?void 0:n.bind(e);(i=a.set)===null||i===void 0?void 0:i.bind(e)}else{var u=t[s];if(typeof u==="function"&&s!=="constructor"){e[s]=u.bind(e)}}}t=Object.getPrototypeOf(t)}}e("default",i);return{setters:[],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/UrlActionType",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){(function(e){e["Load"]="LOAD";e["PushState"]="PUSH_STATE";e["ReplaceState"]="REPLACE_STATE";e["HashChange"]="HASH_CHANGE"})(n||(n={}));e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/FocusedInputFieldType",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){(function(e){e["Text"]="TEXT";e["IFrame"]="IFRAME";e["None"]="NONE"})(n||(n={}));e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/isTextInputOrTextarea",[],function(e,t){"use strict";var i;var n=t&&t.id;function r(e,t){if(e instanceof t.HTMLInputElement){var n=i[e.type.toLowerCase()];return!n}return e instanceof t.HTMLTextAreaElement}e("default",r);return{setters:[],execute:function(){i={button:true,checkbox:true,color:true,file:true,hidden:true,image:true,radio:true,range:true,reset:true,submit:true}}}});_vuplexSystem.register("libs/browser-agent/src/getActiveElement",[],function(e,t){"use strict";var n=t&&t.id;function i(e){return r(e.document.activeElement)}e("default",i);function r(e){if(e===null||e===void 0?void 0:e.shadowRoot){return r(e.shadowRoot.activeElement)}return e}return{setters:[],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/focusedElementIsEditable",["libs/browser-agent/src/isTextInputOrTextarea","libs/browser-agent/src/getActiveElement"],function(e,t){"use strict";var n,i;var r=t&&t.id;function o(e){var t=i.default(e);return t&&(n.default(t,e)||t.isContentEditable)}e("default",o);return{setters:[function(e){n=e},function(e){i=e}],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/checkIfPageBackgroundIsSet",[],function(e,t){"use strict";var n=t&&t.id;function i(e){var t=[e.document.body,e.document.documentElement].filter(function(e){return e});for(var n=0,i=t;n<i.length;n++){var r=i[n];var o=a(e,r);if(o.backgroundIsSet){return o}}return{backgroundIsSet:false}}e("default",i);function s(e,t,n){var i="<"+e.tagName.toLowerCase()+">";return"The page's "+i+" element "+t+' is set to "'+n+'".'}function a(e,t){var n=e.getComputedStyle(t);var i=n.background,r=n.backgroundImage,o=n.backgroundColor;if(r!=="none"){return{backgroundIsSet:true,details:s(t,"backgroundImage",r)}}if(i&&i.indexOf("rgba(0, 0, 0, 0) none")!==0){return{backgroundIsSet:true,details:s(t,"background",i)}}if(!(!o||o.indexOf("rgba(0, 0, 0, 0)")===0||o==="transparent")){return{backgroundIsSet:true,details:s(t,"backgroundColor",o)}}return{backgroundIsSet:false}}return{setters:[],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/BrowserAgent",["libs/browser-agent/src/utils/EventEmitter","libs/browser-agent/src/IFrameBridge","libs/browser-agent/src/MessageType","libs/browser-agent/src/utils/flattenPrototypes","libs/browser-agent/src/UrlActionType","libs/browser-agent/src/FocusedInputFieldType","libs/browser-agent/src/focusedElementIsEditable","libs/browser-agent/src/getActiveElement","libs/browser-agent/src/checkIfPageBackgroundIsSet"],function(e,t){"use strict";var n,r,s,a,u,l,c,d,o,i;var f=t&&t.id;return{setters:[function(e){n=e},function(e){r=e},function(e){s=e},function(e){a=e},function(e){u=e},function(e){l=e},function(e){c=e},function(e){d=e},function(e){o=e}],execute:function(){i=function(n){__extends(i,n);function i(e,t){var o=n.call(this)||this;o._consoleApiPatched=false;o._consoleMessageEventsEnabled=false;o._defaultBackgroundEnabled=true;o._focusedInputField=null;o._focusedInputFieldIntervalToken=0;o._isInIframe=parent!==window;o._checkFocusedInputField=function(){var e=d.default(o._window);var t=e instanceof HTMLIFrameElement;var n=c.default(o._window);var i=n||t?e:null;if(o._focusedInputField!==i){if(o._focusedInputField){o._focusedInputField.removeEventListener("click",o._handleFocusedInputFieldClicked)}if(i){i.addEventListener("click",o._handleFocusedInputFieldClicked)}var r=t?l.default.IFrame:n?l.default.Text:l.default.None;o._focusedInputField=i;o._bridge.postMessage({type:s.default.FocusedInputFieldChanged,value:r})}};o._handleFocusedInputFieldClicked=function(){o._bridge.postMessage({type:s.default.FocusedInputFieldChanged,value:l.default.Text})};o._consoleMessageEventsEnabled=!!(t===null||t===void 0?void 0:t.enableConsoleMessageEvents);o._windowReference=t===null||t===void 0?void 0:t.window;o._patchConsoleApiIfNeeded();if((t===null||t===void 0?void 0:t.defaultBackgroundEnabled)!==undefined){o._defaultBackgroundEnabled=t.defaultBackgroundEnabled}a.default(o,i.prototype);if(o._isInIframe){o._bridge=new r.default}else{o._bridge=e}if(o._document.readyState==="loading"||!o._document.head){o._document.addEventListener("DOMContentLoaded",function(){o._performPostDomLoadInitialization(t===null||t===void 0?void 0:t.enableFocusedInputFieldEvents)})}else{o._performPostDomLoadInitialization(t===null||t===void 0?void 0:t.enableFocusedInputFieldEvents)}if(o._isInMainFrame){o._emitTitleChangeIfNeeded();o._window.setInterval(o._emitTitleChangeIfNeeded.bind(o),200);o._emitUrlChange(u.default.Load);o._watchForUrlChanges()}return o}i.prototype.setConsoleMessageEventsEnabled=function(e){this._consoleMessageEventsEnabled=e;this._patchConsoleApiIfNeeded()};i.prototype.setDefaultBackgroundEnabled=function(e){this._defaultBackgroundEnabled=e;if(!e){this._warnIfTransparencyIsBlocked()}};i.prototype.setFocusedInputFieldEventsEnabled=function(e){if(e&&!this._focusedInputFieldIntervalToken){this._focusedInputFieldIntervalToken=this._window.setInterval(this._checkFocusedInputField,200)}};Object.defineProperty(i.prototype,"_document",{get:function(){return this._window.document},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"_window",{get:function(){return this._windowReference||window},enumerable:false,configurable:true});i.prototype._emitTitleChangeIfNeeded=function(){var e=this._document.title,t=e===void 0?"":e;if(this._title===t){return}this._title=t;this._bridge.postMessage({type:s.default.TitleChanged,value:t})};i.prototype._emitTransparentMetaTagStatus=function(){this._bridge.postMessage({type:s.default.PageTransparencyDetermined,value:this._transparencyEnabledViaMetaTag()})};i.prototype._emitUrlChange=function(e){try{var t=this._document.URL;if(t.indexOf("chrome-error://")===0){return}if(t.indexOf("about:")===0){return}if(t.indexOf("ms-local-stream://")===0){return}if(t.indexOf(".pdf?file=")!==-1){return}this._bridge.postMessage({type:s.default.UrlChanged,urlAction:{Url:t,Title:this._document.title,Type:e}})}catch(e){console.error("An error occurred while handling the URL change.",e)}};Object.defineProperty(i.prototype,"_isInMainFrame",{get:function(){return parent===window},enumerable:false,configurable:true});i.prototype._onHashChange=function(){this._emitUrlChange(u.default.HashChange)};i.prototype._onPushState=function(){this._emitUrlChange(u.default.PushState)};i.prototype._onReplaceState=function(){this._emitUrlChange(u.default.ReplaceState)};i.prototype._transparencyEnabledViaMetaTag=function(){var e=this._document.head.getElementsByTagName("meta");var t=Array.prototype.filter.call(e,function(e){return e.getAttribute("name")==="transparent"})[0];return!!t&&t.getAttribute("content")==="true"};i.prototype._patchConsoleApiIfNeeded=function(){if(this._consoleApiPatched||!this._consoleMessageEventsEnabled){return}this._consoleApiPatched=true;this._patchConsoleMethod("log","LOG");this._patchConsoleMethod("info","LOG");this._patchConsoleMethod("debug","DEBUG");this._patchConsoleMethod("error","ERROR");this._patchConsoleMethod("warn","WARNING")};i.prototype._patchConsoleMethod=function(e,i){var r=this;var o=this._window.console[e].bind(this._window.console);this._window.console[e]=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}if(r._consoleMessageEventsEnabled){try{var n=e.map(function(e){return typeof e==="object"&&!(e instanceof r._window.Error)?JSON.stringify(e):e}).join(", ");r._bridge.postMessage({type:"vuplex.webview.consoleMessageLogged",level:i,message:n})}catch(e){}}o.apply(void 0,e)}};i.prototype._performPostDomLoadInitialization=function(e){if(this._isInMainFrame){this._emitTransparentMetaTagStatus();this._warnIfTransparencyIsBlocked()}if(e){this.setFocusedInputFieldEventsEnabled(true)}};i.prototype._warnIfTransparencyIsBlocked=function(){var e=this._transparencyEnabledViaMetaTag()||!this._defaultBackgroundEnabled;if(!e){return}var t=o.default(this._window),n=t.backgroundIsSet,i=t.details;if(n){this._bridge.postMessage({type:s.default.TransparencyBlockedWarning,value:i})}};i.prototype._watchForUrlChanges=function(){var i=this;var r=this._window.history.pushState;this._window.history.pushState=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var n=r.apply(i._window.history,e);i._onPushState();return n};var o=this._window.history.replaceState;this._window.history.replaceState=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var n=o.apply(i._window.history,e);i._onReplaceState();return n};this._window.addEventListener("hashchange",this._onHashChange.bind(this));this._window.addEventListener("yt-navigate-finish",this._onPushState.bind(this))};return i}(n.default);e("default",i)}}});_vuplexSystem.register("libs/browser-agent/src/initBrowserAgent",["libs/browser-agent/src/BrowserAgent"],function(e,t){"use strict";var r;var n=t&&t.id;function i(e,t){var n;var i=((n=t===null||t===void 0?void 0:t.browserAgentOptions)===null||n===void 0?void 0:n.window)||window;if(i.vuplex&&i._vuplexInternal){return}i.vuplex=e;i._vuplexInternal={browserAgent:new r.default(e,t===null||t===void 0?void 0:t.browserAgentOptions)};if(t===null||t===void 0?void 0:t.optionalComponents){Object.assign(i._vuplexInternal,t===null||t===void 0?void 0:t.optionalComponents)}i.dispatchEvent(new Event("vuplexready"))}e("default",i);return{setters:[function(e){r=e}],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/optional/FocusManager",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){n=function(){function e(e){if(e===void 0){e=window}this._activeElementDuringLastBlur=null;this._window=e}e.prototype.setFocused=function(e){if(e){var t=this._activeElementDuringLastBlur||this._document.activeElement;if(t instanceof this._window.HTMLElement){t.focus();this._activeElementDuringLastBlur=null}return}var n=this._document.activeElement;this._activeElementDuringLastBlur=n;if(n instanceof this._window.HTMLElement){n.blur()}};Object.defineProperty(e.prototype,"_document",{get:function(){return this._window.document},enumerable:false,configurable:true});return e}();e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/IFramePostMessageDomain",[],function(e,t){"use strict";var n;var i=t&&t.id;return{setters:[],execute:function(){(function(e){e["IFrameBridgeDownstream"]="vuplex.iframeBridgeDownstream";e["IFrameBridgeUpstream"]="vuplex.iframeBridgeUpstream"})(n||(n={}));e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/optional/KeyboardInputManager",["libs/browser-agent/src/isTextInputOrTextarea","libs/browser-agent/src/IFramePostMessageDomain","libs/browser-agent/src/focusedElementIsEditable"],function(e,t){"use strict";var s,i,p,r,n;var o=t&&t.id;return{setters:[function(e){s=e},function(e){i=e},function(e){p=e}],execute:function(){r="vuplex.webview.sendKey";n=function(){function e(e){var n=this;this._textInputEventsEnabled=false;this._handleIFrameMessage=function(e){if(!e.data){return}var t=e.data.message;if(e.data.domain===i.default.IFrameBridgeDownstream&&t.type===r){n.sendKey(t.input)}};this._window=(e===null||e===void 0?void 0:e.window)||window;this._textInputEventsEnabled=!!(e===null||e===void 0?void 0:e.enableTextInputEvents);this._window.addEventListener("message",this._handleIFrameMessage)}e.prototype.sendKey=function(e){if(this._document.activeElement instanceof this._window.HTMLIFrameElement){this._document.activeElement.contentWindow.postMessage({domain:i.default.IFrameBridgeDownstream,message:{type:r,input:e}},"*");return}if(e==="Backspace"){e="\\b"}else if(e==="Enter"){e="\\n"}var t=Array.from(e).length;if(t===1){this._dispatchCharacter(e);return}if(p.default(this._window)&&(e==="ArrowLeft"||e==="ArrowRight")){this._dispatchCharacter(e);return}switch(e){case"ArrowUp":this._window.scrollBy(0,-50);break;case"ArrowDown":this._window.scrollBy(0,50);break;case"ArrowLeft":this._window.scrollBy(-50,0);break;case"ArrowRight":this._window.scrollBy(50,0);break}};Object.defineProperty(e.prototype,"_document",{get:function(){return this._window.document},enumerable:false,configurable:true});e.prototype._dispatchCharacter=function(e){if(e==="\\n"&&this._document.activeElement instanceof this._window.HTMLInputElement){var t=this._getFocusedForm();if(t){var n=t.dispatchEvent(new Event("submit",{cancelable:true}));if(n){t.submit()}}else{this._dispatchKeyPressEvents(this._document.activeElement,"\\r")}return}if(this._document.activeElement){this._dispatchKeyPressEvents(this._document.activeElement,e)}var i=this._document.activeElement;if(!p.default(this._window)){return}var r=this._getSelection(i),o=r.selectionStart,s=r.selectionEnd;var a=this._getTextValue(i);if(e==="\\b"){var u=o===s&&o===0;if(u){return}var l=o!==s;if(l){var c=this._spliceString(a,o,s-o,"");this._setTextValue(i,c);this._setSelection(i,o,o)}else{var c=this._spliceString(a,o-1,1,"");this._setTextValue(i,c);var d=o-1;this._setSelection(i,d,d)}}else if(e==="ArrowLeft"){if(o===s){var f=Math.max(o-1,0);this._setSelection(i,f,f)}else{this._setSelection(i,o,o)}}else if(e==="ArrowRight"){if(o===s){var f=Math.min(s+1,a.length);this._setSelection(i,f,f)}else{this._setSelection(i,s,s)}}else{var c=this._spliceString(a,o,s-o,e);this._setTextValue(i,c);var d=o+1;this._setSelection(i,d,d)}};e.prototype._dispatchKeyboardEvent=function(e,t,n){var i=n.charCodeAt(0);var r=new KeyboardEvent(t,{key:n,keyCode:i,bubbles:true,cancelable:true});Object.defineProperty(r,"keyCode",{value:i,writable:false});e.dispatchEvent(r)};e.prototype._dispatchKeyPressEvents=function(e,t){this._dispatchKeyboardEvent(e,"keydown",t);this._dispatchKeyboardEvent(e,"keypress",t);if(this._textInputEventsEnabled){var n=this._document.createEvent("TextEvent");n.initTextEvent("textInput",true,true,this._window,t,0,"en-US");e.dispatchEvent(n)}this._dispatchKeyboardEvent(e,"keyup",t)};e.prototype._getFocusedForm=function(){var e=this._document.activeElement||null;while(e){if(e instanceof this._window.HTMLFormElement){return e}e=e.parentElement}return null};e.prototype._getSelection=function(e){if(s.default(e,this._window)){return{selectionStart:e.selectionStart||0,selectionEnd:e.selectionEnd||0}}var t=this._window.getSelection();if(t&&t.rangeCount){var n=t.getRangeAt(0);if(n.commonAncestorContainer.parentNode==e){return{selectionStart:n.startOffset,selectionEnd:n.endOffset}}}return{selectionStart:0,selectionEnd:0}};e.prototype._getTextValue=function(e){if(s.default(e,this._window)){return e.value}return e.innerText||""};e.prototype._setSelection=function(e,t,n){if(s.default(e,this._window)){e.setSelectionRange(t,n);return}var i=this._document.createRange();var r=this._window.getSelection();var o=e.childNodes[0];i.setStart(o,t);i.setStart(o,n);if(r){r.removeAllRanges();r.addRange(i)}};e.prototype._setTextValue=function(e,t){if(e instanceof this._window.HTMLInputElement){Object.getOwnPropertyDescriptor(this._window.HTMLInputElement.prototype,"value").set.call(e,t)}else if(e instanceof this._window.HTMLTextAreaElement){Object.getOwnPropertyDescriptor(this._window.HTMLTextAreaElement.prototype,"value").set.call(e,t)}else{e.innerText=t}e.dispatchEvent(new Event("input",{bubbles:true}))};e.prototype._spliceString=function(e,t,n,i){return e.slice(0,t)+i+e.slice(t+Math.abs(n))};return e}();e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/optional/IPointAdjuster",[],function(e,t){"use strict";var n=t&&t.id;return{setters:[],execute:function(){}}});_vuplexSystem.register("libs/browser-agent/src/optional/PointerInputManager",["libs/browser-agent/src/IFramePostMessageDomain","libs/browser-agent/src/utils/flattenPrototypes"],function(e,t){"use strict";var c,i,a,d,f,r,p,n;var o=t&&t.id;return{setters:[function(e){c=e},function(e){i=e}],execute:function(){a="vuplex.webview.movePointer";d="vuplex.webview.pointerDown";f="vuplex.webview.pointerUp";r="vuplex.webview.click";(function(e){e[e["Left"]=0]="Left";e[e["Right"]=1]="Right";e[e["Middle"]=2]="Middle";e[e["None"]=3]="None"})(p||(p={}));n=function(){function t(e){var n=this;this._buttonDown=p.None;this._lastMouseOverElement=null;this._handleIframeMessage=function(e){if(!e.data){return}var t=e.data.message;if(e.data.domain===c.default.IFrameBridgeDownstream){switch(t.type){case a:n.movePointer(t.x,t.y);break;case d:n.pointerDown(t.x,t.y,t.mouseButton,t.clickCount);break;case f:n.pointerUp(t.x,t.y,t.mouseButton,t.clickCount);break;case r:n.click(t.x,t.y);break}}};if(e){this._windowReference=e.window;this._isIOS=!!e.isIOS;this._pointAdjuster=e.pointAdjuster}i.default(this,t.prototype);this._window.addEventListener("message",this._handleIframeMessage)}t.prototype.click=function(e,t){this.pointerDown(e,t,p.Left,1);this.pointerUp(e,t,p.Left,1)};t.prototype.movePointer=function(e,t,n){if(n===void 0){n=false}if(n){e=0;t=0}var i=this._document.elementFromPoint(e,t);if(i instanceof this._window.HTMLIFrameElement&&i.contentWindow){var r=i.getBoundingClientRect();var o=e-r.left;var s=t-r.top;i.contentWindow.postMessage({domain:c.default.IFrameBridgeDownstream,message:{type:a,x:o,y:s}},"*");return}if(i){this._dispatchPointerEvent(i,"pointermove",e,t,this._buttonDown,0);this._dispatchPointerEvent(i,"mousemove",e,t,this._buttonDown,0)}if(this._lastMouseOverElement!==i){if(this._lastMouseOverElement){if(!this._lastMouseOverElement.contains(i)){this._dispatchPointerEvent(this._lastMouseOverElement,"pointerleave",e,t,this._buttonDown,0,false);this._dispatchPointerEvent(this._lastMouseOverElement,"mouseleave",e,t,this._buttonDown,0,false)}this._dispatchPointerEvent(this._lastMouseOverElement,"pointerout",e,t,this._buttonDown,0);this._dispatchPointerEvent(this._lastMouseOverElement,"mouseout",e,t,this._buttonDown,0)}this._lastMouseOverElement=i;if(i){this._dispatchPointerEvent(i,"pointerenter",e,t,this._buttonDown,0,false);this._dispatchPointerEvent(i,"mouseenter",e,t,this._buttonDown,0,false);this._dispatchPointerEvent(i,"pointerover",e,t,this._buttonDown,0);this._dispatchPointerEvent(i,"mouseover",e,t,this._buttonDown,0)}}};t.prototype.pointerDown=function(e,t,n,i){if(this._pointAdjuster){e=this._pointAdjuster.adjust(e);t=this._pointAdjuster.adjust(t)}this.movePointer(e,t);var r=this._document.elementFromPoint(e,t);if(!r){return}if(r instanceof this._window.HTMLIFrameElement&&r.contentWindow){var o=r.getBoundingClientRect();var s=e-o.left;var a=t-o.top;r.contentWindow.postMessage({domain:c.default.IFrameBridgeDownstream,message:{type:d,x:s,y:a,mouseButton:n,clickCount:i}},"*");return}var u=this._getParent(r,["a","button"]);var l=u||r;this._buttonDown=n;this._dispatchPointerEvent(l,"pointerdown",e,t,n,i);if(!(this._isIOS&&r instanceof this._window.HTMLSelectElement)){this._dispatchPointerEvent(l,"mousedown",e,t,n,i)}if(n===p.Right){this._dispatchPointerEvent(l,"contextmenu",e,t,n,i)}};t.prototype.pointerUp=function(e,t,n,i){if(this._pointAdjuster){e=this._pointAdjuster.adjust(e);t=this._pointAdjuster.adjust(t)}this.movePointer(e,t);var r=this._document.elementFromPoint(e,t);if(!r){return}if(r instanceof this._window.HTMLIFrameElement&&r.contentWindow){var o=r.getBoundingClientRect();var s=e-o.left;var a=t-o.top;r.contentWindow.postMessage({domain:c.default.IFrameBridgeDownstream,message:{type:f,x:s,y:a,mouseButton:n,clickCount:i}},"*");return}var u=this._getParent(r,["a","button"]);var l=u||r;if(this._isIOS&&l instanceof this._window.HTMLSelectElement){l.dispatchEvent(new FocusEvent("focus"))}else if(l instanceof this._window.HTMLElement){l.focus()}this._dispatchPointerEvent(l,"pointerup",e,t,n,i);this._dispatchPointerEvent(l,"mouseup",e,t,n,i);if(this._instanceof(l,[this._window.HTMLAnchorElement,this._window.HTMLButtonElement,this._window.HTMLInputElement])){l.click()}else{this._dispatchPointerEvent(l,"click",e,t,n,i)}if(i===2){this._dispatchPointerEvent(l,"dblclick",e,t,n,i)}this._buttonDown=p.None};Object.defineProperty(t.prototype,"_document",{get:function(){return this._window.document},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"_window",{get:function(){return this._windowReference||window},enumerable:false,configurable:true});t.prototype._convertMouseButtonToPointerEventButton=function(e){switch(e){case p.Left:return 0;case p.Right:return 2;case p.Middle:return 1;case p.None:default:return 0}};t.prototype._convertMouseButtonToPointerEventButtons=function(e){switch(e){case p.Left:return 1;case p.Right:return 2;case p.Middle:return 4;case p.None:default:return 0}};t.prototype._dispatchPointerEvent=function(e,t,n,i,r,o,s){if(s===void 0){s=true}var a=t.indexOf("up")!==-1||t.indexOf("click")!==-1;var u=a?0:this._convertMouseButtonToPointerEventButton(r);var l=a?0:this._convertMouseButtonToPointerEventButtons(r);var c=this._window.PointerEvent||this._window.MouseEvent;var d=new c(t,{bubbles:s,cancelable:true,screenX:n,screenY:i,clientX:n,clientY:i,button:u,buttons:l,pointerId:1,pointerType:"mouse",detail:o,isPrimary:true});e.dispatchEvent(d)};t.prototype._getParent=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e.tagName===r.toUpperCase()&&e instanceof this._window.HTMLElement){return e}}if(e===this._document.documentElement){return null}var o=e.parentElement;if(!o){return null}return this._getParent(o,t)};t.prototype._instanceof=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(e instanceof r){return true}}return false};return t}();e("default",n)}}});_vuplexSystem.register("libs/browser-agent/src/optional/ScrollManager",["libs/browser-agent/src/IFramePostMessageDomain"],function(e,t){"use strict";var v,g,b,n;var i=t&&t.id;return{setters:[function(e){v=e}],execute:function(){g="vuplex.webview.scrollAtPoint";b="vuplex.webview.iframeUnscrollable";n=function(){function e(e){var s=this;this._handleIFrameMessage=function(t){if(!t.data){return}var e=t.data.message;if(t.data.domain===v.default.IFrameBridgeDownstream){if(e.type===g){s.scrollAtPoint(e.deltaX,e.deltaY,e.pointerX,e.pointerY)}}else if(t.data.domain===v.default.IFrameBridgeUpstream){if(e.type===b){var n=Array.from(s._document.getElementsByTagName("iframe")).find(function(e){return e.contentWindow===t.source});if(!n){return}var i=n.getBoundingClientRect();var r=i.left+e.pointerX;var o=i.top+e.pointerY;s.scrollAtPoint(e.deltaX,e.deltaY,r,o,true)}}};this._window=e&&e.window||window;if(e){this._pointAdjuster=e.pointAdjuster}this._window.addEventListener("message",this._handleIFrameMessage)}e.prototype.scrollAtPoint=function(e,t,n,i,r){if(r===void 0){r=false}if(e===0&&t===0){return}if(this._pointAdjuster){e=this._pointAdjuster.adjust(e);t=this._pointAdjuster.adjust(t);n=this._pointAdjuster.adjust(n);i=this._pointAdjuster.adjust(i)}var o;var s=false;while(!(o===this._document.scrollingElement||o instanceof this._window.HTMLIFrameElement&&!r||s)){o=o?o.parentElement:this._document.elementFromPoint(n,i)||this._document.scrollingElement;if(!o){break}if(o.tagName==="VUPLEX-DROPDOWN-CONTAINER"){return}if(Math.abs(t)>Math.abs(e)){var a=false;if(t>0){var u=o.scrollHeight-(o.scrollTop+o.clientHeight);a=u>0}else{var l=o.scrollTop;a=l>0}s=a&&["scroll","auto"].indexOf(this._window.getComputedStyle(o).overflowY)!==-1}else{var a=false;if(e>0){var c=o.scrollWidth-(o.scrollLeft+o.clientWidth);a=c>0}else{var d=o.scrollLeft;a=d>0}s=a&&["scroll","auto"].indexOf(this._window.getComputedStyle(o).overflowX)!==-1}}if(o&&o instanceof this._window.HTMLIFrameElement&&o.contentWindow&&!r){var f=o.getBoundingClientRect();var p=n-f.left;var h=i-f.top;o.contentWindow.postMessage({domain:v.default.IFrameBridgeDownstream,message:{type:g,deltaX:e,deltaY:t,pointerX:p,pointerY:h}},"*")}else if(o){var _=parent!==window;if(_&&!s){parent.postMessage({domain:v.default.IFrameBridgeUpstream,message:{type:b,deltaX:e,deltaY:t,pointerX:n,pointerY:i}},"*");return}if(this._window.getComputedStyle(o).scrollBehavior==="smooth"){o.style.scrollBehavior="auto"}o.scrollTop+=t;o.scrollLeft+=e;if(o===this._document.body&&this._document.scrollingElement&&this._document.scrollingElement!==this._document.body){this._document.scrollingElement.scrollTop+=t;this._document.scrollingElement.scrollLeft+=e}}else{this._window.scrollBy(e,t)}};Object.defineProperty(e.prototype,"_document",{get:function(){return this._window.document},enumerable:false,configurable:true});return e}();e("default",n)}}});_vuplexSystem.register("src/TM",[],function(e,t){"use strict";var r,n;var i=t&&t.id;return{setters:[],execute:function(){r="6342b0fc-0034-4424-a882-13df9bd2c13e";n=function(){function e(){}e.gtifvs=function(e){if(e===void 0){e=r}if(!this._it(e)){return""}var t=this._gdt(e);var n=["January","February","March","April","May","June","July","August","September","October","November","December"];var i=n[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear();if(this.iet(e)){return"[expired trial version - ended "+i+"]"}return"[trial version - valid until "+i+"]"};e.iet=function(e){if(e===void 0){e=r}if(!this._it(e)){return false}var t=this._gdt(e);var n=new Date;return n>=t};e._gdt=function(e){var t=e.split("-",5);var n="20"+t[0].substr(0,1)+t[1].substr(0,1);var i=t[2].substr(0,1)+t[3].substr(0,1);var r=t[4].substr(0,1)+t[4].substr(11,1);return new Date(n+"-"+i+"-"+r)};e._it=function(e){if(e===void 0){e=r}return e.indexOf("6342b0fc")!==0};return e}();e("default",n)}}});_vuplexSystem.register("src/WebGLBridge",["libs/browser-agent/src/BaseBridge"],function(e,t){"use strict";var n,i,r;var o=t&&t.id;return{setters:[function(e){n=e}],execute:function(){e("POST_MESSAGE_MESSAGE_TYPE",i="vuplex.postMessage");r=function(t){__extends(e,t);function e(e){var n=t.call(this)||this;n._handleWindowMessage=function(e){var t;if(((t=e.data)===null||t===void 0?void 0:t.type)===i){n._emit("message",{data:e.data.message})}};e.addEventListener("message",n._handleWindowMessage);return n}e.prototype.postMessage=function(e){var t=typeof e==="string"?e:JSON.stringify(e);parent.postMessage({type:i,message:t},"*")};return e}(n.default);e("default",r)}}});_vuplexSystem.register("src/WebGLWebView",["src/Logger","libs/browser-agent/src/initBrowserAgent","libs/browser-agent/src/optional/FocusManager","libs/browser-agent/src/optional/KeyboardInputManager","libs/browser-agent/src/optional/PointerInputManager","libs/browser-agent/src/optional/ScrollManager","src/TM","src/WebGLBridge"],function(exports_24,context_24){"use strict";var Logger_1,initBrowserAgent_1,FocusManager_1,KeyboardInputManager_1,PointerInputManager_1,ScrollManager_1,TM_1,WebGLBridge_1,VERSION,TOP_Z_INDEX,CROSS_ORIGIN_EMBEDDER_POLICY_ARTICLE_URL,userAgent,WebGLWebView;var __moduleName=context_24&&context_24.id;return{setters:[function(e){Logger_1=e},function(e){initBrowserAgent_1=e},function(e){FocusManager_1=e},function(e){KeyboardInputManager_1=e},function(e){PointerInputManager_1=e},function(e){ScrollManager_1=e},function(e){TM_1=e},function(e){WebGLBridge_1=e}],execute:function(){VERSION="v4.7";TOP_Z_INDEX=2147483647-1e3;CROSS_ORIGIN_EMBEDDER_POLICY_ARTICLE_URL="https://support.vuplex.com/articles/webgl-cross-origin-embedder-policy";Logger_1.default.info("Using Vuplex 2D WebView for WebGL "+VERSION+" "+TM_1.default.gtifvs());userAgent=navigator.userAgent;if(userAgent.includes("Android")||userAgent.includes("iPhone")||userAgent.includes("iPad")){window.addEventListener("blur",function(){setTimeout(function(){window.dispatchEvent(new Event("focus"))},1)})}WebGLWebView=function(){function WebGLWebView(e,t,n,i,r,o){var s=this;this.reload=function(){return s._iframe.src+=""};this._consoleMessageEventsEnabled=false;this._defaultBackgroundEnabled=true;this._emitPageLoadStartOnUnload=true;this._focusedInputFieldEventsEnabled=false;this._ignoreDevicePixelRatio=false;this._emitPageLoadStarted=function(){return s._sendMessage("HandleLoadStarted","")};this._handleIFrameLoaded=function(){var e;s._emitPageLoadStartOnUnload=true;if(s.canAccessIFrameContent()){var t=(e=s._iframe.contentWindow)===null||e===void 0?void 0:e.window;initBrowserAgent_1.default(new WebGLBridge_1.default(t),{browserAgentOptions:{defaultBackgroundEnabled:s._defaultBackgroundEnabled,enableConsoleMessageEvents:s._consoleMessageEventsEnabled,enableFocusedInputFieldEvents:s._focusedInputFieldEventsEnabled,window:t},optionalComponents:{focusManager:new FocusManager_1.default(t),keyboardInputManager:new KeyboardInputManager_1.default({window:t}),pointerInputManager:new PointerInputManager_1.default(t),scrollManager:new ScrollManager_1.default(t)}});t.addEventListener("unload",s._handleIFrameUnloaded)}else{Logger_1.default.warn("The URL loaded is from a different origin, so most of 2D WebView's IWebView APIs will be disabled due to browser limitations. For more info, please see this article: https://support.vuplex.com/articles/webgl-limitations");if(s._defaultBackgroundEnabled){s._setPageTransparency(false)}}s._sendMessage("HandleLoadFinished","")};this._handleIFrameUnloaded=function(){if(s._emitPageLoadStartOnUnload){s._emitPageLoadStarted()}};this._handleWindowMessage=function(e){var t;if(((t=e.data)===null||t===void 0?void 0:t.type)!==WebGLBridge_1.POST_MESSAGE_MESSAGE_TYPE){return}var n=e.data.message;if(n.indexOf("vuplex.webview.pageTransparencyDetermined")!==-1){if(s._defaultBackgroundEnabled){var i=n.indexOf("true")!==-1;s._setPageTransparency(i)}}else{s._sendMessage("HandleMessageEmitted",n)}};this._sendMessage=function(e,t){return SendMessage(s._gameObjectName,e,t)};if(TM_1.default.iet()){var a="Your trial of 2D WebView for WebGL has expired. Please purchase a license to continue using it.";console.error(a);throw new Error(a)}this._pointer=WebGLWebView._nextWebViewPtr++;WebGLWebView._webViews[this._pointer]=this;this._gameObjectName=e;this._ignoreDevicePixelRatio=o;window.addEventListener("message",this._handleWindowMessage);this._iframe=document.createElement("iframe");this._iframe.style.position="absolute";this._iframe.style.border="none";this.bringToFront();this._iframe.setAttribute("id",e);this._iframe.setAttribute("vuplex","true");WebGLWebView._updatePermissions(this._iframe);this._iframe.addEventListener("load",this._handleIFrameLoaded);this.setRect(t,n,i,r);var u=WebGLWebView._unityContainer;if(window.getComputedStyle(u).position==="static"){u.style.position="relative"}u.appendChild(this._iframe)}WebGLWebView.prototype.bringToFront=function(){for(var e=0,t=Object.values(WebGLWebView._webViews);e<t.length;e++){var n=t[e];var i=n==this?TOP_Z_INDEX:TOP_Z_INDEX-1;n._iframe.style.zIndex=""+i}};WebGLWebView.prototype.canAccessIFrameContent=function(){try{typeof this._iframe.contentWindow._test;return true}catch(e){return false}};WebGLWebView.prototype.canGoBackOrForward=function(){var e,t;if(this.canAccessIFrameContent()){return((t=(e=this._iframe.contentWindow)===null||e===void 0?void 0:e.history.length)!==null&&t!==void 0?t:0)>1}return false};WebGLWebView.prototype.click=function(e,t){var n;if(this.canAccessIFrameContent()){(n=this._vuplexInternal)===null||n===void 0?void 0:n.pointerInputManager.click(this._getScaledCoordinateComponent(e),this._getScaledCoordinateComponent(t))}};WebGLWebView.prototype.destroy=function(){this._emitPageLoadStartOnUnload=false;this._iframe.remove();delete WebGLWebView._webViews[this._pointer]};WebGLWebView.prototype.executeJavaScript=function(e){if(!this.canAccessIFrameContent()){return""}try{var t=this._iframe.contentWindow.eval(e);return new String(t).toString()}catch(e){return e.toString()}};WebGLWebView.executeJavaScriptLocally=function(javaScript){try{var result=eval(javaScript);return new String(result).toString()}catch(error){return error.toString()}};WebGLWebView.getInstance=function(e){var t=this._webViews[e];if(t){return t}throw new Error("No WebView found for pointer "+e)};WebGLWebView.prototype.goBack=function(){var e;if(this.canAccessIFrameContent()){(e=this._iframe.contentWindow)===null||e===void 0?void 0:e.history.back()}};WebGLWebView.prototype.goForward=function(){var e;if(this.canAccessIFrameContent()){(e=this._iframe.contentWindow)===null||e===void 0?void 0:e.history.forward()}};WebGLWebView.prototype.loadHtml=function(e){this._emitPageLoadStartOnUnload=false;this._emitPageLoadStarted();this.loadUrl("data:text/html;charset=utf-8,"+encodeURIComponent(e))};WebGLWebView.prototype.loadUrl=function(e){if(e.indexOf("http:")===0&&location.protocol==="https:"){var t="https:"+e.substring(5);Logger_1.default.warn("The URL passed to LoadUrl() ("+e+") uses the protocol http://, but the Unity app is hosted with https:// ("+location.href+"), and browsers block https:// sites from loading http:// URLs. So, 2D WebView will automatically try to load the URL using https:// instead ("+t+")");e=t}if(this._handleCrossOriginEmbedderPolicyHeaderIfNeeded(e)){return}this._emitPageLoadStartOnUnload=false;this._emitPageLoadStarted();this._iframe.src=e;this._sendMessage("HandleMessageEmitted",JSON.stringify({type:"vuplex.webview.urlChanged",urlAction:{Type:"LOAD",Url:e}}))};Object.defineProperty(WebGLWebView.prototype,"pointer",{get:function(){return this._pointer},enumerable:false,configurable:true});WebGLWebView.prototype.postMessage=function(e){var t;(t=this._iframe.contentWindow)===null||t===void 0?void 0:t.postMessage({type:WebGLBridge_1.POST_MESSAGE_MESSAGE_TYPE,message:e},"*")};WebGLWebView.prototype.resize=function(e,t){this._iframe.style.width=this._getScaledCoordinateComponent(e)+"px";this._iframe.style.height=this._getScaledCoordinateComponent(t)+"px"};WebGLWebView.prototype.scroll=function(e,t){var n;if(this.canAccessIFrameContent()){(n=this._iframe.contentWindow)===null||n===void 0?void 0:n.scrollBy(e,t)}};WebGLWebView.prototype.scrollAtPoint=function(e,t,n,i){var r;if(this.canAccessIFrameContent()){(r=this._vuplexInternal)===null||r===void 0?void 0:r.scrollManager.scrollAtPoint(e,t,this._getScaledCoordinateComponent(n),this._getScaledCoordinateComponent(i))}};WebGLWebView.prototype.sendKey=function(e){var t;if(this.canAccessIFrameContent()){(t=this._vuplexInternal)===null||t===void 0?void 0:t.keyboardInputManager.sendKey(e)}};WebGLWebView.setCameraAndMicrophoneEnabled=function(e){this._permissions.camera=e;this._permissions.microphone=e;this._updatePermissionsForAll()};WebGLWebView.prototype.setConsoleMessageEventsEnabled=function(e){var t;this._consoleMessageEventsEnabled=e;if(this.canAccessIFrameContent()){(t=this._vuplexInternal)===null||t===void 0?void 0:t.browserAgent.setConsoleMessageEventsEnabled(e)}};WebGLWebView.prototype.setDefaultBackgroundEnabled=function(e){this._defaultBackgroundEnabled=e;this._setPageTransparency(!e)};WebGLWebView.setDevicePixelRatio=function(e){if(e>0){this._devicePixelRatioOverride=e}else{Logger_1.default.error("Invalid value passed to setDevicePixelRatio: "+e)}};WebGLWebView.prototype.setFocused=function(e){var t;if(e){this._iframe.focus()}else{this._iframe.blur()}if(this.canAccessIFrameContent()){(t=this._vuplexInternal)===null||t===void 0?void 0:t.focusManager.setFocused(e)}};WebGLWebView.prototype.setFocusedInputFieldEventsEnabled=function(e){var t;this._focusedInputFieldEventsEnabled=e;if(this.canAccessIFrameContent()){(t=this._vuplexInternal)===null||t===void 0?void 0:t.browserAgent.setFocusedInputFieldEventsEnabled(e)}};WebGLWebView.setFullscreenEnabled=function(e){this._permissions.fullscreen=e;this._updatePermissionsForAll()};WebGLWebView.setGeolocationEnabled=function(e){this._permissions.geolocation=e;this._updatePermissionsForAll()};WebGLWebView.prototype.setRect=function(e,t,n,i){this._iframe.style.left=this._getScaledCoordinateComponent(e)+"px";this._iframe.style.top=this._getScaledCoordinateComponent(t)+"px";this.resize(n,i)};WebGLWebView.setScreenSharingEnabled=function(e){this._permissions["display-capture"]=e;this._updatePermissionsForAll()};WebGLWebView.setUnityContainerElementId=function(e){this._unityContainerIdOverride=e};WebGLWebView.setUnityFullscreen=function(e){if(e){var t=this._unityContainer.getElementsByTagName("canvas")[0];if(t){t.style.width="100%";t.style.height="100%"}this._unityContainer.requestFullscreen()}else{document.exitFullscreen()}};WebGLWebView.prototype.setVisible=function(e){this._iframe.style.display=e?"block":"none"};WebGLWebView.prototype.stopLoad=function(){if(this.canAccessIFrameContent()&&this._iframe.contentWindow){this._iframe.contentWindow.stop()}else{this._iframe.src="about:blank"}};Object.defineProperty(WebGLWebView,"_unityContainer",{get:function(){if(!this._cachedUnityContainer){var e=["unity-container","unityContainer","gameContainer"];if(this._unityContainerIdOverride){e.unshift(this._unityContainerIdOverride)}for(var t=0,n=e;t<n.length;t++){var i=n[t];var r=document.getElementById(i);if(r){this._cachedUnityContainer=r;break}}if(!this._cachedUnityContainer){throw new Error("[2D WebView] Unable to locate the Unity container element! There is no element with the following IDs: "+e.join(", ")+". This is probably because your project is using a WebGL template with a customized container element ID. Please call WebGLWebView.SetUnityContainerElementId() to set the container element for 2D WebView to use.")}}return this._cachedUnityContainer},enumerable:false,configurable:true});Object.defineProperty(WebGLWebView.prototype,"_vuplexInternal",{get:function(){if(this.canAccessIFrameContent()){return this._iframe.contentWindow._vuplexInternal}return null},enumerable:false,configurable:true});WebGLWebView.prototype._getDevicePixelRatioDivisor=function(){if(this._ignoreDevicePixelRatio){return 1}if(WebGLWebView._devicePixelRatioOverride>0){return WebGLWebView._devicePixelRatioOverride}if(typeof config==="object"&&config.devicePixelRatio){return config.devicePixelRatio}return window.devicePixelRatio||1};WebGLWebView.prototype._getScaledCoordinateComponent=function(e){return e/this._getDevicePixelRatioDivisor()};WebGLWebView.prototype._handleCrossOriginEmbedderPolicyHeaderIfNeeded=function(e){if(e.indexOf("data:")===0){return false}var t=typeof SharedArrayBuffer!=="undefined";if(!t){return false}var n=new URL(e);var i=n.origin===location.origin;if(i){return false}var r=navigator.userAgent.indexOf("Chrome")!==-1;if(r&&location.hostname==="localhost"){var o="credentialless";if(this._iframe.getAttribute(o)===null){Logger_1.default.warn('The web page in the webview will be unable to access cookies or storage because 2D WebView is adding a "'+o+"\\" attribute to the webview's iframe as a workaround for the issue described here: "+CROSS_ORIGIN_EMBEDDER_POLICY_ARTICLE_URL);this._iframe.setAttribute(o,"")}return false}this.loadHtml('<!DOCTYPE html>\\n <html>\\n <head>\\n <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">\\n </head>\\n <body>\\n <style>\\n html {\\n height: 100vh;\\n font-family: Arial, Helvetica, sans-serif;\\n }\\n html {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n padding: 0 10px;\\n }\\n div {\\n text-align: center;\\n }\\n </style>\\n <div>\\n The browser is blocking the webview\\'s <iframe> element from loading the URL because the web server responded with a Cross-Origin-Embedder-Policy HTTP header. For details on how to resolve this issue, please see <a href="#" onclick="window.open(\\''+CROSS_ORIGIN_EMBEDDER_POLICY_ARTICLE_URL+"', '_blank')\\">this article.</a>.\\n </div>\\n </body>\\n </html>");return true};WebGLWebView.prototype._setPageTransparency=function(e){this._iframe.style.backgroundColor=e?"transparent":"white"};WebGLWebView._updatePermissions=function(e){var t=Object.keys(WebGLWebView._permissions).filter(function(e){return WebGLWebView._permissions[e]});if(!t.length){e.removeAttribute("allow");return}var n=t.map(function(e){return e+" *"}).join(";");e.setAttribute("allow",n)};WebGLWebView._updatePermissionsForAll=function(){var t=this;document.querySelectorAll("iframe[vuplex]").forEach(function(e){return t._updatePermissions(e)})};WebGLWebView._cachedUnityContainer=null;WebGLWebView._devicePixelRatioOverride=0;WebGLWebView._nextWebViewPtr=1;WebGLWebView._permissions={camera:false,microphone:false,"display-capture":false,fullscreen:false,geolocation:false};WebGLWebView._webViews={};return WebGLWebView}();exports_24("default",WebGLWebView);if(!window.vuplex){window.vuplex={}}window.vuplex.SetFullscreen=WebGLWebView.setUnityFullscreen.bind(WebGLWebView)}}});_vuplexSystem.register("src/index",["src/WebGLWebView"],function(e,t){"use strict";var u;var n=t&&t.id;function r(e){var t=lengthBytesUTF8(e)+1;var n=_malloc(t);stringToUTF8(e,n,t);return n}return{setters:[function(e){u=e}],execute:function(){_WebView_canGoBack=function(e){};_WebView_canGoForward=function(e){};_WebView_destroyTexture=function(e,t){};_WebView_executeJavaScript=function(e,t,n){};_WebView_loadUrlWithHeaders=function(e,t,n){};_WebView_setRenderingEnabled=function(e,t){};_WebView_zoomIn=function(e){};_WebView_zoomOut=function(e){};_WebView_bringToFront=function(e){return u.default.getInstance(e).bringToFront()};_WebView_canAccessIFrameContent=function(e){return u.default.getInstance(e).canAccessIFrameContent()};_WebView_canGoBackOrForward=function(e){return u.default.getInstance(e).canGoBackOrForward()};_WebView_click=function(e,t,n){return u.default.getInstance(e).click(t,n)};_WebView_destroy=function(e){return u.default.getInstance(e).destroy()};_WebView_executeJavaScriptSync=function(e,t){var n=UTF8ToString(t);var i=u.default.getInstance(e).executeJavaScript(n);return r(i)};_WebView_executeJavaScriptLocally=function(e){var t=UTF8ToString(e);var n=u.default.executeJavaScriptLocally(t);return r(n)};_WebView_goBack=function(e){return u.default.getInstance(e).goBack()};_WebView_goForward=function(e){return u.default.getInstance(e).goForward()};_WebView_loadHtml=function(e,t){return u.default.getInstance(e).loadHtml(UTF8ToString(t))};_WebView_loadUrl=function(e,t){return u.default.getInstance(e).loadUrl(UTF8ToString(t))};_WebView_newInNative2DMode=function(e,t,n,i,r,o){var s=UTF8ToString(e);try{var a=new u.default(s,t,n,i,r,o);return a.pointer}catch(e){if(e.message.indexOf("trial")!==-1){return 0}throw e}};_WebView_postMessage=function(e,t){return u.default.getInstance(e).postMessage(UTF8ToString(t))};_WebView_reload=function(e){return u.default.getInstance(e).reload()};_WebView_resize=function(e,t,n){return u.default.getInstance(e).resize(t,n)};_WebView_scroll=function(e,t,n){return u.default.getInstance(e).scroll(t,n)};_WebView_scrollAtPoint=function(e,t,n,i,r){return u.default.getInstance(e).scrollAtPoint(t,n,i,r)};_WebView_sendKey=function(e,t){return u.default.getInstance(e).sendKey(UTF8ToString(t))};_WebView_setCameraAndMicrophoneEnabled=function(e){return u.default.setCameraAndMicrophoneEnabled(e)};_WebView_setConsoleMessageEventsEnabled=function(e,t){return u.default.getInstance(e).setConsoleMessageEventsEnabled(t)};_WebView_setDefaultBackgroundEnabled=function(e,t){return u.default.getInstance(e).setDefaultBackgroundEnabled(t)};_WebView_setDevicePixelRatio=function(e){return u.default.setDevicePixelRatio(e)};_WebView_setFocused=function(e,t){return u.default.getInstance(e).setFocused(t)};_WebView_setFocusedInputFieldEventsEnabled=function(e,t){return u.default.getInstance(e).setFocusedInputFieldEventsEnabled(t)};_WebView_setFullscreenEnabled=function(e){return u.default.setFullscreenEnabled(e)};_WebView_setGeolocationEnabled=function(e){return u.default.setGeolocationEnabled(e)};_WebView_setRect=function(e,t,n,i,r){return u.default.getInstance(e).setRect(t,n,i,r)};_WebView_setScreenSharingEnabled=function(e){return u.default.setScreenSharingEnabled(e)};_WebView_setUnityContainerElementId=function(e){return u.default.setUnityContainerElementId(UTF8ToString(e))};_WebView_setVisible=function(e,t){return u.default.getInstance(e).setVisible(t)};_WebView_stopLoad=function(e){return u.default.getInstance(e).stopLoad()}}}});_vuplexSystem.require("src/index");
- `,WebView_canGoBack:function(){},WebView_canGoBack__deps:["$VuplexWebViewImplementation"],WebView_canGoForward:function(){},WebView_canGoForward__deps:["$VuplexWebViewImplementation"],WebView_destroyTexture:function(){},WebView_destroyTexture__deps:["$VuplexWebViewImplementation"],WebView_executeJavaScript:function(){},WebView_executeJavaScript__deps:["$VuplexWebViewImplementation"],WebView_loadUrlWithHeaders:function(){},WebView_loadUrlWithHeaders__deps:["$VuplexWebViewImplementation"],WebView_setRenderingEnabled:function(){},WebView_setRenderingEnabled__deps:["$VuplexWebViewImplementation"],WebView_zoomIn:function(){},WebView_zoomIn__deps:["$VuplexWebViewImplementation"],WebView_zoomOut:function(){},WebView_zoomOut__deps:["$VuplexWebViewImplementation"],WebView_bringToFront:function(){},WebView_bringToFront__deps:["$VuplexWebViewImplementation"],WebView_canAccessIFrameContent:function(){},WebView_canAccessIFrameContent__deps:["$VuplexWebViewImplementation"],WebView_canGoBackOrForward:function(){},WebView_canGoBackOrForward__deps:["$VuplexWebViewImplementation"],WebView_click:function(){},WebView_click__deps:["$VuplexWebViewImplementation"],WebView_destroy:function(){},WebView_destroy__deps:["$VuplexWebViewImplementation"],WebView_executeJavaScriptSync:function(){},WebView_executeJavaScriptSync__deps:["$VuplexWebViewImplementation"],WebView_executeJavaScriptLocally:function(){},WebView_executeJavaScriptLocally__deps:["$VuplexWebViewImplementation"],WebView_goBack:function(){},WebView_goBack__deps:["$VuplexWebViewImplementation"],WebView_goForward:function(){},WebView_goForward__deps:["$VuplexWebViewImplementation"],WebView_loadHtml:function(){},WebView_loadHtml__deps:["$VuplexWebViewImplementation"],WebView_loadUrl:function(){},WebView_loadUrl__deps:["$VuplexWebViewImplementation"],WebView_newInNative2DMode:function(){},WebView_newInNative2DMode__deps:["$VuplexWebViewImplementation"],WebView_postMessage:function(){},WebView_postMessage__deps:["$VuplexWebViewImplementation"],WebView_reload:function(){},WebView_reload__deps:["$VuplexWebViewImplementation"],WebView_resize:function(){},WebView_resize__deps:["$VuplexWebViewImplementation"],WebView_scroll:function(){},WebView_scroll__deps:["$VuplexWebViewImplementation"],WebView_scrollAtPoint:function(){},WebView_scrollAtPoint__deps:["$VuplexWebViewImplementation"],WebView_sendKey:function(){},WebView_sendKey__deps:["$VuplexWebViewImplementation"],WebView_setCameraAndMicrophoneEnabled:function(){},WebView_setCameraAndMicrophoneEnabled__deps:["$VuplexWebViewImplementation"],WebView_setConsoleMessageEventsEnabled:function(){},WebView_setConsoleMessageEventsEnabled__deps:["$VuplexWebViewImplementation"],WebView_setDefaultBackgroundEnabled:function(){},WebView_setDefaultBackgroundEnabled__deps:["$VuplexWebViewImplementation"],WebView_setDevicePixelRatio:function(){},WebView_setDevicePixelRatio__deps:["$VuplexWebViewImplementation"],WebView_setFocused:function(){},WebView_setFocused__deps:["$VuplexWebViewImplementation"],WebView_setFocusedInputFieldEventsEnabled:function(){},WebView_setFocusedInputFieldEventsEnabled__deps:["$VuplexWebViewImplementation"],WebView_setFullscreenEnabled:function(){},WebView_setFullscreenEnabled__deps:["$VuplexWebViewImplementation"],WebView_setGeolocationEnabled:function(){},WebView_setGeolocationEnabled__deps:["$VuplexWebViewImplementation"],WebView_setRect:function(){},WebView_setRect__deps:["$VuplexWebViewImplementation"],WebView_setScreenSharingEnabled:function(){},WebView_setScreenSharingEnabled__deps:["$VuplexWebViewImplementation"],WebView_setUnityContainerElementId:function(){},WebView_setUnityContainerElementId__deps:["$VuplexWebViewImplementation"],WebView_setVisible:function(){},WebView_setVisible__deps:["$VuplexWebViewImplementation"],WebView_stopLoad:function(){},WebView_stopLoad__deps:["$VuplexWebViewImplementation"]});
|