UNPKG

4.55 kBJavaScriptView Raw
1/***************************************************************************************
2 * (c) 2017 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 ****************************************************************************************/
12
13!function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var n,t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=(function(n){!function(e){var o=setTimeout;function r(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function c(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var o;try{o=t(e._value)}catch(e){return void u(n.promise,e)}f(n.promise,o)}else(1===e._state?f:u)(n.promise,e._value)})):e._deferreds.push(n)}function f(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"===(void 0===n?"undefined":t(n))||"function"==typeof n)){var o=n.then;if(n instanceof i)return e._state=3,e._value=n,void a(e);if("function"==typeof o)return void s((r=o,c=n,function(){r.apply(c,arguments)}),e)}e._state=1,e._value=n,a(e)}catch(n){u(e,n)}var r,c}function u(e,n){e._state=2,e._value=n,a(e)}function a(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)c(e,e._deferreds[n]);e._deferreds=null}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,f(n,e))},function(e){t||(t=!0,u(n,e))})}catch(e){if(t)return;t=!0,u(n,e)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,n){var t=new this.constructor(r);return c(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(e,n,t)),t},i.all=function(e){return new i(function(n,o){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);var i=r.length;function c(e,f){try{if(f&&("object"===(void 0===f?"undefined":t(f))||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){c(e,n)},o)}r[e]=f,0==--i&&n(r)}catch(e){o(e)}}for(var f=0;f<r.length;f++)c(f,r[f])})},i.resolve=function(e){return e&&"object"===(void 0===e?"undefined":t(e))&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(e){return new i(function(n,t){for(var o=0,r=e.length;o<r;o++)e[o].then(n,t)})},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){o(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},n.exports?n.exports=i:e.Promise||(e.Promise=i)}(e)}(n={exports:{}},n.exports),n.exports);if(!window.extensionBridge){var r=window.extensionBridge={_callQueue:[]},i=document.createElement("a");i.href=document.referrer;var c=i.protocol+"//"+i.hostname+(i.port?":"+i.port:"")+"/extensionbridge/extensionbridge-child.js";["openCodeEditor","openDataElementSelector","openRegexTester","register","setDebug"].forEach(function(e){r[e]=function(){for(var n=arguments.length,t=Array(n),i=0;i<n;i++)t[i]=arguments[i];return new o(function(n,o){r._callQueue.push({methodName:e,args:t,resolve:n,reject:o})})}});var f=document.createElement("script");f.async=!0,f.src=c;var u=document.getElementsByTagName("script")[0];u.parentNode.insertBefore(f,u)}}();