Files
HTCloud/HT.Cloud.Web/wwwroot/lib/drawio-embed/drawio-embed.min.js

1 line
7.2 KiB
JavaScript
Raw Normal View History

2025-02-19 16:05:53 +08:00
!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = e || self).drawioEmbed = t() }(this, function () { "use strict"; function e(t) { return (e = "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 })(t) } function t(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } function n(e, t) { for (var n = 0; t.length > n; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } function i(e, t, i) { return t && n(e.prototype, t), i && n(e, i), e } function o(e) { return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e) })(e) } function r(e, t) { return (r = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e })(e, t) } function a(e, t) { return !t || "object" != typeof t && "function" != typeof t ? function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e }(e) : t } function s(e) { var t = function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(Reflect.construct(Date, [], function () { })), !0 } catch (e) { return !1 } }(); return function () { var n, i = o(e); if (t) { var r = o(this).constructor; n = Reflect.construct(i, arguments, r) } else n = i.apply(this, arguments); return a(this, n) } } function c(e, t, n) { var i = function (e) { var t = document.createElement("div"); null != t.textContent ? t.textContent = e : t.innerText = e; var n = t.innerHTML; return t = null, n }(e); t = t.split(",")[1], t = atob(t); for (var o = new Uint8Array(t.length), r = 0; t.length > r; r++)o[r] = t.charCodeAt(r); var a = new Blob([o], { type: "image/svg+xml" }), s = new FileReader; s.readAsText(a), s.onload = function () { "function" == typeof n && n(s.result.replace("<svg ", "<svg content='".concat(i, "' "))) } } function u(e, t) { return function (e) { var t = {}; return (e || "").replace(/([^?&=/]+)=([^?&=/]*)/g, function (e, n, i) { return t[decodeURIComponent(n)] = decodeURIComponent(i) }), t }(e.split("?")[1])[t] } var d = "embed=1&ui=atlas&spin=1&proto=json&lang=zh", f = function () { function e() { t(this, e), this.savingSto = null, this.isSaving = !1 } return i(e, [{ key: "setSavingFlag", value: function () { var e = this; this.clearSavingFlag(), this.isSaving = !0, this.savingSto = setTimeout(function () { e.isSaving = !1 }, 5e3) } }, { key: "clearSavingFlag", value: function () { this.isSaving = !1, clearTimeout(this.savingSto) } }, { key: "checkReady", value: function (e) { var t = this, n = 0, i = setInterval(function () { 100 >= ++n && t.isSaving || (clearInterval(i), e()) }, 50) } }]), e }(); return (new (function (n) { !function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && r(e, t) }(a, f); var o = s(a); function a() { var e; t(this, a); for (var n = arguments.length, i = [], r = 0; n > r; r++)i[r] = arguments[r]; return (e = o.call.apply(o, [this].concat(i))).drawioIframe = null, e.isIframeVisible = !1, e.closeHolding = !1, e.initialized = !1, e.drawioFrameLoaded = !1, e.eventListenerBound = !1, e.iframeInserted = !1, e.drawioUrl = "", e.closeIframe = function () { var t = new Event("drawioClosed"); window.dispatchEvent(t), e.hideIframe() }, e.isOpen = function () { return e.isIframeVisible }, e.isLoaded = function () { return e.initialized }, e.editImage = function (t) { return e.drawioFrameLoaded ? t ? 0 === t.ind