2020-09-11 23:27:47 +00:00
|
|
|
System.register([],(function(t){"use strict";return{execute:function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var check=function(t){return t&&t.Math==Math&&t},r=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof e&&e)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},n=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a={f:i&&!o.call({1:2},1)?function propertyIsEnumerable(t){var e=i(this,t);return!!e&&e.enumerable}:o},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},c={}.toString,classofRaw=function(t){return c.call(t).slice(8,-1)},s="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?s.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},l={}.hasOwnProperty,has=function(t,e){return l.call(t,e)},f=r.document,p=isObject(f)&&isObject(f.createElement),documentCreateElement=function(t){return p?f.createElement(t):{}},h=!n&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),d=Object.getOwnPropertyDescriptor,g={f:n?d:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),h)try{return d(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!a.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},m=Object.defineProperty,v={f:n?m:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),h)try{return m(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},y=n?function(t,e,r){return v.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,e){try{y(r,t,e)}catch(n){r[t]=e}return e},b="__core-js_shared__",w=r[b]||setGlobal(b,{}),S=Function.toString;"function"!=typeof w.inspectSource&&(w.inspectSource=function(t){return S.call(t)});var x,_,E,O=w.inspectSource,k=r.WeakMap,j="function"==typeof k&&/native code/.test(O(k)),L=createCommonjsModule((function(t){(t.exports=function(t,e){return w[t]||(w[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),A=0,P=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++A+P).toString(36)},I=L("keys"),sharedKey=function(t){return I[t]||(I[t]=uid(t))},R={},T=r.WeakMap;if(j){var U=new T,C=U.get,M=U.has,G=U.set;x=function(t,e){return G.call(U,t,e),e},_=function(t){return C.call(U,t)||{}},E=function(t){return M.call(U,t)}}else{var N=sharedKey("state");R[N]=!0,x=function(t,e){return y(t,N,e),e},_=function(t){return has(t,N)?t[N]:{}},E=function(t){return has(t,N)}}var D,B={set:x,get:_,has:E,enforce:function(t){return E(t)?_(t):x(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=_(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},q=cr
|
2020-09-06 06:32:10 +00:00
|
|
|
/**
|
2020-09-11 23:27:47 +00:00
|
|
|
* @file ext-imagelib.js
|
|
|
|
*
|
2020-09-08 23:35:47 +00:00
|
|
|
* @license MIT
|
|
|
|
*
|
|
|
|
* @copyright 2010 Alexis Deveria
|
|
|
|
*
|
2020-10-05 20:01:57 +00:00
|
|
|
*/var Sa=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t){var e;return regeneratorRuntime.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,__variableDynamicImportRuntime0__("./locale/".concat(encodeURIComponent(t),".js"));case 3:e=r.sent,r.next=12;break;case 6:return r.prev=6,r.t0=r.catch(0),console.error("Missing translation (".concat(t,") - using 'en'")),r.next=11,Promise.resolve().then((function(){return _a}));case 11:e=r.sent;case 12:return r.abrupt("return",e.default);case 13:case"end":return r.stop()}}),_callee,null,[[0,6]])})));return function loadExtensionTranslation(e){return t.apply(this,arguments)}}(),xa=(t("default",{name:"imagelib",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee3(){var r,n,o,i,a,c,s,u,l,f,p,h,d,g,m,v,y,b,w,S,x;return regeneratorRuntime.wrap((function _callee3$(_){for(;;)switch(_.prev=_.next){case 0:return S=function _showBrowser(){var t=r("#imgbrowse");if(t.length)r("#imgbrowse_holder").show();else{r("<div id=imgbrowse_holder><div id=imgbrowse class=toolbar_button></div></div>").insertAfter("#svg_docprops"),t=r("#imgbrowse");var e=a.select_lib,n=r("<ul id=imglib_opts>").appendTo(t),o=r('<iframe src="javascript:0"/>').prependTo(t).hide().wrap("<div id=lib_framewrap>"),i=r("<h1>").prependTo(t).text(e).css({position:"absolute",top:0,left:0,width:"100%"}),s=r("<button>"+c.common.cancel+"</button>").appendTo(t).on("click touchend",(function(){r("#imgbrowse_holder").hide()})).css({position:"absolute",top:5,right:-10}),u=r("<span>").css({position:"absolute",top:5,left:10}).appendTo(t),l=r("<button hidden>"+a.show_list+"</button>").appendTo(u).on("click touchend",(function(){o.attr("src","about:blank").hide(),n.show(),i.text(e),l.hide()})).css({"margin-right":5}).hide();r("<select><option value=s>"+a.import_single+"</option><option value=m>"+a.import_multi+"</option><option value=o>"+a.open+"</option></select>").appendTo(u).change((function(){switch(h=r(this).val()){case"s":case"o":w(!1);break;case"m":w(!0)}})).css({"margin-top":10}),s.prepend(r.getSvgIcon("cancel",!0)),l.prepend(r.getSvgIcon("tool_imagelib",!0)),a.imgLibs.forEach((function(t){var e=t.name,a=t.url,c=t.description;r("<li>").appendTo(n).text(e).on("click touchend",(function(){o.attr("src",a).show(),i.text(e),n.hide(),l.show()})).append("<span>".concat(c,"</span>"))}))}},w=function _toggleMulti(t){r("#lib_framewrap, #imglib_opts").css({right:t?200:10}),m||(m=r("<div id=imglib_preview>").css({position:"absolute",top:45,right:10,width:180,bottom:45,background:"#fff",overflow:"auto"}).insertAfter("#lib_framewrap"),v=r("<button disabled>Import selected</button>").appendTo("#imgbrowse").on("click touchend",(function(){r.each(d,(function(t){var e=this[0],r=this[1];"svg"===e?s.importSvgString(r):f(r),s.moveSelectedElements(20*t,20*t,!1)})),m.empty(),d=[],r("#imgbrowse_holder").hide()})).css({position:"absolute",bottom:10,right:-10})),m.toggle(t),v.toggle(t)},b=function _onMessage3(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t){var e,a,y,b,w,S,x,_,E,O,k,j,L,A,P,I,R;return regeneratorRuntime.wrap((function _callee2$(T){for(;;)switch(T.prev=T.next){case 0:if(e=t.origin,(a=t.data)&&["string","object"].includes(_typeof(a))){T.next=3;break}return T.abrupt("return");case 3:if(T.prev=3,"imagelib"===(a="object"===_typeof(a)?a:JSON.parse(a)).namespace){T.next=7;break}return T.abrupt("return");case 7:if(u.includes("*")||u.includes(e)){T.next=10;break}return console.log("Origin ".concat(e," not whitelisted for posting to ").concat(window.origin)),T.abrupt("return");case 10:if(S="href"in a,(w="name"in a)||!g){T.next=15;break}return g=!1,T.abrupt("return");case 15:S&&(y=a.href,a=a.data),r("#dialog_box").hide(),b=w?"meta":a.charAt(0),T.next=28;break;case 20:if(T.prev=20,T.t0=T.catch(3),"string"!=typeof a){T.next=28;break}if("{"===(x=a.charAt(0))||!g){T.next=27;break}return g=!1,T.abrupt("return");case 27:"|"===x&&(_=a.indexOf("|",1),y=a.substr(1,_-1),a=a.substr(_+1),b=a.charAt(0));case 28:T.t1=b,T.next="m
|