svgedit/dist/editor/system/extensions/ext-panning/ext-panning.js

12 lines
50 KiB
JavaScript
Raw Normal View History

2020-09-10 06:24:38 +00:00
System.register([],(function(t,e){"use strict";return{execute:function(){var r="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},n=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r&&r)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},o=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),i={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,a={f:c&&!i.call({1:2},1)?function propertyIsEnumerable(t){var e=c(this,t);return!!e&&e.enumerable}:i},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},u={}.toString,classofRaw=function(t){return u.call(t).slice(8,-1)},f="".split,s=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?f.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 s(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)},p=n.document,h=isObject(p)&&isObject(p.createElement),documentCreateElement=function(t){return h?p.createElement(t):{}},v=!o&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),y=Object.getOwnPropertyDescriptor,d={f:o?y:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),v)try{return y(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},g=Object.defineProperty,m={f:o?g:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),v)try{return g(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}},b=o?function(t,e,r){return m.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,e){try{b(n,t,e)}catch(r){n[t]=e}return e},w="__core-js_shared__",x=n[w]||setGlobal(w,{}),S=Function.toString;"function"!=typeof x.inspectSource&&(x.inspectSource=function(t){return S.call(t)});var E,O,j,P=x.inspectSource,T=n.WeakMap,A="function"==typeof T&&/native code/.test(P(T)),I=createCommonjsModule((function(t){(t.exports=function(t,e){return x[t]||(x[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),_=0,L=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++_+L).toString(36)},k=I("keys"),sharedKey=function(t){return k[t]||(k[t]=uid(t))},R={},C=n.WeakMap;if(A){var M=new C,G=M.get,N=M.has,D=M.set;E=function(t,e){return D.call(M,t,e),e},O=function(t){return G.call(M,t)||{}},j=function(t){return N.call(M,t)}}else{var U=sharedKey("state");R[U]=!0,E=function(t,e){return b(t,U,e),e},O=function(t){return has(t,U)?t[U]:{}},j=function(t){return has(t,U)}}var $,W,q={set:E,get:O,has:j,enforce:function(t){return j(t)?O(t):E(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=O(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},
/**
* Localizing script for SVG-edit UI.
* @module locale
* @license MIT
*
* @copyright 2010 Narendra Sisodya
* @copyright 2010 Alexis Deveria
*
*/
jQuery;var ii=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,r){var n;return regeneratorRuntime.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,e.import("./extensions/ext-".concat(t,"/locale/").concat(r,".js"));case 3:n=o.sent,o.next=12;break;case 6:return o.prev=6,o.t0=o.catch(0),console.error("Missing translation (".concat(r,") for extension ").concat(t," - using 'en'")),o.next=11,e.import("./extensions/ext-".concat(t,"/locale/en.js"));case 11:n=o.sent;case 12:return o.abrupt("return",n.default);case 13:case"end":return o.stop()}}),_callee2,null,[[0,6]])})));return function loadExtensionTranslation(e,r){return t.apply(this,arguments)}}();t("default",{name:"panning",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var r,n,o,i;return regeneratorRuntime.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:return t.importLocale,r=e,c.next=4,ii("panning",r.curPrefs.lang);case 4:return n=c.sent,o=r.canvas,i=[{id:"ext-panning",icon:"panning.png",type:"mode",events:{click:function click(){o.setMode("ext-panning")}}}],c.abrupt("return",{name:n.name,svgicons:"ext-panning.xml",buttons:n.buttons.map((function(t,e){return Object.assign(i[e],t)})),mouseDown:function mouseDown(){if("ext-panning"===o.getMode())return r.setPanning(!0),{started:!0}},mouseUp:function mouseUp(){if("ext-panning"===o.getMode())return r.setPanning(!1),{keep:!1,element:null}}});case 8:case"end":return c.stop()}}),_callee)})))()}})}}}));