UNPKG

@itk-wasm/mesh-to-poly-data

Version:

Convert an ITK Mesh to a simple data structure compatible with vtkPolyData.

6 lines 137 kB
var Qt=Object.defineProperty;var ct=(A,e)=>{for(var t in e)Qt(A,t,{get:e[t],enumerable:!0})};var ut="1.1.1",RA=ut;var ft={Int8:"int8",UInt8:"uint8",Int16:"int16",UInt16:"uint16",Int32:"int32",UInt32:"uint32",Int64:"int64",UInt64:"uint64",SizeValueType:"uint64",IdentifierType:"uint64",IndexValueType:"int64",OffsetValueType:"int64"},D=ft;var pt={Float32:"float32",Float64:"float64",SpacePrecisionType:"float64"},P=pt;function dt(A,e){let t=null;switch(A){case D.UInt8:{t=new Uint8Array(e);break}case D.Int8:{t=new Int8Array(e);break}case D.UInt16:{t=new Uint16Array(e);break}case D.Int16:{t=new Int16Array(e);break}case D.UInt32:{t=new Uint32Array(e);break}case D.Int32:{t=new Int32Array(e);break}case D.UInt64:{typeof globalThis.BigUint64Array=="function"?t=new BigUint64Array(e):t=new Uint8Array(e);break}case D.Int64:{typeof globalThis.BigInt64Array=="function"?t=new BigInt64Array(e):t=new Uint8Array(e);break}case P.Float32:{t=new Float32Array(e);break}case P.Float64:{t=new Float64Array(e);break}case"null":{t=null;break}case null:{t=null;break}default:throw new Error("Type is not supported as a TypedArray")}return t}var N=dt;var ht={TextFile:"TextFile",BinaryFile:"BinaryFile",TextStream:"TextStream",BinaryStream:"BinaryStream",Image:"Image",Mesh:"Mesh",PolyData:"PolyData",JsonCompatible:"JsonCompatible"},p=ht;var oe=Symbol("Comlink.proxy"),yt=Symbol("Comlink.endpoint"),UA=Symbol("Comlink.releaseProxy"),kA=Symbol("Comlink.finalizer"),oA=Symbol("Comlink.thrown"),ae=A=>typeof A=="object"&&A!==null||typeof A=="function",mt={canHandle:A=>ae(A)&&A[oe],serialize(A){let{port1:e,port2:t}=new MessageChannel;return Ie(A,e),[t,[t]]},deserialize(A){return A.start(),NA(A)}},wt={canHandle:A=>ae(A)&&oA in A,serialize({value:A}){let e;return A instanceof Error?e={isError:!0,value:{message:A.message,name:A.name,stack:A.stack}}:e={isError:!1,value:A},[e,[]]},deserialize(A){throw A.isError?Object.assign(new Error(A.value.message),A.value):A.value}},se=new Map([["proxy",mt],["throw",wt]]);function Dt(A,e){for(let t of A)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Ie(A,e=globalThis,t=["*"]){e.addEventListener("message",function r(n){if(!n||!n.data)return;if(!Dt(t,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}let{id:i,type:o,path:g}=Object.assign({path:[]},n.data),E=(n.data.argumentList||[]).map(O),B;try{let I=g.slice(0,-1).reduce((c,C)=>c[C],A),a=g.reduce((c,C)=>c[C],A);switch(o){case"GET":B=a;break;case"SET":I[g.slice(-1)[0]]=O(n.data.value),B=!0;break;case"APPLY":B=a.apply(I,E);break;case"CONSTRUCT":{let c=new a(...E);B=bt(c)}break;case"ENDPOINT":{let{port1:c,port2:C}=new MessageChannel;Ie(A,C),B=GA(c,[c])}break;case"RELEASE":B=void 0;break;default:return}}catch(I){B={value:I,[oA]:0}}Promise.resolve(B).catch(I=>({value:I,[oA]:0})).then(I=>{let[a,c]=IA(I);e.postMessage(Object.assign(Object.assign({},a),{id:i}),c),o==="RELEASE"&&(e.removeEventListener("message",r),ge(e),kA in A&&typeof A[kA]=="function"&&A[kA]())}).catch(I=>{let[a,c]=IA({value:new TypeError("Unserializable return value"),[oA]:0});e.postMessage(Object.assign(Object.assign({},a),{id:i}),c)})}),e.start&&e.start()}function St(A){return A.constructor.name==="MessagePort"}function ge(A){St(A)&&A.close()}function NA(A,e){return bA(A,[],e)}function iA(A){if(A)throw new Error("Proxy has been released and is not useable")}function Ce(A){return J(A,{type:"RELEASE"}).then(()=>{ge(A)})}var aA=new WeakMap,sA="FinalizationRegistry"in globalThis&&new FinalizationRegistry(A=>{let e=(aA.get(A)||0)-1;aA.set(A,e),e===0&&Ce(A)});function Ft(A,e){let t=(aA.get(e)||0)+1;aA.set(e,t),sA&&sA.register(A,e,A)}function Rt(A){sA&&sA.unregister(A)}function bA(A,e=[],t=function(){}){let r=!1,n=new Proxy(t,{get(i,o){if(iA(r),o===UA)return()=>{Rt(n),Ce(A),r=!0};if(o==="then"){if(e.length===0)return{then:()=>n};let g=J(A,{type:"GET",path:e.map(E=>E.toString())}).then(O);return g.then.bind(g)}return bA(A,[...e,o])},set(i,o,g){iA(r);let[E,B]=IA(g);return J(A,{type:"SET",path:[...e,o].map(I=>I.toString()),value:E},B).then(O)},apply(i,o,g){iA(r);let E=e[e.length-1];if(E===yt)return J(A,{type:"ENDPOINT"}).then(O);if(E==="bind")return bA(A,e.slice(0,-1));let[B,I]=ie(g);return J(A,{type:"APPLY",path:e.map(a=>a.toString()),argumentList:B},I).then(O)},construct(i,o){iA(r);let[g,E]=ie(o);return J(A,{type:"CONSTRUCT",path:e.map(B=>B.toString()),argumentList:g},E).then(O)}});return Ft(n,A),n}function kt(A){return Array.prototype.concat.apply([],A)}function ie(A){let e=A.map(IA);return[e.map(t=>t[0]),kt(e.map(t=>t[1]))]}var Be=new WeakMap;function GA(A,e){return Be.set(A,e),A}function bt(A){return Object.assign(A,{[oe]:!0})}function IA(A){for(let[e,t]of se)if(t.canHandle(A)){let[r,n]=t.serialize(A);return[{type:"HANDLER",name:e,value:r},n]}return[{type:"RAW",value:A},Be.get(A)||[]]}function O(A){switch(A.type){case"HANDLER":return se.get(A.name).deserialize(A.value);case"RAW":return A.value}}function J(A,e,t){return new Promise(r=>{let n=Ut();A.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==n||(A.removeEventListener("message",i),r(o.data))}),A.start&&A.start(),A.postMessage(Object.assign({id:n},e),t)})}function Ut(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function _(A,e){return function(){return A.apply(e,arguments)}}var{toString:Nt}=Object.prototype,{getPrototypeOf:OA}=Object,CA=(A=>e=>{let t=Nt.call(e);return A[t]||(A[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),b=A=>(A=A.toLowerCase(),e=>CA(e)===A),BA=A=>e=>typeof e===A,{isArray:x}=Array,z=BA("undefined");function Gt(A){return A!==null&&!z(A)&&A.constructor!==null&&!z(A.constructor)&&F(A.constructor.isBuffer)&&A.constructor.isBuffer(A)}var ce=b("ArrayBuffer");function Lt(A){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(A):e=A&&A.buffer&&ce(A.buffer),e}var Tt=BA("string"),F=BA("function"),ue=BA("number"),EA=A=>A!==null&&typeof A=="object",Ot=A=>A===!0||A===!1,gA=A=>{if(CA(A)!=="object")return!1;let e=OA(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in A)&&!(Symbol.iterator in A)},Pt=b("Date"),Jt=b("File"),xt=b("Blob"),Mt=b("FileList"),Ht=A=>EA(A)&&F(A.pipe),Yt=A=>{let e;return A&&(typeof FormData=="function"&&A instanceof FormData||F(A.append)&&((e=CA(A))==="formdata"||e==="object"&&F(A.toString)&&A.toString()==="[object FormData]"))},qt=b("URLSearchParams"),Kt=A=>A.trim?A.trim():A.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(A,e,{allOwnKeys:t=!1}={}){if(A===null||typeof A>"u")return;let r,n;if(typeof A!="object"&&(A=[A]),x(A))for(r=0,n=A.length;r<n;r++)e.call(null,A[r],r,A);else{let i=t?Object.getOwnPropertyNames(A):Object.keys(A),o=i.length,g;for(r=0;r<o;r++)g=i[r],e.call(null,A[g],g,A)}}function fe(A,e){e=e.toLowerCase();let t=Object.keys(A),r=t.length,n;for(;r-- >0;)if(n=t[r],e===n.toLowerCase())return n;return null}var pe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,de=A=>!z(A)&&A!==pe;function TA(){let{caseless:A}=de(this)&&this||{},e={},t=(r,n)=>{let i=A&&fe(e,n)||n;gA(e[i])&&gA(r)?e[i]=TA(e[i],r):gA(r)?e[i]=TA({},r):x(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&V(arguments[r],t);return e}var Wt=(A,e,t,{allOwnKeys:r}={})=>(V(e,(n,i)=>{t&&F(n)?A[i]=_(n,t):A[i]=n},{allOwnKeys:r}),A),jt=A=>(A.charCodeAt(0)===65279&&(A=A.slice(1)),A),vt=(A,e,t,r)=>{A.prototype=Object.create(e.prototype,r),A.prototype.constructor=A,Object.defineProperty(A,"super",{value:e.prototype}),t&&Object.assign(A.prototype,t)},_t=(A,e,t,r)=>{let n,i,o,g={};if(e=e||{},A==null)return e;do{for(n=Object.getOwnPropertyNames(A),i=n.length;i-- >0;)o=n[i],(!r||r(o,A,e))&&!g[o]&&(e[o]=A[o],g[o]=!0);A=t!==!1&&OA(A)}while(A&&(!t||t(A,e))&&A!==Object.prototype);return e},zt=(A,e,t)=>{A=String(A),(t===void 0||t>A.length)&&(t=A.length),t-=e.length;let r=A.indexOf(e,t);return r!==-1&&r===t},Vt=A=>{if(!A)return null;if(x(A))return A;let e=A.length;if(!ue(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=A[e];return t},Zt=(A=>e=>A&&e instanceof A)(typeof Uint8Array<"u"&&OA(Uint8Array)),Xt=(A,e)=>{let r=(A&&A[Symbol.iterator]).call(A),n;for(;(n=r.next())&&!n.done;){let i=n.value;e.call(A,i[0],i[1])}},$t=(A,e)=>{let t,r=[];for(;(t=A.exec(e))!==null;)r.push(t);return r},Ar=b("HTMLFormElement"),er=A=>A.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),le=(({hasOwnProperty:A})=>(e,t)=>A.call(e,t))(Object.prototype),tr=b("RegExp"),he=(A,e)=>{let t=Object.getOwnPropertyDescriptors(A),r={};V(t,(n,i)=>{let o;(o=e(n,i,A))!==!1&&(r[i]=o||n)}),Object.defineProperties(A,r)},rr=A=>{he(A,(e,t)=>{if(F(A)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=A[t];if(F(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},nr=(A,e)=>{let t={},r=n=>{n.forEach(i=>{t[i]=!0})};return x(A)?r(A):r(String(A).split(e)),t},ir=()=>{},or=(A,e)=>(A=+A,Number.isFinite(A)?A:e),LA="abcdefghijklmnopqrstuvwxyz",Qe="0123456789",ye={DIGIT:Qe,ALPHA:LA,ALPHA_DIGIT:LA+LA.toUpperCase()+Qe},ar=(A=16,e=ye.ALPHA_DIGIT)=>{let t="",{length:r}=e;for(;A--;)t+=e[Math.random()*r|0];return t};function sr(A){return!!(A&&F(A.append)&&A[Symbol.toStringTag]==="FormData"&&A[Symbol.iterator])}var Ir=A=>{let e=new Array(10),t=(r,n)=>{if(EA(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[n]=r;let i=x(r)?[]:{};return V(r,(o,g)=>{let E=t(o,n+1);!z(E)&&(i[g]=E)}),e[n]=void 0,i}}return r};return t(A,0)},gr=b("AsyncFunction"),Cr=A=>A&&(EA(A)||F(A))&&F(A.then)&&F(A.catch),s={isArray:x,isArrayBuffer:ce,isBuffer:Gt,isFormData:Yt,isArrayBufferView:Lt,isString:Tt,isNumber:ue,isBoolean:Ot,isObject:EA,isPlainObject:gA,isUndefined:z,isDate:Pt,isFile:Jt,isBlob:xt,isRegExp:tr,isFunction:F,isStream:Ht,isURLSearchParams:qt,isTypedArray:Zt,isFileList:Mt,forEach:V,merge:TA,extend:Wt,trim:Kt,stripBOM:jt,inherits:vt,toFlatObject:_t,kindOf:CA,kindOfTest:b,endsWith:zt,toArray:Vt,forEachEntry:Xt,matchAll:$t,isHTMLForm:Ar,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:he,freezeMethods:rr,toObjectSet:nr,toCamelCase:er,noop:ir,toFiniteNumber:or,findKey:fe,global:pe,isContextDefined:de,ALPHABET:ye,generateString:ar,isSpecCompliantForm:sr,toJSONObject:Ir,isAsyncFn:gr,isThenable:Cr};function M(A,e,t,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=A,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),n&&(this.response=n)}s.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:s.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var me=M.prototype,we={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(A=>{we[A]={value:A}});Object.defineProperties(M,we);Object.defineProperty(me,"isAxiosError",{value:!0});M.from=(A,e,t,r,n,i)=>{let o=Object.create(me);return s.toFlatObject(A,o,function(E){return E!==Error.prototype},g=>g!=="isAxiosError"),M.call(o,A.message,e,t,r,n),o.cause=A,o.name=A.name,i&&Object.assign(o,i),o};var f=M;var lA=null;function PA(A){return s.isPlainObject(A)||s.isArray(A)}function Se(A){return s.endsWith(A,"[]")?A.slice(0,-2):A}function De(A,e,t){return A?A.concat(e).map(function(n,i){return n=Se(n),!t&&i?"["+n+"]":n}).join(t?".":""):e}function Br(A){return s.isArray(A)&&!A.some(PA)}var Er=s.toFlatObject(s,{},null,function(e){return/^is[A-Z]/.test(e)});function lr(A,e,t){if(!s.isObject(A))throw new TypeError("target must be an object");e=e||new(lA||FormData),t=s.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(l,u){return!s.isUndefined(u[l])});let r=t.metaTokens,n=t.visitor||I,i=t.dots,o=t.indexes,E=(t.Blob||typeof Blob<"u"&&Blob)&&s.isSpecCompliantForm(e);if(!s.isFunction(n))throw new TypeError("visitor must be a function");function B(Q){if(Q===null)return"";if(s.isDate(Q))return Q.toISOString();if(!E&&s.isBlob(Q))throw new f("Blob is not supported. Use a Buffer instead.");return s.isArrayBuffer(Q)||s.isTypedArray(Q)?E&&typeof Blob=="function"?new Blob([Q]):Buffer.from(Q):Q}function I(Q,l,u){let d=Q;if(Q&&!u&&typeof Q=="object"){if(s.endsWith(l,"{}"))l=r?l:l.slice(0,-2),Q=JSON.stringify(Q);else if(s.isArray(Q)&&Br(Q)||(s.isFileList(Q)||s.endsWith(l,"[]"))&&(d=s.toArray(Q)))return l=Se(l),d.forEach(function(k,lt){!(s.isUndefined(k)||k===null)&&e.append(o===!0?De([l],lt,i):o===null?l:l+"[]",B(k))}),!1}return PA(Q)?!0:(e.append(De(u,l,i),B(Q)),!1)}let a=[],c=Object.assign(Er,{defaultVisitor:I,convertValue:B,isVisitable:PA});function C(Q,l){if(!s.isUndefined(Q)){if(a.indexOf(Q)!==-1)throw Error("Circular reference detected in "+l.join("."));a.push(Q),s.forEach(Q,function(d,R){(!(s.isUndefined(d)||d===null)&&n.call(e,d,s.isString(R)?R.trim():R,l,c))===!0&&C(d,l?l.concat(R):[R])}),a.pop()}}if(!s.isObject(A))throw new TypeError("data must be an object");return C(A),e}var G=lr;function Fe(A){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(A).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Re(A,e){this._pairs=[],A&&G(A,this,e)}var ke=Re.prototype;ke.append=function(e,t){this._pairs.push([e,t])};ke.toString=function(e){let t=e?function(r){return e.call(this,r,Fe)}:Fe;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};var QA=Re;function Qr(A){return encodeURIComponent(A).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(A,e,t){if(!e)return A;let r=t&&t.encode||Qr,n=t&&t.serialize,i;if(n?i=n(e,t):i=s.isURLSearchParams(e)?e.toString():new QA(e,t).toString(r),i){let o=A.indexOf("#");o!==-1&&(A=A.slice(0,o)),A+=(A.indexOf("?")===-1?"?":"&")+i}return A}var JA=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){s.forEach(this.handlers,function(r){r!==null&&e(r)})}},xA=JA;var cA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var be=typeof URLSearchParams<"u"?URLSearchParams:QA;var Ue=typeof FormData<"u"?FormData:null;var Ne=typeof Blob<"u"?Blob:null;var Ge={isBrowser:!0,classes:{URLSearchParams:be,FormData:Ue,Blob:Ne},protocols:["http","https","file","blob","url","data"]};var MA={};ct(MA,{hasBrowserEnv:()=>Le,hasStandardBrowserEnv:()=>cr,hasStandardBrowserWebWorkerEnv:()=>ur});var Le=typeof window<"u"&&typeof document<"u",cr=(A=>Le&&["ReactNative","NativeScript","NS"].indexOf(A)<0)(typeof navigator<"u"&&navigator.product),ur=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var m={...MA,...Ge};function HA(A,e){return G(A,new m.classes.URLSearchParams,Object.assign({visitor:function(t,r,n,i){return m.isNode&&s.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function fr(A){return s.matchAll(/\w+|\[(\w*)]/g,A).map(e=>e[0]==="[]"?"":e[1]||e[0])}function pr(A){let e={},t=Object.keys(A),r,n=t.length,i;for(r=0;r<n;r++)i=t[r],e[i]=A[i];return e}function dr(A){function e(t,r,n,i){let o=t[i++];if(o==="__proto__")return!0;let g=Number.isFinite(+o),E=i>=t.length;return o=!o&&s.isArray(n)?n.length:o,E?(s.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!g):((!n[o]||!s.isObject(n[o]))&&(n[o]=[]),e(t,r,n[o],i)&&s.isArray(n[o])&&(n[o]=pr(n[o])),!g)}if(s.isFormData(A)&&s.isFunction(A.entries)){let t={};return s.forEachEntry(A,(r,n)=>{e(fr(r),n,t,0)}),t}return null}var uA=dr;function hr(A,e,t){if(s.isString(A))try{return(e||JSON.parse)(A),s.trim(A)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(A)}var YA={transitional:cA,adapter:["xhr","http"],transformRequest:[function(e,t){let r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=s.isObject(e);if(i&&s.isHTMLForm(e)&&(e=new FormData(e)),s.isFormData(e))return n?JSON.stringify(uA(e)):e;if(s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e))return e;if(s.isArrayBufferView(e))return e.buffer;if(s.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let g;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return HA(e,this.formSerializer).toString();if((g=s.isFileList(e))||r.indexOf("multipart/form-data")>-1){let E=this.env&&this.env.FormData;return G(g?{"files[]":e}:e,E&&new E,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),hr(e)):e}],transformResponse:[function(e){let t=this.transitional||YA.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(e&&s.isString(e)&&(r&&!this.responseType||n)){let o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(g){if(o)throw g.name==="SyntaxError"?f.from(g,f.ERR_BAD_RESPONSE,this,null,this.response):g}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:m.classes.FormData,Blob:m.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};s.forEach(["delete","get","head","post","put","patch"],A=>{YA.headers[A]={}});var H=YA;var yr=s.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Te=A=>{let e={},t,r,n;return A&&A.split(` `).forEach(function(o){n=o.indexOf(":"),t=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!t||e[t]&&yr[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e};var Oe=Symbol("internals");function X(A){return A&&String(A).trim().toLowerCase()}function fA(A){return A===!1||A==null?A:s.isArray(A)?A.map(fA):String(A)}function mr(A){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(A);)e[r[1]]=r[2];return e}var wr=A=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(A.trim());function qA(A,e,t,r,n){if(s.isFunction(r))return r.call(this,e,t);if(n&&(e=t),!!s.isString(e)){if(s.isString(r))return e.indexOf(r)!==-1;if(s.isRegExp(r))return r.test(e)}}function Dr(A){return A.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Sr(A,e){let t=s.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(A,r+t,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}var Y=class{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function i(g,E,B){let I=X(E);if(!I)throw new Error("header name must be a non-empty string");let a=s.findKey(n,I);(!a||n[a]===void 0||B===!0||B===void 0&&n[a]!==!1)&&(n[a||E]=fA(g))}let o=(g,E)=>s.forEach(g,(B,I)=>i(B,I,E));return s.isPlainObject(e)||e instanceof this.constructor?o(e,t):s.isString(e)&&(e=e.trim())&&!wr(e)?o(Te(e),t):e!=null&&i(t,e,r),this}get(e,t){if(e=X(e),e){let r=s.findKey(this,e);if(r){let n=this[r];if(!t)return n;if(t===!0)return mr(n);if(s.isFunction(t))return t.call(this,n,r);if(s.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=X(e),e){let r=s.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||qA(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function i(o){if(o=X(o),o){let g=s.findKey(r,o);g&&(!t||qA(r,r[g],g,t))&&(delete r[g],n=!0)}}return s.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let i=t[r];(!e||qA(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,r={};return s.forEach(this,(n,i)=>{let o=s.findKey(r,i);if(o){t[o]=fA(n),delete t[i];return}let g=e?Dr(i):String(i).trim();g!==i&&delete t[i],t[g]=fA(n),r[g]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return s.forEach(this,(r,n)=>{r!=null&&r!==!1&&(t[n]=e&&s.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){let r=(this[Oe]=this[Oe]={accessors:{}}).accessors,n=this.prototype;function i(o){let g=X(o);r[g]||(Sr(n,o),r[g]=!0)}return s.isArray(e)?e.forEach(i):i(e),this}};Y.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);s.reduceDescriptors(Y.prototype,({value:A},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>A,set(r){this[t]=r}}});s.freezeMethods(Y);var w=Y;function $(A,e){let t=this||H,r=e||t,n=w.from(r.headers),i=r.data;return s.forEach(A,function(g){i=g.call(t,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function AA(A){return!!(A&&A.__CANCEL__)}function Pe(A,e,t){f.call(this,A??"canceled",f.ERR_CANCELED,e,t),this.name="CanceledError"}s.inherits(Pe,f,{__CANCEL__:!0});var L=Pe;function KA(A,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?A(t):e(new f("Request failed with status code "+t.status,[f.ERR_BAD_REQUEST,f.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}var Je=m.hasStandardBrowserEnv?{write(A,e,t,r,n,i){let o=[A+"="+encodeURIComponent(e)];s.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),s.isString(r)&&o.push("path="+r),s.isString(n)&&o.push("domain="+n),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(A){let e=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function WA(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function jA(A,e){return e?A.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):A}function eA(A,e){return A&&!WA(e)?jA(A,e):e}var xe=m.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),r;function n(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(o){let g=s.isString(o)?n(o):o;return g.protocol===r.protocol&&g.host===r.host}}():function(){return function(){return!0}}();function vA(A){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return e&&e[1]||""}function Fr(A,e){A=A||10;let t=new Array(A),r=new Array(A),n=0,i=0,o;return e=e!==void 0?e:1e3,function(E){let B=Date.now(),I=r[i];o||(o=B),t[n]=E,r[n]=B;let a=i,c=0;for(;a!==n;)c+=t[a++],a=a%A;if(n=(n+1)%A,n===i&&(i=(i+1)%A),B-o<e)return;let C=I&&B-I;return C?Math.round(c*1e3/C):void 0}}var Me=Fr;function He(A,e){let t=0,r=Me(50,250);return n=>{let i=n.loaded,o=n.lengthComputable?n.total:void 0,g=i-t,E=r(g),B=i<=o;t=i;let I={loaded:i,total:o,progress:o?i/o:void 0,bytes:g,rate:E||void 0,estimated:E&&o&&B?(o-i)/E:void 0,event:n};I[e?"download":"upload"]=!0,A(I)}}var Rr=typeof XMLHttpRequest<"u",Ye=Rr&&function(A){return new Promise(function(t,r){let n=A.data,i=w.from(A.headers).normalize(),{responseType:o,withXSRFToken:g}=A,E;function B(){A.cancelToken&&A.cancelToken.unsubscribe(E),A.signal&&A.signal.removeEventListener("abort",E)}let I;if(s.isFormData(n)){if(m.hasStandardBrowserEnv||m.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((I=i.getContentType())!==!1){let[l,...u]=I?I.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...u].join("; "))}}let a=new XMLHttpRequest;if(A.auth){let l=A.auth.username||"",u=A.auth.password?unescape(encodeURIComponent(A.auth.password)):"";i.set("Authorization","Basic "+btoa(l+":"+u))}let c=eA(A.baseURL,A.url);a.open(A.method.toUpperCase(),Z(c,A.params,A.paramsSerializer),!0),a.timeout=A.timeout;function C(){if(!a)return;let l=w.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),d={data:!o||o==="text"||o==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:l,config:A,request:a};KA(function(k){t(k),B()},function(k){r(k),B()},d),a=null}if("onloadend"in a?a.onloadend=C:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(C)},a.onabort=function(){a&&(r(new f("Request aborted",f.ECONNABORTED,A,a)),a=null)},a.onerror=function(){r(new f("Network Error",f.ERR_NETWORK,A,a)),a=null},a.ontimeout=function(){let u=A.timeout?"timeout of "+A.timeout+"ms exceeded":"timeout exceeded",d=A.transitional||cA;A.timeoutErrorMessage&&(u=A.timeoutErrorMessage),r(new f(u,d.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,A,a)),a=null},m.hasStandardBrowserEnv&&(g&&s.isFunction(g)&&(g=g(A)),g||g!==!1&&xe(c))){let l=A.xsrfHeaderName&&A.xsrfCookieName&&Je.read(A.xsrfCookieName);l&&i.set(A.xsrfHeaderName,l)}n===void 0&&i.setContentType(null),"setRequestHeader"in a&&s.forEach(i.toJSON(),function(u,d){a.setRequestHeader(d,u)}),s.isUndefined(A.withCredentials)||(a.withCredentials=!!A.withCredentials),o&&o!=="json"&&(a.responseType=A.responseType),typeof A.onDownloadProgress=="function"&&a.addEventListener("progress",He(A.onDownloadProgress,!0)),typeof A.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",He(A.onUploadProgress)),(A.cancelToken||A.signal)&&(E=l=>{a&&(r(!l||l.type?new L(null,A,a):l),a.abort(),a=null)},A.cancelToken&&A.cancelToken.subscribe(E),A.signal&&(A.signal.aborted?E():A.signal.addEventListener("abort",E)));let Q=vA(c);if(Q&&m.protocols.indexOf(Q)===-1){r(new f("Unsupported protocol "+Q+":",f.ERR_BAD_REQUEST,A));return}a.send(n||null)})};var _A={http:lA,xhr:Ye};s.forEach(_A,(A,e)=>{if(A){try{Object.defineProperty(A,"name",{value:e})}catch{}Object.defineProperty(A,"adapterName",{value:e})}});var qe=A=>`- ${A}`,kr=A=>s.isFunction(A)||A===null||A===!1,pA={getAdapter:A=>{A=s.isArray(A)?A:[A];let{length:e}=A,t,r,n={};for(let i=0;i<e;i++){t=A[i];let o;if(r=t,!kr(t)&&(r=_A[(o=String(t)).toLowerCase()],r===void 0))throw new f(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r}if(!r){let i=Object.entries(n).map(([g,E])=>`adapter ${g} `+(E===!1?"is not supported by the environment":"is not available in the build")),o=e?i.length>1?`since : `+i.map(qe).join(` `):" "+qe(i[0]):"as no adapter specified";throw new f("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:_A};function zA(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new L(null,A)}function dA(A){return zA(A),A.headers=w.from(A.headers),A.data=$.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),pA.getAdapter(A.adapter||H.adapter)(A).then(function(r){return zA(A),r.data=$.call(A,A.transformResponse,r),r.headers=w.from(r.headers),r},function(r){return AA(r)||(zA(A),r&&r.response&&(r.response.data=$.call(A,A.transformResponse,r.response),r.response.headers=w.from(r.response.headers))),Promise.reject(r)})}var Ke=A=>A instanceof w?A.toJSON():A;function U(A,e){e=e||{};let t={};function r(B,I,a){return s.isPlainObject(B)&&s.isPlainObject(I)?s.merge.call({caseless:a},B,I):s.isPlainObject(I)?s.merge({},I):s.isArray(I)?I.slice():I}function n(B,I,a){if(s.isUndefined(I)){if(!s.isUndefined(B))return r(void 0,B,a)}else return r(B,I,a)}function i(B,I){if(!s.isUndefined(I))return r(void 0,I)}function o(B,I){if(s.isUndefined(I)){if(!s.isUndefined(B))return r(void 0,B)}else return r(void 0,I)}function g(B,I,a){if(a in e)return r(B,I);if(a in A)return r(void 0,B)}let E={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:g,headers:(B,I)=>n(Ke(B),Ke(I),!0)};return s.forEach(Object.keys(Object.assign({},A,e)),function(I){let a=E[I]||n,c=a(A[I],e[I],I);s.isUndefined(c)&&a!==g||(t[I]=c)}),t}var hA="1.6.7";var VA={};["object","boolean","number","function","string","symbol"].forEach((A,e)=>{VA[A]=function(r){return typeof r===A||"a"+(e<1?"n ":" ")+A}});var We={};VA.transitional=function(e,t,r){function n(i,o){return"[Axios v"+hA+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,g)=>{if(e===!1)throw new f(n(o," has been removed"+(t?" in "+t:"")),f.ERR_DEPRECATED);return t&&!We[o]&&(We[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,g):!0}};function br(A,e,t){if(typeof A!="object")throw new f("options must be an object",f.ERR_BAD_OPTION_VALUE);let r=Object.keys(A),n=r.length;for(;n-- >0;){let i=r[n],o=e[i];if(o){let g=A[i],E=g===void 0||o(g,i,A);if(E!==!0)throw new f("option "+i+" must be "+E,f.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new f("Unknown option "+i,f.ERR_BAD_OPTION)}}var yA={assertOptions:br,validators:VA};var T=yA.validators,q=class{constructor(e){this.defaults=e,this.interceptors={request:new xA,response:new xA}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;let i=n.stack?n.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=U(this.defaults,t);let{transitional:r,paramsSerializer:n,headers:i}=t;r!==void 0&&yA.assertOptions(r,{silentJSONParsing:T.transitional(T.boolean),forcedJSONParsing:T.transitional(T.boolean),clarifyTimeoutError:T.transitional(T.boolean)},!1),n!=null&&(s.isFunction(n)?t.paramsSerializer={serialize:n}:yA.assertOptions(n,{encode:T.function,serialize:T.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&s.merge(i.common,i[t.method]);i&&s.forEach(["delete","get","head","post","put","patch","common"],Q=>{delete i[Q]}),t.headers=w.concat(o,i);let g=[],E=!0;this.interceptors.request.forEach(function(l){typeof l.runWhen=="function"&&l.runWhen(t)===!1||(E=E&&l.synchronous,g.unshift(l.fulfilled,l.rejected))});let B=[];this.interceptors.response.forEach(function(l){B.push(l.fulfilled,l.rejected)});let I,a=0,c;if(!E){let Q=[dA.bind(this),void 0];for(Q.unshift.apply(Q,g),Q.push.apply(Q,B),c=Q.length,I=Promise.resolve(t);a<c;)I=I.then(Q[a++],Q[a++]);return I}c=g.length;let C=t;for(a=0;a<c;){let Q=g[a++],l=g[a++];try{C=Q(C)}catch(u){l.call(this,u);break}}try{I=dA.call(this,C)}catch(Q){return Promise.reject(Q)}for(a=0,c=B.length;a<c;)I=I.then(B[a++],B[a++]);return I}getUri(e){e=U(this.defaults,e);let t=eA(e.baseURL,e.url);return Z(t,e.params,e.paramsSerializer)}};s.forEach(["delete","get","head","options"],function(e){q.prototype[e]=function(t,r){return this.request(U(r||{},{method:e,url:t,data:(r||{}).data}))}});s.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,g){return this.request(U(g||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}q.prototype[e]=t(),q.prototype[e+"Form"]=t(!0)});var tA=q;var ZA=class A{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});let r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i,o=new Promise(g=>{r.subscribe(g),i=g}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,g){r.reason||(r.reason=new L(i,o,g),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new A(function(n){e=n}),cancel:e}}},je=ZA;function XA(A){return function(t){return A.apply(null,t)}}function $A(A){return s.isObject(A)&&A.isAxiosError===!0}var Ae={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ae).forEach(([A,e])=>{Ae[e]=A});var ve=Ae;function _e(A){let e=new tA(A),t=_(tA.prototype.request,e);return s.extend(t,tA.prototype,e,{allOwnKeys:!0}),s.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return _e(U(A,n))},t}var h=_e(H);h.Axios=tA;h.CanceledError=L;h.CancelToken=je;h.isCancel=AA;h.VERSION=hA;h.toFormData=G;h.AxiosError=f;h.Cancel=h.CanceledError;h.all=function(e){return Promise.all(e)};h.spread=XA;h.isAxiosError=$A;h.mergeConfig=U;h.AxiosHeaders=w;h.formToJSON=A=>uA(s.isHTMLForm(A)?new FormData(A):A);h.getAdapter=pA.getAdapter;h.HttpStatusCode=ve;h.default=h;var K=h;var{Axios:Wo,AxiosError:jo,CanceledError:vo,isCancel:_o,CancelToken:zo,VERSION:Vo,all:Zo,Cancel:Xo,isAxiosError:$o,spread:Aa,toFormData:ea,AxiosHeaders:ta,HttpStatusCode:ra,formToJSON:na,getAdapter:ia,mergeConfig:oa}=K;async function Ur(A,e){let t=A,r=null;if(t==null)r=new Worker(new URL("./web-workers/itk-wasm-pipeline.worker.js",import.meta.url),{type:"module"});else if(t.startsWith("http")){let n=await K.get(t,{responseType:"blob",params:e}),i=URL.createObjectURL(n.data);r=new Worker(i,{type:"module"})}else r=new Worker(t,{type:"module"});return r}var rA=Ur;function ze(A){let e=NA(A),t=A;return t.terminated=!1,t.workerProxy=e,t.originalTerminate=t.terminate,t.terminate=()=>{t.terminated=!0,t.workerProxy[UA](),t.originalTerminate()},{workerProxy:e,worker:t}}async function Nr(A,e,t){let r;if(A!=null){let i=A;return i.workerProxy!==void 0?(r=i.workerProxy,{workerProxy:r,worker:i}):ze(A)}let n=await rA(e,t);return ze(n)}var Ve=Nr;async function Gr(A,e,t){let r="unknown";typeof A!="string"?r=A.href:A.startsWith("http")?r=A:r=typeof e<"u"?`${e}/${A}`:A,r.endsWith(".js")&&(r=r.substring(0,r.length-3)),r.endsWith(".wasm")&&(r=r.substring(0,r.length-5));let n=`${r}.wasm`,o=(await K.get(n,{responseType:"arraybuffer",params:t})).data;return(await import(`${r}.js`)).default({wasmBinary:o})}var Ze=Gr;var Xe=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]));var et=typeof globalThis.SharedArrayBuffer=="function",$e=new TextEncoder,At=new TextDecoder("utf-8");function Lr(A,e){let t={flags:"r",encoding:"binary"},r=A.fs_open(e,t.flags),i=A.fs_stat(e).size,o=null;et?o=new SharedArrayBuffer(i):o=new ArrayBuffer(i);let g=new Uint8Array(o);return A.fs_read(r,g,0,i,0),A.fs_close(r),g}function tt(A,e,t){let r=null;et?r=new SharedArrayBuffer(t):r=new ArrayBuffer(t);let n=new Uint8Array(r),i=new Uint8Array(A.HEAPU8.buffer,e,t);return n.set(i),n}function y(A,e,t,r){let n=0;return e!==null&&(n=A.ccall("itk_wasm_input_array_alloc","number",["number","number","number","number"],[0,t,r,e.buffer.byteLength]),A.HEAPU8.set(new Uint8Array(e.buffer),n)),n}function W(A,e,t){let r=JSON.stringify(e),n=A.lengthBytesUTF8(r)+1,i=A.ccall("itk_wasm_input_json_alloc","number",["number","number","number"],[0,t,n]);A.stringToUTF8(r,i,n)}function S(A,e,t,r){let n=A.ccall("itk_wasm_output_array_address","number",["number","number","number"],[0,e,t]),i=A.ccall("itk_wasm_output_array_size","number",["number","number","number"],[0,e,t]),o=tt(A,n,i);return N(r,o.buffer)}function ee(A,e){let t=A.ccall("itk_wasm_output_json_address","number",["number","number"],[0,e]),r=A.UTF8ToString(t);return JSON.parse(r)}function Tr(A,e,t,r){r!=null&&r.length>0&&r.forEach(function(B,I){switch(B.type){case p.TextStream:{let a=$e.encode(B.data.data),c=y(A,a,I,0),C={size:a.buffer.byteLength,data:`data:application/vnd.itk.address,0:${c}`};W(A,C,I);break}case p.JsonCompatible:{let a=$e.encode(JSON.stringify(B.data)),c=y(A,a,I,0),C={size:a.buffer.byteLength,data:`data:application/vnd.itk.address,0:${c}`};W(A,C,I);break}case p.BinaryStream:{let a=B.data.data,c=y(A,a,I,0),C={size:a.buffer.byteLength,data:`data:application/vnd.itk.address,0:${c}`};W(A,C,I);break}case p.TextFile:{A.fs_writeFile(B.data.path,B.data.data);break}case p.BinaryFile:{A.fs_writeFile(B.data.path,B.data.data);break}case p.Image:{let a=B.data,c=y(A,a.data,I,0),C=y(A,a.direction,I,1),Q=typeof a.metadata?.entries<"u"?JSON.stringify(Array.from(a.metadata.entries())):"[]",l={imageType:a.imageType,name:a.name,origin:a.origin,spacing:a.spacing,direction:`data:application/vnd.itk.address,0:${C}`,size:a.size,data:`data:application/vnd.itk.address,0:${c}`,metadata:Q};W(A,l,I);break}case p.Mesh:{let a=B.data,c=y(A,a.points,I,0),C=y(A,a.cells,I,1),Q=y(A,a.pointData,I,2),l=y(A,a.cellData,I,3),u={meshType:a.meshType,name:a.name,numberOfPoints:a.numberOfPoints,points:`data:application/vnd.itk.address,0:${c}`,numberOfCells:a.numberOfCells,cells:`data:application/vnd.itk.address,0:${C}`,cellBufferSize:a.cellBufferSize,numberOfPointPixels:a.numberOfPointPixels,pointData:`data:application/vnd.itk.address,0:${Q}`,numberOfCellPixels:a.numberOfCellPixels,cellData:`data:application/vnd.itk.address,0:${l}`};W(A,u,I);break}case p.PolyData:{let a=B.data,c=y(A,a.points,I,0),C=y(A,a.vertices,I,1),Q=y(A,a.lines,I,2),l=y(A,a.polygons,I,3),u=y(A,a.triangleStrips,I,4),d=y(A,a.pointData,I,5),R=y(A,a.pointData,I,6),k={polyDataType:a.polyDataType,name:a.name,numberOfPoints:a.numberOfPoints,points:`data:application/vnd.itk.address,0:${c}`,verticesBufferSize:a.verticesBufferSize,vertices:`data:application/vnd.itk.address,0:${C}`,linesBufferSize:a.linesBufferSize,lines:`data:application/vnd.itk.address,0:${Q}`,polygonsBufferSize:a.polygonsBufferSize,polygons:`data:application/vnd.itk.address,0:${l}`,triangleStripsBufferSize:a.triangleStripsBufferSize,triangleStrips:`data:application/vnd.itk.address,0:${u}`,numberOfPointPixels:a.numberOfPointPixels,pointData:`data:application/vnd.itk.address,0:${d}`,numberOfCellPixels:a.numberOfCellPixels,cellData:`data:application/vnd.itk.address,0:${R}`};W(A,k,I);break}default:throw Error("Unsupported input InterfaceType")}}),A.resetModuleStdout(),A.resetModuleStderr();let n=A.stackSave(),i=0;try{i=A.callMain(e.slice())}catch(B){throw typeof B=="number"&&(console.log("Exception while running pipeline:"),console.log("stdout:",A.getModuleStdout()),console.error("stderr:",A.getModuleStderr()),typeof A.getExceptionMessage<"u"?console.error("exception:",A.getExceptionMessage(B)):console.error("Build module in Debug mode for exception message information.")),B}finally{A.stackRestore(n)}let o=A.getModuleStdout(),g=A.getModuleStderr(),E=[];return t!=null&&t.length>0&&i===0&&t.forEach(function(B,I){let a=null;switch(B.type){case p.TextStream:{let C=A.ccall("itk_wasm_output_array_address","number",["number","number","number"],[0,I,0]),Q=A.ccall("itk_wasm_output_array_size","number",["number","number","number"],[0,I,0]),l=new Uint8Array(A.HEAPU8.buffer,C,Q);a={data:At.decode(l)};break}case p.JsonCompatible:{let C=A.ccall("itk_wasm_output_array_address","number",["number","number","number"],[0,I,0]),Q=A.ccall("itk_wasm_output_array_size","number",["number","number","number"],[0,I,0]),l=new Uint8Array(A.HEAPU8.buffer,C,Q);a=JSON.parse(At.decode(l));break}case p.BinaryStream:{let C=A.ccall("itk_wasm_output_array_address","number",["number","number","number"],[0,I,0]),Q=A.ccall("itk_wasm_output_array_size","number",["number","number","number"],[0,I,0]);a={data:tt(A,C,Q)};break}case p.TextFile:{a={path:B.data.path,data:A.fs_readFile(B.data.path,{encoding:"utf8"})};break}case p.BinaryFile:{a={path:B.data.path,data:Lr(A,B.data.path)};break}case p.Image:{let C=ee(A,I);C.data=S(A,I,0,C.imageType.componentType),C.direction=S(A,I,1,P.Float64),C.metadata=new Map(C.metadata),a=C;break}case p.Mesh:{let C=ee(A,I);C.numberOfPoints>0?C.points=S(A,I,0,C.meshType.pointComponentType):C.points=N(C.meshType.pointComponentType,new ArrayBuffer(0)),C.numberOfCells>0?C.cells=S(A,I,1,C.meshType.cellComponentType):C.cells=N(C.meshType.cellComponentType,new ArrayBuffer(0)),C.numberOfPointPixels>0?C.pointData=S(A,I,2,C.meshType.pointPixelComponentType):C.pointData=N(C.meshType.pointPixelComponentType,new ArrayBuffer(0)),C.numberOfCellPixels>0?C.cellData=S(A,I,3,C.meshType.cellPixelComponentType):C.cellData=N(C.meshType.cellPixelComponentType,new ArrayBuffer(0)),a=C;break}case p.PolyData:{let C=ee(A,I);C.numberOfPoints>0?C.points=S(A,I,0,P.Float32):C.points=new Float32Array,C.verticesBufferSize>0?C.vertices=S(A,I,1,D.UInt32):C.vertices=new Uint32Array,C.linesBufferSize>0?C.lines=S(A,I,2,D.UInt32):C.lines=new Uint32Array,C.polygonsBufferSize>0?C.polygons=S(A,I,3,D.UInt32):C.polygons=new Uint32Array,C.triangleStripsBufferSize>0?C.triangleStrips=S(A,I,4,D.UInt32):C.triangleStrips=new Uint32Array,C.numberOfPointPixels>0?C.pointData=S(A,I,5,C.polyDataType.pointPixelComponentType):C.pointData=N(C.polyDataType.pointPixelComponentType,new ArrayBuffer(0)),C.numberOfCellPixels>0?C.cellData=S(A,I,6,C.polyDataType.cellPixelComponentType):C.cellData=N(C.polyDataType.cellPixelComponentType,new ArrayBuffer(0)),a=C;break}default:throw Error("Unsupported output InterfaceType")}let c={type:B.type,data:a};E.push(c)}),{returnValue:i,stdout:o,stderr:g,outputs:E}}var rt=Tr;var Or=typeof globalThis.SharedArrayBuffer<"u";function Pr(A,e){if(A==null)return[];let t=[];for(let r=0;r<A.length;r++){let n=Jr(A[r],e);n!==null&&t.push(n)}return t}function Jr(A,e){if(A==null)return null;let t=null;return A.buffer!==void 0?t=A.buffer:A.byteLength!==void 0&&(t=A),Or&&t instanceof SharedArrayBuffer?null:e?t:t.slice(0)}var nt=Pr;function xr(A){return[A.data,A.direction]}var it=xr;function Mr(A){return[A.points,A.pointData,A.cells,A.cellData]}var ot=Mr;function Hr(A){return[A.points,A.vertices,A.lines,A.polygons,A.triangleStrips,A.pointData,A.cellData]}var at=Hr;var Yr;function mA(){return Yr}var qr;function st(){return qr}var Kr;function wA(){return Kr}var te=new Map;function Wr(){let A=wA();return typeof A>"u"&&(A=null),A}function It(){let A=mA();return typeof A>"u"&&(A=new URL("/pipelines",document.location.origin).href),A}function DA(){let A=st();return typeof A>"u"&&(A={}),A}async function jr(A,e,t){let r=A,n=A;if(typeof A!="string"&&(r=new URL(A.href),n=r.href),te.has(n))return te.get(n);{let i=await Ze(A,e?.toString()??It(),t??DA());return te.set(n,i),i}}async function vr(A,e,t,r,n){if(!await Xe()){let u="WebAssembly SIMD support is required -- please update your browser.";throw alert(u),new Error(u)}let i=n?.webWorker??null;if(i===!1){let u=await jr(A.toString(),n?.pipelineBaseUrl,n?.pipelineQueryParams??DA());return rt(u,e,t,r)}let o=i,g=n?.pipelineWorkerUrl??Wr(),E=typeof g!="string"&&typeof g?.href<"u"?g.href:g,{workerProxy:B,worker:I}=await Ve(o,E,n?.pipelineQueryParams??DA());o=I;let a=[];r!=null&&r.length>0&&r.forEach(function(u){if(u.type===p.BinaryStream){let d=u.data.data;a.push(d)}else if(u.type===p.BinaryFile){let d=u.data.data;a.push(d)}else if(u.type===p.Image){let d=u.data;d.data!==null&&a.push(...it(d))}else if(u.type===p.Mesh){let d=u.data;a.push(...ot(d))}else if(u.type===p.PolyData){let d=u.data;a.push(...at(d))}});let c=n?.pipelineBaseUrl??It(),C=typeof c!="string"&&typeof c?.href<"u"?c.href:c,Q=r!=null?GA(r,nt(a,n?.noCopy)):null,l=await B.runPipeline(A.toString(),C,e,t,Q,n?.pipelineQueryParams??DA());return{returnValue:l.returnValue,stdout:l.stdout,stderr:l.stderr,outputs:l.outputs,webWorker:o}}var nA=vr;var _r=null;function gt(){return _r}var re,zr=`https://cdn.jsdelivr.net/npm/@itk-wasm/mesh-to-poly-data@${RA}/dist/pipelines`;function Va(A){re=A}function SA(){if(typeof re<"u")return re;let A=mA();return typeof A<"u"?A:zr}var ne,Vr=null;function Ct(A){ne=A}function j(){if(typeof ne<"u")return ne;let A=wA();return typeof A<"u"?A:Vr}var v=null;async function Bt(){let A=j(),e=typeof A!="string"&&typeof A?.href<"u"?A.href:A;v=await rA(e)}function rs(A){v=A}async function FA(){if(v!==null)return v.terminated&&await Bt(),v;let A=gt();return A!==null?A:(await Bt(),v)}async function Zr(A,e={}){let t=[{type:p.PolyData}],r=[{type:p.Mesh,data:A}],n=[];n.push("0"),n.push("0"),n.push("--memory-io");let g="mesh-to-poly-data",E=e?.webWorker;E===void 0&&(E=await FA());let{webWorker:B,returnValue:I,stderr:a,outputs:c}=await nA(g,n,t,r,{pipelineBaseUrl:SA(),pipelineWorkerUrl:j(),webWorker:E,noCopy:e?.noCopy});if(I!==0&&a!=="")throw new Error(a);return{webWorker:B,polyData:c[0]?.data}}var Xr=Zr;async function $r(A,e={}){let t=[{type:p.Mesh}],r=[{type:p.PolyData,data:A}],n=[];n.push("0"),n.push("0"),n.push("--memory-io");let g="poly-data-to-mesh",E=e?.webWorker;E===void 0&&(E=await FA());let{webWorker:B,returnValue:I,stderr:a,outputs:c}=await nA(g,n,t,r,{pipelineBaseUrl:SA(),pipelineWorkerUrl:j(),webWorker:E,noCopy:e?.noCopy});if(I!==0&&a!=="")throw new Error(a);return{webWorker:B,mesh:c[0]?.data}}var An=$r;var Et='data:text/javascript;charset=utf-8,var tt=Object.defineProperty;var et=(A,I)=>{for(var t in I)tt(A,t,{get:I[t],enumerable:!0})};var vA=Symbol("Comlink.proxy"),gt=Symbol("Comlink.endpoint"),rt=Symbol("Comlink.releaseProxy"),mA=Symbol("Comlink.finalizer"),eA=Symbol("Comlink.thrown"),$A=A=>typeof A=="object"&&A!==null||typeof A=="function",it={canHandle:A=>$A(A)&&A[vA],serialize(A){let{port1:I,port2:t}=new MessageChannel;return oA(A,I),[t,[t]]},deserialize(A){return A.start(),st(A)}},ot={canHandle:A=>$A(A)&&eA in A,serialize({value:A}){let I;return A instanceof Error?I={isError:!0,value:{message:A.message,name:A.name,stack:A.stack}}:I={isError:!1,value:A},[I,[]]},deserialize(A){throw A.isError?Object.assign(new Error(A.value.message),A.value):A.value}},AI=new Map([["proxy",it],["throw",ot]]);function Bt(A,I){for(let t of A)if(I===t||t==="*"||t instanceof RegExp&&t.test(I))return!0;return!1}function oA(A,I=globalThis,t=["*"]){I.addEventListener("message",function e(g){if(!g||!g.data)return;if(!Bt(t,g.origin)){console.warn(`Invalid origin \'${g.origin}\' for comlink proxy`);return}let{id:r,type:i,path:s}=Object.assign({path:[]},g.data),a=(g.data.argumentList||[]).map(b),Q;try{let C=s.slice(0,-1).reduce((f,n)=>f[n],A),o=s.reduce((f,n)=>f[n],A);switch(i){case"GET":Q=o;break;case"SET":C[s.slice(-1)[0]]=b(g.data.value),Q=!0;break;case"APPLY":Q=o.apply(C,a);break;case"CONSTRUCT":{let f=new o(...a);Q=at(f)}break;case"ENDPOINT":{let{port1:f,port2:n}=new MessageChannel;oA(A,n),Q=SA(f,[f])}break;case"RELEASE":Q=void 0;break;default:return}}catch(C){Q={value:C,[eA]:0}}Promise.resolve(Q).catch(C=>({value:C,[eA]:0})).then(C=>{let[o,f]=iA(C);I.postMessage(Object.assign(Object.assign({},o),{id:r}),f),i==="RELEASE"&&(I.removeEventListener("message",e),II(I),mA in A&&typeof A[mA]=="function"&&A[mA]())}).catch(C=>{let[o,f]=iA({value:new TypeError("Unserializable return value"),[eA]:0});I.postMessage(Object.assign(Object.assign({},o),{id:r}),f)})}),I.start&&I.start()}function Ct(A){return A.constructor.name==="MessagePort"}function II(A){Ct(A)&&A.close()}function st(A,I){return pA(A,[],I)}function tA(A){if(A)throw new Error("Proxy has been released and is not useable")}function tI(A){return M(A,{type:"RELEASE"}).then(()=>{II(A)})}var gA=new WeakMap,rA="FinalizationRegistry"in globalThis&&new FinalizationRegistry(A=>{let I=(gA.get(A)||0)-1;gA.set(A,I),I===0&&tI(A)});function nt(A,I){let t=(gA.get(I)||0)+1;gA.set(I,t),rA&&rA.register(A,I,A)}function Qt(A){rA&&rA.unregister(A)}function pA(A,I=[],t=function(){}){let e=!1,g=new Proxy(t,{get(r,i){if(tA(e),i===rt)return()=>{Qt(g),tI(A),e=!0};if(i==="then"){if(I.length===0)return{then:()=>g};let s=M(A,{type:"GET",path:I.map(a=>a.toString())}).then(b);return s.then.bind(s)}return pA(A,[...I,i])},set(r,i,s){tA(e);let[a,Q]=iA(s);return M(A,{type:"SET",path:[...I,i].map(C=>C.toString()),value:a},Q).then(b)},apply(r,i,s){tA(e);let a=I[I.length-1];if(a===gt)return M(A,{type:"ENDPOINT"}).then(b);if(a==="bind")return pA(A,I.slice(0,-1));let[Q,C]=_A(s);return M(A,{type:"APPLY",path:I.map(o=>o.toString()),argumentList:Q},C).then(b)},construct(r,i){tA(e);let[s,a]=_A(i);return M(A,{type:"CONSTRUCT",path:I.map(Q=>Q.toString()),argumentList:s},a).then(b)}});return nt(g,