yoga-wasm-web
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,2 +0,1 @@ | ||
var jn=Object.create;var fn=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Yn=Object.getOwnPropertyNames;var Hn=Object.getPrototypeOf,xn=Object.prototype.hasOwnProperty;var cn=(p,m)=>()=>(m||p((m={exports:{}}).exports,m),m.exports);var kn=(p,m,l,w)=>{if(m&&typeof m=="object"||typeof m=="function")for(let v of Yn(m))!xn.call(p,v)&&v!==l&&fn(p,v,{get:()=>m[v],enumerable:!(w=Xn(m,v))||w.enumerable});return p};var Bn=(p,m,l)=>(l=p!=null?jn(Hn(p)):{},kn(m||!p||!p.__esModule?fn(l,"default",{value:p,enumerable:!0}):l,p));var hn=cn((Jn,ln)=>{ln.exports={ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE:1,EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN:2,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,GUTTER_COLUMN:0,GUTTER_ROW:1,GUTTER_ALL:2,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_STATIC:0,POSITION_TYPE_RELATIVE:1,POSITION_TYPE_ABSOLUTE:2,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2}});var vn=cn((Zn,pn)=>{var Y=hn();pn.exports=p=>{function m(v,g,L){let I=v[g];v[g]=function(..._){return L.call(this,I,..._)}}for(let v of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"]){let g={[Y.UNIT_POINT]:p.Node.prototype[v],[Y.UNIT_PERCENT]:p.Node.prototype[`${v}Percent`],[Y.UNIT_AUTO]:p.Node.prototype[`${v}Auto`]};m(p.Node.prototype,v,function(L,...I){let _=I.pop(),C,U;if(_==="auto")C=Y.UNIT_AUTO,U=void 0;else if(typeof _=="object")C=_.unit,U=_.valueOf();else if(C=typeof _=="string"&&_.endsWith("%")?Y.UNIT_PERCENT:Y.UNIT_POINT,U=parseFloat(_),!Number.isNaN(_)&&Number.isNaN(U))throw new Error(`Invalid value ${_} for ${v}`);if(!g[C])throw new Error(`Failed to execute "${v}": Unsupported unit '${_}'`);return U!==void 0?g[C].call(this,...I,U):g[C].call(this,...I)})}function l(v){return p.MeasureCallback.implement({measure:(...g)=>{let{width:L,height:I}=v(...g);return{width:L??NaN,height:I??NaN}}})}m(p.Node.prototype,"setMeasureFunc",function(v,g){return g?v.call(this,l(g)):this.unsetMeasureFunc()});function w(v){return p.DirtiedCallback.implement({dirtied:v})}return m(p.Node.prototype,"setDirtiedFunc",function(v,g){v.call(this,w(g))}),m(p.Config.prototype,"free",function(){p.Config.destroy(this)}),m(p.Node,"create",(v,g)=>g?p.Node.createWithConfig(g):p.Node.createDefault()),m(p.Node.prototype,"free",function(){p.Node.destroy(this)}),m(p.Node.prototype,"freeRecursive",function(){for(let v=0,g=this.getChildCount();v<g;++v)this.getChild(0).freeRecursive();this.free()}),m(p.Node.prototype,"calculateLayout",function(v,g=NaN,L=NaN,I=Y.DIRECTION_LTR){return v.call(this,g,L,I)}),{Config:p.Config,Node:p.Node,...Y}}});var Ft=Bn(vn(),1);var $n=(()=>{var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(m={}){var l;l||(l=typeof m<"u"?m:{});var w,v;l.ready=new Promise(function(t,n){w=t,v=n});var g=Object.assign({},l),L="";typeof document<"u"&&document.currentScript&&(L=document.currentScript.src),p&&(L=p),L.indexOf("blob:")!==0?L=L.substr(0,L.replace(/[?#].*/,"").lastIndexOf("/")+1):L="";var I=console.log.bind(console),_=console.warn.bind(console);Object.assign(l,g),g=null,typeof WebAssembly!="object"&&K("no native wasm support detected");var C,U=!1;function Dt(t,n,r){r=n+r;for(var e="";!(n>=r);){var i=t[n++];if(!i)break;if(i&128){var o=t[n++]&63;if((i&224)==192)e+=String.fromCharCode((i&31)<<6|o);else{var a=t[n++]&63;i=(i&240)==224?(i&15)<<12|o<<6|a:(i&7)<<18|o<<12|a<<6|t[n++]&63,65536>i?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|i&1023))}}else e+=String.fromCharCode(i)}return e}var dt,O,B,yt,H,A,Vt,Gt;function jt(){var t=C.buffer;l.HEAP8=dt=new Int8Array(t),l.HEAP16=B=new Int16Array(t),l.HEAP32=H=new Int32Array(t),l.HEAPU8=O=new Uint8Array(t),l.HEAPU16=yt=new Uint16Array(t),l.HEAPU32=A=new Uint32Array(t),l.HEAPF32=Vt=new Float32Array(t),l.HEAPF64=Gt=new Float64Array(t)}var Xt,dn=[],Yt=[],yn=[],Z=0,mt=null,q=null;function K(t){throw t="Aborted("+t+")",_(t),U=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),v(t),t}function Ht(){return x.startsWith("data:application/octet-stream;base64,")}var x;x="yoga.wasm",Ht()||(x=L+x);function xt(){try{throw"both async and sync fetching of the wasm failed"}catch(t){K(t)}}function mn(){return typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+x+"'";return t.arrayBuffer()}).catch(function(){return xt()}):Promise.resolve().then(function(){return xt()})}function Et(t){for(;0<t.length;)t.shift()(l)}function kt(t){if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var n=t.charCodeAt(0);return 48<=n&&57>=n?"_"+t:t}function gt(t,n){return t=kt(t),function(){return n.apply(this,arguments)}}var R=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Tt=[];function et(t){var n=Error,r=gt(t,function(e){this.name=t,this.message=e,e=Error(e).stack,e!==void 0&&(this.stack=this.toString()+` | ||
`+e.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},r}var $=void 0;function d(t){throw new $(t)}var Q=t=>(t||d("Cannot use deleted val. handle = "+t),R[t].value),it=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=Tt.length?Tt.pop():R.length;return R[n]={fa:1,value:t},n}},Bt=void 0,$t=void 0;function N(t){for(var n="";O[t];)n+=$t[O[t++]];return n}var b=[];function _t(){for(;b.length;){var t=b.pop();t.L.Z=!1,t.delete()}}var tt=void 0,M={};function Nt(t,n){for(n===void 0&&d("ptr should not be undefined");t.P;)n=t.aa(n),t=t.P;return n}var k={};function zt(t){t=on(t);var n=N(t);return V(t),n}function Jt(t,n){var r=k[t];return r===void 0&&d(n+" has unknown type "+zt(t)),r}function ot(){}var Lt=!1;function Zt(t){--t.count.value,t.count.value===0&&(t.S?t.T.V(t.S):t.O.M.V(t.N))}function qt(t,n,r){return n===r?t:r.P===void 0?null:(t=qt(t,n,r.P),t===null?null:r.ma(t))}var Kt={};function En(t,n){return n=Nt(t,n),M[n]}var Qt=void 0;function at(t){throw new Qt(t)}function ut(t,n){return n.O&&n.N||at("makeClassHandle requires ptr and ptrType"),!!n.T!=!!n.S&&at("Both smartPtrType and smartPtr must be specified"),n.count={value:1},z(Object.create(t,{L:{value:n}}))}function z(t){return typeof FinalizationRegistry>"u"?(z=n=>n,t):(Lt=new FinalizationRegistry(n=>{Zt(n.L)}),z=n=>{var r=n.L;return r.S&&Lt.register(n,{L:r},n),n},ot=n=>{Lt.unregister(n)},z(t))}var st={};function At(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function nt(t){return this.fromWireType(H[t>>2])}var J={},ft={};function j(t,n,r){function e(u){u=r(u),u.length!==t.length&&at("Mismatched type converter count");for(var f=0;f<t.length;++f)F(t[f],u[f])}t.forEach(function(u){ft[u]=n});var i=Array(n.length),o=[],a=0;n.forEach((u,f)=>{k.hasOwnProperty(u)?i[f]=k[u]:(o.push(u),J.hasOwnProperty(u)||(J[u]=[]),J[u].push(()=>{i[f]=k[u],++a,a===o.length&&e(i)}))}),o.length===0&&e(i)}function Ot(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function F(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||d('type "'+e+'" must have a positive integer typeid pointer'),k.hasOwnProperty(t)){if(r.ta)return;d("Cannot register type '"+e+"' twice")}k[t]=n,delete ft[t],J.hasOwnProperty(t)&&(n=J[t],delete J[t],n.forEach(i=>i()))}function Pt(t){d(t.L.O.M.name+" instance already deleted")}function X(){}function wt(t,n,r){if(t[n].R===void 0){var e=t[n];t[n]=function(){return t[n].R.hasOwnProperty(arguments.length)||d("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].R+")!"),t[n].R[arguments.length].apply(this,arguments)},t[n].R=[],t[n].R[e.Y]=e}}function gn(t,n){l.hasOwnProperty(t)?(d("Cannot register public name '"+t+"' twice"),wt(l,t,t),l.hasOwnProperty(void 0)&&d("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),l[t].R[void 0]=n):l[t]=n}function Tn(t,n,r,e,i,o,a,u){this.name=t,this.constructor=n,this.W=r,this.V=e,this.P=i,this.oa=o,this.aa=a,this.ma=u,this.ia=[]}function It(t,n,r){for(;n!==r;)n.aa||d("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.aa(t),n=n.P;return t}function _n(t,n){return n===null?(this.da&&d("null is not a valid "+this.name),0):(n.L||d('Cannot pass "'+Wt(n)+'" as a '+this.name),n.L.N||d("Cannot pass deleted object as a pointer of type "+this.name),It(n.L.N,n.L.O.M,this.M))}function Nn(t,n){if(n===null){if(this.da&&d("null is not a valid "+this.name),this.ca){var r=this.ea();return t!==null&&t.push(this.V,r),r}return 0}if(n.L||d('Cannot pass "'+Wt(n)+'" as a '+this.name),n.L.N||d("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&n.L.O.ba&&d("Cannot convert argument of type "+(n.L.T?n.L.T.name:n.L.O.name)+" to parameter type "+this.name),r=It(n.L.N,n.L.O.M,this.M),this.ca)switch(n.L.S===void 0&&d("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:n.L.T===this?r=n.L.S:d("Cannot convert argument of type "+(n.L.T?n.L.T.name:n.L.O.name)+" to parameter type "+this.name);break;case 1:r=n.L.S;break;case 2:if(n.L.T===this)r=n.L.S;else{var e=n.clone();r=this.wa(r,it(function(){e.delete()})),t!==null&&t.push(this.V,r)}break;default:d("Unsupporting sharing policy")}return r}function Ln(t,n){return n===null?(this.da&&d("null is not a valid "+this.name),0):(n.L||d('Cannot pass "'+Wt(n)+'" as a '+this.name),n.L.N||d("Cannot pass deleted object as a pointer of type "+this.name),n.L.O.ba&&d("Cannot convert argument of type "+n.L.O.name+" to parameter type "+this.name),It(n.L.N,n.L.O.M,this.M))}function D(t,n,r,e){this.name=t,this.M=n,this.da=r,this.ba=e,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,n.P!==void 0?this.toWireType=Nn:(this.toWireType=e?_n:Ln,this.U=null)}function An(t,n){l.hasOwnProperty(t)||at("Replacing nonexistant public symbol"),l[t]=n,l[t].Y=void 0}var ct=[];function bt(t){var n=ct[t];return n||(t>=ct.length&&(ct.length=t+1),ct[t]=n=Xt.get(t)),n}function On(t,n){var r=[];return function(){if(r.length=0,Object.assign(r,arguments),t.includes("j")){var e=l["dynCall_"+t];e=r&&r.length?e.apply(null,[n].concat(r)):e.call(null,n)}else e=bt(n).apply(null,r);return e}}function S(t,n){t=N(t);var r=t.includes("j")?On(t,n):bt(n);return typeof r!="function"&&d("unknown function pointer with signature "+t+": "+n),r}var tn=void 0;function lt(t,n){function r(o){i[o]||k[o]||(ft[o]?ft[o].forEach(r):(e.push(o),i[o]=!0))}var e=[],i={};throw n.forEach(r),new tn(t+": "+e.map(zt).join([", "]))}function Ct(t,n,r,e,i){var o=n.length;2>o&&d("argTypes array size mismatch! Must at least get return value and 'this' types!");var a=n[1]!==null&&r!==null,u=!1;for(r=1;r<n.length;++r)if(n[r]!==null&&n[r].U===void 0){u=!0;break}var f=n[0].name!=="void",s=o-2,c=Array(s),h=[],y=[];return function(){if(arguments.length!==s&&d("function "+t+" called with "+arguments.length+" arguments, expected "+s+" args!"),y.length=0,h.length=a?2:1,h[0]=i,a){var T=n[1].toWireType(y,this);h[1]=T}for(var E=0;E<s;++E)c[E]=n[E+2].toWireType(y,arguments[E]),h.push(c[E]);if(E=e.apply(null,h),u)At(y);else for(var P=a?1:2;P<n.length;P++){var W=P===1?T:c[P-2];n[P].U!==null&&n[P].U(W)}return T=f?n[0].fromWireType(E):void 0,T}}function Rt(t,n){for(var r=[],e=0;e<t;e++)r.push(A[n+4*e>>2]);return r}function St(t){4<t&&--R[t].fa===0&&(R[t]=void 0,Tt.push(t))}function Wt(t){if(t===null)return"null";var n=typeof t;return n==="object"||n==="array"||n==="function"?t.toString():""+t}function Pn(t,n){switch(n){case 2:return function(r){return this.fromWireType(Vt[r>>2])};case 3:return function(r){return this.fromWireType(Gt[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function wn(t,n,r){switch(n){case 0:return r?function(e){return dt[e]}:function(e){return O[e]};case 1:return r?function(e){return B[e>>1]}:function(e){return yt[e>>1]};case 2:return r?function(e){return H[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function In(t,n){for(var r="",e=0;!(e>=n/2);++e){var i=B[t+2*e>>1];if(i==0)break;r+=String.fromCharCode(i)}return r}function Cn(t,n,r){if(r===void 0&&(r=2147483647),2>r)return 0;r-=2;var e=n;r=r<2*t.length?r/2:t.length;for(var i=0;i<r;++i)B[n>>1]=t.charCodeAt(i),n+=2;return B[n>>1]=0,n-e}function Rn(t){return 2*t.length}function Sn(t,n){for(var r=0,e="";!(r>=n/4);){var i=H[t+4*r>>2];if(i==0)break;++r,65536<=i?(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|i&1023)):e+=String.fromCharCode(i)}return e}function Wn(t,n,r){if(r===void 0&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o){var a=t.charCodeAt(++i);o=65536+((o&1023)<<10)|a&1023}if(H[n>>2]=o,n+=4,n+4>r)break}return H[n>>2]=0,n-e}function Un(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&++r,n+=4}return n}var Mn={};function nn(t){var n=Mn[t];return n===void 0?N(t):n}var ht=[];function Fn(t){var n=ht.length;return ht.push(t),n}function Dn(t,n){for(var r=Array(t),e=0;e<t;++e)r[e]=Jt(A[n+4*e>>2],"parameter "+e);return r}var rn=[],Vn=[null,[],[]];$=l.BindingError=et("BindingError"),l.count_emval_handles=function(){for(var t=0,n=5;n<R.length;++n)R[n]!==void 0&&++t;return t},l.get_first_emval=function(){for(var t=5;t<R.length;++t)if(R[t]!==void 0)return R[t];return null},Bt=l.PureVirtualError=et("PureVirtualError");for(var en=Array(256),pt=0;256>pt;++pt)en[pt]=String.fromCharCode(pt);$t=en,l.getInheritedInstanceCount=function(){return Object.keys(M).length},l.getLiveInheritedInstances=function(){var t=[],n;for(n in M)M.hasOwnProperty(n)&&t.push(M[n]);return t},l.flushPendingDeletes=_t,l.setDelayFunction=function(t){tt=t,b.length&&tt&&tt(_t)},Qt=l.InternalError=et("InternalError"),X.prototype.isAliasOf=function(t){if(!(this instanceof X&&t instanceof X))return!1;var n=this.L.O.M,r=this.L.N,e=t.L.O.M;for(t=t.L.N;n.P;)r=n.aa(r),n=n.P;for(;e.P;)t=e.aa(t),e=e.P;return n===e&&r===t},X.prototype.clone=function(){if(this.L.N||Pt(this),this.L.$)return this.L.count.value+=1,this;var t=z,n=Object,r=n.create,e=Object.getPrototypeOf(this),i=this.L;return t=t(r.call(n,e,{L:{value:{count:i.count,Z:i.Z,$:i.$,N:i.N,O:i.O,S:i.S,T:i.T}}})),t.L.count.value+=1,t.L.Z=!1,t},X.prototype.delete=function(){this.L.N||Pt(this),this.L.Z&&!this.L.$&&d("Object already scheduled for deletion"),ot(this),Zt(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},X.prototype.isDeleted=function(){return!this.L.N},X.prototype.deleteLater=function(){return this.L.N||Pt(this),this.L.Z&&!this.L.$&&d("Object already scheduled for deletion"),b.push(this),b.length===1&&tt&&tt(_t),this.L.Z=!0,this},D.prototype.pa=function(t){return this.ja&&(t=this.ja(t)),t},D.prototype.ga=function(t){this.V&&this.V(t)},D.prototype.argPackAdvance=8,D.prototype.readValueFromPointer=nt,D.prototype.deleteObject=function(t){t!==null&&t.delete()},D.prototype.fromWireType=function(t){function n(){return this.ca?ut(this.M.W,{O:this.va,N:r,T:this,S:t}):ut(this.M.W,{O:this,N:t})}var r=this.pa(t);if(!r)return this.ga(t),null;var e=En(this.M,r);if(e!==void 0)return e.L.count.value===0?(e.L.N=r,e.L.S=t,e.clone()):(e=e.clone(),this.ga(t),e);if(e=this.M.oa(r),e=Kt[e],!e)return n.call(this);e=this.ba?e.ka:e.pointerType;var i=qt(r,this.M,e.M);return i===null?n.call(this):this.ca?ut(e.M.W,{O:e,N:i,T:this,S:t}):ut(e.M.W,{O:e,N:i})},tn=l.UnboundTypeError=et("UnboundTypeError");var Gn={q:function(t,n,r){t=N(t),n=Jt(n,"wrapper"),r=Q(r);var e=[].slice,i=n.M,o=i.W,a=i.P.W,u=i.P.constructor;t=gt(t,function(){i.P.ia.forEach(function(s){if(this[s]===a[s])throw new Bt("Pure virtual function "+s+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:o}),this.__construct.apply(this,e.call(arguments))}),o.__construct=function(){this===o&&d("Pass correct 'this' to __construct");var s=u.implement.apply(void 0,[this].concat(e.call(arguments)));ot(s);var c=s.L;s.notifyOnDestruction(),c.$=!0,Object.defineProperties(this,{L:{value:c}}),z(this),s=c.N,s=Nt(i,s),M.hasOwnProperty(s)?d("Tried to register registered instance: "+s):M[s]=this},o.__destruct=function(){this===o&&d("Pass correct 'this' to __destruct"),ot(this);var s=this.L.N;s=Nt(i,s),M.hasOwnProperty(s)?delete M[s]:d("Tried to unregister unregistered instance: "+s)},t.prototype=Object.create(o);for(var f in r)t.prototype[f]=r[f];return it(t)},l:function(t){var n=st[t];delete st[t];var r=n.ea,e=n.V,i=n.ha,o=i.map(a=>a.sa).concat(i.map(a=>a.ya));j([t],o,a=>{var u={};return i.forEach((f,s)=>{var c=a[s],h=f.qa,y=f.ra,T=a[s+i.length],E=f.xa,P=f.za;u[f.na]={read:W=>c.fromWireType(h(y,W)),write:(W,rt)=>{var G=[];E(P,W,T.toWireType(G,rt)),At(G)}}}),[{name:n.name,fromWireType:function(f){var s={},c;for(c in u)s[c]=u[c].read(f);return e(f),s},toWireType:function(f,s){for(var c in u)if(!(c in s))throw new TypeError('Missing field: "'+c+'"');var h=r();for(c in u)u[c].write(h,s[c]);return f!==null&&f.push(e,h),h},argPackAdvance:8,readValueFromPointer:nt,U:e}]})},v:function(){},B:function(t,n,r,e,i){var o=Ot(r);n=N(n),F(t,{name:n,fromWireType:function(a){return!!a},toWireType:function(a,u){return u?e:i},argPackAdvance:8,readValueFromPointer:function(a){if(r===1)var u=dt;else if(r===2)u=B;else if(r===4)u=H;else throw new TypeError("Unknown boolean type size: "+n);return this.fromWireType(u[a>>o])},U:null})},h:function(t,n,r,e,i,o,a,u,f,s,c,h,y){c=N(c),o=S(i,o),u&&(u=S(a,u)),s&&(s=S(f,s)),y=S(h,y);var T=kt(c);gn(T,function(){lt("Cannot construct "+c+" due to unbound types",[e])}),j([t,n,r],e?[e]:[],function(E){if(E=E[0],e)var P=E.M,W=P.W;else W=X.prototype;E=gt(T,function(){if(Object.getPrototypeOf(this)!==rt)throw new $("Use 'new' to construct "+c);if(G.X===void 0)throw new $(c+" has no accessible constructor");var sn=G.X[arguments.length];if(sn===void 0)throw new $("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(G.X).toString()+") parameters instead!");return sn.apply(this,arguments)});var rt=Object.create(W,{constructor:{value:E}});E.prototype=rt;var G=new Tn(c,E,rt,y,P,o,u,s);P=new D(c,G,!0,!1),W=new D(c+"*",G,!1,!1);var un=new D(c+" const*",G,!1,!0);return Kt[t]={pointerType:W,ka:un},An(T,E),[P,W,un]})},d:function(t,n,r,e,i,o,a){var u=Rt(r,e);n=N(n),o=S(i,o),j([],[t],function(f){function s(){lt("Cannot call "+c+" due to unbound types",u)}f=f[0];var c=f.name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var h=f.M.constructor;return h[n]===void 0?(s.Y=r-1,h[n]=s):(wt(h,n,c),h[n].R[r-1]=s),j([],u,function(y){return y=Ct(c,[y[0],null].concat(y.slice(1)),null,o,a),h[n].R===void 0?(y.Y=r-1,h[n]=y):h[n].R[r-1]=y,[]}),[]})},p:function(t,n,r,e,i,o){0<n||K();var a=Rt(n,r);i=S(e,i),j([],[t],function(u){u=u[0];var f="constructor "+u.name;if(u.M.X===void 0&&(u.M.X=[]),u.M.X[n-1]!==void 0)throw new $("Cannot register multiple constructors with identical number of parameters ("+(n-1)+") for class '"+u.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return u.M.X[n-1]=()=>{lt("Cannot construct "+u.name+" due to unbound types",a)},j([],a,function(s){return s.splice(1,0,null),u.M.X[n-1]=Ct(f,s,null,i,o),[]}),[]})},a:function(t,n,r,e,i,o,a,u){var f=Rt(r,e);n=N(n),o=S(i,o),j([],[t],function(s){function c(){lt("Cannot call "+h+" due to unbound types",f)}s=s[0];var h=s.name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),u&&s.M.ia.push(n);var y=s.M.W,T=y[n];return T===void 0||T.R===void 0&&T.className!==s.name&&T.Y===r-2?(c.Y=r-2,c.className=s.name,y[n]=c):(wt(y,n,h),y[n].R[r-2]=c),j([],f,function(E){return E=Ct(h,E,s,o,a),y[n].R===void 0?(E.Y=r-2,y[n]=E):y[n].R[r-2]=E,[]}),[]})},A:function(t,n){n=N(n),F(t,{name:n,fromWireType:function(r){var e=Q(r);return St(r),e},toWireType:function(r,e){return it(e)},argPackAdvance:8,readValueFromPointer:nt,U:null})},n:function(t,n,r){r=Ot(r),n=N(n),F(t,{name:n,fromWireType:function(e){return e},toWireType:function(e,i){return i},argPackAdvance:8,readValueFromPointer:Pn(n,r),U:null})},e:function(t,n,r,e,i){n=N(n),i===-1&&(i=4294967295),i=Ot(r);var o=u=>u;if(e===0){var a=32-8*r;o=u=>u<<a>>>a}r=n.includes("unsigned")?function(u,f){return f>>>0}:function(u,f){return f},F(t,{name:n,fromWireType:o,toWireType:r,argPackAdvance:8,readValueFromPointer:wn(n,i,e!==0),U:null})},b:function(t,n,r){function e(o){o>>=2;var a=A;return new i(a.buffer,a[o+1],a[o])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];r=N(r),F(t,{name:r,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{ta:!0})},o:function(t,n){n=N(n);var r=n==="std::string";F(t,{name:n,fromWireType:function(e){var i=A[e>>2],o=e+4;if(r)for(var a=o,u=0;u<=i;++u){var f=o+u;if(u==i||O[f]==0){if(a=a?Dt(O,a,f-a):"",s===void 0)var s=a;else s+=String.fromCharCode(0),s+=a;a=f+1}}else{for(s=Array(i),u=0;u<i;++u)s[u]=String.fromCharCode(O[o+u]);s=s.join("")}return V(e),s},toWireType:function(e,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var o,a=typeof i=="string";if(a||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||d("Cannot pass non-string to std::string"),r&&a){var u=0;for(o=0;o<i.length;++o){var f=i.charCodeAt(o);127>=f?u++:2047>=f?u+=2:55296<=f&&57343>=f?(u+=4,++o):u+=3}o=u}else o=i.length;if(u=Ut(4+o+1),f=u+4,A[u>>2]=o,r&&a){if(a=f,f=o+1,o=O,0<f){f=a+f-1;for(var s=0;s<i.length;++s){var c=i.charCodeAt(s);if(55296<=c&&57343>=c){var h=i.charCodeAt(++s);c=65536+((c&1023)<<10)|h&1023}if(127>=c){if(a>=f)break;o[a++]=c}else{if(2047>=c){if(a+1>=f)break;o[a++]=192|c>>6}else{if(65535>=c){if(a+2>=f)break;o[a++]=224|c>>12}else{if(a+3>=f)break;o[a++]=240|c>>18,o[a++]=128|c>>12&63}o[a++]=128|c>>6&63}o[a++]=128|c&63}}o[a]=0}}else if(a)for(a=0;a<o;++a)s=i.charCodeAt(a),255<s&&(V(f),d("String has UTF-16 code units that do not fit in 8 bits")),O[f+a]=s;else for(a=0;a<o;++a)O[f+a]=i[a];return e!==null&&e.push(V,u),u},argPackAdvance:8,readValueFromPointer:nt,U:function(e){V(e)}})},k:function(t,n,r){if(r=N(r),n===2)var e=In,i=Cn,o=Rn,a=()=>yt,u=1;else n===4&&(e=Sn,i=Wn,o=Un,a=()=>A,u=2);F(t,{name:r,fromWireType:function(f){for(var s=A[f>>2],c=a(),h,y=f+4,T=0;T<=s;++T){var E=f+4+T*n;(T==s||c[E>>u]==0)&&(y=e(y,E-y),h===void 0?h=y:(h+=String.fromCharCode(0),h+=y),y=E+n)}return V(f),h},toWireType:function(f,s){typeof s!="string"&&d("Cannot pass non-string to C++ string type "+r);var c=o(s),h=Ut(4+c+n);return A[h>>2]=c>>u,i(s,h+4,c+n),f!==null&&f.push(V,h),h},argPackAdvance:8,readValueFromPointer:nt,U:function(f){V(f)}})},m:function(t,n,r,e,i,o){st[t]={name:N(n),ea:S(r,e),V:S(i,o),ha:[]}},c:function(t,n,r,e,i,o,a,u,f,s){st[t].ha.push({na:N(n),sa:r,qa:S(e,i),ra:o,ya:a,xa:S(u,f),za:s})},C:function(t,n){n=N(n),F(t,{ua:!0,name:n,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},t:function(t,n,r,e,i){t=ht[t],n=Q(n),r=nn(r);var o=[];return A[e>>2]=it(o),t(n,r,o,i)},j:function(t,n,r,e){t=ht[t],n=Q(n),r=nn(r),t(n,r,null,e)},f:St,g:function(t,n){var r=Dn(t,n),e=r[0];n=e.name+"_$"+r.slice(1).map(function(a){return a.name}).join("_")+"$";var i=rn[n];if(i!==void 0)return i;var o=Array(t-1);return i=Fn((a,u,f,s)=>{for(var c=0,h=0;h<t-1;++h)o[h]=r[h+1].readValueFromPointer(s+c),c+=r[h+1].argPackAdvance;for(a=a[u].apply(a,o),h=0;h<t-1;++h)r[h+1].la&&r[h+1].la(o[h]);if(!e.ua)return e.toWireType(f,a)}),rn[n]=i},r:function(t){4<t&&(R[t].fa+=1)},s:function(t){var n=Q(t);At(n),St(t)},i:function(){K("")},x:function(t,n,r){O.copyWithin(t,n,n+r)},w:function(t){var n=O.length;if(t>>>=0,2147483648<t)return!1;for(var r=1;4>=r;r*=2){var e=n*(1+.2/r);e=Math.min(e,t+100663296);var i=Math,o=i.min;e=Math.max(t,e),e+=(65536-e%65536)%65536;t:{var a=C.buffer;try{C.grow(o.call(i,2147483648,e)-a.byteLength+65535>>>16),jt();var u=1;break t}catch{}u=void 0}if(u)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(t,n,r,e){for(var i=0,o=0;o<r;o++){var a=A[n>>2],u=A[n+4>>2];n+=8;for(var f=0;f<u;f++){var s=O[a+f],c=Vn[t];s===0||s===10?((t===1?I:_)(Dt(c,0)),c.length=0):c.push(s)}i+=u}return A[e>>2]=i,0}};(function(){function t(i){l.asm=i.exports,C=l.asm.D,jt(),Xt=l.asm.I,Yt.unshift(l.asm.E),Z--,Z==0&&(mt!==null&&(clearInterval(mt),mt=null),q&&(i=q,q=null,i()))}function n(i){t(i.instance)}function r(i){return mn().then(function(o){return WebAssembly.instantiate(o,e)}).then(function(o){return o}).then(i,function(o){_("failed to asynchronously prepare wasm: "+o),K(o)})}var e={a:Gn};if(Z++,l.instantiateWasm)try{return l.instantiateWasm(e,t)}catch(i){_("Module.instantiateWasm callback failed with error: "+i),v(i)}return function(){return typeof WebAssembly.instantiateStreaming!="function"||Ht()||typeof fetch!="function"?r(n):fetch(x,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,e).then(n,function(o){return _("wasm streaming compile failed: "+o),_("falling back to ArrayBuffer instantiation"),r(n)})})}().catch(v),{}})();var on=l.___getTypeName=function(){return(on=l.___getTypeName=l.asm.F).apply(null,arguments)};l.__embind_initialize_bindings=function(){return(l.__embind_initialize_bindings=l.asm.G).apply(null,arguments)};function Ut(){return(Ut=l.asm.H).apply(null,arguments)}function V(){return(V=l.asm.J).apply(null,arguments)}l.dynCall_jiji=function(){return(l.dynCall_jiji=l.asm.K).apply(null,arguments)};var vt;q=function t(){vt||an(),vt||(q=t)};function an(){0<Z||(Et(dn),0<Z||vt||(vt=!0,l.calledRun=!0,U||(Et(Yt),w(l),Et(yn))))}return an(),m.ready}})(),Mt=$n;async function Qn(p){let m=await Mt({instantiateWasm(l,w){WebAssembly.instantiate(p,l).then(({instance:v})=>{w(v)})}});return(0,Ft.default)(m)}async function bn(p){let m=await Mt({instantiateWasm(l,w){WebAssembly.instantiateStreaming(p,l).then(({instance:v})=>{w(v)})}});return(0,Ft.default)(m)}export{Qn as default,bn as initStreaming}; | ||
import{w}from"./wrapAsm-57389177.js";export{A as ALIGN_AUTO,e as ALIGN_BASELINE,b as ALIGN_CENTER,c as ALIGN_FLEX_END,a as ALIGN_FLEX_START,g as ALIGN_SPACE_AROUND,f as ALIGN_SPACE_BETWEEN,d as ALIGN_STRETCH,h as DIMENSION_HEIGHT,D as DIMENSION_WIDTH,i as DIRECTION_INHERIT,j as DIRECTION_LTR,k as DIRECTION_RTL,l as DISPLAY_FLEX,m as DISPLAY_NONE,u as EDGE_ALL,p as EDGE_BOTTOM,r as EDGE_END,s as EDGE_HORIZONTAL,E as EDGE_LEFT,o as EDGE_RIGHT,q as EDGE_START,n as EDGE_TOP,t as EDGE_VERTICAL,x as EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE,y as EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN,v as EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS,F as FLEX_DIRECTION_COLUMN,z as FLEX_DIRECTION_COLUMN_REVERSE,B as FLEX_DIRECTION_ROW,C as FLEX_DIRECTION_ROW_REVERSE,I as GUTTER_ALL,G as GUTTER_COLUMN,H as GUTTER_ROW,K as JUSTIFY_CENTER,L as JUSTIFY_FLEX_END,J as JUSTIFY_FLEX_START,N as JUSTIFY_SPACE_AROUND,M as JUSTIFY_SPACE_BETWEEN,O as JUSTIFY_SPACE_EVENLY,S as LOG_LEVEL_DEBUG,P as LOG_LEVEL_ERROR,U as LOG_LEVEL_FATAL,R as LOG_LEVEL_INFO,T as LOG_LEVEL_VERBOSE,Q as LOG_LEVEL_WARN,X as MEASURE_MODE_AT_MOST,W as MEASURE_MODE_EXACTLY,V as MEASURE_MODE_UNDEFINED,Y as NODE_TYPE_DEFAULT,Z as NODE_TYPE_TEXT,$ as OVERFLOW_HIDDEN,a0 as OVERFLOW_SCROLL,_ as OVERFLOW_VISIBLE,a3 as POSITION_TYPE_ABSOLUTE,a2 as POSITION_TYPE_RELATIVE,a1 as POSITION_TYPE_STATIC,a6 as PRINT_OPTIONS_CHILDREN,a4 as PRINT_OPTIONS_LAYOUT,a5 as PRINT_OPTIONS_STYLE,aa as UNIT_AUTO,a9 as UNIT_PERCENT,a8 as UNIT_POINT,a7 as UNIT_UNDEFINED,ab as WRAP_NO_WRAP,ac as WRAP_WRAP,ad as WRAP_WRAP_REVERSE}from"./wrapAsm-57389177.js";var nn,tn=(nn="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(n={}){var t,r,e;t||(t=void 0!==n?n:{}),t.ready=new Promise((function(n,t){r=n,e=t}));var a=Object.assign({},t),i="";"undefined"!=typeof document&&document.currentScript&&(i=document.currentScript.src),nn&&(i=nn),i=0!==i.indexOf("blob:")?i.substr(0,i.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var o=console.log.bind(console),u=console.warn.bind(console);Object.assign(t,a),a=null,"object"!=typeof WebAssembly&&N("no native wasm support detected");var s,c,f,l,h,p,v,d,y,m=!1;function E(n,t,r){r=t+r;for(var e="";!(t>=r);){var a=n[t++];if(!a)break;if(128&a){var i=63&n[t++];if(192==(224&a))e+=String.fromCharCode((31&a)<<6|i);else{var o=63&n[t++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&n[t++])?e+=String.fromCharCode(a):(a-=65536,e+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else e+=String.fromCharCode(a)}return e}function g(){var n=s.buffer;t.HEAP8=c=new Int8Array(n),t.HEAP16=l=new Int16Array(n),t.HEAP32=p=new Int32Array(n),t.HEAPU8=f=new Uint8Array(n),t.HEAPU16=h=new Uint16Array(n),t.HEAPU32=v=new Uint32Array(n),t.HEAPF32=d=new Float32Array(n),t.HEAPF64=y=new Float64Array(n)}var _,T,L=[],A=[],O=[],P=0,w=null;function N(n){throw u(n="Aborted("+n+")"),m=!0,n=new WebAssembly.RuntimeError(n+". Build with -sASSERTIONS for more info."),e(n),n}function b(){return T.startsWith("data:application/octet-stream;base64,")}function I(){try{throw"both async and sync fetching of the wasm failed"}catch(n){N(n)}}function S(n){for(;0<n.length;)n.shift()(t)}function R(n){if(void 0===n)return"_unknown";var t=(n=n.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?"_"+n:n}function C(n,t){return n=R(n),function(){return t.apply(this,arguments)}}T="yoga.wasm",b()||(T=i+T);var W=[{},{value:void 0},{value:null},{value:!0},{value:!1}],U=[];function M(n){var t=Error,r=C(n,(function(t){this.name=n,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var F=void 0;function D(n){throw new F(n)}var k=n=>(n||D("Cannot use deleted val. handle = "+n),W[n].value),V=n=>{switch(n){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=U.length?U.pop():W.length;return W[t]={fa:1,value:n},t}},j=void 0,G=void 0;function X(n){for(var t="";f[n];)t+=G[f[n++]];return t}var Y=[];function B(){for(;Y.length;){var n=Y.pop();n.L.Z=!1,n.delete()}}var H=void 0,x={};function z(n,t){for(void 0===t&&D("ptr should not be undefined");n.P;)t=n.aa(t),n=n.P;return t}var $={};function Z(n){var t=X(n=qn(n));return Qn(n),t}function J(n,t){var r=$[n];return void 0===r&&D(t+" has unknown type "+Z(n)),r}function q(){}var K=!1;function Q(n){--n.count.value,0===n.count.value&&(n.S?n.T.V(n.S):n.O.M.V(n.N))}function tn(n,t,r){return t===r?n:void 0===r.P||null===(n=tn(n,t,r.P))?null:r.ma(n)}var rn={},en=void 0;function an(n){throw new en(n)}function on(n,t){return t.O&&t.N||an("makeClassHandle requires ptr and ptrType"),!!t.T!=!!t.S&&an("Both smartPtrType and smartPtr must be specified"),t.count={value:1},un(Object.create(n,{L:{value:t}}))}function un(n){return"undefined"==typeof FinalizationRegistry?(un=n=>n,n):(K=new FinalizationRegistry((n=>{Q(n.L)})),q=n=>{K.unregister(n)},(un=n=>{var t=n.L;return t.S&&K.register(n,{L:t},n),n})(n))}var sn={};function cn(n){for(;n.length;){var t=n.pop();n.pop()(t)}}function fn(n){return this.fromWireType(p[n>>2])}var ln={},hn={};function pn(n,t,r){function e(t){(t=r(t)).length!==n.length&&an("Mismatched type converter count");for(var e=0;e<n.length;++e)dn(n[e],t[e])}n.forEach((function(n){hn[n]=t}));var a=Array(t.length),i=[],o=0;t.forEach(((n,t)=>{$.hasOwnProperty(n)?a[t]=$[n]:(i.push(n),ln.hasOwnProperty(n)||(ln[n]=[]),ln[n].push((()=>{a[t]=$[n],++o===i.length&&e(a)})))})),0===i.length&&e(a)}function vn(n){switch(n){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+n)}}function dn(n,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=t.name;if(n||D('type "'+e+'" must have a positive integer typeid pointer'),$.hasOwnProperty(n)){if(r.ta)return;D("Cannot register type '"+e+"' twice")}$[n]=t,delete hn[n],ln.hasOwnProperty(n)&&(t=ln[n],delete ln[n],t.forEach((n=>n())))}function yn(n){D(n.L.O.M.name+" instance already deleted")}function mn(){}function En(n,t,r){if(void 0===n[t].R){var e=n[t];n[t]=function(){return n[t].R.hasOwnProperty(arguments.length)||D("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+n[t].R+")!"),n[t].R[arguments.length].apply(this,arguments)},n[t].R=[],n[t].R[e.Y]=e}}function gn(n,t,r,e,a,i,o,u){this.name=n,this.constructor=t,this.W=r,this.V=e,this.P=a,this.oa=i,this.aa=o,this.ma=u,this.ia=[]}function _n(n,t,r){for(;t!==r;)t.aa||D("Expected null or instance of "+r.name+", got an instance of "+t.name),n=t.aa(n),t=t.P;return n}function Tn(n,t){return null===t?(this.da&&D("null is not a valid "+this.name),0):(t.L||D('Cannot pass "'+Wn(t)+'" as a '+this.name),t.L.N||D("Cannot pass deleted object as a pointer of type "+this.name),_n(t.L.N,t.L.O.M,this.M))}function Ln(n,t){if(null===t){if(this.da&&D("null is not a valid "+this.name),this.ca){var r=this.ea();return null!==n&&n.push(this.V,r),r}return 0}if(t.L||D('Cannot pass "'+Wn(t)+'" as a '+this.name),t.L.N||D("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&t.L.O.ba&&D("Cannot convert argument of type "+(t.L.T?t.L.T.name:t.L.O.name)+" to parameter type "+this.name),r=_n(t.L.N,t.L.O.M,this.M),this.ca)switch(void 0===t.L.S&&D("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:t.L.T===this?r=t.L.S:D("Cannot convert argument of type "+(t.L.T?t.L.T.name:t.L.O.name)+" to parameter type "+this.name);break;case 1:r=t.L.S;break;case 2:if(t.L.T===this)r=t.L.S;else{var e=t.clone();r=this.wa(r,V((function(){e.delete()}))),null!==n&&n.push(this.V,r)}break;default:D("Unsupporting sharing policy")}return r}function An(n,t){return null===t?(this.da&&D("null is not a valid "+this.name),0):(t.L||D('Cannot pass "'+Wn(t)+'" as a '+this.name),t.L.N||D("Cannot pass deleted object as a pointer of type "+this.name),t.L.O.ba&&D("Cannot convert argument of type "+t.L.O.name+" to parameter type "+this.name),_n(t.L.N,t.L.O.M,this.M))}function On(n,t,r,e){this.name=n,this.M=t,this.da=r,this.ba=e,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,void 0!==t.P?this.toWireType=Ln:(this.toWireType=e?Tn:An,this.U=null)}var Pn=[];function wn(n){var t=Pn[n];return t||(n>=Pn.length&&(Pn.length=n+1),Pn[n]=t=_.get(n)),t}function Nn(n,r){var e=(n=X(n)).includes("j")?function(n,r){var e=[];return function(){if(e.length=0,Object.assign(e,arguments),n.includes("j")){var a=t["dynCall_"+n];a=e&&e.length?a.apply(null,[r].concat(e)):a.call(null,r)}else a=wn(r).apply(null,e);return a}}(n,r):wn(r);return"function"!=typeof e&&D("unknown function pointer with signature "+n+": "+r),e}var bn=void 0;function In(n,t){var r=[],e={};throw t.forEach((function n(t){e[t]||$[t]||(hn[t]?hn[t].forEach(n):(r.push(t),e[t]=!0))})),new bn(n+": "+r.map(Z).join([", "]))}function Sn(n,t,r,e,a){var i=t.length;2>i&&D("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==r,u=!1;for(r=1;r<t.length;++r)if(null!==t[r]&&void 0===t[r].U){u=!0;break}var s="void"!==t[0].name,c=i-2,f=Array(c),l=[],h=[];return function(){if(arguments.length!==c&&D("function "+n+" called with "+arguments.length+" arguments, expected "+c+" args!"),h.length=0,l.length=o?2:1,l[0]=a,o){var r=t[1].toWireType(h,this);l[1]=r}for(var i=0;i<c;++i)f[i]=t[i+2].toWireType(h,arguments[i]),l.push(f[i]);if(i=e.apply(null,l),u)cn(h);else for(var p=o?1:2;p<t.length;p++){var v=1===p?r:f[p-2];null!==t[p].U&&t[p].U(v)}return s?t[0].fromWireType(i):void 0}}function Rn(n,t){for(var r=[],e=0;e<n;e++)r.push(v[t+4*e>>2]);return r}function Cn(n){4<n&&0==--W[n].fa&&(W[n]=void 0,U.push(n))}function Wn(n){if(null===n)return"null";var t=typeof n;return"object"===t||"array"===t||"function"===t?n.toString():""+n}function Un(n,t){switch(t){case 2:return function(n){return this.fromWireType(d[n>>2])};case 3:return function(n){return this.fromWireType(y[n>>3])};default:throw new TypeError("Unknown float type: "+n)}}function Mn(n,t,r){switch(t){case 0:return r?function(n){return c[n]}:function(n){return f[n]};case 1:return r?function(n){return l[n>>1]}:function(n){return h[n>>1]};case 2:return r?function(n){return p[n>>2]}:function(n){return v[n>>2]};default:throw new TypeError("Unknown integer type: "+n)}}function Fn(n,t){for(var r="",e=0;!(e>=t/2);++e){var a=l[n+2*e>>1];if(0==a)break;r+=String.fromCharCode(a)}return r}function Dn(n,t,r){if(void 0===r&&(r=2147483647),2>r)return 0;var e=t;r=(r-=2)<2*n.length?r/2:n.length;for(var a=0;a<r;++a)l[t>>1]=n.charCodeAt(a),t+=2;return l[t>>1]=0,t-e}function kn(n){return 2*n.length}function Vn(n,t){for(var r=0,e="";!(r>=t/4);){var a=p[n+4*r>>2];if(0==a)break;++r,65536<=a?(a-=65536,e+=String.fromCharCode(55296|a>>10,56320|1023&a)):e+=String.fromCharCode(a)}return e}function jn(n,t,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=t;r=e+r-4;for(var a=0;a<n.length;++a){var i=n.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&n.charCodeAt(++a)),p[t>>2]=i,(t+=4)+4>r)break}return p[t>>2]=0,t-e}function Gn(n){for(var t=0,r=0;r<n.length;++r){var e=n.charCodeAt(r);55296<=e&&57343>=e&&++r,t+=4}return t}var Xn={};function Yn(n){var t=Xn[n];return void 0===t?X(n):t}var Bn=[],Hn=[],xn=[null,[],[]];F=t.BindingError=M("BindingError"),t.count_emval_handles=function(){for(var n=0,t=5;t<W.length;++t)void 0!==W[t]&&++n;return n},t.get_first_emval=function(){for(var n=5;n<W.length;++n)if(void 0!==W[n])return W[n];return null},j=t.PureVirtualError=M("PureVirtualError");for(var zn=Array(256),$n=0;256>$n;++$n)zn[$n]=String.fromCharCode($n);G=zn,t.getInheritedInstanceCount=function(){return Object.keys(x).length},t.getLiveInheritedInstances=function(){var n,t=[];for(n in x)x.hasOwnProperty(n)&&t.push(x[n]);return t},t.flushPendingDeletes=B,t.setDelayFunction=function(n){H=n,Y.length&&H&&H(B)},en=t.InternalError=M("InternalError"),mn.prototype.isAliasOf=function(n){if(!(this instanceof mn&&n instanceof mn))return!1;var t=this.L.O.M,r=this.L.N,e=n.L.O.M;for(n=n.L.N;t.P;)r=t.aa(r),t=t.P;for(;e.P;)n=e.aa(n),e=e.P;return t===e&&r===n},mn.prototype.clone=function(){if(this.L.N||yn(this),this.L.$)return this.L.count.value+=1,this;var n=un,t=Object,r=t.create,e=Object.getPrototypeOf(this),a=this.L;return(n=n(r.call(t,e,{L:{value:{count:a.count,Z:a.Z,$:a.$,N:a.N,O:a.O,S:a.S,T:a.T}}}))).L.count.value+=1,n.L.Z=!1,n},mn.prototype.delete=function(){this.L.N||yn(this),this.L.Z&&!this.L.$&&D("Object already scheduled for deletion"),q(this),Q(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},mn.prototype.isDeleted=function(){return!this.L.N},mn.prototype.deleteLater=function(){return this.L.N||yn(this),this.L.Z&&!this.L.$&&D("Object already scheduled for deletion"),Y.push(this),1===Y.length&&H&&H(B),this.L.Z=!0,this},On.prototype.pa=function(n){return this.ja&&(n=this.ja(n)),n},On.prototype.ga=function(n){this.V&&this.V(n)},On.prototype.argPackAdvance=8,On.prototype.readValueFromPointer=fn,On.prototype.deleteObject=function(n){null!==n&&n.delete()},On.prototype.fromWireType=function(n){function t(){return this.ca?on(this.M.W,{O:this.va,N:r,T:this,S:n}):on(this.M.W,{O:this,N:n})}var r=this.pa(n);if(!r)return this.ga(n),null;var e=function(n,t){return t=z(n,t),x[t]}(this.M,r);if(void 0!==e)return 0===e.L.count.value?(e.L.N=r,e.L.S=n,e.clone()):(e=e.clone(),this.ga(n),e);if(e=this.M.oa(r),!(e=rn[e]))return t.call(this);e=this.ba?e.ka:e.pointerType;var a=tn(r,this.M,e.M);return null===a?t.call(this):this.ca?on(e.M.W,{O:e,N:a,T:this,S:n}):on(e.M.W,{O:e,N:a})},bn=t.UnboundTypeError=M("UnboundTypeError");var Zn={q:function(n,t,r){n=X(n),t=J(t,"wrapper"),r=k(r);var e=[].slice,a=t.M,i=a.W,o=a.P.W,u=a.P.constructor;for(var s in n=C(n,(function(){a.P.ia.forEach(function(n){if(this[n]===o[n])throw new j("Pure virtual function "+n+" must be implemented in JavaScript")}.bind(this)),Object.defineProperty(this,"__parent",{value:i}),this.__construct.apply(this,e.call(arguments))})),i.__construct=function(){this===i&&D("Pass correct 'this' to __construct");var n=u.implement.apply(void 0,[this].concat(e.call(arguments)));q(n);var t=n.L;n.notifyOnDestruction(),t.$=!0,Object.defineProperties(this,{L:{value:t}}),un(this),n=t.N,n=z(a,n),x.hasOwnProperty(n)?D("Tried to register registered instance: "+n):x[n]=this},i.__destruct=function(){this===i&&D("Pass correct 'this' to __destruct"),q(this);var n=this.L.N;n=z(a,n),x.hasOwnProperty(n)?delete x[n]:D("Tried to unregister unregistered instance: "+n)},n.prototype=Object.create(i),r)n.prototype[s]=r[s];return V(n)},l:function(n){var t=sn[n];delete sn[n];var r=t.ea,e=t.V,a=t.ha;pn([n],a.map((n=>n.sa)).concat(a.map((n=>n.ya))),(n=>{var i={};return a.forEach(((t,r)=>{var e=n[r],o=t.qa,u=t.ra,s=n[r+a.length],c=t.xa,f=t.za;i[t.na]={read:n=>e.fromWireType(o(u,n)),write:(n,t)=>{var r=[];c(f,n,s.toWireType(r,t)),cn(r)}}})),[{name:t.name,fromWireType:function(n){var t,r={};for(t in i)r[t]=i[t].read(n);return e(n),r},toWireType:function(n,t){for(var a in i)if(!(a in t))throw new TypeError('Missing field: "'+a+'"');var o=r();for(a in i)i[a].write(o,t[a]);return null!==n&&n.push(e,o),o},argPackAdvance:8,readValueFromPointer:fn,U:e}]}))},v:function(){},B:function(n,t,r,e,a){var i=vn(r);dn(n,{name:t=X(t),fromWireType:function(n){return!!n},toWireType:function(n,t){return t?e:a},argPackAdvance:8,readValueFromPointer:function(n){if(1===r)var e=c;else if(2===r)e=l;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);e=p}return this.fromWireType(e[n>>i])},U:null})},h:function(n,r,e,a,i,o,u,s,c,f,l,h,p){l=X(l),o=Nn(i,o),s&&(s=Nn(u,s)),f&&(f=Nn(c,f)),p=Nn(h,p);var v=R(l);!function(n,r){t.hasOwnProperty(n)?(D("Cannot register public name '"+n+"' twice"),En(t,n,n),t.hasOwnProperty(void 0)&&D("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),t[n].R[void 0]=r):t[n]=r}(v,(function(){In("Cannot construct "+l+" due to unbound types",[a])})),pn([n,r,e],a?[a]:[],(function(r){if(r=r[0],a)var e=r.M,i=e.W;else i=mn.prototype;r=C(v,(function(){if(Object.getPrototypeOf(this)!==u)throw new F("Use 'new' to construct "+l);if(void 0===c.X)throw new F(l+" has no accessible constructor");var n=c.X[arguments.length];if(void 0===n)throw new F("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(c.X).toString()+") parameters instead!");return n.apply(this,arguments)}));var u=Object.create(i,{constructor:{value:r}});r.prototype=u;var c=new gn(l,r,u,p,e,o,s,f);e=new On(l,c,!0,!1),i=new On(l+"*",c,!1,!1);var h=new On(l+" const*",c,!1,!0);return rn[n]={pointerType:i,ka:h},function(n,r){t.hasOwnProperty(n)||an("Replacing nonexistant public symbol"),t[n]=r,t[n].Y=void 0}(v,r),[e,i,h]}))},d:function(n,t,r,e,a,i,o){var u=Rn(r,e);t=X(t),i=Nn(a,i),pn([],[n],(function(n){function e(){In("Cannot call "+a+" due to unbound types",u)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var s=n.M.constructor;return void 0===s[t]?(e.Y=r-1,s[t]=e):(En(s,t,a),s[t].R[r-1]=e),pn([],u,(function(n){return n=Sn(a,[n[0],null].concat(n.slice(1)),null,i,o),void 0===s[t].R?(n.Y=r-1,s[t]=n):s[t].R[r-1]=n,[]})),[]}))},p:function(n,t,r,e,a,i){0<t||N();var o=Rn(t,r);a=Nn(e,a),pn([],[n],(function(n){var r="constructor "+(n=n[0]).name;if(void 0===n.M.X&&(n.M.X=[]),void 0!==n.M.X[t-1])throw new F("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+n.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return n.M.X[t-1]=()=>{In("Cannot construct "+n.name+" due to unbound types",o)},pn([],o,(function(e){return e.splice(1,0,null),n.M.X[t-1]=Sn(r,e,null,a,i),[]})),[]}))},a:function(n,t,r,e,a,i,o,u){var s=Rn(r,e);t=X(t),i=Nn(a,i),pn([],[n],(function(n){function e(){In("Cannot call "+a+" due to unbound types",s)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&n.M.ia.push(t);var c=n.M.W,f=c[t];return void 0===f||void 0===f.R&&f.className!==n.name&&f.Y===r-2?(e.Y=r-2,e.className=n.name,c[t]=e):(En(c,t,a),c[t].R[r-2]=e),pn([],s,(function(e){return e=Sn(a,e,n,i,o),void 0===c[t].R?(e.Y=r-2,c[t]=e):c[t].R[r-2]=e,[]})),[]}))},A:function(n,t){dn(n,{name:t=X(t),fromWireType:function(n){var t=k(n);return Cn(n),t},toWireType:function(n,t){return V(t)},argPackAdvance:8,readValueFromPointer:fn,U:null})},n:function(n,t,r){r=vn(r),dn(n,{name:t=X(t),fromWireType:function(n){return n},toWireType:function(n,t){return t},argPackAdvance:8,readValueFromPointer:Un(t,r),U:null})},e:function(n,t,r,e,a){t=X(t),-1===a&&(a=4294967295),a=vn(r);var i=n=>n;if(0===e){var o=32-8*r;i=n=>n<<o>>>o}r=t.includes("unsigned")?function(n,t){return t>>>0}:function(n,t){return t},dn(n,{name:t,fromWireType:i,toWireType:r,argPackAdvance:8,readValueFromPointer:Mn(t,a,0!==e),U:null})},b:function(n,t,r){function e(n){n>>=2;var t=v;return new a(t.buffer,t[n+1],t[n])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];dn(n,{name:r=X(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{ta:!0})},o:function(n,t){var r="std::string"===(t=X(t));dn(n,{name:t,fromWireType:function(n){var t=v[n>>2],e=n+4;if(r)for(var a=e,i=0;i<=t;++i){var o=e+i;if(i==t||0==f[o]){if(a=a?E(f,a,o-a):"",void 0===u)var u=a;else u+=String.fromCharCode(0),u+=a;a=o+1}}else{for(u=Array(t),i=0;i<t;++i)u[i]=String.fromCharCode(f[e+i]);u=u.join("")}return Qn(n),u},toWireType:function(n,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var e,a="string"==typeof t;if(a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||D("Cannot pass non-string to std::string"),r&&a){var i=0;for(e=0;e<t.length;++e){var o=t.charCodeAt(e);127>=o?i++:2047>=o?i+=2:55296<=o&&57343>=o?(i+=4,++e):i+=3}e=i}else e=t.length;if(o=(i=Kn(4+e+1))+4,v[i>>2]=e,r&&a){if(a=o,o=e+1,e=f,0<o){o=a+o-1;for(var u=0;u<t.length;++u){var s=t.charCodeAt(u);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++u)),127>=s){if(a>=o)break;e[a++]=s}else{if(2047>=s){if(a+1>=o)break;e[a++]=192|s>>6}else{if(65535>=s){if(a+2>=o)break;e[a++]=224|s>>12}else{if(a+3>=o)break;e[a++]=240|s>>18,e[a++]=128|s>>12&63}e[a++]=128|s>>6&63}e[a++]=128|63&s}}e[a]=0}}else if(a)for(a=0;a<e;++a)255<(u=t.charCodeAt(a))&&(Qn(o),D("String has UTF-16 code units that do not fit in 8 bits")),f[o+a]=u;else for(a=0;a<e;++a)f[o+a]=t[a];return null!==n&&n.push(Qn,i),i},argPackAdvance:8,readValueFromPointer:fn,U:function(n){Qn(n)}})},k:function(n,t,r){if(r=X(r),2===t)var e=Fn,a=Dn,i=kn,o=()=>h,u=1;else 4===t&&(e=Vn,a=jn,i=Gn,o=()=>v,u=2);dn(n,{name:r,fromWireType:function(n){for(var r,a=v[n>>2],i=o(),s=n+4,c=0;c<=a;++c){var f=n+4+c*t;c!=a&&0!=i[f>>u]||(s=e(s,f-s),void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),s=f+t)}return Qn(n),r},toWireType:function(n,e){"string"!=typeof e&&D("Cannot pass non-string to C++ string type "+r);var o=i(e),s=Kn(4+o+t);return v[s>>2]=o>>u,a(e,s+4,o+t),null!==n&&n.push(Qn,s),s},argPackAdvance:8,readValueFromPointer:fn,U:function(n){Qn(n)}})},m:function(n,t,r,e,a,i){sn[n]={name:X(t),ea:Nn(r,e),V:Nn(a,i),ha:[]}},c:function(n,t,r,e,a,i,o,u,s,c){sn[n].ha.push({na:X(t),sa:r,qa:Nn(e,a),ra:i,ya:o,xa:Nn(u,s),za:c})},C:function(n,t){dn(n,{ua:!0,name:t=X(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},t:function(n,t,r,e,a){n=Bn[n],t=k(t),r=Yn(r);var i=[];return v[e>>2]=V(i),n(t,r,i,a)},j:function(n,t,r,e){(n=Bn[n])(t=k(t),r=Yn(r),null,e)},f:Cn,g:function(n,t){var r=function(n,t){for(var r=Array(n),e=0;e<n;++e)r[e]=J(v[t+4*e>>2],"parameter "+e);return r}(n,t),e=r[0];t=e.name+"_$"+r.slice(1).map((function(n){return n.name})).join("_")+"$";var a=Hn[t];if(void 0!==a)return a;var i=Array(n-1);return a=function(n){var t=Bn.length;return Bn.push(n),t}(((t,a,o,u)=>{for(var s=0,c=0;c<n-1;++c)i[c]=r[c+1].readValueFromPointer(u+s),s+=r[c+1].argPackAdvance;for(t=t[a].apply(t,i),c=0;c<n-1;++c)r[c+1].la&&r[c+1].la(i[c]);if(!e.ua)return e.toWireType(o,t)})),Hn[t]=a},r:function(n){4<n&&(W[n].fa+=1)},s:function(n){cn(k(n)),Cn(n)},i:function(){N("")},x:function(n,t,r){f.copyWithin(n,t,t+r)},w:function(n){var t=f.length;if(2147483648<(n>>>=0))return!1;for(var r=1;4>=r;r*=2){var e=t*(1+.2/r);e=Math.min(e,n+100663296);var a=Math,i=a.min;e=Math.max(n,e),e+=(65536-e%65536)%65536;n:{var o=s.buffer;try{s.grow(i.call(a,2147483648,e)-o.byteLength+65535>>>16),g();var u=1;break n}catch(n){}u=void 0}if(u)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(n,t,r,e){for(var a=0,i=0;i<r;i++){var s=v[t>>2],c=v[t+4>>2];t+=8;for(var l=0;l<c;l++){var h=f[s+l],p=xn[n];0===h||10===h?((1===n?o:u)(E(p,0)),p.length=0):p.push(h)}a+=c}return v[e>>2]=a,0}};!function(){function n(n){t.asm=n.exports,s=t.asm.D,g(),_=t.asm.I,A.unshift(t.asm.E),0==--P&&w&&(n=w,w=null,n())}function r(t){n(t.instance)}function a(n){return("function"==typeof fetch?fetch(T,{credentials:"same-origin"}).then((function(n){if(!n.ok)throw"failed to load wasm binary file at '"+T+"'";return n.arrayBuffer()})).catch((function(){return I()})):Promise.resolve().then((function(){return I()}))).then((function(n){return WebAssembly.instantiate(n,i)})).then((function(n){return n})).then(n,(function(n){u("failed to asynchronously prepare wasm: "+n),N(n)}))}var i={a:Zn};if(P++,t.instantiateWasm)try{return t.instantiateWasm(i,n)}catch(n){u("Module.instantiateWasm callback failed with error: "+n),e(n)}("function"!=typeof WebAssembly.instantiateStreaming||b()||"function"!=typeof fetch?a(r):fetch(T,{credentials:"same-origin"}).then((function(n){return WebAssembly.instantiateStreaming(n,i).then(r,(function(n){return u("wasm streaming compile failed: "+n),u("falling back to ArrayBuffer instantiation"),a(r)}))}))).catch(e)}();var Jn,qn=t.___getTypeName=function(){return(qn=t.___getTypeName=t.asm.F).apply(null,arguments)};function Kn(){return(Kn=t.asm.H).apply(null,arguments)}function Qn(){return(Qn=t.asm.J).apply(null,arguments)}function nt(){0<P||(S(L),0<P||Jn||(Jn=!0,t.calledRun=!0,m||(S(A),r(t),S(O))))}return t.__embind_initialize_bindings=function(){return(t.__embind_initialize_bindings=t.asm.G).apply(null,arguments)},t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.K).apply(null,arguments)},w=function n(){Jn||nt(),Jn||(w=n)},nt(),n.ready});async function rn(n){const t=await tn({instantiateWasm(t,r){WebAssembly.instantiate(n,t).then((({instance:n})=>{r(n)}))}});return w(t)}async function en(n){const t=await tn({instantiateWasm(t,r){WebAssembly.instantiateStreaming(n,t).then((({instance:n})=>{r(n)}))}});return w(t)}export{rn as default,en as initStreaming}; |
@@ -24,5 +24,5 @@ /** | ||
Wrap, | ||
} from './generated/YGEnums'; | ||
} from './generated/YGEnums.js'; | ||
import type * as YGEnums from './generated/YGEnums'; | ||
import type * as YGEnums from './generated/YGEnums.js'; | ||
@@ -96,3 +96,3 @@ type Layout = { | ||
getDisplay(): Display, | ||
getFlexBasis(): number, | ||
getFlexBasis(): Value, | ||
getFlexDirection(): FlexDirection, | ||
@@ -161,3 +161,3 @@ getFlexGrow(): number, | ||
setWidthPercent(width: number): void, | ||
unsetMeasureFun(): void, | ||
unsetMeasureFunc(): void, | ||
}; | ||
@@ -164,0 +164,0 @@ |
{ | ||
"name": "yoga-wasm-web", | ||
"version": "0.3.1", | ||
"types": "index.d.ts", | ||
"typings": "index.d.ts", | ||
"version": "0.3.2", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"asm": [ | ||
"dist/asm.d.ts" | ||
] | ||
} | ||
}, | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": "./dist/index.js", | ||
"./asm": "./dist/asm.js" | ||
"./dist/yoga.wasm": "./dist/yoga.wasm", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"./asm": { | ||
"types": "./dist/asm.d.ts", | ||
"default": "./dist/asm.js" | ||
} | ||
}, | ||
@@ -17,14 +30,19 @@ "repository": "shuding/yoga-wasm-web", | ||
"package.json", | ||
"index.d.ts", | ||
"asm.d.ts", | ||
"LICENSE" | ||
], | ||
"devDependencies": { | ||
"esbuild": "^0.17.4", | ||
"vitest": "^0.28.2" | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"rollup": "^3.17.0", | ||
"typescript": "^4.9.5", | ||
"vitest": "^0.28.5" | ||
}, | ||
"scripts": { | ||
"build": "make && node build.js", | ||
"test": "vitest run --dir ./test" | ||
"build": "make && rollup -c", | ||
"typecheck": "tsc --noEmit", | ||
"test": "pnpm test:asm && pnpm test:wasm", | ||
"test:asm": "ASM=true vitest run --dir ./test", | ||
"test:wasm": "vitest run --dir ./test" | ||
} | ||
} |
# yoga-wasm-web | ||
[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js. This is an **opinionated** fork from [pinqy520/yoga-layout-wasm](https://github.com/pinqy520/yoga-layout-wasm) with the following changes: | ||
[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js. | ||
- Stick to commit eea87c3 of Yoga, which supports `gap`. | ||
- Fix missing `YGMeasureMode` binding. | ||
- Fix missing `YGUnit` binding. | ||
- Set flag `DYNAMIC_EXECUTION=0` for `emcc` to remove `eval` and `Function` executions. | ||
- Set flag `TEXTDECODER=0`. | ||
- Force the `ENVIRONMENT` to be `web`. | ||
- Add `pre.js` to set `document` as `this`. | ||
- Replace Rollup with esbuild for bundling. | ||
- Remove the asm.js build. | ||
- Enable LTO. | ||
- Enable SIMD128. | ||
## Usage | ||
## Install & Build | ||
Install with your package manager: | ||
To develop this project locally, you need to clone the repo and fetch the yoga submodule first. Also, [emcc](https://emscripten.org/docs/getting_started/downloads.html) is required to build this project too. | ||
After that, install npm dependencies: | ||
```sh | ||
pnpm i | ||
pnpm i yoga-wasm-web | ||
npm i yoga-wasm-web | ||
yarn add yoga-wasm-web | ||
``` | ||
And run the build script: | ||
### ASM.js | ||
```sh | ||
pnpm build | ||
To use the ASM.js build: | ||
```js | ||
import initYoga, { ALIGN_CENTER } from 'yoga-wasm-web/asm' | ||
const Yoga = initYoga() | ||
const node = Yoga.Node.create() | ||
node.setAlignContent(ALIGN_CENTER) | ||
``` | ||
## WASM | ||
### WASM | ||
@@ -39,7 +33,10 @@ To use the WASM build (take Node.js as an example): | ||
import fs from 'fs' | ||
import initYoga from 'yoga-wasm-web' | ||
import initYoga, { ALIGN_CENTER } from 'yoga-wasm-web' | ||
const yoga = await initYoga( | ||
const Yoga = await initYoga( | ||
fs.readFileSync('./node_modules/yoga-wasm-web/dist/yoga.wasm') | ||
) | ||
const node = Yoga.Node.create() | ||
node.setAlignContent(ALIGN_CENTER) | ||
``` | ||
@@ -49,10 +46,27 @@ | ||
## ASM.js | ||
To use the ASM.js build: | ||
## Contribution | ||
```js | ||
import initYoga from 'yoga-wasm-web/asm' | ||
To develop this project locally, you need to clone the repo and fetch the yoga submodule first. Also, [emcc](https://emscripten.org/docs/getting_started/downloads.html) is required to build this project too. | ||
const yoga = initYoga() | ||
After that, install npm dependencies: | ||
```sh | ||
pnpm i | ||
``` | ||
And run the build script: | ||
```sh | ||
pnpm build | ||
``` | ||
And run the tests: | ||
```sh | ||
pnpm test | ||
``` | ||
# Acknowledgements | ||
This project was started as **opinionated** fork from [pinqy520/yoga-layout-wasm](https://github.com/pinqy520/yoga-layout-wasm) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11
71
4
275480
6
1048
2