@mlightcad/common 1.14.11 → 1.14.12
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/common.umd.cjs +1 -1
- package/lib/AcCmEventManager.d.ts +8 -0
- package/lib/AcCmEventManager.d.ts.map +1 -1
- package/lib/AcCmEventManager.js +14 -0
- package/lib/AcCmEventManager.js.map +1 -1
- package/lib/AcCmObject.d.ts +19 -5
- package/lib/AcCmObject.d.ts.map +1 -1
- package/lib/AcCmObject.js +117 -28
- package/lib/AcCmObject.js.map +1 -1
- package/package.json +1 -1
package/dist/common.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(h=typeof globalThis<"u"?globalThis:h||self,n(h.common={}))})(this,(function(h){"use strict";var n=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(n||{});const $={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},S=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class b{static getColorByIndex(e){return S[e]}static getIndexByColor(e){const t=S.length-1;for(let s=1;s<t;++s)if(S[s]===e)return s}static getColorByName(e){return $[e.toLowerCase()]}static getNameByColor(e){for(const[t,s]of Object.entries($))if(s===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class m{constructor(e=n.ByLayer,t){this._colorMethod=e,this._colorMethod==n.ByColor&&t==null?this._value=16777215:this._colorMethod==n.ByACI?t==null?this._value=8:t===0?this._colorMethod=n.ByBlock:t===256?this._colorMethod=n.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case n.ByColor:case n.ByBlock:case n.ByLayer:return this._value;case n.ByACI:return this._value?b.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,s){const i=Math.max(0,Math.min(255,Math.round(e))),l=Math.max(0,Math.min(255,Math.round(t))),o=Math.max(0,Math.min(255,Math.round(s)));return this._value=i<<16|l<<8|o,this._colorMethod=n.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?this:(this._value=e&16777215,this._colorMethod=n.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let l=0,o=0,d=0;if(t.length===7)l=parseInt(t.substr(1,2),16),o=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)l=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return this;return this.setRGB(l,o,d)}const s=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(s){const l=parseInt(s[1],10),o=parseInt(s[2],10),d=parseInt(s[3],10);return this.setRGB(l,o,d)}const i=b.getColorByName(e);return i!==void 0?this.setRGBValue(i):this}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}cssColorAlpha(e){const t=this.RGB;if(t!=null)return`rgba(${t>>16&255},${t>>8&255},${t&255},${e})`}get colorIndex(){return this._colorMethod===n.ByACI?this._value:this._colorMethod===n.ByLayer?256:this._colorMethod===n.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=n.ByBlock,this._value=void 0):t===256?(this._colorMethod=n.ByLayer,this._value=void 0):(this._colorMethod=n.ByACI,this._value=t)}get isByColor(){return this._colorMethod===n.ByColor}get isByACI(){return this._colorMethod===n.ByACI}get isForeground(){return this._colorMethod===n.ByACI&&this._value===7}setForeground(){return this._colorMethod=n.ByACI,this._value=7,this}get isByLayer(){return this._colorMethod===n.ByLayer}setByLayer(e){return this._colorMethod=n.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===n.ByBlock}setByBlock(e){return this._colorMethod=n.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByColor:return this._value?b.getNameByColor(this._value):"";case n.ByACI:return this._value?b.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=b.getColorByName(e);t!==void 0&&(this._value=t,this._colorMethod=n.ByColor)}clone(){const e=new m;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case n.None:return"None";case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByACI:return this._value!==void 0?String(this._value):"";case n.ByColor:return this._value?`RGB:${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^none$/i.test(t))return new m(n.None);if(/^bylayer$/i.test(t))return new m(n.ByLayer);if(/^byblock$/i.test(t))return new m(n.ByBlock);const s=t.match(/^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i);if(s){const l=Number(s[1]),o=Number(s[2]),d=Number(s[3]),B=new m(n.ByColor);return B.setRGB(l,o,d),B}if(/^\d{1,3},\d{1,3},\d{1,3}$/.test(t)){const[l,o,d]=t.split(",").map(Number),B=new m(n.ByColor);return B.setRGB(l,o,d),B}if(/^\d+$/.test(t)){const l=parseInt(t,10);return new m(n.ByACI,l)}if(/^book\$/i.test(t)){const l=t.substring(t.indexOf("$")+1),o=b.getColorByName(l);return o!=null?new m(n.ByColor,o):void 0}const i=b.getColorByName(t);if(i!=null)return new m(n.ByColor,i)}}class Q{constructor(e=n.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=n.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=n.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=n.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,s){this._colorMethod=n.ByColor,this._value=(e&255)<<16|(t&255)<<8|s&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=n.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=n.ByLayer,this._value=e}isByColor(){return this._colorMethod===n.ByColor}isByLayer(){return this._colorMethod===n.ByLayer}isByBlock(){return this._colorMethod===n.ByBlock}isByACI(){return this._colorMethod===n.ByACI}isNone(){return this._colorMethod===n.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const ee={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class te{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let l=0,o=i.length;l<o;l++)i[l].call(this,e)}}}class P{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const s of this.listeners)s.call(null,e,...t)}}function I(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function D(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(D);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=D(r[t]));return e}function x(r,...e){for(const t of e)if(t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&r[s]===void 0&&(r[s]=t[s]);return r}function V(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function j(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function L(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!L(r[i],e[i]))return!1;return!0}const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!L(r[i],e[i]))return!1;return!0}function re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var N={exports:{}},se=N.exports,Y;function ne(){return Y||(Y=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(se,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],l={},o=null;function d(u,f){var a=u[f];if(typeof a.bind=="function")return a.bind(u);try{return Function.prototype.bind.call(a,u)}catch{return function(){return Function.prototype.apply.apply(a,[u,arguments])}}}function B(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function k(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&s?B:console[u]!==void 0?d(console,u):console.log!==void 0?d(console,"log"):e}function w(){for(var u=this.getLevel(),f=0;f<i.length;f++){var a=i[f];this[a]=f<u?e:this.methodFactory(a,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function G(u){return function(){typeof console!==t&&(w.call(this),this[u].apply(this,arguments))}}function p(u,f,a){return k(u)||G.apply(this,arguments)}function W(u,f){var a=this,R,q,C,_="loglevel";typeof u=="string"?_+=":"+u:typeof u=="symbol"&&(_=void 0);function ye(c){var y=(i[c]||"silent").toUpperCase();if(!(typeof window===t||!_)){try{window.localStorage[_]=y;return}catch{}try{window.document.cookie=encodeURIComponent(_)+"="+y+";"}catch{}}}function Z(){var c;if(!(typeof window===t||!_)){try{c=window.localStorage[_]}catch{}if(typeof c===t)try{var y=window.document.cookie,T=encodeURIComponent(_),X=y.indexOf(T+"=");X!==-1&&(c=/^([^;]+)/.exec(y.slice(X+T.length+1))[1])}catch{}return a.levels[c]===void 0&&(c=void 0),c}}function pe(){if(!(typeof window===t||!_)){try{window.localStorage.removeItem(_)}catch{}try{window.document.cookie=encodeURIComponent(_)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(c){var y=c;if(typeof y=="string"&&a.levels[y.toUpperCase()]!==void 0&&(y=a.levels[y.toUpperCase()]),typeof y=="number"&&y>=0&&y<=a.levels.SILENT)return y;throw new TypeError("log.setLevel() called with invalid level: "+c)}a.name=u,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=f||p,a.getLevel=function(){return C??q??R},a.setLevel=function(c,y){return C=O(c),y!==!1&&ye(C),w.call(a)},a.setDefaultLevel=function(c){q=O(c),Z()||a.setLevel(c,!1)},a.resetLevel=function(){C=null,pe(),w.call(a)},a.enableAll=function(c){a.setLevel(a.levels.TRACE,c)},a.disableAll=function(c){a.setLevel(a.levels.SILENT,c)},a.rebuild=function(){if(o!==a&&(R=O(o.getLevel())),w.call(a),o===a)for(var c in l)l[c].rebuild()},R=O(o?o.getLevel():"WARN");var J=Z();J!=null&&(C=O(J)),w.call(a)}o=new W,o.getLogger=function(f){if(typeof f!="symbol"&&typeof f!="string"||f==="")throw new TypeError("You must supply a name when creating a logger.");var a=l[f];return a||(a=l[f]=new W(f,o.methodFactory)),a};var fe=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=fe),o},o.getLoggers=function(){return l},o.default=o,o})})(N)),N.exports}var ie=ne();const oe=re(ie),le=!0,A=oe;A.setLevel("debug");const ae=r=>{try{A.setLevel(r)}catch(e){A.setLevel("error"),A.error(e)}};class U{constructor(e,t){this.events={attrChanged:new P,modelChanged:new P},this._changing=!1,this._previousAttributes={},this._pending=!1;const s=e||{};t&&x(s,t),this.attributes=s,this.changed={}}get(e){return this.attributes[e]}set(e,t,s){if(e==null)return this;let i;typeof e=="object"?(i=e,s=t):(i={},i[e]=t),s||(s={});const l=s.unset,o=s.silent,d=[],B=this._changing;this._changing=!0,B||(this._previousAttributes=I(this.attributes),this.changed={});const k=this.attributes,w=this.changed,G=this._previousAttributes;for(const p in i)t=i[p],L(k[p],t)||d.push(p),L(G[p],t)?delete w[p]:w[p]=t,l?delete k[p]:k[p]=t;if(!o){d.length&&(this._pending=s);for(let p=0;p<d.length;p++)this.events.attrChanged.dispatch({object:this,attrName:d[p],attrValue:k[d[p]],options:s})}if(B)return this;if(!o)for(;this._pending;)s=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:s});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!j(this.changed):V(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?I(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,s={};for(const i in e){const l=e[i];L(t[i],l)||(s[i]=l)}return s}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return I(this._previousAttributes)}clone(){const e=I(this.attributes);return new U(e)}}class M{constructor(){this.entries=new Map}static getInstance(){return M.instance||(M.instance=new M),M.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries);}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class he{static formatBytes(e,t=2){if(e===0)return"0 B";const s=1024,i=Math.max(0,t),l=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(e)/Math.log(s)),d=e/Math.pow(s,o);return`${parseFloat(d.toFixed(i))} ${l[o]}`}}var g=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(g||{});class v{constructor(e){e!==void 0?(this._method=g.ByAlpha,this._alpha=v.clampAlpha(e)):(this._method=g.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=v.clampAlpha(e),this._method=g.ByAlpha}get percentage(){if(this._method===g.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),s=Math.round(255*(1-t/100));this.alpha=s}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===g.ByAlpha}get isByBlock(){return this._method===g.ByBlock}get isByLayer(){return this._method===g.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===g.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new v;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim(),s=t.toLowerCase();if(s===""||s==="."||s==="use current"||s==="bylayer"){const o=new v;return o._method=g.ByLayer,o}if(s==="byblock"){const o=new v;return o._method=g.ByBlock,o}const i=Number(t);if(Number.isInteger(i)&&i>=0&&i<=255){const o=new v;return i<=90?o.percentage=i:o.alpha=i,o}const l=new v;return l._method=g.ErrorValue,l}static deserialize(e){const t=e>>>24&255,s=e&255,i=t>=g.ByLayer&&t<=g.ErrorValue?t:g.ErrorValue,l=new v;return l._method=i,l._alpha=v.clampAlpha(s),l}}const z=50;function F(){return new Promise(r=>{typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame(()=>r()):setTimeout(r,0)})}function ue(){return new Promise(r=>{if(typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"){const e=globalThis.requestAnimationFrame;e(()=>e(()=>r()))}else setTimeout(r,0)})}class E{constructor(e=z){this._budgetMs=e,this._lastYieldCompletedAt=E.now()}get budgetMs(){return this._budgetMs}async maybeYield(e=F){return E.now()-this._lastYieldCompletedAt<this._budgetMs?!1:(await e(),this._lastYieldCompletedAt=E.now(),!0)}mark(){this._lastYieldCompletedAt=E.now()}static now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}}class ce{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class de{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}async scheduleTask(e){return await F(),e()}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let s=e;for(let i=0;i<t;i++){const l=this.tasks[i];try{s=await this.scheduleTask(async()=>{const o=await l.run(s);return this.onProgress((i+1)/t,l),o})}catch(o){if(this.onError({error:o,taskIndex:i,task:l}))return Promise.reject(o)}}this.onComplete(s)}}class H{constructor(e,t,s){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,s=this.handlers.length;t<s;t+=2){const i=this.handlers[t],l=this.handlers[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return l}return null}}const K=new H;class ge{constructor(e){this.manager=e!==void 0?e:K,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((s,i)=>{this.load(e,s,t,i)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}h.ACCM_DEFAULT_UI_YIELD_BUDGET_MS=z,h.AcCmColor=m,h.AcCmColorMethod=n,h.AcCmColorUtil=b,h.AcCmEntityColor=Q,h.AcCmErrors=ee,h.AcCmEventDispatcher=te,h.AcCmEventManager=P,h.AcCmLoader=ge,h.AcCmLoadingManager=H,h.AcCmObject=U,h.AcCmPerformanceCollector=M,h.AcCmTask=ce,h.AcCmTaskScheduler=de,h.AcCmTransparency=v,h.AcCmTransparencyMethod=g,h.AcCmUiYieldGate=E,h.AcTrStringUtil=he,h.DEBUG_MODE=le,h.DefaultLoadingManager=K,h.accmYieldForPaint=ue,h.accmYieldToUi=F,h.clone=I,h.deepClone=D,h.defaults=x,h.has=V,h.isEmpty=j,h.isEqual=L,h.log=A,h.setLogLevel=ae,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(u,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u.common={}))})(this,(function(u){"use strict";var i=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(i||{});const V={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},D=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class b{static getColorByIndex(e){return D[e]}static getIndexByColor(e){const t=D.length-1;for(let n=1;n<t;++n)if(D[n]===e)return n}static getColorByName(e){return V[e.toLowerCase()]}static getNameByColor(e){for(const[t,n]of Object.entries(V))if(n===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class _{constructor(e=i.ByLayer,t){this._colorMethod=e,this._colorMethod==i.ByColor&&t==null?this._value=16777215:this._colorMethod==i.ByACI?t==null?this._value=8:t===0?this._colorMethod=i.ByBlock:t===256?this._colorMethod=i.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case i.ByColor:case i.ByBlock:case i.ByLayer:return this._value;case i.ByACI:return this._value?b.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,n){const s=Math.max(0,Math.min(255,Math.round(e))),l=Math.max(0,Math.min(255,Math.round(t))),o=Math.max(0,Math.min(255,Math.round(n)));return this._value=s<<16|l<<8|o,this._colorMethod=i.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?this:(this._value=e&16777215,this._colorMethod=i.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let l=0,o=0,g=0;if(t.length===7)l=parseInt(t.substr(1,2),16),o=parseInt(t.substr(3,2),16),g=parseInt(t.substr(5,2),16);else if(t.length===4)l=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),g=parseInt(t[3]+t[3],16);else return this;return this.setRGB(l,o,g)}const n=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const l=parseInt(n[1],10),o=parseInt(n[2],10),g=parseInt(n[3],10);return this.setRGB(l,o,g)}const s=b.getColorByName(e);return s!==void 0?this.setRGBValue(s):this}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}cssColorAlpha(e){const t=this.RGB;if(t!=null)return`rgba(${t>>16&255},${t>>8&255},${t&255},${e})`}get colorIndex(){return this._colorMethod===i.ByACI?this._value:this._colorMethod===i.ByLayer?256:this._colorMethod===i.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=i.ByBlock,this._value=void 0):t===256?(this._colorMethod=i.ByLayer,this._value=void 0):(this._colorMethod=i.ByACI,this._value=t)}get isByColor(){return this._colorMethod===i.ByColor}get isByACI(){return this._colorMethod===i.ByACI}get isForeground(){return this._colorMethod===i.ByACI&&this._value===7}setForeground(){return this._colorMethod=i.ByACI,this._value=7,this}get isByLayer(){return this._colorMethod===i.ByLayer}setByLayer(e){return this._colorMethod=i.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===i.ByBlock}setByBlock(e){return this._colorMethod=i.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case i.ByLayer:return"ByLayer";case i.ByBlock:return"ByBlock";case i.ByColor:return this._value?b.getNameByColor(this._value):"";case i.ByACI:return this._value?b.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=b.getColorByName(e);t!==void 0&&(this._value=t,this._colorMethod=i.ByColor)}clone(){const e=new _;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case i.None:return"None";case i.ByLayer:return"ByLayer";case i.ByBlock:return"ByBlock";case i.ByACI:return this._value!==void 0?String(this._value):"";case i.ByColor:return this._value?`RGB:${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^none$/i.test(t))return new _(i.None);if(/^bylayer$/i.test(t))return new _(i.ByLayer);if(/^byblock$/i.test(t))return new _(i.ByBlock);const n=t.match(/^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i);if(n){const l=Number(n[1]),o=Number(n[2]),g=Number(n[3]),p=new _(i.ByColor);return p.setRGB(l,o,g),p}if(/^\d{1,3},\d{1,3},\d{1,3}$/.test(t)){const[l,o,g]=t.split(",").map(Number),p=new _(i.ByColor);return p.setRGB(l,o,g),p}if(/^\d+$/.test(t)){const l=parseInt(t,10);return new _(i.ByACI,l)}if(/^book\$/i.test(t)){const l=t.substring(t.indexOf("$")+1),o=b.getColorByName(l);return o!=null?new _(i.ByColor,o):void 0}const s=b.getColorByName(t);if(s!=null)return new _(i.ByColor,s)}}class ee{constructor(e=i.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=i.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=i.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=i.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,n){this._colorMethod=i.ByColor,this._value=(e&255)<<16|(t&255)<<8|n&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=i.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=i.ByLayer,this._value=e}isByColor(){return this._colorMethod===i.ByColor}isByLayer(){return this._colorMethod===i.ByLayer}isByBlock(){return this._colorMethod===i.ByBlock}isByACI(){return this._colorMethod===i.ByACI}isNone(){return this._colorMethod===i.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const te={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class re{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let l=0,o=s.length;l<o;l++)s[l].call(this,e)}}}class F{constructor(){this.listeners=[]}get listenerCount(){return this.listeners.length}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const n of this.listeners)n.call(null,e,...t)}}function L(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function G(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(G);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=G(r[t]));return e}function j(r,...e){for(const t of e)if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r[n]===void 0&&(r[n]=t[n]);return r}function Y(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function z(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function w(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++)if(!w(r[s],e[s]))return!1;return!0}const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(const s of t)if(!Object.prototype.hasOwnProperty.call(e,s)||!w(r[s],e[s]))return!1;return!0}function ne(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var R={exports:{}},se=R.exports,H;function ie(){return H||(H=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(se,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],l={},o=null;function g(a,d){var h=a[d];if(typeof h.bind=="function")return h.bind(a);try{return Function.prototype.bind.call(h,a)}catch{return function(){return Function.prototype.apply.apply(h,[a,arguments])}}}function p(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function T(a){return a==="debug"&&(a="log"),typeof console===t?!1:a==="trace"&&n?p:console[a]!==void 0?g(console,a):console.log!==void 0?g(console,"log"):e}function v(){for(var a=this.getLevel(),d=0;d<s.length;d++){var h=s[d];this[h]=d<a?e:this.methodFactory(h,a,this.name)}if(this.log=this.debug,typeof console===t&&a<this.levels.SILENT)return"No console available for logging"}function C(a){return function(){typeof console!==t&&(v.call(this),this[a].apply(this,arguments))}}function A(a,d,h){return T(a)||C.apply(this,arguments)}function O(a,d){var h=this,P,x,k,B="loglevel";typeof a=="string"?B+=":"+a:typeof a=="symbol"&&(B=void 0);function ye(c){var y=(s[c]||"silent").toUpperCase();if(!(typeof window===t||!B)){try{window.localStorage[B]=y;return}catch{}try{window.document.cookie=encodeURIComponent(B)+"="+y+";"}catch{}}}function J(){var c;if(!(typeof window===t||!B)){try{c=window.localStorage[B]}catch{}if(typeof c===t)try{var y=window.document.cookie,U=encodeURIComponent(B),Q=y.indexOf(U+"=");Q!==-1&&(c=/^([^;]+)/.exec(y.slice(Q+U.length+1))[1])}catch{}return h.levels[c]===void 0&&(c=void 0),c}}function pe(){if(!(typeof window===t||!B)){try{window.localStorage.removeItem(B)}catch{}try{window.document.cookie=encodeURIComponent(B)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(c){var y=c;if(typeof y=="string"&&h.levels[y.toUpperCase()]!==void 0&&(y=h.levels[y.toUpperCase()]),typeof y=="number"&&y>=0&&y<=h.levels.SILENT)return y;throw new TypeError("log.setLevel() called with invalid level: "+c)}h.name=a,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=d||A,h.getLevel=function(){return k??x??P},h.setLevel=function(c,y){return k=N(c),y!==!1&&ye(k),v.call(h)},h.setDefaultLevel=function(c){x=N(c),J()||h.setLevel(c,!1)},h.resetLevel=function(){k=null,pe(),v.call(h)},h.enableAll=function(c){h.setLevel(h.levels.TRACE,c)},h.disableAll=function(c){h.setLevel(h.levels.SILENT,c)},h.rebuild=function(){if(o!==h&&(P=N(o.getLevel())),v.call(h),o===h)for(var c in l)l[c].rebuild()},P=N(o?o.getLevel():"WARN");var X=J();X!=null&&(k=N(X)),v.call(h)}o=new O,o.getLogger=function(d){if(typeof d!="symbol"&&typeof d!="string"||d==="")throw new TypeError("You must supply a name when creating a logger.");var h=l[d];return h||(h=l[d]=new O(d,o.methodFactory)),h};var S=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=S),o},o.getLoggers=function(){return l},o.default=o,o})})(R)),R.exports}var oe=ie();const le=ne(oe),ae=!0,I=le;I.setLevel("debug");const he=r=>{try{I.setLevel(r)}catch(e){I.setLevel("error"),I.error(e)}};class q{constructor(e,t){this._changing=!1,this._pending=!1;const n=e||{};t&&j(n,t),this.attributes=n}get events(){return this._events??(this._events={attrChanged:new F,modelChanged:new F})}get changed(){return this._changed??(this._changed={})}get(e){return this.attributes[e]}set(e,t,n){var O,S;if(e==null)return this;let s;typeof e=="object"?(s=e,n=t):(s={},s[e]=t),n||(n={});const l=n.unset,o=n.silent,g=this._events;if(!l&&!this._changing&&(g===void 0||g.attrChanged.listenerCount===0&&g.modelChanged.listenerCount===0)){if(typeof e=="object"){const a=e;for(const d in a)this.attributes[d]=a[d]}else this.attributes[e]=t;return this}if(!l){let a=!0;for(const d in s)if(this.attributes[d]!==s[d]){a=!1;break}if(a)return this._changing||(this._previousAttributes=L(this.attributes),this._changed={}),this}let p=null;const T=this._changing;this._changing=!0,T||(this._previousAttributes=L(this.attributes),this._changed={});const v=this.attributes,C=this._changed??(this._changed={}),A=this._previousAttributes??{};for(const a in s){if(t=s[a],!l&&v[a]===t){A[a]===t||w(A[a],t)?delete C[a]:C[a]=t;continue}w(v[a],t)||(p||(p=[])).push(a),w(A[a],t)?delete C[a]:C[a]=t,l?delete v[a]:v[a]=t}if(!o&&(p&&(this._pending=n),p))for(let a=0;a<p.length;a++)(O=this._events)==null||O.attrChanged.dispatch({object:this,attrName:p[a],attrValue:v[p[a]],options:n});if(T)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,(S=this._events)==null||S.modelChanged.dispatch({object:this,options:n});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!z(this._changed):this._changed?Y(this._changed,e):!1}changedAttributes(e){if(!e)return this.hasChanged()?L(this._changed??{}):{};const t=this._changing?this._previousAttributes:this.attributes,n={};for(const s in e){const l=e[s];w(t==null?void 0:t[s],l)||(n[s]=l)}return n}previous(e){var t;return e==null?null:(t=this._previousAttributes)==null?void 0:t[e]}previousAttributes(){return L(this._previousAttributes??{})}clone(){const e=L(this.attributes);return new q(e)}}class M{constructor(){this.entries=new Map}static getInstance(){return M.instance||(M.instance=new M),M.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries);}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class ue{static formatBytes(e,t=2){if(e===0)return"0 B";const n=1024,s=Math.max(0,t),l=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(e)/Math.log(n)),g=e/Math.pow(n,o);return`${parseFloat(g.toFixed(s))} ${l[o]}`}}var f=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(f||{});class m{constructor(e){e!==void 0?(this._method=f.ByAlpha,this._alpha=m.clampAlpha(e)):(this._method=f.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=m.clampAlpha(e),this._method=f.ByAlpha}get percentage(){if(this._method===f.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),n=Math.round(255*(1-t/100));this.alpha=n}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===f.ByAlpha}get isByBlock(){return this._method===f.ByBlock}get isByLayer(){return this._method===f.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===f.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new m;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim(),n=t.toLowerCase();if(n===""||n==="."||n==="use current"||n==="bylayer"){const o=new m;return o._method=f.ByLayer,o}if(n==="byblock"){const o=new m;return o._method=f.ByBlock,o}const s=Number(t);if(Number.isInteger(s)&&s>=0&&s<=255){const o=new m;return s<=90?o.percentage=s:o.alpha=s,o}const l=new m;return l._method=f.ErrorValue,l}static deserialize(e){const t=e>>>24&255,n=e&255,s=t>=f.ByLayer&&t<=f.ErrorValue?t:f.ErrorValue,l=new m;return l._method=s,l._alpha=m.clampAlpha(n),l}}const K=50;function $(){return new Promise(r=>{typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame(()=>r()):setTimeout(r,0)})}function ce(){return new Promise(r=>{if(typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"){const e=globalThis.requestAnimationFrame;e(()=>e(()=>r()))}else setTimeout(r,0)})}class E{constructor(e=K){this._budgetMs=e,this._lastYieldCompletedAt=E.now()}get budgetMs(){return this._budgetMs}async maybeYield(e=$){return E.now()-this._lastYieldCompletedAt<this._budgetMs?!1:(await e(),this._lastYieldCompletedAt=E.now(),!0)}mark(){this._lastYieldCompletedAt=E.now()}static now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}}class de{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class ge{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}async scheduleTask(e){return await $(),e()}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let n=e;for(let s=0;s<t;s++){const l=this.tasks[s];try{n=await this.scheduleTask(async()=>{const o=await l.run(n);return this.onProgress((s+1)/t,l),o})}catch(o){if(this.onError({error:o,taskIndex:s,task:l}))return Promise.reject(o)}}this.onComplete(n)}}class W{constructor(e,t,n){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,n=this.handlers.length;t<n;t+=2){const s=this.handlers[t],l=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return l}return null}}const Z=new W;class fe{constructor(e){this.manager=e!==void 0?e:Z,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((n,s)=>{this.load(e,n,t,s)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}u.ACCM_DEFAULT_UI_YIELD_BUDGET_MS=K,u.AcCmColor=_,u.AcCmColorMethod=i,u.AcCmColorUtil=b,u.AcCmEntityColor=ee,u.AcCmErrors=te,u.AcCmEventDispatcher=re,u.AcCmEventManager=F,u.AcCmLoader=fe,u.AcCmLoadingManager=W,u.AcCmObject=q,u.AcCmPerformanceCollector=M,u.AcCmTask=de,u.AcCmTaskScheduler=ge,u.AcCmTransparency=m,u.AcCmTransparencyMethod=f,u.AcCmUiYieldGate=E,u.AcTrStringUtil=ue,u.DEBUG_MODE=ae,u.DefaultLoadingManager=Z,u.accmYieldForPaint=ce,u.accmYieldToUi=$,u.clone=L,u.deepClone=G,u.defaults=j,u.has=Y,u.isEmpty=z,u.isEqual=w,u.log=I,u.setLogLevel=he,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -42,6 +42,14 @@
|
|
|
42
42
|
*/
|
|
43
43
|
export declare class AcCmEventManager<T = unknown> {
|
|
44
44
|
private listeners;
|
|
45
|
+
/**
|
|
46
|
+
* Number of listeners currently registered.
|
|
47
|
+
*
|
|
48
|
+
* Used by `AcCmObject.set` to decide whether an untracked fast path is
|
|
49
|
+
* possible — a zero-listener check is cheaper than the lazy container
|
|
50
|
+
* allocation (`listenerCount === 0` means "nobody is listening").
|
|
51
|
+
*/
|
|
52
|
+
get listenerCount(): number;
|
|
45
53
|
/**
|
|
46
54
|
* Add the event listener
|
|
47
55
|
* @param listener Input listener to be added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmEventManager.d.ts","sourceRoot":"","sources":["../src/AcCmEventManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,gBAAgB,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,CAAC,SAAS,CAA+B;IAEhD;;;OAGG;IACI,gBAAgB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAItD;;;OAGG;IACI,mBAAmB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAIzD;;;OAGG;IACI,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAK1D;;;OAGG;IACI,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;CAMhD"}
|
|
1
|
+
{"version":3,"file":"AcCmEventManager.d.ts","sourceRoot":"","sources":["../src/AcCmEventManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,gBAAgB,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,CAAC,SAAS,CAA+B;IAEhD;;;;;;OAMG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;;OAGG;IACI,gBAAgB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAItD;;;OAGG;IACI,mBAAmB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAIzD;;;OAGG;IACI,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI;IAK1D;;;OAGG;IACI,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;CAMhD"}
|
package/lib/AcCmEventManager.js
CHANGED
|
@@ -80,6 +80,20 @@ var AcCmEventManager = /** @class */ (function () {
|
|
|
80
80
|
function AcCmEventManager() {
|
|
81
81
|
this.listeners = [];
|
|
82
82
|
}
|
|
83
|
+
Object.defineProperty(AcCmEventManager.prototype, "listenerCount", {
|
|
84
|
+
/**
|
|
85
|
+
* Number of listeners currently registered.
|
|
86
|
+
*
|
|
87
|
+
* Used by `AcCmObject.set` to decide whether an untracked fast path is
|
|
88
|
+
* possible — a zero-listener check is cheaper than the lazy container
|
|
89
|
+
* allocation (`listenerCount === 0` means "nobody is listening").
|
|
90
|
+
*/
|
|
91
|
+
get: function () {
|
|
92
|
+
return this.listeners.length;
|
|
93
|
+
},
|
|
94
|
+
enumerable: false,
|
|
95
|
+
configurable: true
|
|
96
|
+
});
|
|
83
97
|
/**
|
|
84
98
|
* Add the event listener
|
|
85
99
|
* @param listener Input listener to be added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmEventManager.js","sourceRoot":"","sources":["../src/AcCmEventManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAAA;QACU,cAAS,GAA6B,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"AcCmEventManager.js","sourceRoot":"","sources":["../src/AcCmEventManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAAA;QACU,cAAS,GAA6B,EAAE,CAAA;IAgDlD,CAAC;IAvCC,sBAAW,2CAAa;QAPxB;;;;;;WAMG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;QAC9B,CAAC;;;OAAA;IAED;;;OAGG;IACI,2CAAgB,GAAvB,UAAwB,QAA8B;QACpD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC;IAED;;;OAGG;IACI,8CAAmB,GAA1B,UAA2B,QAA8B;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,QAAQ,EAAd,CAAc,CAAC,CAAA;IAC7D,CAAC;IAED;;;OAGG;IACI,+CAAoB,GAA3B,UAA4B,QAA8B;QACxD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IAED;;;OAGG;IACI,mCAAQ,GAAf,UAAgB,OAAW;;QAAE,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,6BAAkB;;;YAC7C,KAAmB,IAAA,KAAA,SAAA,IAAI,CAAC,SAAS,CAAA,gBAAA,4BAAE,CAAC;gBAA/B,IAAM,IAAI,WAAA;gBACb,IAAM,QAAQ,GAAG,IAAoC,CAAA;gBACrD,QAAQ,CAAC,IAAI,OAAb,QAAQ,iBAAM,IAAI,EAAE,OAAO,UAAK,IAAI,WAAC;YACvC,CAAC;;;;;;;;;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AAjDD,IAiDC"}
|
package/lib/AcCmObject.d.ts
CHANGED
|
@@ -44,14 +44,28 @@ export interface AcCmObjectAttributeChangedEventArgs<T extends AcCmAttributes> e
|
|
|
44
44
|
*/
|
|
45
45
|
export declare class AcCmObject<T extends AcCmAttributes = any> {
|
|
46
46
|
attributes: Partial<T>;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
private _events?;
|
|
48
|
+
private _changed?;
|
|
49
|
+
private _changing;
|
|
50
|
+
private _previousAttributes?;
|
|
51
|
+
private _pending;
|
|
52
|
+
/**
|
|
53
|
+
* Change-event managers of this object, materialized on first read.
|
|
54
|
+
*
|
|
55
|
+
* Reading this property is what "somebody observes this object" means for the
|
|
56
|
+
* {@link set} fast path: until a listener is registered the underlying
|
|
57
|
+
* managers (and their listener arrays) are never allocated.
|
|
58
|
+
*/
|
|
59
|
+
get events(): {
|
|
49
60
|
attrChanged: AcCmEventManager<AcCmObjectAttributeChangedEventArgs<T>>;
|
|
50
61
|
modelChanged: AcCmEventManager<AcCmObjectChangedEventArgs<T>>;
|
|
51
62
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Attributes changed during the current change session, materialized on first
|
|
65
|
+
* read. Stays `undefined` while no tracked write happened, so importing code
|
|
66
|
+
* that never looks at it pays nothing.
|
|
67
|
+
*/
|
|
68
|
+
get changed(): Partial<T>;
|
|
55
69
|
/**
|
|
56
70
|
* Create one object to store attributes. For performance reason, values of attributes passed to constructor
|
|
57
71
|
* will not be cloned to `attributes` property. So it means that value of `attributes` property in this object
|
package/lib/AcCmObject.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmObject.d.ts","sourceRoot":"","sources":["../src/AcCmObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEhD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,MAAM,aAAa,CA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AAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO;IAInC;;;OAGG;IACH,UAAU,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;IAKjC;;;;;;OAMG;IACH,iBAAiB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAchD;;OAEG;IACH,QAAQ,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;IAKrE;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC;IAIhC;;OAEG;IACH,KAAK;CAIN"}
|
package/lib/AcCmObject.js
CHANGED
|
@@ -29,20 +29,45 @@ var AcCmObject = /** @class */ (function () {
|
|
|
29
29
|
* @param attributes Input attributes to store in this object
|
|
30
30
|
*/
|
|
31
31
|
function AcCmObject(attributes, defaultAttrs) {
|
|
32
|
-
this.events = {
|
|
33
|
-
attrChanged: new AcCmEventManager(),
|
|
34
|
-
modelChanged: new AcCmEventManager()
|
|
35
|
-
};
|
|
36
32
|
this._changing = false;
|
|
37
|
-
this._previousAttributes = {};
|
|
38
33
|
this._pending = false;
|
|
39
34
|
var attrs = attributes || {};
|
|
40
35
|
if (defaultAttrs) {
|
|
41
36
|
defaults(attrs, defaultAttrs);
|
|
42
37
|
}
|
|
43
38
|
this.attributes = attrs;
|
|
44
|
-
this.changed = {};
|
|
45
39
|
}
|
|
40
|
+
Object.defineProperty(AcCmObject.prototype, "events", {
|
|
41
|
+
/**
|
|
42
|
+
* Change-event managers of this object, materialized on first read.
|
|
43
|
+
*
|
|
44
|
+
* Reading this property is what "somebody observes this object" means for the
|
|
45
|
+
* {@link set} fast path: until a listener is registered the underlying
|
|
46
|
+
* managers (and their listener arrays) are never allocated.
|
|
47
|
+
*/
|
|
48
|
+
get: function () {
|
|
49
|
+
var _a;
|
|
50
|
+
return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = {
|
|
51
|
+
attrChanged: new AcCmEventManager(),
|
|
52
|
+
modelChanged: new AcCmEventManager()
|
|
53
|
+
}));
|
|
54
|
+
},
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(AcCmObject.prototype, "changed", {
|
|
59
|
+
/**
|
|
60
|
+
* Attributes changed during the current change session, materialized on first
|
|
61
|
+
* read. Stays `undefined` while no tracked write happened, so importing code
|
|
62
|
+
* that never looks at it pays nothing.
|
|
63
|
+
*/
|
|
64
|
+
get: function () {
|
|
65
|
+
var _a;
|
|
66
|
+
return ((_a = this._changed) !== null && _a !== void 0 ? _a : (this._changed = {}));
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
46
71
|
/**
|
|
47
72
|
* Gets the value of an attribute.
|
|
48
73
|
*
|
|
@@ -73,6 +98,7 @@ var AcCmObject = /** @class */ (function () {
|
|
|
73
98
|
return this.attributes[key];
|
|
74
99
|
};
|
|
75
100
|
AcCmObject.prototype.set = function (key, val, options) {
|
|
101
|
+
var _a, _b, _c, _d;
|
|
76
102
|
if (key == null)
|
|
77
103
|
return this;
|
|
78
104
|
// Handle both `"key", value` and `{key: value}` -style arguments.
|
|
@@ -89,21 +115,78 @@ var AcCmObject = /** @class */ (function () {
|
|
|
89
115
|
// Extract attributes and options.
|
|
90
116
|
var unset = options.unset;
|
|
91
117
|
var silent = options.silent;
|
|
92
|
-
|
|
118
|
+
// Untracked fast path: nobody observes this object's change events, so the
|
|
119
|
+
// session snapshot (`_previousAttributes` / `changed`), the per-attribute
|
|
120
|
+
// deep comparisons and the event payloads would all be invisible work.
|
|
121
|
+
// Write straight to `attributes` instead (see the class doc for the
|
|
122
|
+
// `hasChanged()` / `previous()` contract narrowing this implies). This
|
|
123
|
+
// reads the private `_events` field instead of the `events` getter so the
|
|
124
|
+
// check itself never materializes the managers.
|
|
125
|
+
var events = this._events;
|
|
126
|
+
if (!unset &&
|
|
127
|
+
!this._changing &&
|
|
128
|
+
(events === undefined ||
|
|
129
|
+
(events.attrChanged.listenerCount === 0 &&
|
|
130
|
+
events.modelChanged.listenerCount === 0))) {
|
|
131
|
+
if (typeof key === 'object') {
|
|
132
|
+
var directAttrs = key;
|
|
133
|
+
for (var attr in directAttrs) {
|
|
134
|
+
this.attributes[attr] = directAttrs[attr];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.attributes[key] = val;
|
|
139
|
+
}
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
if (!unset) {
|
|
143
|
+
// Fast path: when every written value is reference-equal to the current
|
|
144
|
+
// value, no attribute walk can produce changes. Replicate the session
|
|
145
|
+
// bookkeeping (snapshot + changed reset) exactly, then return — the
|
|
146
|
+
// per-attribute deep `isEqual` walks are the only work skipped.
|
|
147
|
+
var allUnchanged = true;
|
|
148
|
+
for (var attr in attrs) {
|
|
149
|
+
if (this.attributes[attr] !== attrs[attr]) {
|
|
150
|
+
allUnchanged = false;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (allUnchanged) {
|
|
155
|
+
if (!this._changing) {
|
|
156
|
+
this._previousAttributes = clone(this.attributes);
|
|
157
|
+
this._changed = {};
|
|
158
|
+
}
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// `changes` is allocated lazily: sets that change nothing never dispatch.
|
|
163
|
+
var changes = null;
|
|
93
164
|
var changing = this._changing;
|
|
94
165
|
this._changing = true;
|
|
95
166
|
if (!changing) {
|
|
96
167
|
this._previousAttributes = clone(this.attributes);
|
|
97
|
-
this.
|
|
168
|
+
this._changed = {};
|
|
98
169
|
}
|
|
99
170
|
var current = this.attributes;
|
|
100
|
-
var changed = this.
|
|
101
|
-
var prev = this._previousAttributes;
|
|
171
|
+
var changed = ((_a = this._changed) !== null && _a !== void 0 ? _a : (this._changed = {}));
|
|
172
|
+
var prev = (_b = this._previousAttributes) !== null && _b !== void 0 ? _b : {};
|
|
102
173
|
// For each `set` attribute, update or delete the current value.
|
|
103
174
|
for (var attr in attrs) {
|
|
104
175
|
val = attrs[attr];
|
|
176
|
+
if (!unset && current[attr] === val) {
|
|
177
|
+
// Reference-equal: no write, no change event. `changed` still needs
|
|
178
|
+
// reconciling against the session snapshot when the attribute was
|
|
179
|
+
// mutated earlier in this session and set back to its current value.
|
|
180
|
+
if (prev[attr] === val || isEqual(prev[attr], val)) {
|
|
181
|
+
delete changed[attr];
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
changed[attr] = val;
|
|
185
|
+
}
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
105
188
|
if (!isEqual(current[attr], val))
|
|
106
|
-
changes.push(attr);
|
|
189
|
+
(changes || (changes = [])).push(attr);
|
|
107
190
|
if (!isEqual(prev[attr], val)) {
|
|
108
191
|
changed[attr] = val;
|
|
109
192
|
}
|
|
@@ -115,15 +198,17 @@ var AcCmObject = /** @class */ (function () {
|
|
|
115
198
|
// Trigger all relevant attribute changes.
|
|
116
199
|
if (!silent) {
|
|
117
200
|
// @ts-expect-error just keep backbone implementation as is
|
|
118
|
-
if (changes
|
|
201
|
+
if (changes)
|
|
119
202
|
this._pending = options;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
203
|
+
if (changes) {
|
|
204
|
+
for (var i = 0; i < changes.length; i++) {
|
|
205
|
+
(_c = this._events) === null || _c === void 0 ? void 0 : _c.attrChanged.dispatch({
|
|
206
|
+
object: this,
|
|
207
|
+
attrName: changes[i],
|
|
208
|
+
attrValue: current[changes[i]],
|
|
209
|
+
options: options
|
|
210
|
+
});
|
|
211
|
+
}
|
|
127
212
|
}
|
|
128
213
|
}
|
|
129
214
|
// You might be wondering why there's a `while` loop here. Changes can
|
|
@@ -135,7 +220,7 @@ var AcCmObject = /** @class */ (function () {
|
|
|
135
220
|
// @ts-expect-error just keep backbone implementation as is
|
|
136
221
|
options = this._pending;
|
|
137
222
|
this._pending = false;
|
|
138
|
-
this.
|
|
223
|
+
(_d = this._events) === null || _d === void 0 ? void 0 : _d.modelChanged.dispatch({
|
|
139
224
|
object: this,
|
|
140
225
|
options: options
|
|
141
226
|
});
|
|
@@ -154,8 +239,8 @@ var AcCmObject = /** @class */ (function () {
|
|
|
154
239
|
*/
|
|
155
240
|
AcCmObject.prototype.hasChanged = function (key) {
|
|
156
241
|
if (key == null)
|
|
157
|
-
return !isEmpty(this.
|
|
158
|
-
return has(this.
|
|
242
|
+
return !isEmpty(this._changed);
|
|
243
|
+
return this._changed ? has(this._changed, key) : false;
|
|
159
244
|
};
|
|
160
245
|
/**
|
|
161
246
|
* Return an object containing all the attributes that have changed. Useful for determining what parts
|
|
@@ -165,13 +250,15 @@ var AcCmObject = /** @class */ (function () {
|
|
|
165
250
|
* the model, determining if there *would be* a change.
|
|
166
251
|
*/
|
|
167
252
|
AcCmObject.prototype.changedAttributes = function (diff) {
|
|
168
|
-
|
|
169
|
-
|
|
253
|
+
var _a;
|
|
254
|
+
if (!diff) {
|
|
255
|
+
return this.hasChanged() ? clone((_a = this._changed) !== null && _a !== void 0 ? _a : {}) : {};
|
|
256
|
+
}
|
|
170
257
|
var old = this._changing ? this._previousAttributes : this.attributes;
|
|
171
258
|
var changed = {};
|
|
172
259
|
for (var attr in diff) {
|
|
173
260
|
var val = diff[attr];
|
|
174
|
-
if (isEqual(old[attr], val))
|
|
261
|
+
if (isEqual(old === null || old === void 0 ? void 0 : old[attr], val))
|
|
175
262
|
continue;
|
|
176
263
|
changed[attr] = val;
|
|
177
264
|
}
|
|
@@ -181,15 +268,17 @@ var AcCmObject = /** @class */ (function () {
|
|
|
181
268
|
* Get the previous value of an attribute, recorded at the time the last `"change"` event was fired.
|
|
182
269
|
*/
|
|
183
270
|
AcCmObject.prototype.previous = function (key) {
|
|
184
|
-
|
|
271
|
+
var _a;
|
|
272
|
+
if (key == null)
|
|
185
273
|
return null;
|
|
186
|
-
return this._previousAttributes[key];
|
|
274
|
+
return (_a = this._previousAttributes) === null || _a === void 0 ? void 0 : _a[key];
|
|
187
275
|
};
|
|
188
276
|
/**
|
|
189
277
|
* Get all of the attributes of the model at the time of the previous `"change"` event.
|
|
190
278
|
*/
|
|
191
279
|
AcCmObject.prototype.previousAttributes = function () {
|
|
192
|
-
|
|
280
|
+
var _a;
|
|
281
|
+
return clone((_a = this._previousAttributes) !== null && _a !== void 0 ? _a : {});
|
|
193
282
|
};
|
|
194
283
|
/**
|
|
195
284
|
* Create a new model with identical attributes to this one.
|
package/lib/AcCmObject.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmObject.js","sourceRoot":"","sources":["../src/AcCmObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAiC1E;;;;;;;;;GASG;AACH,8DAA8D;AAC9D;
|
|
1
|
+
{"version":3,"file":"AcCmObject.js","sourceRoot":"","sources":["../src/AcCmObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAiC1E;;;;;;;;;GASG;AACH,8DAA8D;AAC9D;IAwCE;;;;;OAKG;IACH,oBAAY,UAAuB,EAAE,YAAyB;QAtCtD,cAAS,GAAY,KAAK,CAAA;QAE1B,aAAQ,GAAY,KAAK,CAAA;QAqC/B,I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