cloudcmd/modules/smalltalk/dist/smalltalk.poly.min.js
2017-07-10 12:43:50 +03:00

2 lines
No EOL
12 KiB
JavaScript

var smalltalk=function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=4)}([function(t,n,e){(function(n,r){!function(n,e){t.exports=e()}(0,function(){"use strict";function t(t){var n=typeof t;return null!==t&&("object"===n||"function"===n)}function o(t){return"function"==typeof t}function i(t){G=t}function u(t){I=t}function c(){return void 0!==W?function(){W(a)}:s()}function s(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<H;t+=2){(0,Z[t])(Z[t+1]),Z[t]=void 0,Z[t+1]=void 0}H=0}function f(t,n){var e=arguments,r=this,o=new this.constructor(h);void 0===o[tt]&&P(o);var i=r._state;return i?function(){var t=e[i-1];I(function(){return S(i,o,t,r._result)})}():A(r,o,t,n),o}function l(t){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var e=new n(h);return w(e,t),e}function h(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function d(t){try{return t.then}catch(t){return ot.error=t,ot}}function m(t,n,e,r){try{t.call(n,e,r)}catch(t){return t}}function y(t,n,e){I(function(t){var r=!1,o=m(e,n,function(e){r||(r=!0,n!==e?w(t,e):E(t,e))},function(n){r||(r=!0,T(t,n))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,T(t,o))},t)}function _(t,n){n._state===et?E(t,n._result):n._state===rt?T(t,n._result):A(n,void 0,function(n){return w(t,n)},function(n){return T(t,n)})}function g(t,n,e){n.constructor===t.constructor&&e===f&&n.constructor.resolve===l?_(t,n):e===ot?(T(t,ot.error),ot.error=null):void 0===e?E(t,n):o(e)?y(t,n,e):E(t,n)}function w(n,e){n===e?T(n,p()):t(e)?g(n,e,d(e)):E(n,e)}function b(t){t._onerror&&t._onerror(t._result),k(t)}function E(t,n){t._state===nt&&(t._result=n,t._state=et,0!==t._subscribers.length&&I(k,t))}function T(t,n){t._state===nt&&(t._state=rt,t._result=n,I(b,t))}function A(t,n,e,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=n,o[i+et]=e,o[i+rt]=r,0===i&&t._state&&I(k,t)}function k(t){var n=t._subscribers,e=t._state;if(0!==n.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<n.length;u+=3)r=n[u],o=n[u+e],r?S(e,r,o,i):o(i);t._subscribers.length=0}}function j(){this.error=null}function x(t,n){try{return t(n)}catch(t){return it.error=t,it}}function S(t,n,e,r){var i=o(e),u=void 0,c=void 0,s=void 0,a=void 0;if(i){if(u=x(e,r),u===it?(a=!0,c=u.error,u.error=null):s=!0,n===u)return void T(n,v())}else u=r,s=!0;n._state!==nt||(i&&s?w(n,u):a?T(n,c):t===et?E(n,u):t===rt&&T(n,u))}function C(t,n){try{n(function(n){w(t,n)},function(n){T(t,n)})}catch(n){T(t,n)}}function O(){return ut++}function P(t){t[tt]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function L(t,n){this._instanceConstructor=t,this.promise=new t(h),this.promise[tt]||P(this.promise),B(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?E(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&E(this.promise,this._result))):T(this.promise,M())}function M(){return new Error("Array Methods must be provided an Array")}function N(t){return new L(this,t).promise}function D(t){var n=this;return new n(B(t)?function(e,r){for(var o=t.length,i=0;i<o;i++)n.resolve(t[i]).then(e,r)}:function(t,n){return n(new TypeError("You must pass an array to race."))})}function F(t){var n=this,e=new n(h);return T(e,t),e}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function R(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(t){this[tt]=O(),this._result=this._state=void 0,this._subscribers=[],h!==t&&("function"!=typeof t&&K(),this instanceof q?C(this,t):R())}function U(){var t=void 0;if(void 0!==r)t=r;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 n=t.Promise;if(n){var e=null;try{e=Object.prototype.toString.call(n.resolve())}catch(t){}if("[object Promise]"===e&&!n.cast)return}t.Promise=q}var Y=void 0;Y=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=Y,H=0,W=void 0,G=void 0,I=function(t,n){Z[H]=t,Z[H+1]=n,2===(H+=2)&&(G?G(a):$())},z="undefined"!=typeof window?window:void 0,J=z||{},Q=J.MutationObserver||J.WebKitMutationObserver,V="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),X="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),$=void 0;$=V?function(){return function(){return n.nextTick(a)}}():Q?function(){var t=0,n=new Q(a),e=document.createTextNode("");return n.observe(e,{characterData:!0}),function(){e.data=t=++t%2}}():X?function(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}():void 0===z?function(){try{var t=e(3);return W=t.runOnLoop||t.runOnContext,c()}catch(t){return s()}}():s();var tt=Math.random().toString(36).substring(16),nt=void 0,et=1,rt=2,ot=new j,it=new j,ut=0;return L.prototype._enumerate=function(t){for(var n=0;this._state===nt&&n<t.length;n++)this._eachEntry(t[n],n)},L.prototype._eachEntry=function(t,n){var e=this._instanceConstructor,r=e.resolve;if(r===l){var o=d(t);if(o===f&&t._state!==nt)this._settledAt(t._state,n,t._result);else if("function"!=typeof o)this._remaining--,this._result[n]=t;else if(e===q){var i=new e(h);g(i,t,o),this._willSettleAt(i,n)}else this._willSettleAt(new e(function(n){return n(t)}),n)}else this._willSettleAt(r(t),n)},L.prototype._settledAt=function(t,n,e){var r=this.promise;r._state===nt&&(this._remaining--,t===rt?T(r,e):this._result[n]=e),0===this._remaining&&E(r,this._result)},L.prototype._willSettleAt=function(t,n){var e=this;A(t,void 0,function(t){return e._settledAt(et,n,t)},function(t){return e._settledAt(rt,n,t)})},q.all=N,q.race=D,q.resolve=l,q.reject=F,q._setScheduler=i,q._setAsap=u,q._asap=I,q.prototype={constructor:q,then:f,catch:function(t){return this.then(null,t)}},q.polyfill=U,q.Promise=q,q})}).call(n,e(1),e(2))},function(t,n){function e(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===e||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(n){try{return f.call(null,t,0)}catch(n){return f.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(n){try{return l.call(null,t)}catch(n){return l.call(this,t)}}}function u(){d&&p&&(d=!1,p.length?v=p.concat(v):m=-1,v.length&&c())}function c(){if(!d){var t=o(u);d=!0;for(var n=v.length;n;){for(p=v,v=[];++m<n;)p&&p[m].run();m=-1,n=v.length}p=null,d=!1,i(t)}}function s(t,n){this.fun=t,this.array=n}function a(){}var f,l,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:e}catch(t){f=e}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,v=[],d=!1,m=-1;h.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];v.push(new s(t,n)),1!==v.length||d||o(c)},s.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=a,h.addListener=a,h.once=a,h.off=a,h.removeListener=a,h.removeAllListeners=a,h.emit=a,h.prependListener=a,h.prependOnceListener=a,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,n){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n){},function(t,n,e){"use strict";function r(t,n,e,r){return'<div class="page">\n <div data-name="js-close" class="close-button"></div>\n <header>'+t+'</header>\n <div class="content-area">\n '+n.replace(/\n/g,"<br>")+"\n "+e+'\n </div>\n <div class="action-area">\n <div class="button-strip"> '+r.map(function(t,n){return"<button tabindex="+n+' data-name="js-'+t.toLowerCase()+'">'+t+"</button>"}).join("")+"\n </div>\n </div>\n </div>"}function o(t,n,e,o,i){var u=v(),c=v(),s=document.createElement("div"),h=["cancel","close","ok"],p=new Promise(function(t,n){var e=i&&!i.cancel,r=function(){};u(t),c(e?r:n)}),m=r(t,n,e,o);return s.innerHTML=m,s.className="smalltalk",document.body.appendChild(s),f(s,["ok","input"]).forEach(function(t){return t.focus()}),f(s,["input"]).forEach(function(t){t.setSelectionRange(0,e.length)}),l("click",s,h,function(t){return a(t.target,s,u(),c())}),["click","contextmenu"].forEach(function(t){return s.addEventListener(t,function(){return f(s,["ok","input"]).forEach(function(t){return t.focus()})})}),s.addEventListener("keydown",d(s,u(),c())),p}function i(t,n,e,r){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},i=r.keyCode,l=r.target,h=["ok","cancel","input"],p=f(t,h).map(u);switch(i){case o.ENTER:a(l,t,n,e),r.preventDefault();break;case o.ESC:m(),e();break;case o.TAB:r.shiftKey&&s(t,p),s(t,p),r.preventDefault();break;default:["left","right","up","down"].filter(function(t){return i===o[t.toUpperCase()]}).forEach(function(){c(t,p)})}r.stopPropagation()}function u(t){return t.getAttribute("data-name").replace("js-","")}function c(t,n){var e=document.activeElement,r=u(e),o=/ok|cancel/.test(r),i=n.length-1;if("input"!==r&&i&&o){f(t,[function(t){return"cancel"===t?"ok":"cancel"}(r)]).forEach(function(t){t.focus()})}}function s(t,n){var e=document.activeElement,r=u(e),o=n.length-1,i=n.indexOf(r);f(t,[n[g(o,i)]]).forEach(function(t){return t.focus()})}function a(t,n,e,r){if(/close|cancel/.test(t.getAttribute("data-name").replace("js-","")))return r(),void m();e(f(n,["input"]).reduce(function(t,n){return n.value},null)),m()}function f(t,n){var e=function(t){return t};return n.map(function(n){return t.querySelector('[data-name="js-'+n+'"]')}).filter(e)}function l(t,n,e,r){f(n,e).forEach(function(n){return n.addEventListener(t,r)})}function h(t){var n=document.querySelector(t);n.parentElement.removeChild(n)}window.Promise=window.Promise||e(0);var p=e(5),v=e(7),d=p(i),m=function(t){for(var n=arguments.length,e=Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];return function(){return t.apply(void 0,e)}}(h,".smalltalk"),y=["OK"],_=["OK","Cancel"];n.alert=function(t,n){return o(t,n,"",y,{cancel:!1})},n.prompt=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments[3];return o(t,n,'<input type="text" value="'+String(e).replace(/"/g,"&quot;")+'" data-name="js-input">',_,r)},n.confirm=function(t,n,e){return o(t,n,"",_,e)};var g=function(t,n){return n===t?0:n+1}},function(t,n,e){t.exports=e(6)},function(t,n,e){"use strict";function r(t){if("function"!=typeof t)throw Error("fn should be function!")}var o=function(t){return[function(n){return t.apply(void 0,arguments)},function(n,e){return t.apply(void 0,arguments)},function(n,e,r){return t.apply(void 0,arguments)},function(n,e,r,o){return t.apply(void 0,arguments)},function(n,e,r,o,i){return t.apply(void 0,arguments)}]};t.exports=function t(n){for(var e=arguments.length,i=Array(e>1?e-1:0),u=1;u<e;u++)i[u-1]=arguments[u];if(r(n),i.length>=n.length)return n.apply(void 0,i);var c=function(){return t.apply(void 0,[n].concat(i,Array.prototype.slice.call(arguments)))},s=n.length-i.length-1;return o(c)[s]||c}},function(t,n,e){t.exports=e(8)},function(t,n,e){"use strict";t.exports=function(){var t={};return function(n){return arguments.length?(t.value=n,n):t.value}}}]);
//# sourceMappingURL=smalltalk.poly.min.js.map