mxcad 1.0.382 → 1.0.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mxcad.es.js CHANGED
@@ -2740,321 +2740,6 @@ try {
2740
2740
  }
2741
2741
  }
2742
2742
 
2743
- function b64Encode(str) {
2744
- return btoa(unescape(encodeURIComponent(str)));
2745
- }
2746
- function b64Decode(str) {
2747
- return decodeURIComponent(escape(atob(str)));
2748
- }
2749
- function crateHexString(str) {
2750
- return Array.from(new TextEncoder().encode(str)).map(function (byte) {
2751
- return byte.toString(16).padStart(2, "0");
2752
- }).join("");
2753
- }
2754
- function saveAsFileDialog(_x) {
2755
- return _saveAsFileDialog.apply(this, arguments);
2756
- }
2757
- function _saveAsFileDialog() {
2758
- _saveAsFileDialog = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee3(_ref) {
2759
- var blob, _ref$filename, filename, _ref$types, types, _window$navigator, userActivation, handle, writable, blobWithTypeName, objectUrl, link;
2760
- return regenerator.wrap(function _callee3$(_context3) {
2761
- while (1) switch (_context3.prev = _context3.next) {
2762
- case 0:
2763
- blob = _ref.blob, _ref$filename = _ref.filename, filename = _ref$filename === void 0 ? "" : _ref$filename, _ref$types = _ref.types, types = _ref$types === void 0 ? [{
2764
- description: "mxweb File",
2765
- accept: {
2766
- "application/octet-stream": [".mxweb"]
2767
- }
2768
- }] : _ref$types;
2769
- if (blob) {
2770
- _context3.next = 4;
2771
- break;
2772
- }
2773
- console.error("Invalid blob provided");
2774
- return _context3.abrupt("return");
2775
- case 4:
2776
- _context3.prev = 4;
2777
- if (!(typeof window.showSaveFilePicker === "function")) {
2778
- _context3.next = 31;
2779
- break;
2780
- }
2781
- userActivation = (_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userActivation;
2782
- if (!(userActivation !== null && userActivation !== void 0 && userActivation.isActive || userActivation !== null && userActivation !== void 0 && userActivation.hasBeenActive)) {
2783
- _context3.next = 30;
2784
- break;
2785
- }
2786
- _context3.prev = 8;
2787
- _context3.next = 11;
2788
- return window.showSaveFilePicker({
2789
- suggestedName: filename,
2790
- types: types
2791
- });
2792
- case 11:
2793
- handle = _context3.sent;
2794
- _context3.next = 14;
2795
- return handle.createWritable();
2796
- case 14:
2797
- writable = _context3.sent;
2798
- _context3.next = 17;
2799
- return writable.write(blob);
2800
- case 17:
2801
- _context3.next = 19;
2802
- return writable.close();
2803
- case 19:
2804
- return _context3.abrupt("return", handle);
2805
- case 22:
2806
- _context3.prev = 22;
2807
- _context3.t0 = _context3["catch"](8);
2808
- if (!(_context3.t0.name === "AbortError")) {
2809
- _context3.next = 27;
2810
- break;
2811
- }
2812
- console.log("\u7528\u6237\u53D6\u6D88\u6216\u6743\u9650\u88AB\u62D2");
2813
- return _context3.abrupt("return", false);
2814
- case 27:
2815
- if (_context3.t0.name === "AbortError" || _context3.t0.name === "NotAllowedError") {
2816
- console.warn("Save cancelled or not allowed:", _context3.t0.message);
2817
- } else {
2818
- console.error("showSaveFilePicker failed:", _context3.t0);
2819
- }
2820
- case 28:
2821
- _context3.next = 31;
2822
- break;
2823
- case 30:
2824
- console.warn("No user activation, skipping showSaveFilePicker");
2825
- case 31:
2826
- if (!(window.navigator.msSaveOrOpenBlob && typeof window.navigator.msSaveOrOpenBlob === "function")) {
2827
- _context3.next = 35;
2828
- break;
2829
- }
2830
- blobWithTypeName = blob.slice(0, blob.size, blob.type || "application/octet-stream");
2831
- window.navigator.msSaveOrOpenBlob(blobWithTypeName, filename);
2832
- return _context3.abrupt("return");
2833
- case 35:
2834
- objectUrl = window.URL.createObjectURL(blob);
2835
- link = document.createElement("a");
2836
- link.href = objectUrl;
2837
- link.download = filename;
2838
- link.style.display = "none";
2839
- document.body.appendChild(link);
2840
- link.click();
2841
- setTimeout(function () {
2842
- window.URL.revokeObjectURL(objectUrl);
2843
- }, 100);
2844
- document.body.removeChild(link);
2845
- return _context3.abrupt("return");
2846
- case 47:
2847
- _context3.prev = 47;
2848
- _context3.t1 = _context3["catch"](4);
2849
- console.error("File save failed:", _context3.t1.name, _context3.t1.message);
2850
- case 50:
2851
- case "end":
2852
- return _context3.stop();
2853
- }
2854
- }, _callee3, null, [[4, 47], [8, 22]]);
2855
- }));
2856
- return _saveAsFileDialog.apply(this, arguments);
2857
- }
2858
- function downloadFile(blob, filename) {
2859
- var link = document.createElement("a");
2860
- link.href = window.URL.createObjectURL(blob);
2861
- link.download = filename;
2862
- link.click();
2863
- }
2864
- function downloadFileFromUrl(url, filename) {
2865
- fetch(url).then(function (response) {
2866
- return response.blob();
2867
- }).then(function (blob) {
2868
- var link = document.createElement("a");
2869
- link.href = window.URL.createObjectURL(blob);
2870
- link.download = filename;
2871
- link.click();
2872
- });
2873
- }
2874
- var getJsonFromUrl = /*#__PURE__*/function () {
2875
- var _ref2 = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee(url) {
2876
- return regenerator.wrap(function _callee$(_context) {
2877
- while (1) switch (_context.prev = _context.next) {
2878
- case 0:
2879
- _context.prev = 0;
2880
- _context.next = 3;
2881
- return fetch(url);
2882
- case 3:
2883
- _context.next = 5;
2884
- return _context.sent.json();
2885
- case 5:
2886
- return _context.abrupt("return", _context.sent);
2887
- case 8:
2888
- _context.prev = 8;
2889
- _context.t0 = _context["catch"](0);
2890
- console.error("MxTip:error getJsonFromurl:" + url);
2891
- case 11:
2892
- case "end":
2893
- return _context.stop();
2894
- }
2895
- }, _callee, null, [[0, 8]]);
2896
- }));
2897
- return function getJsonFromUrl(_x2) {
2898
- return _ref2.apply(this, arguments);
2899
- };
2900
- }();
2901
- var getFileFromUrl = /*#__PURE__*/function () {
2902
- var _ref3 = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee2(url) {
2903
- return regenerator.wrap(function _callee2$(_context2) {
2904
- while (1) switch (_context2.prev = _context2.next) {
2905
- case 0:
2906
- _context2.prev = 0;
2907
- _context2.next = 3;
2908
- return fetch(url);
2909
- case 3:
2910
- return _context2.abrupt("return", _context2.sent);
2911
- case 6:
2912
- _context2.prev = 6;
2913
- _context2.t0 = _context2["catch"](0);
2914
- console.error("MxTip:error getFileFromUrl:" + url);
2915
- case 9:
2916
- case "end":
2917
- return _context2.stop();
2918
- }
2919
- }, _callee2, null, [[0, 6]]);
2920
- }));
2921
- return function getFileFromUrl(_x3) {
2922
- return _ref3.apply(this, arguments);
2923
- };
2924
- }();
2925
- function _ML_String(strId, str) {
2926
- return MxFun.getLanguageString(strId, str);
2927
- }
2928
- function IsZero(val) {
2929
- return Math.abs(val) < 1e-7;
2930
- }
2931
- function postMemoryFile(memoryData, url, filename, retCall, param) {
2932
- try {
2933
- var formData = new FormData();
2934
- var blob = new Blob([memoryData], {
2935
- type: "application/octet-stream"
2936
- });
2937
- formData.append("file", new File([blob], filename));
2938
- if (param) formData.append("param", param);
2939
- var xhr = new XMLHttpRequest();
2940
- xhr.open("POST", url);
2941
- xhr.send(formData);
2942
- xhr.onreadystatechange = function () {
2943
- if (xhr.readyState === XMLHttpRequest.DONE) {
2944
- if (xhr.status === 200) {
2945
- retCall(0, xhr.responseText);
2946
- } else {
2947
- console.log(xhr.responseText);
2948
- retCall(4, "server error");
2949
- }
2950
- }
2951
- };
2952
- } catch (error) {
2953
- retCall(-1, "catch error");
2954
- }
2955
- }
2956
- function postEmscriptenIndexedDBFile(filekey, url, retCall, param) {
2957
- var request = window.indexedDB.open("emscripten_filesystem", 1);
2958
- request.onerror = function () {
2959
- retCall(1, "open emscripten_filesystem failed");
2960
- };
2961
- request.onsuccess = function (event) {
2962
- try {
2963
- if (event.target != null) {
2964
- var db = event.target.result;
2965
- var transaction = db.transaction("FILES", "readonly");
2966
- var objectStore = transaction.objectStore("FILES");
2967
- var request2 = objectStore.get(filekey);
2968
- request2.onerror = function () {
2969
- retCall(3, "get file error");
2970
- };
2971
- request2.onsuccess = function () {
2972
- var file = request2.result;
2973
- if (file) {
2974
- var formData = new FormData();
2975
- formData.append("file", file);
2976
- if (param) formData.append("param", param);
2977
- var xhr = new XMLHttpRequest();
2978
- xhr.open("POST", url);
2979
- xhr.send(formData);
2980
- xhr.onreadystatechange = function () {
2981
- if (xhr.readyState === XMLHttpRequest.DONE) {
2982
- if (xhr.status === 200) {
2983
- retCall(0, xhr.responseText);
2984
- } else {
2985
- console.log(xhr.responseText);
2986
- retCall(4, "server error");
2987
- }
2988
- }
2989
- };
2990
- } else {
2991
- retCall(5, "get file data error");
2992
- }
2993
- };
2994
- } else {
2995
- retCall(2, "event.target == null");
2996
- }
2997
- } catch (error) {
2998
- retCall(-1, "catch error");
2999
- }
3000
- };
3001
- }
3002
- function createCursorHelp() {
3003
- var canvasSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128;
3004
- var squareSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
3005
- var isRoss = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3006
- var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "#ffffff";
3007
- var canvas = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document.createElement("canvas");
3008
- var background = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "transparent";
3009
- canvas.width = canvas.height = canvasSize;
3010
- canvas.style.background = background;
3011
- var ctx = canvas.getContext("2d");
3012
- var canvasDevil = canvasSize % 2 === 0 ? -0.5 : 0;
3013
- var squareDevil = squareSize % 2 === 0 ? -0.5 : 0;
3014
- ctx.strokeStyle = color;
3015
- ctx.lineWidth = 0;
3016
- ctx.imageSmoothingEnabled = false;
3017
- if (isRoss) {
3018
- ctx.beginPath();
3019
- ctx.moveTo(canvas.width / 2 + canvasDevil, canvasDevil);
3020
- ctx.lineTo(canvas.width / 2 + canvasDevil, canvas.height + canvasDevil);
3021
- ctx.stroke();
3022
- ctx.beginPath();
3023
- ctx.moveTo(canvasDevil, canvas.height / 2 + canvasDevil);
3024
- ctx.lineTo(canvas.width + canvasDevil, canvas.height / 2 + canvasDevil);
3025
- ctx.stroke();
3026
- }
3027
- ctx.beginPath();
3028
- ctx.strokeRect(canvasSize / 2 - squareSize / 2 + squareDevil, canvasSize / 2 - squareSize / 2 + squareDevil, squareSize, squareSize);
3029
- ctx.stroke();
3030
- return canvas.toDataURL("image/png");
3031
- }
3032
- function createCursor() {
3033
- var cursorSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128;
3034
- var targetFrameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
3035
- var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#ffffff";
3036
- return {
3037
- Rect: "url('".concat(createCursorHelp(cursorSize, targetFrameSize, false, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, ", auto"),
3038
- Cross: "url('".concat(createCursorHelp(cursorSize, 0, true, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, " , auto"),
3039
- Normal: "url('".concat(createCursorHelp(cursorSize, targetFrameSize, true, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, ", auto"),
3040
- Pan: "grabbing"
3041
- };
3042
- }
3043
- var MxTools = {
3044
- b64Encode: b64Encode,
3045
- b64Decode: b64Decode,
3046
- saveAsFileDialog: saveAsFileDialog,
3047
- downloadFile: downloadFile,
3048
- downloadFileFromUrl: downloadFileFromUrl,
3049
- getJsonFromUrl: getJsonFromUrl,
3050
- getFileFromUrl: getFileFromUrl,
3051
- _ML_String: _ML_String,
3052
- IsZero: IsZero,
3053
- postEmscriptenIndexedDBFile: postEmscriptenIndexedDBFile,
3054
- postMemoryFile: postMemoryFile,
3055
- createCursor: createCursor
3056
- };
3057
-
3058
2743
  function _classCallCheck$1(instance, Constructor) {
3059
2744
  if (!(instance instanceof Constructor)) {
3060
2745
  throw new TypeError("Cannot call a class as a function");
@@ -3120,175 +2805,6 @@ function _defineProperty(obj, key, value) {
3120
2805
  return obj;
3121
2806
  }
3122
2807
 
3123
- var MxCanvas2Image = /*#__PURE__*/function () {
3124
- function MxCanvas2Image() {
3125
- var in_document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : void 0;
3126
- _classCallCheck$1(this, MxCanvas2Image);
3127
- _defineProperty(this, "$support", void 0);
3128
- _defineProperty(this, "downloadMime", "image/octet-stream");
3129
- _defineProperty(this, "mydocument", document);
3130
- if (in_document) this.mydocument = in_document;
3131
- this.$support = function () {
3132
- var canvas = in_document.createElement("canvas"),
3133
- ctx = canvas.getContext("2d");
3134
- return {
3135
- canvas: !!ctx,
3136
- imageData: !!ctx.getImageData,
3137
- dataURL: !!canvas.toDataURL,
3138
- btoa: !!window.btoa
3139
- };
3140
- }();
3141
- }
3142
- _createClass$1(MxCanvas2Image, [{
3143
- key: "scaleCanvas",
3144
- value: function scaleCanvas(canvas, width, height) {
3145
- var w = canvas.width,
3146
- h = canvas.height;
3147
- if (width == void 0) {
3148
- width = w;
3149
- }
3150
- if (height == void 0) {
3151
- height = h;
3152
- }
3153
- var retCanvas = this.mydocument.createElement("canvas");
3154
- var retCtx = retCanvas.getContext("2d");
3155
- retCanvas.width = width;
3156
- retCanvas.height = height;
3157
- retCtx.drawImage(canvas, 0, 0, w, h, 0, 0, width, height);
3158
- return retCanvas;
3159
- }
3160
- }, {
3161
- key: "getDataURL",
3162
- value: function getDataURL(canvas, type, width, height) {
3163
- canvas = this.scaleCanvas(canvas, width, height);
3164
- return canvas.toDataURL(type);
3165
- }
3166
- }, {
3167
- key: "saveFile",
3168
- value: function saveFile(strData) {
3169
- var link = this.mydocument.createElement("a");
3170
- link.href = strData;
3171
- link.download = "save.bmp";
3172
- link.click();
3173
- }
3174
- }, {
3175
- key: "genImage",
3176
- value: function genImage(strData) {
3177
- var img = this.mydocument.createElement("img");
3178
- img.src = strData;
3179
- return img;
3180
- }
3181
- }, {
3182
- key: "fixType",
3183
- value: function fixType(type) {
3184
- type = type.toLowerCase().replace(/jpg/i, "jpeg");
3185
- var r = type.match(/png|jpeg|bmp|gif/)[0];
3186
- return "image/" + r;
3187
- }
3188
- }, {
3189
- key: "encodeData",
3190
- value: function encodeData(data) {
3191
- if (!window.btoa) {
3192
- throw "btoa undefined";
3193
- }
3194
- var str = "";
3195
- if (typeof data == "string") {
3196
- str = data;
3197
- } else {
3198
- for (var i = 0; i < data.length; i++) {
3199
- str += String.fromCharCode(data[i]);
3200
- }
3201
- }
3202
- return btoa(str);
3203
- }
3204
- }, {
3205
- key: "getImageData",
3206
- value: function getImageData(canvas) {
3207
- var w = canvas.width,
3208
- h = canvas.height;
3209
- return canvas.getContext("2d").getImageData(0, 0, w, h);
3210
- }
3211
- }, {
3212
- key: "makeURI",
3213
- value: function makeURI(strData, type) {
3214
- return "data:" + type + ";base64," + strData;
3215
- }
3216
- }, {
3217
- key: "genBitmapImage",
3218
- value: function genBitmapImage(oData) {
3219
- var biWidth = oData.width;
3220
- var biHeight = oData.height;
3221
- var biSizeImage = biWidth * biHeight * 3;
3222
- var bfSize = biSizeImage + 54;
3223
- var BITMAPFILEHEADER = [66, 77, bfSize & 255, bfSize >> 8 & 255, bfSize >> 16 & 255, bfSize >> 24 & 255, 0, 0, 0, 0, 54, 0, 0, 0];
3224
- var BITMAPINFOHEADER = [40, 0, 0, 0, biWidth & 255, biWidth >> 8 & 255, biWidth >> 16 & 255, biWidth >> 24 & 255, biHeight & 255, biHeight >> 8 & 255, biHeight >> 16 & 255, biHeight >> 24 & 255, 1, 0, 24, 0, 0, 0, 0, 0, biSizeImage & 255, biSizeImage >> 8 & 255, biSizeImage >> 16 & 255, biSizeImage >> 24 & 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
3225
- var iPadding = (4 - biWidth * 3 % 4) % 4;
3226
- var aImgData = oData.data;
3227
- var strPixelData = "";
3228
- var biWidth4 = biWidth << 2;
3229
- var y = biHeight;
3230
- var fromCharCode = String.fromCharCode;
3231
- do {
3232
- var iOffsetY = biWidth4 * (y - 1);
3233
- var strPixelRow = "";
3234
- for (var x = 0; x < biWidth; x++) {
3235
- var iOffsetX = x << 2;
3236
- strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) + fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) + fromCharCode(aImgData[iOffsetY + iOffsetX]);
3237
- }
3238
- for (var c = 0; c < iPadding; c++) {
3239
- strPixelRow += String.fromCharCode(0);
3240
- }
3241
- strPixelData += strPixelRow;
3242
- } while (--y);
3243
- var strEncoded = this.encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + this.encodeData(strPixelData);
3244
- return strEncoded;
3245
- }
3246
- }, {
3247
- key: "saveAsImage",
3248
- value: function saveAsImage(canvas, width, height, type) {
3249
- if (this.$support.canvas && this.$support.dataURL) {
3250
- if (typeof canvas == "string") {
3251
- canvas = this.mydocument.getElementById(canvas);
3252
- }
3253
- if (type == void 0) {
3254
- type = "png";
3255
- }
3256
- type = this.fixType(type);
3257
- if (/bmp/.test(type)) {
3258
- var data = this.getImageData(this.scaleCanvas(canvas, width, height));
3259
- var strData = this.genBitmapImage(data);
3260
- this.saveFile(this.makeURI(strData, this.downloadMime));
3261
- } else {
3262
- var _strData = this.getDataURL(canvas, type, width, height);
3263
- this.saveFile(_strData.replace(type, this.downloadMime));
3264
- }
3265
- }
3266
- }
3267
- }, {
3268
- key: "convertToImage",
3269
- value: function convertToImage(canvas, width, height, type) {
3270
- if (this.$support.canvas && this.$support.dataURL) {
3271
- if (typeof canvas == "string") {
3272
- canvas = this.mydocument.getElementById(canvas);
3273
- }
3274
- if (type == void 0) {
3275
- type = "png";
3276
- }
3277
- type = this.fixType(type);
3278
- if (/bmp/.test(type)) {
3279
- var data = this.getImageData(this.scaleCanvas(canvas, width, height));
3280
- var strData = this.genBitmapImage(data);
3281
- return this.genImage(this.makeURI(strData, "image/bmp"));
3282
- } else {
3283
- var _strData2 = this.getDataURL(canvas, type, width, height);
3284
- return this.genImage(_strData2);
3285
- }
3286
- }
3287
- }
3288
- }]);
3289
- return MxCanvas2Image;
3290
- }();
3291
-
3292
2808
  var lib = {exports: {}};
3293
2809
 
3294
2810
  /* eslint-disable node/no-deprecated-api */
@@ -15080,7 +14596,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
15080
14596
  return MxG2312Obj.decodeFromGb2312Imp(hexstr);
15081
14597
  };
15082
14598
 
15083
- const version$1 = "1.0.381";
14599
+ const version$1 = "1.0.383";
15084
14600
 
15085
14601
  var isSharedArrayBuffer = "SharedArrayBuffer" in window;
15086
14602
  var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
@@ -15095,6 +14611,16 @@ var get2DSTFileURL = function get2DSTFileURL(fileName) {
15095
14611
  if (isCdn) return "https://unpkg.com/mxcad@".concat(version$1, "/dist/wasm/2d/").concat(fileName);
15096
14612
  return base + fileName;
15097
14613
  };
14614
+ var get2D64FileURL = function get2D64FileURL(fileName) {
14615
+ var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : self.location.href;
14616
+ if (isCdn) return "https://unpkg.com/mxcad@".concat(version$1, "/dist/wasm/2d-x64-st/").concat(fileName);
14617
+ return base + fileName;
14618
+ };
14619
+ var get2D64STFileURL = function get2D64STFileURL(fileName) {
14620
+ var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : self.location.href;
14621
+ if (isCdn) return "https://unpkg.com/mxcad@".concat(version$1, "/dist/wasm/2d-x64/").concat(fileName);
14622
+ return base + fileName;
14623
+ };
15098
14624
 
15099
14625
  var loadScript = function loadScript(url) {
15100
14626
  return new Promise(function (resolve, reject) {
@@ -15318,8 +14844,53 @@ var McObjectId = /*#__PURE__*/function () {
15318
14844
  this.type = type;
15319
14845
  }
15320
14846
  }
14847
+ if (MxCpp.App.isWasmx64()) {
14848
+ if (this.type == 0 /* kMxCAD */) {
14849
+ if (typeof this.id === "string") {
14850
+ this.id = BigInt(this.id);
14851
+ } else if (typeof this.id === "number") {
14852
+ if (this.id == 0) {
14853
+ this.id = BigInt(0);
14854
+ } else {
14855
+ this.id = BigInt(0);
14856
+ console.log("mx:error id:" + this.id);
14857
+ }
14858
+ }
14859
+ } else if (this.type == 2 /* kInvalid */) {
14860
+ if (this.id == 0) {
14861
+ this.id = BigInt(0);
14862
+ }
14863
+ }
14864
+ }
15321
14865
  }
15322
14866
  _createClass$1(McObjectId, [{
14867
+ key: "initFromCpp",
14868
+ value: function initFromCpp(id) {
14869
+ this.type = 0 /* kMxCAD */;
14870
+ if (MxCpp.App.isWasmx64()) {
14871
+ if (typeof id === "string") {
14872
+ this.id = BigInt(id);
14873
+ } else {
14874
+ this.id = id;
14875
+ }
14876
+ } else {
14877
+ this.id = id;
14878
+ }
14879
+ }
14880
+ }, {
14881
+ key: "getValueFromCpp",
14882
+ value: function getValueFromCpp() {
14883
+ if (this.type == 0 /* kMxCAD */) {
14884
+ if (MxCpp.App.isWasmx64()) {
14885
+ return this.id.toString();
14886
+ } else {
14887
+ return this.id;
14888
+ }
14889
+ } else {
14890
+ return this.id;
14891
+ }
14892
+ }
14893
+ }, {
15323
14894
  key: "isValid",
15324
14895
  value: function isValid() {
15325
14896
  return this.type != 2 /* kInvalid */ && this.id != 0;
@@ -15917,6 +15488,14 @@ var MxCADResbuf = /*#__PURE__*/function (_McRxObject) {
15917
15488
  ret: MxCpp.getCallResult() == 0
15918
15489
  };
15919
15490
  }
15491
+ }, {
15492
+ key: "AtObjectIdValue",
15493
+ value: function AtObjectIdValue(lItem) {
15494
+ return {
15495
+ val: this.imp.AtObjectId(lItem),
15496
+ ret: MxCpp.getCallResult() == 0
15497
+ };
15498
+ }
15920
15499
  }, {
15921
15500
  key: "AtString",
15922
15501
  value: function AtString(lItem) {
@@ -16175,13 +15754,13 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
16175
15754
  }
16176
15755
  if (filter != null || isFilterLockLayer) {
16177
15756
  if (!filter) filter = new MxCADResbuf();
16178
- var _aryId = new McGeLongArray();
15757
+ var aryId_imp = new MxCpp.mxcadassemblyimp.MdGeLongLongArray();
16179
15758
  aryMxCADId.forEach(function (val) {
16180
- _aryId.append(val);
15759
+ aryId_imp.append(val);
16181
15760
  });
16182
15761
  var ssimp = new MxCpp.mxcadassemblyimp.McDrawSelSet();
16183
15762
  ssimp.setFilterLockLayer(isFilterLockLayer);
16184
- var aryOutId = ssimp.getFilterEntity(_aryId.imp, getFilterImp(filter));
15763
+ var aryOutId = ssimp.getFilterEntity(aryId_imp, getFilterImp(filter));
16185
15764
  aryMxCADId = [];
16186
15765
  var len = aryOutId.length();
16187
15766
  for (var k = 0; k < len; k++) {
@@ -18442,7 +18021,7 @@ var McDbBlockReference = /*#__PURE__*/function (_McDbEntity4) {
18442
18021
  for (var i = 0; i < iLen; i++) {
18443
18022
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
18444
18023
  }
18445
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
18024
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
18446
18025
  return ret;
18447
18026
  }
18448
18027
  }, {
@@ -19396,7 +18975,7 @@ var McDbProxyEntity = /*#__PURE__*/function (_McDbEntity8) {
19396
18975
  for (var i = 0; i < iLen; i++) {
19397
18976
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
19398
18977
  }
19399
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
18978
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
19400
18979
  return ret;
19401
18980
  }
19402
18981
  }, {
@@ -20276,7 +19855,7 @@ var MxCustomEntityManagerImp = /*#__PURE__*/function () {
20276
19855
  }, {
20277
19856
  key: "allocId",
20278
19857
  value: function allocId() {
20279
- if (this.alloc_id > 9007199254740900) {
19858
+ if (this.alloc_id > 2147483646) {
20280
19859
  this.alloc_id = 1;
20281
19860
  }
20282
19861
  this.alloc_id += 1;
@@ -20291,7 +19870,7 @@ var MxCustomEntityManagerImp = /*#__PURE__*/function () {
20291
19870
  key: "createMxEntity",
20292
19871
  value: function createMxEntity(typeName, imp) {
20293
19872
  if (typeName.length == 0) {
20294
- console.log("MxTip:assert(0) typeName is empty ");
19873
+ console.log("mx:assert(0) typeName is empty ");
20295
19874
  return null;
20296
19875
  }
20297
19876
  var create = this.mapType2Create.get(typeName);
@@ -20411,11 +19990,13 @@ var MxCustomEntityManagerImp = /*#__PURE__*/function () {
20411
19990
  ent = MxCustomEntityManager.getObject(customid, indexIdDatabase);
20412
19991
  }
20413
19992
  if (!ent) return;
20414
- var mxcadWorldDraw = new MxCADWorldDraw(ptrWorldDraw);
20415
- if (ptrVecOsnapEntity !== 0) mxcadWorldDraw.imp.connectVecOsnapEntity(ptrVecOsnapEntity);
19993
+ var mxcadWorldDraw = new MxCADWorldDraw(MxCpp.getIdFromCpp(ptrWorldDraw));
19994
+ var ptrVecOsnapEntityId = MxCpp.getIdFromCpp(ptrVecOsnapEntity);
19995
+ if (ptrVecOsnapEntityId !== 0) mxcadWorldDraw.imp.connectVecOsnapEntity(ptrVecOsnapEntityId);
20416
19996
  if (lPtrVecExplodeEntity !== 0) {
20417
19997
  mxcadWorldDraw.initType(MxCADWorldDrawType.kExplodeDraw);
20418
- mxcadWorldDraw.imp.connectVecExplodeEntity(lPtrVecExplodeEntity);
19998
+ var lPtrVecExplodeEntityId = MxCpp.getIdFromCpp(lPtrVecExplodeEntity);
19999
+ mxcadWorldDraw.imp.connectVecExplodeEntity(lPtrVecExplodeEntityId);
20419
20000
  }
20420
20001
  ent.worldDraw(mxcadWorldDraw);
20421
20002
  };
@@ -20442,7 +20023,8 @@ var MxCustomEntityManagerImp = /*#__PURE__*/function () {
20442
20023
  };
20443
20024
  win.MxCustomEntityManager_transformBy = function (customid, indexIdDatabase, ptrMat, tempid) {
20444
20025
  var mat = new McGeMatrix3d();
20445
- mat.imp.copyFormPointer(ptrMat);
20026
+ var ptrMatId = MxCpp.getIdFromCpp(ptrMat);
20027
+ mat.imp.copyFormPointer(ptrMatId);
20446
20028
  var ent;
20447
20029
  if (tempid != 0) {
20448
20030
  ent = MxCustomEntityManager.getTmpObject(tempid);
@@ -20810,11 +20392,11 @@ var McCmColor = /*#__PURE__*/function () {
20810
20392
  }, {
20811
20393
  key: "getColorValue",
20812
20394
  value: function getColorValue(layerId, blkRefId) {
20813
- var lId1 = 0;
20395
+ var lId1 = MxCpp.App.isWasmx64() ? BigInt(0) : 0;
20814
20396
  if ((layerId === null || layerId === void 0 ? void 0 : layerId.type) == McObjectIdType.kMxCAD) {
20815
20397
  lId1 = layerId.id;
20816
20398
  }
20817
- var lId2 = 0;
20399
+ var lId2 = MxCpp.App.isWasmx64() ? BigInt(0) : 0;
20818
20400
  if ((blkRefId === null || blkRefId === void 0 ? void 0 : blkRefId.type) == McObjectIdType.kMxCAD) {
20819
20401
  lId2 = blkRefId.id;
20820
20402
  }
@@ -20893,12 +20475,12 @@ var McDbLinetypeTableRecord = /*#__PURE__*/function (_McDbObject) {
20893
20475
  }, {
20894
20476
  key: "shapeStyleAt",
20895
20477
  value: function shapeStyleAt(index) {
20896
- return this.imp.shapeStyleAt(index);
20478
+ return new McObjectId(this.imp.shapeStyleAt(index), McObjectIdType.kMxCAD);
20897
20479
  }
20898
20480
  }, {
20899
20481
  key: "setShapeStyleAt",
20900
- value: function setShapeStyleAt(index, value) {
20901
- return this.imp.setShapeStyleAt(index, value);
20482
+ value: function setShapeStyleAt(index, id) {
20483
+ return this.imp.setShapeStyleAt(index, id.id);
20902
20484
  }
20903
20485
  }, {
20904
20486
  key: "shapeNumberAt",
@@ -21288,7 +20870,7 @@ var McDbLayerTable = /*#__PURE__*/function (_McDbObject5) {
21288
20870
  for (var i = 0; i < iLen; i++) {
21289
20871
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21290
20872
  }
21291
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
20873
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21292
20874
  return ret;
21293
20875
  }
21294
20876
  }, {
@@ -21330,7 +20912,7 @@ var McDbLinetypeTable = /*#__PURE__*/function (_McDbObject6) {
21330
20912
  for (var i = 0; i < iLen; i++) {
21331
20913
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21332
20914
  }
21333
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
20915
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21334
20916
  return ret;
21335
20917
  }
21336
20918
  }, {
@@ -21372,7 +20954,7 @@ var McDbDimStyleTable = /*#__PURE__*/function (_McDbObject7) {
21372
20954
  for (var i = 0; i < iLen; i++) {
21373
20955
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21374
20956
  }
21375
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
20957
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21376
20958
  return ret;
21377
20959
  }
21378
20960
  }, {
@@ -21414,7 +20996,7 @@ var McDbTextStyleTable = /*#__PURE__*/function (_McDbObject8) {
21414
20996
  for (var i = 0; i < iLen; i++) {
21415
20997
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21416
20998
  }
21417
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
20999
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21418
21000
  return ret;
21419
21001
  }
21420
21002
  }, {
@@ -21468,11 +21050,11 @@ var McDbDatabase = /*#__PURE__*/function (_McRxObject) {
21468
21050
  key: "wblock",
21469
21051
  value: function wblock(database, aryId, ptBase, param) {
21470
21052
  if (!ptBase) ptBase = McGePoint3d.kOrigin;
21471
- var ids = new McGeLongArray();
21053
+ var ids_imp = new MxCpp.mxcadassemblyimp.MdGeLongLongArray();
21472
21054
  aryId.forEach(function (val) {
21473
- ids.append(val.id);
21055
+ ids_imp.append(val.id);
21474
21056
  });
21475
- return this.imp.wblock(database.getImp(), ids.imp, ptBase.imp, param ? JSON.stringify(param) : "");
21057
+ return this.imp.wblock(database.getImp(), ids_imp, ptBase.imp, param ? JSON.stringify(param) : "");
21476
21058
  }
21477
21059
  }, {
21478
21060
  key: "insert",
@@ -21545,7 +21127,7 @@ var McDbDatabase = /*#__PURE__*/function (_McRxObject) {
21545
21127
  for (var i = 0; i < iLen; i++) {
21546
21128
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21547
21129
  }
21548
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
21130
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21549
21131
  return ret;
21550
21132
  }
21551
21133
  }, {
@@ -21769,7 +21351,7 @@ var McDbBlockTableRecord = /*#__PURE__*/function (_McDbObject9) {
21769
21351
  for (var i = 0; i < iLen; i++) {
21770
21352
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21771
21353
  }
21772
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
21354
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21773
21355
  return ret;
21774
21356
  }
21775
21357
  }, {
@@ -21846,7 +21428,7 @@ var McDbBlockTable = /*#__PURE__*/function (_McDbObject0) {
21846
21428
  for (var i = 0; i < iLen; i++) {
21847
21429
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21848
21430
  }
21849
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
21431
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21850
21432
  return ret;
21851
21433
  }
21852
21434
  }, {
@@ -21935,7 +21517,7 @@ var McDbDictionary = /*#__PURE__*/function (_McDbObject10) {
21935
21517
  for (var i = 0; i < iLen; i++) {
21936
21518
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
21937
21519
  }
21938
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
21520
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
21939
21521
  return ret;
21940
21522
  }
21941
21523
  }, {
@@ -22049,9 +21631,11 @@ var McDbGroup = /*#__PURE__*/function (_McDbObject12) {
22049
21631
  }, {
22050
21632
  key: "appendArray",
22051
21633
  value: function appendArray(aryId) {
22052
- var aryIdLong = new McGeLongArray();
22053
- aryIdLong.copyFormAryId(aryId);
22054
- return this.imp.appendArray(aryIdLong.imp);
21634
+ var ids_imp = new MxCpp.mxcadassemblyimp.MdGeLongLongArray();
21635
+ aryId.forEach(function (val) {
21636
+ ids_imp.append(val.id);
21637
+ });
21638
+ return this.imp.appendArray(ids_imp);
22055
21639
  }
22056
21640
  }, {
22057
21641
  key: "has",
@@ -22067,7 +21651,7 @@ var McDbGroup = /*#__PURE__*/function (_McDbObject12) {
22067
21651
  for (var i = 0; i < iLen; i++) {
22068
21652
  ret.push(new McObjectId(aryId.at(i), McObjectIdType.kMxCAD));
22069
21653
  }
22070
- MxCpp.App.getImp().DestroyMdGeLongArray(aryId);
21654
+ MxCpp.App.getImp().DestroyMdGeLongLongArray(aryId);
22071
21655
  return ret;
22072
21656
  }
22073
21657
  }, {
@@ -22959,7 +22543,7 @@ var McObject = /*#__PURE__*/function () {
22959
22543
  if (xhr.readyState === 4) {
22960
22544
  if (!xhr.responseText || xhr.responseText.length == 0) {
22961
22545
  myThis.imp.openWebFile("", isWorkThread, lOptID, sParam, fetchAttributes, isFetchTzFile);
22962
- console.log("MxTip:authorized service retrun error!");
22546
+ console.log("mx:authorized service retrun error!");
22963
22547
  } else {
22964
22548
  myThis.imp.openWebFile(xhr.responseText, isWorkThread, lOptID, sParam, fetchAttributes, isFetchTzFile);
22965
22549
  }
@@ -22967,7 +22551,7 @@ var McObject = /*#__PURE__*/function () {
22967
22551
  } else {
22968
22552
  if (iErrorTip == 0) {
22969
22553
  myThis.imp.openWebFile("", isWorkThread, lOptID, sParam, fetchAttributes, isFetchTzFile);
22970
- console.log("MxTip:authorized service net error!");
22554
+ console.log("mx:authorized service net error!");
22971
22555
  }
22972
22556
  iErrorTip = 1;
22973
22557
  }
@@ -22987,7 +22571,7 @@ var McObject = /*#__PURE__*/function () {
22987
22571
  this.currentOriginalFileName = "";
22988
22572
  var mxobj = this.getMxDrawObject();
22989
22573
  mxobj.clearAllObject();
22990
- mxobj.clearMxCurrentSelect();
22574
+ mxobj.clearMxCurrentSelect(true);
22991
22575
  return this.imp.newFile();
22992
22576
  }
22993
22577
  }, {
@@ -23016,7 +22600,9 @@ var McObject = /*#__PURE__*/function () {
23016
22600
  if (param.result != 0) {
23017
22601
  console.log("insertBlock result:" + param.result);
23018
22602
  }
23019
- resolve(new McObjectId(param.blkrecid, McObjectIdType.kMxCAD));
22603
+ var blkId = new McObjectId();
22604
+ blkId.initFromCpp(param.blkrecid);
22605
+ resolve(blkId);
23020
22606
  };
23021
22607
  mxObject.addEvent("insertBlockComplete", funCall);
23022
22608
  var initialParameter = "";
@@ -23781,6 +23367,7 @@ var McAppType = /*#__PURE__*/function () {
23781
23367
  }
23782
23368
  });
23783
23369
  _defineProperty(this, "dMcGeBakTol", -1);
23370
+ _defineProperty(this, "iIsWasmx64", -1);
23784
23371
  }
23785
23372
  _createClass$1(McAppType, [{
23786
23373
  key: "init",
@@ -23796,6 +23383,9 @@ var McAppType = /*#__PURE__*/function () {
23796
23383
  this.MxCADAssist = new MxCpp.mxcadassemblyimp.MxDrawAssist();
23797
23384
  this.initCalls();
23798
23385
  McAppFuncton.init();
23386
+ if (this.isWasmx64()) {
23387
+ console.log("mx:full support for 64-bit WebAssembly programs requires Chrome version greater than 133");
23388
+ }
23799
23389
  }
23800
23390
  }, {
23801
23391
  key: "setImp",
@@ -24183,6 +23773,14 @@ var McAppType = /*#__PURE__*/function () {
24183
23773
  _this9.imp.addFontsLoadOnInitialization(val, 0);
24184
23774
  });
24185
23775
  }
23776
+ }, {
23777
+ key: "isWasmx64",
23778
+ value: function isWasmx64() {
23779
+ if (this.iIsWasmx64 === -1) {
23780
+ this.iIsWasmx64 = this.imp.isWasmx64();
23781
+ }
23782
+ return this.iIsWasmx64;
23783
+ }
24186
23784
  }, {
24187
23785
  key: "IniSet",
24188
23786
  value: function IniSet(ini) {
@@ -24375,6 +23973,20 @@ var MxCppType = /*#__PURE__*/function () {
24375
23973
  value: function encodeToGb2312(str) {
24376
23974
  return MxG2312Obj.encodeToGb2312(str);
24377
23975
  }
23976
+ }, {
23977
+ key: "getIdFromCpp",
23978
+ value: function getIdFromCpp(id) {
23979
+ if (typeof id === "string") {
23980
+ return BigInt(id);
23981
+ } else {
23982
+ if (MxCpp.App.isWasmx64()) {
23983
+ if (typeof id === "number") {
23984
+ return BigInt(id);
23985
+ }
23986
+ }
23987
+ return id;
23988
+ }
23989
+ }
24378
23990
  }]);
24379
23991
  return MxCppType;
24380
23992
  }();
@@ -24507,9 +24119,9 @@ var MxCompare = /*#__PURE__*/function () {
24507
24119
  var ret = new MxCADResbuf(this.imp.getResult());
24508
24120
  var count = ret.GetCount();
24509
24121
  for (var i = 0; i + 3 < count; i += 4) {
24510
- var id_current = ret.AtLong(i);
24122
+ var id_current = ret.AtObjectIdValue(i);
24511
24123
  if (!id_current.ret) break;
24512
- var id_base = ret.AtLong(i + 1);
24124
+ var id_base = ret.AtObjectIdValue(i + 1);
24513
24125
  if (!id_base.ret) break;
24514
24126
  var pos = ret.AtPoint(i + 2);
24515
24127
  if (!pos.ret) break;
@@ -24704,15 +24316,17 @@ function _loadMxCADassembly() {
24704
24316
  fontspath,
24705
24317
  networkFonts,
24706
24318
  mxcad,
24319
+ wasmx64,
24707
24320
  _args2 = arguments;
24708
24321
  return regenerator.wrap(function _callee2$(_context2) {
24709
24322
  while (1) switch (_context2.prev = _context2.next) {
24710
24323
  case 0:
24711
- locateFile = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : isSharedArrayBuffer || !isCdn ? get2DFileURL : get2DSTFileURL;
24324
+ locateFile = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : void 0;
24712
24325
  wasmBinary = _args2.length > 2 ? _args2[2] : undefined;
24713
24326
  fontspath = _args2.length > 3 ? _args2[3] : undefined;
24714
24327
  networkFonts = _args2.length > 4 ? _args2[4] : undefined;
24715
24328
  mxcad = _args2.length > 5 ? _args2[5] : undefined;
24329
+ wasmx64 = _args2.length > 6 ? _args2[6] : undefined;
24716
24330
  return _context2.abrupt("return", new Promise(/*#__PURE__*/function () {
24717
24331
  var _ref = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee(resolve, reject) {
24718
24332
  var baseFileName, mxcadassemblyimp, app, win;
@@ -24728,13 +24342,20 @@ function _loadMxCADassembly() {
24728
24342
  call && call(MxCpp);
24729
24343
  return _context.abrupt("return", resolve(MxCpp));
24730
24344
  case 5:
24345
+ if (locateFile == void 0) {
24346
+ if (wasmx64) {
24347
+ locateFile = isSharedArrayBuffer || !isCdn ? get2D64FileURL : get2D64STFileURL;
24348
+ } else {
24349
+ locateFile = isSharedArrayBuffer || !isCdn ? get2DFileURL : get2DSTFileURL;
24350
+ }
24351
+ }
24731
24352
  baseFileName = "mxdrawassembly_min";
24732
- _context.next = 8;
24353
+ _context.next = 9;
24733
24354
  return loadWams(baseFileName, "mxdrawassembly", {
24734
24355
  locateFile: locateFile,
24735
24356
  wasmBinary: wasmBinary
24736
24357
  });
24737
- case 8:
24358
+ case 9:
24738
24359
  mxcadassemblyimp = _context.sent;
24739
24360
  MxCpp.mxcadassemblyimp = mxcadassemblyimp;
24740
24361
  app = new mxcadassemblyimp.McApp();
@@ -24759,23 +24380,23 @@ function _loadMxCADassembly() {
24759
24380
  win["__MxCpp__"] = MxCpp;
24760
24381
  call && call(MxCpp);
24761
24382
  resolve(MxCpp);
24762
- _context.next = 27;
24383
+ _context.next = 28;
24763
24384
  break;
24764
- case 24:
24765
- _context.prev = 24;
24385
+ case 25:
24386
+ _context.prev = 25;
24766
24387
  _context.t0 = _context["catch"](0);
24767
24388
  reject(_context.t0);
24768
- case 27:
24389
+ case 28:
24769
24390
  case "end":
24770
24391
  return _context.stop();
24771
24392
  }
24772
- }, _callee, null, [[0, 24]]);
24393
+ }, _callee, null, [[0, 25]]);
24773
24394
  }));
24774
24395
  return function (_x2, _x3) {
24775
24396
  return _ref.apply(this, arguments);
24776
24397
  };
24777
24398
  }()));
24778
- case 6:
24399
+ case 7:
24779
24400
  case "end":
24780
24401
  return _context2.stop();
24781
24402
  }
@@ -37150,9 +36771,9 @@ var createMxDraw = function createMxDraw(canvas, middlePan, map, webgl1, mxcadob
37150
36771
  }
37151
36772
  mxDraw.addEvent("initObject", function () {
37152
36773
  if (mxDraw.isWebgl2()) {
37153
- console.log("MxTip: use webgl2");
36774
+ console.log("mx: use webgl2");
37154
36775
  } else {
37155
- console.log("MxTip: use webgl1");
36776
+ console.log("mx: use webgl1");
37156
36777
  }
37157
36778
  resolve(mxDraw);
37158
36779
  });
@@ -37178,7 +36799,7 @@ function Mx_About() {
37178
36799
  }
37179
36800
  var createMxCad = /*#__PURE__*/function () {
37180
36801
  var _ref = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee(config, mxcadobj) {
37181
- var _ref2, openParameter, networkFonts, fontspath, locateFile, wasmBinary, canvas, onOpenFileComplete, fileUrl, onInit, middlePan, registdata, registfile, authorized_service, viewBackgroundColor, map, multipleSelect, enableUndo, enableIntelliSelect, browse, webgl1, mxDraw, THREE, size, mxCadObj, iCodeVersion, registfileurl, regdataobj, sMxId, win, agent, fetchAttributes;
36802
+ var _ref2, wasmx64, openParameter, networkFonts, fontspath, locateFile, wasmBinary, canvas, onOpenFileComplete, fileUrl, onInit, middlePan, registdata, registfile, authorized_service, viewBackgroundColor, map, multipleSelect, enableUndo, enableIntelliSelect, browse, webgl1, mxDraw, THREE, size, mxCadObj, iCodeVersion, registfileurl, regdataobj, sMxId, win, agent, fetchAttributes;
37182
36803
  return regenerator.wrap(function _callee$(_context) {
37183
36804
  while (1) switch (_context.prev = _context.next) {
37184
36805
  case 0:
@@ -37189,11 +36810,11 @@ var createMxCad = /*#__PURE__*/function () {
37189
36810
  _context.next = 3;
37190
36811
  return loadCoreCode();
37191
36812
  case 3:
37192
- _ref2 = config || {}, openParameter = _ref2.openParameter, networkFonts = _ref2.networkFonts, fontspath = _ref2.fontspath, locateFile = _ref2.locateFile, wasmBinary = _ref2.wasmBinary, canvas = _ref2.canvas, onOpenFileComplete = _ref2.onOpenFileComplete, fileUrl = _ref2.fileUrl, onInit = _ref2.onInit, middlePan = _ref2.middlePan, registdata = _ref2.registdata, registfile = _ref2.registfile, authorized_service = _ref2.authorized_service, viewBackgroundColor = _ref2.viewBackgroundColor, map = _ref2.map, multipleSelect = _ref2.multipleSelect, enableUndo = _ref2.enableUndo, enableIntelliSelect = _ref2.enableIntelliSelect, browse = _ref2.browse, webgl1 = _ref2.webgl1;
36813
+ _ref2 = config || {}, wasmx64 = _ref2.wasmx64, openParameter = _ref2.openParameter, networkFonts = _ref2.networkFonts, fontspath = _ref2.fontspath, locateFile = _ref2.locateFile, wasmBinary = _ref2.wasmBinary, canvas = _ref2.canvas, onOpenFileComplete = _ref2.onOpenFileComplete, fileUrl = _ref2.fileUrl, onInit = _ref2.onInit, middlePan = _ref2.middlePan, registdata = _ref2.registdata, registfile = _ref2.registfile, authorized_service = _ref2.authorized_service, viewBackgroundColor = _ref2.viewBackgroundColor, map = _ref2.map, multipleSelect = _ref2.multipleSelect, enableUndo = _ref2.enableUndo, enableIntelliSelect = _ref2.enableIntelliSelect, browse = _ref2.browse, webgl1 = _ref2.webgl1;
37193
36814
  _context.next = 6;
37194
36815
  return loadMxCADassembly(function () {
37195
36816
  return void 0;
37196
- }, locateFile, wasmBinary, fontspath, networkFonts, mxcadobj);
36817
+ }, locateFile, wasmBinary, fontspath, networkFonts, mxcadobj, wasmx64);
37197
36818
  case 6:
37198
36819
  MxFun.initMxCpp(MxCpp);
37199
36820
  MxCADUtility.init();
@@ -37272,7 +36893,7 @@ var createMxCad = /*#__PURE__*/function () {
37272
36893
  if (authorized_service) {
37273
36894
  mxCadObj.iniAuthorizedService(authorized_service);
37274
36895
  }
37275
- console.log("MxTip:empty regist data");
36896
+ console.log("mx:empty regist data");
37276
36897
  }
37277
36898
  case 36:
37278
36899
  if (!(iCodeVersion == 3)) {
@@ -45328,7 +44949,7 @@ function Mx_Trim() {
45328
44949
  }
45329
44950
  function _Mx_Trim() {
45330
44951
  _Mx_Trim = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee16() {
45331
- var filterInit, getPoint, ss, aryId, aryIdLong, mxcadTrimAssert, filter, isWindowSelect, _loop8, _ret8;
44952
+ var filterInit, getPoint, ss, aryId, mxcadTrimAssert, filter, isWindowSelect, _loop8, _ret8;
45332
44953
  return regenerator.wrap(function _callee16$(_context24) {
45333
44954
  while (1) switch (_context24.prev = _context24.next) {
45334
44955
  case 0:
@@ -45366,15 +44987,13 @@ function _Mx_Trim() {
45366
44987
  }
45367
44988
  return _context24.abrupt("return");
45368
44989
  case 12:
45369
- aryIdLong = new McGeLongArray();
45370
- aryIdLong.copyFormAryId(aryId);
45371
44990
  mxcadTrimAssert = new MxCpp.mxcadassemblyimp.MxDrawTrimAssist();
45372
- if (mxcadTrimAssert.Init(aryIdLong.imp)) {
45373
- _context24.next = 17;
44991
+ if (mxcadTrimAssert.Init(createMdGeLongLongArrayFormAryId(aryId))) {
44992
+ _context24.next = 15;
45374
44993
  break;
45375
44994
  }
45376
44995
  return _context24.abrupt("return");
45377
- case 17:
44996
+ case 15:
45378
44997
  filter = new MxCADResbuf();
45379
44998
  filter.AddMcDbEntityTypes("LINE,LWPOLYLINE,ELLIPSE,ARC,CIRCLE,SPLINE,XLINE");
45380
44999
  isWindowSelect = true;
@@ -45440,35 +45059,34 @@ function _Mx_Trim() {
45440
45059
  return _context23.abrupt("return", 1);
45441
45060
  case 26:
45442
45061
  selPoint = ss2.getSelectPoint();
45443
- aryIdLong.copyFormAryId(ids);
45444
- mxcadTrimAssert.DoTrim(aryIdLong.imp, selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y);
45445
- case 29:
45062
+ mxcadTrimAssert.DoTrim(createMdGeLongLongArrayFormAryId(ids), selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y);
45063
+ case 28:
45446
45064
  case "end":
45447
45065
  return _context23.stop();
45448
45066
  }
45449
45067
  }, _loop8);
45450
45068
  });
45069
+ case 19:
45070
+ return _context24.delegateYield(_loop8(), "t0", 21);
45451
45071
  case 21:
45452
- return _context24.delegateYield(_loop8(), "t0", 23);
45453
- case 23:
45454
45072
  _ret8 = _context24.t0;
45455
45073
  if (!(_ret8 === 0)) {
45456
- _context24.next = 26;
45074
+ _context24.next = 24;
45457
45075
  break;
45458
45076
  }
45459
- return _context24.abrupt("break", 30);
45460
- case 26:
45077
+ return _context24.abrupt("break", 28);
45078
+ case 24:
45461
45079
  if (!(_ret8 === 1)) {
45462
- _context24.next = 28;
45080
+ _context24.next = 26;
45463
45081
  break;
45464
45082
  }
45465
- return _context24.abrupt("continue", 21);
45466
- case 28:
45467
- _context24.next = 21;
45083
+ return _context24.abrupt("continue", 19);
45084
+ case 26:
45085
+ _context24.next = 19;
45468
45086
  break;
45469
- case 30:
45087
+ case 28:
45470
45088
  mxcadTrimAssert.UnInit();
45471
- case 31:
45089
+ case 29:
45472
45090
  case "end":
45473
45091
  return _context24.stop();
45474
45092
  }
@@ -45481,7 +45099,7 @@ function Mx_Extend() {
45481
45099
  }
45482
45100
  function _Mx_Extend() {
45483
45101
  _Mx_Extend = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee17() {
45484
- var filter, isByWindow, getPoint, ss, isExtend, aryId, aryIdLong, mxcadExtendAssert, mxcadTrimAssert, cachings, isShiftKey2, onKeydown2, onkeyup, _loop9, _ret9;
45102
+ var filter, isByWindow, getPoint, ss, isExtend, aryId, mxcadExtendAssert, mxcadTrimAssert, cachings, isShiftKey2, onKeydown2, onkeyup, _loop9, _ret9;
45485
45103
  return regenerator.wrap(function _callee17$(_context26) {
45486
45104
  while (1) switch (_context26.prev = _context26.next) {
45487
45105
  case 0:
@@ -45521,22 +45139,20 @@ function _Mx_Extend() {
45521
45139
  }
45522
45140
  return _context26.abrupt("return");
45523
45141
  case 15:
45524
- aryIdLong = new McGeLongArray();
45525
- aryIdLong.copyFormAryId(aryId);
45526
45142
  mxcadExtendAssert = new MxCpp.mxcadassemblyimp.MxDrawExtendAssist();
45527
- if (mxcadExtendAssert.Init(aryIdLong.imp)) {
45528
- _context26.next = 20;
45143
+ if (mxcadExtendAssert.Init(createMdGeLongLongArrayFormAryId(aryId))) {
45144
+ _context26.next = 18;
45529
45145
  break;
45530
45146
  }
45531
45147
  return _context26.abrupt("return");
45532
- case 20:
45148
+ case 18:
45533
45149
  mxcadTrimAssert = new MxCpp.mxcadassemblyimp.MxDrawTrimAssist();
45534
- if (mxcadTrimAssert.Init(aryIdLong.imp)) {
45535
- _context26.next = 23;
45150
+ if (mxcadTrimAssert.Init(createMdGeLongLongArrayFormAryId(aryId))) {
45151
+ _context26.next = 21;
45536
45152
  break;
45537
45153
  }
45538
45154
  return _context26.abrupt("return");
45539
- case 23:
45155
+ case 21:
45540
45156
  cachings = [];
45541
45157
  isShiftKey2 = false;
45542
45158
  onKeydown2 = function onKeydown2(e) {
@@ -45594,8 +45210,7 @@ function _Mx_Extend() {
45594
45210
  var intersectPoints = ent.IntersectWith(pl, McDb.Intersect.kOnBothOperands);
45595
45211
  if (intersectPoints.isEmpty()) return;
45596
45212
  intersectPoints.forEach(function (point) {
45597
- aryIdLong.copyFormAryId([objId]);
45598
- isShiftKey2 ? mxcadTrimAssert.DoTrim(aryIdLong.imp, point.x, point.y, point.x, point.y) : mxcadExtendAssert.DoExtend(aryIdLong.imp, point.x, point.y, point.x, point.y);
45213
+ isShiftKey2 ? mxcadTrimAssert.DoTrim(createMdGeLongLongArrayFormAryId([objId]), point.x, point.y, point.x, point.y) : mxcadExtendAssert.DoExtend(createMdGeLongLongArrayFormAryId([objId]), point.x, point.y, point.x, point.y);
45599
45214
  });
45600
45215
  });
45601
45216
  return _context25.abrupt("return", 1);
@@ -45693,8 +45308,7 @@ function _Mx_Extend() {
45693
45308
  var intersectPoints = ent.IntersectWith(_pl, McDb.Intersect.kOnBothOperands);
45694
45309
  if (intersectPoints.isEmpty()) return;
45695
45310
  intersectPoints.forEach(function (point) {
45696
- aryIdLong.copyFormAryId([objId]);
45697
- isShiftKey2 ? mxcadTrimAssert.DoTrim(aryIdLong.imp, point.x, point.y, point.x, point.y) : mxcadExtendAssert.DoExtend(aryIdLong.imp, point.x, point.y, point.x, point.y);
45311
+ isShiftKey2 ? mxcadTrimAssert.DoTrim(createMdGeLongLongArrayFormAryId([objId]), point.x, point.y, point.x, point.y) : mxcadExtendAssert.DoExtend(createMdGeLongLongArrayFormAryId([objId]), point.x, point.y, point.x, point.y);
45698
45312
  });
45699
45313
  });
45700
45314
  return _context25.abrupt("return", 1);
@@ -45702,44 +45316,43 @@ function _Mx_Extend() {
45702
45316
  cachings.push([ids, aryId.map(function (id) {
45703
45317
  return id.clone();
45704
45318
  })]);
45705
- aryIdLong.copyFormAryId(ids);
45706
- isShiftKey2 ? mxcadTrimAssert.DoTrim(aryIdLong.imp, selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y) : mxcadExtendAssert.DoExtend(aryIdLong.imp, selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y);
45707
- case 64:
45319
+ isShiftKey2 ? mxcadTrimAssert.DoTrim(createMdGeLongLongArrayFormAryId(ids), selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y) : mxcadExtendAssert.DoExtend(createMdGeLongLongArrayFormAryId(ids), selPoint.pt1.x, selPoint.pt1.y, selPoint.pt2.x, selPoint.pt2.y);
45320
+ case 63:
45708
45321
  case "end":
45709
45322
  return _context25.stop();
45710
45323
  }
45711
45324
  }, _loop9);
45712
45325
  });
45326
+ case 28:
45327
+ return _context26.delegateYield(_loop9(), "t0", 30);
45713
45328
  case 30:
45714
- return _context26.delegateYield(_loop9(), "t0", 32);
45715
- case 32:
45716
45329
  _ret9 = _context26.t0;
45717
45330
  if (!(_ret9 === 0)) {
45718
- _context26.next = 35;
45331
+ _context26.next = 33;
45719
45332
  break;
45720
45333
  }
45721
- return _context26.abrupt("break", 41);
45722
- case 35:
45334
+ return _context26.abrupt("break", 39);
45335
+ case 33:
45723
45336
  if (!(_ret9 === 1)) {
45724
- _context26.next = 37;
45337
+ _context26.next = 35;
45725
45338
  break;
45726
45339
  }
45727
- return _context26.abrupt("continue", 30);
45728
- case 37:
45340
+ return _context26.abrupt("continue", 28);
45341
+ case 35:
45729
45342
  if (!_ret9) {
45730
- _context26.next = 39;
45343
+ _context26.next = 37;
45731
45344
  break;
45732
45345
  }
45733
45346
  return _context26.abrupt("return", _ret9.v);
45734
- case 39:
45735
- _context26.next = 30;
45347
+ case 37:
45348
+ _context26.next = 28;
45736
45349
  break;
45737
- case 41:
45350
+ case 39:
45738
45351
  window.removeEventListener("keydown", onKeydown2);
45739
45352
  window.removeEventListener("keyup", onkeyup);
45740
45353
  mxcadTrimAssert.UnInit();
45741
45354
  mxcadExtendAssert.UnInit();
45742
- case 45:
45355
+ case 43:
45743
45356
  case "end":
45744
45357
  return _context26.stop();
45745
45358
  }
@@ -45752,7 +45365,7 @@ function Mx_Explode() {
45752
45365
  }
45753
45366
  function _Mx_Explode() {
45754
45367
  _Mx_Explode = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee18() {
45755
- var filter, aryId, aryIdLong;
45368
+ var filter, aryId;
45756
45369
  return regenerator.wrap(function _callee18$(_context27) {
45757
45370
  while (1) switch (_context27.prev = _context27.next) {
45758
45371
  case 0:
@@ -45768,10 +45381,8 @@ function _Mx_Explode() {
45768
45381
  }
45769
45382
  return _context27.abrupt("return");
45770
45383
  case 7:
45771
- aryIdLong = new McGeLongArray();
45772
- aryIdLong.copyFormAryId(aryId);
45773
- MxCpp.App.MxCADAssist.MxExplode(aryIdLong.imp);
45774
- case 10:
45384
+ MxCpp.App.MxCADAssist.MxExplode(createMdGeLongLongArrayFormAryId(aryId));
45385
+ case 8:
45775
45386
  case "end":
45776
45387
  return _context27.stop();
45777
45388
  }
@@ -45784,7 +45395,7 @@ function Mx_Join() {
45784
45395
  }
45785
45396
  function _Mx_Join() {
45786
45397
  _Mx_Join = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee19() {
45787
- var filter, aryId, aryIdLong;
45398
+ var filter, aryId;
45788
45399
  return regenerator.wrap(function _callee19$(_context28) {
45789
45400
  while (1) switch (_context28.prev = _context28.next) {
45790
45401
  case 0:
@@ -45800,10 +45411,8 @@ function _Mx_Join() {
45800
45411
  }
45801
45412
  return _context28.abrupt("return");
45802
45413
  case 7:
45803
- aryIdLong = new McGeLongArray();
45804
- aryIdLong.copyFormAryId(aryId);
45805
- MxCpp.App.MxCADAssist.MxJoin(aryIdLong.imp);
45806
- case 10:
45414
+ MxCpp.App.MxCADAssist.MxJoin(createMdGeLongLongArrayFormAryId(aryId));
45415
+ case 8:
45807
45416
  case "end":
45808
45417
  return _context28.stop();
45809
45418
  }
@@ -47111,6 +46720,498 @@ MxFun.on("init", function () {
47111
46720
  MxFun.addCommand("Mx_Rectang", drawRectang);
47112
46721
  });
47113
46722
 
46723
+ function b64Encode(str) {
46724
+ return btoa(unescape(encodeURIComponent(str)));
46725
+ }
46726
+ function b64Decode(str) {
46727
+ return decodeURIComponent(escape(atob(str)));
46728
+ }
46729
+ function crateHexString(str) {
46730
+ return Array.from(new TextEncoder().encode(str)).map(function (byte) {
46731
+ return byte.toString(16).padStart(2, "0");
46732
+ }).join("");
46733
+ }
46734
+ function saveAsFileDialog(_x) {
46735
+ return _saveAsFileDialog.apply(this, arguments);
46736
+ }
46737
+ function _saveAsFileDialog() {
46738
+ _saveAsFileDialog = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee3(_ref) {
46739
+ var blob, _ref$filename, filename, _ref$types, types, _window$navigator, userActivation, handle, writable, blobWithTypeName, objectUrl, link;
46740
+ return regenerator.wrap(function _callee3$(_context3) {
46741
+ while (1) switch (_context3.prev = _context3.next) {
46742
+ case 0:
46743
+ blob = _ref.blob, _ref$filename = _ref.filename, filename = _ref$filename === void 0 ? "" : _ref$filename, _ref$types = _ref.types, types = _ref$types === void 0 ? [{
46744
+ description: "mxweb File",
46745
+ accept: {
46746
+ "application/octet-stream": [".mxweb"]
46747
+ }
46748
+ }] : _ref$types;
46749
+ if (blob) {
46750
+ _context3.next = 4;
46751
+ break;
46752
+ }
46753
+ console.error("Invalid blob provided");
46754
+ return _context3.abrupt("return");
46755
+ case 4:
46756
+ _context3.prev = 4;
46757
+ if (!(typeof window.showSaveFilePicker === "function")) {
46758
+ _context3.next = 31;
46759
+ break;
46760
+ }
46761
+ userActivation = (_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userActivation;
46762
+ if (!(userActivation !== null && userActivation !== void 0 && userActivation.isActive || userActivation !== null && userActivation !== void 0 && userActivation.hasBeenActive)) {
46763
+ _context3.next = 30;
46764
+ break;
46765
+ }
46766
+ _context3.prev = 8;
46767
+ _context3.next = 11;
46768
+ return window.showSaveFilePicker({
46769
+ suggestedName: filename,
46770
+ types: types
46771
+ });
46772
+ case 11:
46773
+ handle = _context3.sent;
46774
+ _context3.next = 14;
46775
+ return handle.createWritable();
46776
+ case 14:
46777
+ writable = _context3.sent;
46778
+ _context3.next = 17;
46779
+ return writable.write(blob);
46780
+ case 17:
46781
+ _context3.next = 19;
46782
+ return writable.close();
46783
+ case 19:
46784
+ return _context3.abrupt("return", handle);
46785
+ case 22:
46786
+ _context3.prev = 22;
46787
+ _context3.t0 = _context3["catch"](8);
46788
+ if (!(_context3.t0.name === "AbortError")) {
46789
+ _context3.next = 27;
46790
+ break;
46791
+ }
46792
+ console.log("\u7528\u6237\u53D6\u6D88\u6216\u6743\u9650\u88AB\u62D2");
46793
+ return _context3.abrupt("return", false);
46794
+ case 27:
46795
+ if (_context3.t0.name === "AbortError" || _context3.t0.name === "NotAllowedError") {
46796
+ console.warn("Save cancelled or not allowed:", _context3.t0.message);
46797
+ } else {
46798
+ console.error("showSaveFilePicker failed:", _context3.t0);
46799
+ }
46800
+ case 28:
46801
+ _context3.next = 31;
46802
+ break;
46803
+ case 30:
46804
+ console.warn("No user activation, skipping showSaveFilePicker");
46805
+ case 31:
46806
+ if (!(window.navigator.msSaveOrOpenBlob && typeof window.navigator.msSaveOrOpenBlob === "function")) {
46807
+ _context3.next = 35;
46808
+ break;
46809
+ }
46810
+ blobWithTypeName = blob.slice(0, blob.size, blob.type || "application/octet-stream");
46811
+ window.navigator.msSaveOrOpenBlob(blobWithTypeName, filename);
46812
+ return _context3.abrupt("return");
46813
+ case 35:
46814
+ objectUrl = window.URL.createObjectURL(blob);
46815
+ link = document.createElement("a");
46816
+ link.href = objectUrl;
46817
+ link.download = filename;
46818
+ link.style.display = "none";
46819
+ document.body.appendChild(link);
46820
+ link.click();
46821
+ setTimeout(function () {
46822
+ window.URL.revokeObjectURL(objectUrl);
46823
+ }, 100);
46824
+ document.body.removeChild(link);
46825
+ return _context3.abrupt("return");
46826
+ case 47:
46827
+ _context3.prev = 47;
46828
+ _context3.t1 = _context3["catch"](4);
46829
+ console.error("File save failed:", _context3.t1.name, _context3.t1.message);
46830
+ case 50:
46831
+ case "end":
46832
+ return _context3.stop();
46833
+ }
46834
+ }, _callee3, null, [[4, 47], [8, 22]]);
46835
+ }));
46836
+ return _saveAsFileDialog.apply(this, arguments);
46837
+ }
46838
+ function downloadFile(blob, filename) {
46839
+ var link = document.createElement("a");
46840
+ link.href = window.URL.createObjectURL(blob);
46841
+ link.download = filename;
46842
+ link.click();
46843
+ }
46844
+ function downloadFileFromUrl(url, filename) {
46845
+ fetch(url).then(function (response) {
46846
+ return response.blob();
46847
+ }).then(function (blob) {
46848
+ var link = document.createElement("a");
46849
+ link.href = window.URL.createObjectURL(blob);
46850
+ link.download = filename;
46851
+ link.click();
46852
+ });
46853
+ }
46854
+ var getJsonFromUrl = /*#__PURE__*/function () {
46855
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee(url) {
46856
+ return regenerator.wrap(function _callee$(_context) {
46857
+ while (1) switch (_context.prev = _context.next) {
46858
+ case 0:
46859
+ _context.prev = 0;
46860
+ _context.next = 3;
46861
+ return fetch(url);
46862
+ case 3:
46863
+ _context.next = 5;
46864
+ return _context.sent.json();
46865
+ case 5:
46866
+ return _context.abrupt("return", _context.sent);
46867
+ case 8:
46868
+ _context.prev = 8;
46869
+ _context.t0 = _context["catch"](0);
46870
+ console.error("mx:error getJsonFromurl:" + url);
46871
+ case 11:
46872
+ case "end":
46873
+ return _context.stop();
46874
+ }
46875
+ }, _callee, null, [[0, 8]]);
46876
+ }));
46877
+ return function getJsonFromUrl(_x2) {
46878
+ return _ref2.apply(this, arguments);
46879
+ };
46880
+ }();
46881
+ var getFileFromUrl = /*#__PURE__*/function () {
46882
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/regenerator.mark(function _callee2(url) {
46883
+ return regenerator.wrap(function _callee2$(_context2) {
46884
+ while (1) switch (_context2.prev = _context2.next) {
46885
+ case 0:
46886
+ _context2.prev = 0;
46887
+ _context2.next = 3;
46888
+ return fetch(url);
46889
+ case 3:
46890
+ return _context2.abrupt("return", _context2.sent);
46891
+ case 6:
46892
+ _context2.prev = 6;
46893
+ _context2.t0 = _context2["catch"](0);
46894
+ console.error("mx:error getFileFromUrl:" + url);
46895
+ case 9:
46896
+ case "end":
46897
+ return _context2.stop();
46898
+ }
46899
+ }, _callee2, null, [[0, 6]]);
46900
+ }));
46901
+ return function getFileFromUrl(_x3) {
46902
+ return _ref3.apply(this, arguments);
46903
+ };
46904
+ }();
46905
+ function _ML_String(strId, str) {
46906
+ return MxFun.getLanguageString(strId, str);
46907
+ }
46908
+ function IsZero(val) {
46909
+ return Math.abs(val) < 1e-7;
46910
+ }
46911
+ function postMemoryFile(memoryData, url, filename, retCall, param) {
46912
+ try {
46913
+ var formData = new FormData();
46914
+ var blob = new Blob([memoryData], {
46915
+ type: "application/octet-stream"
46916
+ });
46917
+ formData.append("file", new File([blob], filename));
46918
+ if (param) formData.append("param", param);
46919
+ var xhr = new XMLHttpRequest();
46920
+ xhr.open("POST", url);
46921
+ xhr.send(formData);
46922
+ xhr.onreadystatechange = function () {
46923
+ if (xhr.readyState === XMLHttpRequest.DONE) {
46924
+ if (xhr.status === 200) {
46925
+ retCall(0, xhr.responseText);
46926
+ } else {
46927
+ console.log(xhr.responseText);
46928
+ retCall(4, "server error");
46929
+ }
46930
+ }
46931
+ };
46932
+ } catch (error) {
46933
+ retCall(-1, "catch error");
46934
+ }
46935
+ }
46936
+ function postEmscriptenIndexedDBFile(filekey, url, retCall, param) {
46937
+ var request = window.indexedDB.open("emscripten_filesystem", 1);
46938
+ request.onerror = function () {
46939
+ retCall(1, "open emscripten_filesystem failed");
46940
+ };
46941
+ request.onsuccess = function (event) {
46942
+ try {
46943
+ if (event.target != null) {
46944
+ var db = event.target.result;
46945
+ var transaction = db.transaction("FILES", "readonly");
46946
+ var objectStore = transaction.objectStore("FILES");
46947
+ var request2 = objectStore.get(filekey);
46948
+ request2.onerror = function () {
46949
+ retCall(3, "get file error");
46950
+ };
46951
+ request2.onsuccess = function () {
46952
+ var file = request2.result;
46953
+ if (file) {
46954
+ var formData = new FormData();
46955
+ formData.append("file", file);
46956
+ if (param) formData.append("param", param);
46957
+ var xhr = new XMLHttpRequest();
46958
+ xhr.open("POST", url);
46959
+ xhr.send(formData);
46960
+ xhr.onreadystatechange = function () {
46961
+ if (xhr.readyState === XMLHttpRequest.DONE) {
46962
+ if (xhr.status === 200) {
46963
+ retCall(0, xhr.responseText);
46964
+ } else {
46965
+ console.log(xhr.responseText);
46966
+ retCall(4, "server error");
46967
+ }
46968
+ }
46969
+ };
46970
+ } else {
46971
+ retCall(5, "get file data error");
46972
+ }
46973
+ };
46974
+ } else {
46975
+ retCall(2, "event.target == null");
46976
+ }
46977
+ } catch (error) {
46978
+ retCall(-1, "catch error");
46979
+ }
46980
+ };
46981
+ }
46982
+ function createCursorHelp() {
46983
+ var canvasSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128;
46984
+ var squareSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
46985
+ var isRoss = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
46986
+ var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "#ffffff";
46987
+ var canvas = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document.createElement("canvas");
46988
+ var background = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "transparent";
46989
+ canvas.width = canvas.height = canvasSize;
46990
+ canvas.style.background = background;
46991
+ var ctx = canvas.getContext("2d");
46992
+ var canvasDevil = canvasSize % 2 === 0 ? -0.5 : 0;
46993
+ var squareDevil = squareSize % 2 === 0 ? -0.5 : 0;
46994
+ ctx.strokeStyle = color;
46995
+ ctx.lineWidth = 0;
46996
+ ctx.imageSmoothingEnabled = false;
46997
+ if (isRoss) {
46998
+ ctx.beginPath();
46999
+ ctx.moveTo(canvas.width / 2 + canvasDevil, canvasDevil);
47000
+ ctx.lineTo(canvas.width / 2 + canvasDevil, canvas.height + canvasDevil);
47001
+ ctx.stroke();
47002
+ ctx.beginPath();
47003
+ ctx.moveTo(canvasDevil, canvas.height / 2 + canvasDevil);
47004
+ ctx.lineTo(canvas.width + canvasDevil, canvas.height / 2 + canvasDevil);
47005
+ ctx.stroke();
47006
+ }
47007
+ ctx.beginPath();
47008
+ ctx.strokeRect(canvasSize / 2 - squareSize / 2 + squareDevil, canvasSize / 2 - squareSize / 2 + squareDevil, squareSize, squareSize);
47009
+ ctx.stroke();
47010
+ return canvas.toDataURL("image/png");
47011
+ }
47012
+ function createCursor() {
47013
+ var cursorSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128;
47014
+ var targetFrameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
47015
+ var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#ffffff";
47016
+ return {
47017
+ Rect: "url('".concat(createCursorHelp(cursorSize, targetFrameSize, false, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, ", auto"),
47018
+ Cross: "url('".concat(createCursorHelp(cursorSize, 0, true, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, " , auto"),
47019
+ Normal: "url('".concat(createCursorHelp(cursorSize, targetFrameSize, true, color), "') ").concat(cursorSize / 2, " ").concat(cursorSize / 2, ", auto"),
47020
+ Pan: "grabbing"
47021
+ };
47022
+ }
47023
+ function createMdGeLongLongArrayFormAryId(aryId) {
47024
+ var ids_imp = new MxCpp.mxcadassemblyimp.MdGeLongLongArray();
47025
+ aryId.forEach(function (val) {
47026
+ ids_imp.append(val.id);
47027
+ });
47028
+ return ids_imp;
47029
+ }
47030
+ var MxTools = {
47031
+ b64Encode: b64Encode,
47032
+ b64Decode: b64Decode,
47033
+ saveAsFileDialog: saveAsFileDialog,
47034
+ downloadFile: downloadFile,
47035
+ downloadFileFromUrl: downloadFileFromUrl,
47036
+ getJsonFromUrl: getJsonFromUrl,
47037
+ getFileFromUrl: getFileFromUrl,
47038
+ _ML_String: _ML_String,
47039
+ IsZero: IsZero,
47040
+ postEmscriptenIndexedDBFile: postEmscriptenIndexedDBFile,
47041
+ postMemoryFile: postMemoryFile,
47042
+ createCursor: createCursor,
47043
+ createMdGeLongLongArrayFormAryId: createMdGeLongLongArrayFormAryId
47044
+ };
47045
+
47046
+ var MxCanvas2Image = /*#__PURE__*/function () {
47047
+ function MxCanvas2Image() {
47048
+ var in_document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : void 0;
47049
+ _classCallCheck$1(this, MxCanvas2Image);
47050
+ _defineProperty(this, "$support", void 0);
47051
+ _defineProperty(this, "downloadMime", "image/octet-stream");
47052
+ _defineProperty(this, "mydocument", document);
47053
+ if (in_document) this.mydocument = in_document;
47054
+ this.$support = function () {
47055
+ var canvas = in_document.createElement("canvas"),
47056
+ ctx = canvas.getContext("2d");
47057
+ return {
47058
+ canvas: !!ctx,
47059
+ imageData: !!ctx.getImageData,
47060
+ dataURL: !!canvas.toDataURL,
47061
+ btoa: !!window.btoa
47062
+ };
47063
+ }();
47064
+ }
47065
+ _createClass$1(MxCanvas2Image, [{
47066
+ key: "scaleCanvas",
47067
+ value: function scaleCanvas(canvas, width, height) {
47068
+ var w = canvas.width,
47069
+ h = canvas.height;
47070
+ if (width == void 0) {
47071
+ width = w;
47072
+ }
47073
+ if (height == void 0) {
47074
+ height = h;
47075
+ }
47076
+ var retCanvas = this.mydocument.createElement("canvas");
47077
+ var retCtx = retCanvas.getContext("2d");
47078
+ retCanvas.width = width;
47079
+ retCanvas.height = height;
47080
+ retCtx.drawImage(canvas, 0, 0, w, h, 0, 0, width, height);
47081
+ return retCanvas;
47082
+ }
47083
+ }, {
47084
+ key: "getDataURL",
47085
+ value: function getDataURL(canvas, type, width, height) {
47086
+ canvas = this.scaleCanvas(canvas, width, height);
47087
+ return canvas.toDataURL(type);
47088
+ }
47089
+ }, {
47090
+ key: "saveFile",
47091
+ value: function saveFile(strData) {
47092
+ var link = this.mydocument.createElement("a");
47093
+ link.href = strData;
47094
+ link.download = "save.bmp";
47095
+ link.click();
47096
+ }
47097
+ }, {
47098
+ key: "genImage",
47099
+ value: function genImage(strData) {
47100
+ var img = this.mydocument.createElement("img");
47101
+ img.src = strData;
47102
+ return img;
47103
+ }
47104
+ }, {
47105
+ key: "fixType",
47106
+ value: function fixType(type) {
47107
+ type = type.toLowerCase().replace(/jpg/i, "jpeg");
47108
+ var r = type.match(/png|jpeg|bmp|gif/)[0];
47109
+ return "image/" + r;
47110
+ }
47111
+ }, {
47112
+ key: "encodeData",
47113
+ value: function encodeData(data) {
47114
+ if (!window.btoa) {
47115
+ throw "btoa undefined";
47116
+ }
47117
+ var str = "";
47118
+ if (typeof data == "string") {
47119
+ str = data;
47120
+ } else {
47121
+ for (var i = 0; i < data.length; i++) {
47122
+ str += String.fromCharCode(data[i]);
47123
+ }
47124
+ }
47125
+ return btoa(str);
47126
+ }
47127
+ }, {
47128
+ key: "getImageData",
47129
+ value: function getImageData(canvas) {
47130
+ var w = canvas.width,
47131
+ h = canvas.height;
47132
+ return canvas.getContext("2d").getImageData(0, 0, w, h);
47133
+ }
47134
+ }, {
47135
+ key: "makeURI",
47136
+ value: function makeURI(strData, type) {
47137
+ return "data:" + type + ";base64," + strData;
47138
+ }
47139
+ }, {
47140
+ key: "genBitmapImage",
47141
+ value: function genBitmapImage(oData) {
47142
+ var biWidth = oData.width;
47143
+ var biHeight = oData.height;
47144
+ var biSizeImage = biWidth * biHeight * 3;
47145
+ var bfSize = biSizeImage + 54;
47146
+ var BITMAPFILEHEADER = [66, 77, bfSize & 255, bfSize >> 8 & 255, bfSize >> 16 & 255, bfSize >> 24 & 255, 0, 0, 0, 0, 54, 0, 0, 0];
47147
+ var BITMAPINFOHEADER = [40, 0, 0, 0, biWidth & 255, biWidth >> 8 & 255, biWidth >> 16 & 255, biWidth >> 24 & 255, biHeight & 255, biHeight >> 8 & 255, biHeight >> 16 & 255, biHeight >> 24 & 255, 1, 0, 24, 0, 0, 0, 0, 0, biSizeImage & 255, biSizeImage >> 8 & 255, biSizeImage >> 16 & 255, biSizeImage >> 24 & 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
47148
+ var iPadding = (4 - biWidth * 3 % 4) % 4;
47149
+ var aImgData = oData.data;
47150
+ var strPixelData = "";
47151
+ var biWidth4 = biWidth << 2;
47152
+ var y = biHeight;
47153
+ var fromCharCode = String.fromCharCode;
47154
+ do {
47155
+ var iOffsetY = biWidth4 * (y - 1);
47156
+ var strPixelRow = "";
47157
+ for (var x = 0; x < biWidth; x++) {
47158
+ var iOffsetX = x << 2;
47159
+ strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) + fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) + fromCharCode(aImgData[iOffsetY + iOffsetX]);
47160
+ }
47161
+ for (var c = 0; c < iPadding; c++) {
47162
+ strPixelRow += String.fromCharCode(0);
47163
+ }
47164
+ strPixelData += strPixelRow;
47165
+ } while (--y);
47166
+ var strEncoded = this.encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + this.encodeData(strPixelData);
47167
+ return strEncoded;
47168
+ }
47169
+ }, {
47170
+ key: "saveAsImage",
47171
+ value: function saveAsImage(canvas, width, height, type) {
47172
+ if (this.$support.canvas && this.$support.dataURL) {
47173
+ if (typeof canvas == "string") {
47174
+ canvas = this.mydocument.getElementById(canvas);
47175
+ }
47176
+ if (type == void 0) {
47177
+ type = "png";
47178
+ }
47179
+ type = this.fixType(type);
47180
+ if (/bmp/.test(type)) {
47181
+ var data = this.getImageData(this.scaleCanvas(canvas, width, height));
47182
+ var strData = this.genBitmapImage(data);
47183
+ this.saveFile(this.makeURI(strData, this.downloadMime));
47184
+ } else {
47185
+ var _strData = this.getDataURL(canvas, type, width, height);
47186
+ this.saveFile(_strData.replace(type, this.downloadMime));
47187
+ }
47188
+ }
47189
+ }
47190
+ }, {
47191
+ key: "convertToImage",
47192
+ value: function convertToImage(canvas, width, height, type) {
47193
+ if (this.$support.canvas && this.$support.dataURL) {
47194
+ if (typeof canvas == "string") {
47195
+ canvas = this.mydocument.getElementById(canvas);
47196
+ }
47197
+ if (type == void 0) {
47198
+ type = "png";
47199
+ }
47200
+ type = this.fixType(type);
47201
+ if (/bmp/.test(type)) {
47202
+ var data = this.getImageData(this.scaleCanvas(canvas, width, height));
47203
+ var strData = this.genBitmapImage(data);
47204
+ return this.genImage(this.makeURI(strData, "image/bmp"));
47205
+ } else {
47206
+ var _strData2 = this.getDataURL(canvas, type, width, height);
47207
+ return this.genImage(_strData2);
47208
+ }
47209
+ }
47210
+ }
47211
+ }]);
47212
+ return MxCanvas2Image;
47213
+ }();
47214
+
47114
47215
  function _objectDestructuringEmpty(obj) {
47115
47216
  if (obj == null) throw new TypeError("Cannot destructure " + obj);
47116
47217
  }
@@ -104073,6 +104174,7 @@ const mxcad = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
104073
104174
  postMemoryFile,
104074
104175
  postEmscriptenIndexedDBFile,
104075
104176
  createCursor,
104177
+ createMdGeLongLongArrayFormAryId,
104076
104178
  MxTools,
104077
104179
  MxCanvas2Image,
104078
104180
  McGePoint3d,
@@ -104212,4 +104314,4 @@ globalThis.Buffer = buffer$1.Buffer;
104212
104314
  globalThis.Buffer.alloc = buffer$1.Buffer.alloc;
104213
104315
  globalThis.Buffer.from = buffer$1.Buffer.from;
104214
104316
 
104215
- export { ColorIndexType, ColorMethod, DxfCode, FetchAttributes, IMcDbDwgFiler, IsZero, MLineJustificationType, McAppType, McCmColor, McDb, McDb2LineAngularDimension, McDbAlignedDimension, McDbArc, McDbAttribute, McDbAttributeDefinition, McDbBackgroundEntity, McDbBlockReference, McDbBlockTable, McDbBlockTableRecord, McDbCircle, McDbCurve, McDbCustomEntity, McDbDatabase, McDbDiametricDimension, McDbDictionary, McDbDimStyleTable, McDbDimStyleTableRecord, McDbDimension, McDbEllipse, McDbEntity, McDbGroup, McDbHatch$1 as McDbHatch, McDbLayerTable, McDbLayerTableRecord, McDbLine, McDbLinetypeTable, McDbLinetypeTableRecord, McDbMLine, McDbMText, McDbMxRegion, McDbObject, McDbObjectArray, McDbPoint, McDbPolyline, McDbProxyEntity, McDbRadialDimension, McDbRasterImage, McDbRasterImageDef, McDbRay, McDbRotatedDimension, McDbSpatialFilter, McDbSpline, McDbText, McDbTextStyleTable, McDbTextStyleTableRecord, McDbViewport, McDbWipeout, McDbXline, McDbXlsxTable, McDbXrecord, McGeBound, McGeDoubleArray, McGeLongArray, McGeMatrix3d, McGePoint3d, McGePoint3dArray, McGeStringArray, McGeVector3d, McObject, McObjectId, McObjectIdType, McObjectTempDraw, McRxObject, MxCADBaseCustomElement, MxCADBaseCustomText, MxCADCloneType, MxCADMText, MxCADPluginBase, MxCADPluginMapDefaultData, MxCADPluginSampleCode, MxCADResbuf, MxCADSelectionSet, MxCADSelectionSetStatus, MxCADTempForbiddenIntelliSelect, MxCADUiPrAngle, MxCADUiPrBase, MxCADUiPrDist, MxCADUiPrEntity, MxCADUiPrInt, MxCADUiPrKeyWord, MxCADUiPrPoint, MxCADUiPrPointTransform, MxCADUiPrString, MxCADUtility, MxCADUtilityClass, MxCADWorldDraw, MxCADWorldDrawType, MxCanvas2Image, MxCheckTheBrowser, MxCompare, MxCooperate, MxCoordConvert, MxCoordConvertType, MxCpp, MxCppType, MxMap, MxMapAddGoogleCnLayer, MxMapAddRasterTileLayer, MxModifyColor, MxPropertiesWindowCustom, MxPropertiesWindowCustomValue, MxPropertiesWindowCustomValueType, MxTIFFLoader, MxTools, Mx_About, Mx_Erase, TableRenderDirection, _ML_String, b64Decode, b64Encode, crateHexString, createCursor, createMcCmColor, createMxCad, mxcad as default, downloadFile, downloadFileFromUrl, drawArc, drawCircle, drawEllipticalArc, drawLine, drawMText, drawPolyLine, drawPolygon, drawRectang, drawText, getColorUtils, getFileFromUrl, getFilterImp, getJsonFromUrl, loadMxCADassembly, mx_gcj02_To_gps84, mx_gps84_To_gcj02, postEmscriptenIndexedDBFile, postMemoryFile, saveAsFileDialog, setMcCmColor };
104317
+ export { ColorIndexType, ColorMethod, DxfCode, FetchAttributes, IMcDbDwgFiler, IsZero, MLineJustificationType, McAppType, McCmColor, McDb, McDb2LineAngularDimension, McDbAlignedDimension, McDbArc, McDbAttribute, McDbAttributeDefinition, McDbBackgroundEntity, McDbBlockReference, McDbBlockTable, McDbBlockTableRecord, McDbCircle, McDbCurve, McDbCustomEntity, McDbDatabase, McDbDiametricDimension, McDbDictionary, McDbDimStyleTable, McDbDimStyleTableRecord, McDbDimension, McDbEllipse, McDbEntity, McDbGroup, McDbHatch$1 as McDbHatch, McDbLayerTable, McDbLayerTableRecord, McDbLine, McDbLinetypeTable, McDbLinetypeTableRecord, McDbMLine, McDbMText, McDbMxRegion, McDbObject, McDbObjectArray, McDbPoint, McDbPolyline, McDbProxyEntity, McDbRadialDimension, McDbRasterImage, McDbRasterImageDef, McDbRay, McDbRotatedDimension, McDbSpatialFilter, McDbSpline, McDbText, McDbTextStyleTable, McDbTextStyleTableRecord, McDbViewport, McDbWipeout, McDbXline, McDbXlsxTable, McDbXrecord, McGeBound, McGeDoubleArray, McGeLongArray, McGeMatrix3d, McGePoint3d, McGePoint3dArray, McGeStringArray, McGeVector3d, McObject, McObjectId, McObjectIdType, McObjectTempDraw, McRxObject, MxCADBaseCustomElement, MxCADBaseCustomText, MxCADCloneType, MxCADMText, MxCADPluginBase, MxCADPluginMapDefaultData, MxCADPluginSampleCode, MxCADResbuf, MxCADSelectionSet, MxCADSelectionSetStatus, MxCADTempForbiddenIntelliSelect, MxCADUiPrAngle, MxCADUiPrBase, MxCADUiPrDist, MxCADUiPrEntity, MxCADUiPrInt, MxCADUiPrKeyWord, MxCADUiPrPoint, MxCADUiPrPointTransform, MxCADUiPrString, MxCADUtility, MxCADUtilityClass, MxCADWorldDraw, MxCADWorldDrawType, MxCanvas2Image, MxCheckTheBrowser, MxCompare, MxCooperate, MxCoordConvert, MxCoordConvertType, MxCpp, MxCppType, MxMap, MxMapAddGoogleCnLayer, MxMapAddRasterTileLayer, MxModifyColor, MxPropertiesWindowCustom, MxPropertiesWindowCustomValue, MxPropertiesWindowCustomValueType, MxTIFFLoader, MxTools, Mx_About, Mx_Erase, TableRenderDirection, _ML_String, b64Decode, b64Encode, crateHexString, createCursor, createMcCmColor, createMdGeLongLongArrayFormAryId, createMxCad, mxcad as default, downloadFile, downloadFileFromUrl, drawArc, drawCircle, drawEllipticalArc, drawLine, drawMText, drawPolyLine, drawPolygon, drawRectang, drawText, getColorUtils, getFileFromUrl, getFilterImp, getJsonFromUrl, loadMxCADassembly, mx_gcj02_To_gps84, mx_gps84_To_gcj02, postEmscriptenIndexedDBFile, postMemoryFile, saveAsFileDialog, setMcCmColor };