@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
9 lines • 25.8 kB
JavaScript
var editor=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=function(e,n,r,i){return new(r||(r=t))((function(t,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}c((i=i.apply(e,n||[])).next())}))};class i{static _appendToHead(t){document.getElementsByTagName("head")[0].appendChild(t)}static _attachEventHandlers(t,e,n){t.readyState?t.onreadystatechange=function(){"load"!==t.readyState&&"loaded"!==t.readyState&&"complete"!==t.readyState||"function"==typeof e&&(t.onreadystatechange=null,e())}:(t.onload=function(){"function"==typeof e&&e()},t.onerror=function(){"function"==typeof n&&n(arguments)})}static initWebComponentsReadyPromise(){let e=window;return e.webComponentsReadyPromise||(e.webComponentsReadyPromise=new t((function(t){return e.WebComponents?setTimeout(()=>{t(!0)}):document.addEventListener("WebComponentsReady",()=>{t(!0)})}))),e.webComponentsReadyPromise}static loadScript(t,e,n,r){var i;t.toLowerCase().endsWith("au.editor.js")&&(null===(i=window.Aurigma)||void 0===i?void 0:i.UIFramework)&&n();let o=document.createElement("script");o.id=e,o.type="text/javascript",this._attachEventHandlers(o,n,r),this._appendToHead(o),o.src=t}static loadScriptAsync(e,n){return r(this,void 0,void 0,(function*(){return yield new t((t,r)=>{i.loadScript(e,n,t,r)})}))}static loadLink(t,e,n,r,i){let o=document.createElement("link");o.type=e||"",o.rel=n,this._attachEventHandlers(o,r,i),this._appendToHead(o),o.href=t}static loadLinkAsync(e,n,o){return r(this,void 0,void 0,(function*(){return yield new t((t,r)=>{i.loadLink(e,n,o,t,r)})}))}static loadHtml(t,e=(()=>{}),n=(()=>{}),r=!0){let i=new XMLHttpRequest;i.onload=function(){this.status>=200&&this.status<=300?(r&&(t=>{const e=document.createElement("template");e.setAttribute("style","display: none;"),e.innerHTML=t,document.head.appendChild(e.content)})(this.response),e&&e(this.response)):n&&n(this.response)},i.onerror=function(){n&&n()},i.open("get",t,!0),i.send()}static loadHtmlAsync(e,n=!0){return r(this,void 0,void 0,(function*(){return yield new t((t,r)=>{i.loadHtml(e,t,r,n)})}))}static loadJson(e){return new t((t,n)=>{let r=new XMLHttpRequest;r.onload=function(){200===this.status?t(JSON.parse(this.response)):404!==this.status&&500!==this.status||n(this.response)},r.open("get",e,!0),r.send()})}static load(t,e,n,r){const i=this.addTimestampToUrl(t);if(/\.js$/gi.test(t))this.loadScript(t,"",e,n);else if(/\.css$|\.scss$|\.less$/gi.test(t))this.loadLink(r?t:i,"text/css","stylesheet",e,n);else{if(!/\.html$|\.htm$/gi.test(t))throw"bad url: "+t;this.loadHtml(r?t:i,e,n)}}static loadAsync(e,n){return r(this,void 0,void 0,(function*(){return yield new t((t,r)=>{i.load(e,t,r,n)})}))}static appendLoadAnimation(t,e){try{let n=["display:flex","align-items:center","justify-content:center","width:100%","height:100%","background-color:rgba(255, 255, 255, 0.9)","color: #666666;","position:absolute","z-index:600"];return t.style.position="relative",t.innerHTML=`\n <div style="${n.join(";")}">\n <au-preloader style="position: relative !important; z-index: 601;" message="${e}"></au-preloader>\n <div style="${n.join(";")}">\n <span style="top: 32px;position: relative;">${e}</span>\n </div>\n </div>`,t.firstElementChild}catch(t){throw"Failed to attach loader element"}}static toggleLoadAnimation(t,e){try{e?(t.removeAttribute("hidden"),t.style.display="flex"):(t.setAttribute("hidden","true"),t.style.display="none")}catch(t){console.warn("Failed to toggle loader element")}}static concatAndResolveUrl(t,e){return t.replace(/\/$/,"")+"/"+e.replace(/^\//,"")}static addTimestampToUrl(t){return t+(-1===t.indexOf("?")?"?":"&")+"t="+Date.now()}}e.b=i}).call(this,n(2).Promise)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));class r{constructor(){this.promise=new t(function(t,e){this._resolve=t,this._reject=e}.bind(this))}then(t){return this.promise.then(t)}catch(t){return this.promise.catch(t)}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}}).call(this,n(2).Promise)},function(t,e,n){(function(e,n){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/var r;r=function(){"use strict";function t(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(m):g())},c="undefined"!=typeof window?window:void 0,u=c||{},d=u.MutationObserver||u.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(m,1)}}var f=new Array(1e3);function m(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var v,y,w,_,g=void 0;function b(t,e){var n=this,r=new this.constructor(x);void 0===r[A]&&M(r);var i=n._state;if(i){var o=arguments[i-1];a((function(){return k(i,r,o,n._result)}))}else O(n,r,t,e);return r}function E(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(x);return L(e,t),e}l?g=function(){return e.nextTick(m)}:d?(y=0,w=new d(m),_=document.createTextNode(""),w.observe(_,{characterData:!0}),g=function(){_.data=y=++y%2}):p?((v=new MessageChannel).port1.onmessage=m,g=function(){return v.port2.postMessage(0)}):g=void 0===c?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(m)}:h()}catch(t){return h()}}():h();var A=Math.random().toString(36).substring(2);function x(){}function T(e,n,r){n.constructor===e.constructor&&r===b&&n.constructor.resolve===E?function(t,e){1===e._state?P(t,e._result):2===e._state?S(t,e._result):O(e,void 0,(function(e){return L(t,e)}),(function(e){return S(t,e)}))}(e,n):void 0===r?P(e,n):t(r)?function(t,e,n){a((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?L(t,n):P(t,n))}),(function(e){r||(r=!0,S(t,e))}),t._label);!r&&i&&(r=!0,S(t,i))}),t)}(e,n,r):P(e,n)}function L(t,e){if(t===e)S(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=e),null===r||"object"!==i&&"function"!==i)P(t,e);else{var n=void 0;try{n=e.then}catch(e){return void S(t,e)}T(t,e,n)}var r,i}function C(t){t._onerror&&t._onerror(t._result),j(t)}function P(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(j,t))}function S(t,e){void 0===t._state&&(t._state=2,t._result=e,a(C,t))}function O(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+1]=n,i[o+2]=r,0===o&&t._state&&a(j,t)}function j(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?k(n,r,i,o):i(o);t._subscribers.length=0}}function k(e,n,r,i){var o=t(r),s=void 0,a=void 0,c=!0;if(o){try{s=r(i)}catch(t){c=!1,a=t}if(n===s)return void S(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;void 0!==n._state||(o&&c?L(n,s):!1===c?S(n,a):1===e?P(n,s):2===e&&S(n,s))}var R=0;function M(t){t[A]=R++,t._state=void 0,t._result=void 0,t._subscribers=[]}var I=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(x),this.promise[A]||M(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&P(this.promise,this._result))):S(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===E){var i=void 0,o=void 0,s=!1;try{i=t.then}catch(t){s=!0,o=t}if(i===b&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===D){var a=new n(x);s?S(a,o):T(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===t?S(r,n):this._result[e]=n),0===this._remaining&&P(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),D=function(){function e(t){this[A]=R++,this._result=this._state=void 0,this._subscribers=[],x!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){L(t,e)}),(function(e){S(t,e)}))}catch(e){S(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return D.prototype.then=b,D.all=function(t){return new I(this,t).promise},D.race=function(t){var e=this;return r(t)?new e((function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},D.resolve=E,D.reject=function(t){var e=new this(x);return S(e,t),e},D._setScheduler=function(t){s=t},D._setAsap=function(t){a=t},D._asap=a,D.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=D},D.Promise=D,D},t.exports=r()}).call(this,n(6),n(7))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var r={};n.r(r),n.d(r,"default",(function(){return i}));var i='<div class="au-popup-overlay" id="au-popup-main-popup">\n <div target="cc-editor-page" id="au-popup-editor-wrapper">\n <button type="button" id="auwizard-close-button" class="au-popup-close-button">✖</button>\n <div class="au-popup-editor-body"></div>\n </div>\n <style>\n .au-popup-overlay {\n position: static;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n height: 100vh;\n width: 100%;\n width: 100vw;\n background: rgba(0, 0, 0, 0.5);\n z-index: 99999;\n display: none;\n overflow-x: inherit;\n overflow-y: auto;\n }\n\n .au-popup-overlay:target {\n visibility: visible;\n opacity: 1;\n }\n\n @media only screen and (min-width: 1024px) {\n #au-popup-editor-wrapper {\n height: 90vh;\n margin-left: 20px;\n margin-right: 20px;\n margin-top: 20px;\n margin-bottom: 20px;\n overflow: hidden;\n }\n\n .au-popup-editor-body {\n height: 90% !important;\n min-height: 500px !important;\n width: 100%;\n }\n }\n\n @media only screen and (max-width: 1023px) {\n #au-popup-editor-wrapper {\n height: calc(var(--vh, 1vh) * 98 + 8px);\n background-color: white;\n margin-left: 0px;\n margin-right: 0px;\n margin-top: -5px;\n margin-bottom: 0px;\n overflow: auto;\n }\n\n au-wizard {\n min-height: 440px;\n padding-bottom: 30px;\n height: 88vh;\n }\n\n .au-popup-close-button {\n position: relative !important;\n }\n }\n\n au-editor {\n min-height: 100%\n }\n\n #au-popup-editor-wrapper {\n background-color: white;\n }\n\n .au-popup-close-button {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n\n width: 36px !important;\n height: 36px !important;\n\n z-index: 500 !important;\n margin: 0px !important;\n padding: 0px !important;\n\n background: transparent !important;\n background-repeat: no-repeat !important;\n border: none !important;\n cursor: pointer !important;\n overflow: hidden !important;\n outline: none !important;\n font-size: 24px !important;\n color: #000 !important;\n }\n </style>\n</div>';function o(t,e){const n=t=>t&&"object"==typeof t;return n(t)&&n(e)?(Object.keys(e).forEach(r=>{const i=t[r],o=e[r];Array.isArray(i)&&Array.isArray(o)?t[r]=o:n(i)&&n(o)?t[r]=this.DeepMerge(Object.assign({},i),o):t[r]=o}),t):e}function s(){const t=i||r,e=document.createElement("div");return e.innerHTML=t.trim(),e.firstChild}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return c}));var r=n(1),i=n(3),o=n(5),s=n(0),a=function(e,n,r,i){return new(r||(r=t))((function(t,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}c((i=i.apply(e,n||[])).next())}))};class c{constructor(){this.editorType="multistep",this.version="1.1.1",this.isCached=!1,this.telemetryMessages={},this._editorReady=new r.a,this.localeResources=new r.a,this.editorLoaderConfig=new r.a,this.loadingAnimationElement=null,this.driver=null,this.resourcesLoaded=!1}preload(t){return a(this,void 0,void 0,(function*(){const e=performance.now();this.isCached=!0;const n=document.createElement("div");let r=document.body||document.getElementsByTagName("body")[0];null==r&&(r=document.getElementsByTagName("html")[0].appendChild(document.createElement("body"))),n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.style.width="500px",n.style.height="500px",n.style.visibility="hidden",r.appendChild(n),yield this._preloadInternal(t),n.parentNode.removeChild(n);const i=performance.now();this.telemetryMessages.preload=this.telemetryMessages.preload||[],this.telemetryMessages.preload.push({time:i-e})}))}_preloadInternal(t){var e,n;return a(this,void 0,void 0,(function*(){this.resourcesLoaded=yield this.loadSources(),yield s.a.loadScriptAsync(t.designEditorUrl+"/Resources/Generated/IframeApi.js","CcIframeApiScript");const r=null===(n=null===(e=window)||void 0===e?void 0:e.CustomersCanvas)||void 0===n?void 0:n.IframeApi;null!=r?r.preload():console.warn("Design Editor did not preload (no iframeapi.js loaded).")}))}render(e,n,i=!1){return a(this,void 0,void 0,(function*(){if(this.startLoadTime=performance.now(),this.isCached=i,this._editorReady=new r.a,void 0===this.driver||null===this.driver)throw"editor.driver is not defined or null";if(this.resourcesLoaded||(this.resourcesLoaded=yield this.loadSources(e)),n&&Array.isArray(n)){const e=yield t.all(n);for(const t of e)this.driver.addProduct(t)}try{let t=yield this.editorLoaderConfig;!0===this.driver.config.displayInPopup&&(e=this.renderInPopup(e));let n=this.createEditorElement(t.element,e);try{n.set("driver",this.driver)}catch(t){n.driver=this.driver}}catch(t){throw console.error(t),new Error(t)}return this._editorReady.promise}))}renderInPopup(t){let e=document.getElementById("au-popup-main-popup");e||(e=Object(i.b)());const n=t;t=e.querySelector(".au-popup-editor-body"),document.body.prepend(e);const r=()=>{n.dispatchEvent(new CustomEvent("stepInited",{bubbles:!0}))};t.addEventListener("stepInited",r);const o=()=>{n.dispatchEvent(new CustomEvent("stepChanged",{}))};t.addEventListener("stepChanged",o);const s=()=>{n.dispatchEvent(new CustomEvent("attached",{bubbles:!0}))};t.addEventListener("attached",s);const a=()=>{n.dispatchEvent(new CustomEvent("ready",{}))};t.addEventListener("ready",a);const c=()=>{(window.auWizard||document.querySelector("au-wizard")).closeEditorPopup()};window.__auOnResizeAction=t=>{0===t.target.offsetTop&&0!==t.target.pageTop&&window.scrollTo(0,0)};const u=window.__auOnResizeAction,d=()=>{n.dispatchEvent(new CustomEvent("load",{})),document.querySelector(".au-popup-close-button").addEventListener("click",c),window.visualViewport&&window.visualViewport.addEventListener("resize",u)};return t.addEventListener("load",d),t.addEventListener("disconnected",()=>{t.removeEventListener("stepInited",r),t.removeEventListener("stepChanged",o),t.removeEventListener("attached",s),t.removeEventListener("ready",a),t.removeEventListener("load",d),document.querySelector(".au-popup-close-button").removeEventListener("click",c),window.visualViewport&&window.visualViewport.removeEventListener("resize",window.__auOnResizeAction),n.dispatchEvent(new CustomEvent("disconnected",{bubbles:!0}))},{once:!0}),t}toggleLoader(t){s.a.toggleLoadAnimation(this.loadingAnimationElement,t)}loadLocales(){let t=window.patchAurigmaEditorUrl("EDITOR_BASE_PATH./locales.json");this.isCached||(t+="?t="+Date.now());const e=this.driver&&this.driver.localization,n=e?this.driver.localization.find(t=>"ui-framework"===t.app):null;return e&&n&&n.url&&"string"==typeof n.url&&(t=n.url+"?t="+Date.now()),s.a.loadJson(t).then(t=>{e&&n&&n.data&&"object"==typeof n.data&&(t=Object(i.a)(t,n.data)),this.localeResources.resolve(t)}),this.localeResources.promise}loadEditorLoaderConfig(){let t=window.patchAurigmaEditorUrl("EDITOR_BASE_PATH./editor.json");return this.isCached||(t+="?t="+Date.now()),s.a.loadJson(t).then(t=>{this.editorLoaderConfig.resolve(t)}),this.editorLoaderConfig.promise}loadScripts(e){return new t(t=>{Object(o.a)(e.imports.slice(0),t,this.isCached)})}loadSources(e=null){return a(this,void 0,void 0,(function*(){const n=this.loadEditorLoaderConfig();if(this.localization=yield this.loadLocales(),e){const t=this.driver&&this.driver.config&&this.driver.config.language?this.driver.config.language:"en",n=t=>s.a.appendLoadAnimation(e,this.localization[t]["common.loading.waiting"]);try{this.loadingAnimationElement=n(t)}catch(t){this.loadingAnimationElement=n("en")}}const r=yield n;let i=r.element===c.AUWIZARD_ELEMENT?[this.loadScripts(r),s.a.initWebComponentsReadyPromise()]:[this.loadScripts(r)];return yield t.all(i),!0}))}createEditorElement(t,e){const n=e.querySelector(t);n&&n.remove&&n.remove();const r=customElements.get(t);r&&r.clean&&r.clean();let i=document.createElement(t);return i.addEventListener("load",()=>{this.toggleLoader(!1),this._editorReady.resolve(i),window.auWizard=i,window.__auWizards=window.__auWizards||[],window.__auWizards.push(i)}),e.appendChild(i)}setLanguage(t){this._editorReady.then(e=>{e.language=t})}}c.AUWIZARD_ELEMENT="au-wizard",c.FORMBASED_ELEMENT="au-simple-editor"}).call(this,n(2).Promise)},function(module,__webpack_exports__,__webpack_require__){"use strict";(function(Promise){__webpack_require__.d(__webpack_exports__,"a",(function(){return parallelLoad}));var _script_loader__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),__awaiter=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};function parallelLoad(imports,done,isCached){if(0===imports.length)return void done(!0);const promises=imports.map(imported=>__awaiter(this,void 0,void 0,(function*(){return new Promise(resolve=>{if(imported.amd)return void resolve();let check=!1;try{check=eval(imported.check)}catch(t){check=!1}check?_script_loader__WEBPACK_IMPORTED_MODULE_0__.b.load(window.patchAurigmaEditorUrl("EDITOR_BASE_PATH"+imported.src),()=>resolve(),()=>{},isCached):resolve()})})));Promise.all(promises).then(()=>{done(!0)})}function recursiveLoad(imports,done,isCached){if(0===imports.length)done(!0);else{let imported=imports.shift();if(imported.amd)this.recursiveLoad(imports,done);else{let check=!1;try{check=eval(imported.check)}catch(t){check=!1}check?_script_loader__WEBPACK_IMPORTED_MODULE_0__.b.load(window.patchAurigmaEditorUrl("EDITOR_BASE_PATH"+imported.src),()=>{this.recursiveLoad(imports,done)},()=>{},isCached):this.recursiveLoad(imports,done)}}}}).call(this,__webpack_require__(2).Promise)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,u=[],d=!1,l=-1;function p(){d&&c&&(d=!1,c.length?u=c.concat(u):l=-1,u.length&&h())}function h(){if(!d){var t=a(p);d=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,d=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||d||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var r=n(4);class i{constructor(t){this.pathParts=t}static getImportPath(){let t=[];try{throw new Error}catch(e){const n=e.stack.split("\n");let r;for(let t in n)if(n[t].match(/http[s]?:\/\//)){r=Number(t)+2;break}const o=function(t){return n[t].match(/((http[s]?:\/\/.+\/)([^\/]+\.js))/)};return t=o(r)||o(r-1),new i(t)}}fullPath(){return this.pathParts[1]}path(){return this.pathParts[2]}file(){return this.pathParts[3]}fileNoExt(){let t=this.file().split(".");return t.length=1!==t.length?t.length-1:1,t.join(".")}}const o=window;let s=i.getImportPath().fullPath();(t=>{window.patchAurigmaEditorUrl=function(e){if(t.startsWith("http")){return e.substring(e.indexOf("EDITOR_BASE_PATH")).replace("EDITOR_BASE_PATH",t)}if("/"===t[0]){let n=null;try{n=new URL(e)}catch(t){n=new URL(window.location.toString())}let r=e.substring(e.indexOf("EDITOR_BASE_PATH"));return n.origin+r.replace("EDITOR_BASE_PATH",t)}return e.replace("EDITOR_BASE_PATH",t)}})(s.substring(0,s.lastIndexOf("/")+1));let a=function(){const t=window,e=t.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:return"edge";case e.indexOf("opr")>-1&&!!t.opr:return"opera";case e.indexOf("chrome")>-1&&!!t.chrome:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}();try{o.isSupportingEs8=o.eval('(async function () {}).constructor.toString().indexOf("AsyncFunction") > 0;')||"edge"===a}catch(t){o.isSupportingEs8=!1}const c=new r.a;e.default=c}]);
export default editor;