-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.min.js
2 lines (2 loc) · 12.6 KB
/
index.min.js
1
2
const e=e=>Array.from(e.children??[]),r=e=>e.tagName?.toLowerCase().replace("_","-")||"text",t=e=>e?.ownerDocument,n=e=>e?.parentElement,a=(r,t,n=[])=>{for(const e of r)t(e)&&n.push(e);for(const o of r)a(e(o),t,n);return n},o=e=>e.parentElement,s=(e,r)=>{if(e)return r(e)?e:s(n(e),r)},c=(e,r,t=[])=>e?(e&&t.push(e),r(e)?t:c(n(e),r,t)):[],i=(e,r)=>r.appendChild(e),l=e=>Array.from(e.childNodes),u=e=>e.parentNode,p=(e,r)=>u(r).replaceChild(e,r),d=e=>u(e).removeChild(e),m=Object.freeze(["SCRIPT","IFRAME"]),f=e=>(e=>1===e.nodeType)(e)?"":"Element type should be HTML Element.",h=e=>{return r=e,m.includes(r.toUpperCase())?"Unsafe html tag "+e:"";var r},_=(e,r)=>u(r).insertBefore(e,r)&&e,v=e=>0!==e.childNodes,y=e=>(new DOMParser).parseFromString(e,"text/html").documentElement,x=async(e,r=globalThis)=>Object.assign(r,{...await import(e)}),b=async(e="npm:[email protected]",r=globalThis)=>Object.assign(r,{...await import(e),Event:r.Event,InputEvent:r.InputEvent,EventTarget:r.EventTarget}),g=e=>3===e.nodeType,w=e=>g(e)&&e.textContent,E=(e,r)=>e.createTextNode(r),O=(e,r)=>e[r],j=e=>e.__effects,C=e=>e.initialFunc?.(),S=e=>e.func?.(),N=e=>e?Object.values(e).map(S):[],T=(e,r={})=>e.__effects=e.__effects??r,R=(e,r)=>e.initialFunc=r,z=(e,r,t)=>R(O(e,r),t),D=(e,r)=>e===r,$=Object.freeze(["children"]),A=e=>Object.getOwnPropertyNames(e),k=e=>$.includes(e),L=e=>A(e).filter((e=>!k(e))).length,M=e=>null!=e,P=e=>"object"==typeof e&&null!==e,F=e=>null!=e,I=e=>e instanceof Array,W=e=>"function"==typeof e,H=(e,r)=>((e,r)=>F(e)&&F(r))(e,r)?!!((e,r)=>e.length===r.length)(e,r)&&((e,r)=>e.every(((t,n)=>V(e[n],r[n]))))(e,r):D(e,r),V=(e,r)=>!(!W(e)||!W(r))||(I(e)&&I(r)?H(e,r):P(e)&&P(r)?G(e,r):D(e,r)),U=(e,r)=>A(e).every((t=>((e,r,t)=>k(t)||V(e[t],r[t]))(e,r,t))),G=(e,r)=>((e,r)=>M(e)&&M(r))(e,r)?!!((e,r)=>L(e)===L(r))(e,r)&&U(e,r):D(e,r),B=(e,r,t,n)=>{if(!((e,r)=>e[r])(e,r))return((e,r)=>e[r.name]=r)(e,((e,r,t)=>({name:e,func:r,deps:t,initialFunc:void 0}))(r,t,n));const a=O(e,r);return H(a.deps,n)&&!(e=>void 0===e)(n)?((e=>{e.func=void 0})(a),a):(((e,r)=>{e.deps=r})(a,n),((e,r)=>{e.func=r})(a,t),a)},K=e=>{if(!e)return!1;throw new Error(e)},Y=(e,r)=>e.value=r,q=e=>[e.value,r=>Y(e,r())],J=(e,r,t,n)=>{if(!((e,r)=>e[r])(e,r)){const a=((e,r)=>e[r.name]=r)(e,((e,r,t)=>({name:e,value:r,deps:t}))(r,t(),n));return q(a)}const a=((e,r)=>e[r])(e,r);return H(a.deps,n)&&!(e=>void 0===e)(n)||(((e,r)=>{e.deps=r})(a,n),Y(a,t())),q(a)},Q=(e,r)=>e.value=r,X=(e,r={})=>e.__states=e.__states??r,Z=e=>e.__states,ee=e=>[e.value,r=>Q(e,r)],re=(e,r,t,n)=>{if(!((e,r)=>e[r])(e,r)){const a=((e,r)=>e[r.name]=r)(e,((e,r,t)=>({name:e,value:r,deps:t}))(r,t,n));return ee(a)}const a=((e,r)=>e[r])(e,r);return H(a.deps,n)&&!(e=>void 0===e)(n)||(((e,r)=>{e.deps=r})(a,n),Q(a,t)),ee(a)},te=(e,r={})=>e.__contexts=e.__contexts??r,ne=(e,r)=>(e.value=r,e),ae=(e,r)=>e[r],oe=e=>e.__contexts,se=(e,r)=>r in e,ce=(e,t)=>s(e,(e=>((e,t)=>"context"===r(e)&&se(oe(e),t))(e,t))),ie=(e,r)=>ae(e,r).value,le=(t,n)=>((r,t,n=[],o=a)=>o(e(r),t,n))(t,(e=>((e,t)=>"context"!==r(e)&&se(oe(e),t))(e,n))),ue=e=>(e=>e.children instanceof Array)(e)?e.children:[e.children],pe=Symbol.for("react.element"),de=Symbol.for("react.fragment"),me=Object.freeze([pe,de]),fe=e=>e?.type===de,he=[!0,!1,null,void 0],_e=e=>void 0===e?.$$typeof,ve=e=>!!e||""===e,ye=e=>"string"==typeof e.type,xe=e=>"symbol"!=typeof e.$$typeof||me.includes(e.$$typeof),be=e=>(e=>fe(e[0])?ue(e[0].props):e)(e).filter((e=>{return r=e,!he.includes(r)&&xe(e);var r})),ge=e=>"function"==typeof e.type,we=e=>e.__elem,Ee=e=>e.props,Oe=e=>ge(e)&&(e=>e.type.name.toLowerCase().replace("_","-"))(e)||ye(e)&&(e=>e.type)(e)||fe(e)&&"fragment"||"text",je=Ee,Ce=e=>e.key,Se=(e,r)=>e.__elem=r,Ne=e=>xe(e)?"":"Element should be jsx element.",Te=(e,r)=>{const t=Ee(e),n=be(ue(t)),a=((e,r,t)=>e.type(Object.freeze(t),r))(e,r,{...t,children:n});return be((e=>e instanceof Array)(a)?a:[a])},Re=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,ze=Object.freeze(["innerHTML","outerHTML"]),De=Object.freeze(["action","background","dynsrv","href","lowsrc","src"]),$e=(e,r)=>{return!(e=>De.includes(e))(r)||(t=e[r],!Re.test(t||""));var t},Ae=Object.freeze({"aria-autocomplete":"ariaAutoComplete","aria-colcount":"ariaColCount","aria-colindex":"ariaColIndex","aria-colindextext":"ariaColIndexText","aria-haspopup":"ariaHasPopUp","aria-keyshortcuts":"ariaKeyShortcuts","aria-multiselectable":"ariaMultiSelectable","aria-posinset":"ariaPosInSet","aria-readonly":"ariaReadOnly","aria-roledescription":"ariaRoleDescription","aria-rowcount":"ariaRowCount","aria-rowindex":"ariaRowIndex","aria-rowspan":"ariaRowSpan","aria-setsize":"ariaSetSize","aria-valuemax":"ariaValueMax","aria-valuemin":"ariaValueMin","aria-valuenow":"ariaValueNow","aria-valuetext":"ariaValueText"}),ke=Object.freeze({class:"className",for:"htmlFor",readonly:"readOnly",tabindex:"tabIndex",css:"innerHTML",html:"innerHTML"}),Le=Object.freeze(["children"]),Me=Object.freeze(["checked","disabled","hidden","readOnly","readonly","selected"]),Pe=e=>e.startsWith("__"),Fe=e=>{return(e=>e in ke)(e)&&ke[e]||(e=>e.startsWith("aria-"))(e)&&(Ae[e]||`aria${(r=e)[5].toUpperCase()}${r.substring(6)}`)||e;var r},Ie=(e,r)=>((e,r)=>((e,r)=>r in e)(e,Fe(r))||Pe(r))(e,r)&&!(e=>Le.includes(e))(r)&&!(e=>e.startsWith("on"))(r)&&!((e,r)=>e[r]?.constructor?.name.startsWith("SVG"))(e,r),We=e=>Object.getOwnPropertyNames(e),He=(e,r)=>We(r).filter((r=>Ie(e,r))).filter((e=>((e,r)=>!ze.includes(r)&&$e(e,r))(r,e))),Ve=(e,r)=>{const t=((e,r)=>Object.getOwnPropertyDescriptor(e,r))(e,r);return!t||!("writable"in t)||t.writable},Ue=/[^\w. ]/gi,Ge=e=>`&#${e.charCodeAt(0)};`,Be=(e,r,t)=>(e=>Me.includes(e))(r)&&(e=>(e=>null==e||""===e)(e)||e)(t)||((e,r)=>"STYLE"!==e.tagName&&"css"===r)(e,r)&&"*"||(e=>"html"===e)(r)&&t.replace(Ue,Ge)||t,Ke=(e,r,t)=>e[r]=t,Ye=(e,r,t)=>(e=>"style"===e)(r)?((e,r)=>Object.assign(e.style,r))(e,t):Pe(r)?Ke(e,r,t):Ve(e,r)?(Ke(e,Fe(r),Be(e,r,t)),t):void 0,qe=(e,r)=>He(e,r).reduce(((e,t)=>(Ye(e,t,((e,r)=>e[r])(r,t)),e)),e),Je=(e,r)=>{if(Ve(e,r))return((e,r)=>e[r]=(e=>"className"===e)(r)?"":void 0)(e,Fe(r))},Qe=(e,r)=>r in e,Xe=(e,r)=>((e,r)=>!Qe(e,Fe(r))||((e,r)=>e[r]?.constructor?.name.startsWith("SVG"))(e,r))(e,r)&&!(e=>e.startsWith("on"))(r)&&!(e=>e.startsWith("__"))(r)&&!(e=>"xmlns"===e)(r),Ze=(e,r)=>(e=>Object.getOwnPropertyNames(e))(r).filter((r=>Xe(e,r))),er=(e,r)=>Ze(e,r).reduce(((e,t)=>(((e,r,t)=>{if(!(e=>"function"==typeof e)(t))((e,r,t)=>{e.setAttributeNS?.(null,r,t)})(e,r,t)})(e,t,r[t]),e)),e),rr=(e,r,t)=>e.dispatchEvent(((e,r)=>new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r}))(r,t)),tr=e=>e.replace("on",""),nr=e=>e.startsWith("on"),ar=e=>(e=>Object.getOwnPropertyNames(e))(e).filter(nr).filter((r=>((e,r)=>"function"==typeof e[r])(e,r))),or=e=>"__"+e,sr=(e,r,t)=>(e.addEventListener(tr(r),t),((e,r,t)=>{e[or(r)]=t})(e,r,t),r),cr=(e,r)=>ar(r).map((t=>sr(e,t,r[t]))),ir=(e,r)=>(e.removeEventListener(tr(r),((e,r)=>e[or(r)])(e,r)),((e,r)=>{delete e[or(r)]})(e,r),r),lr=(e,r)=>ar(r).map((r=>ir(e,r))),ur=e=>{if(!e)return!1;throw new Error(e)},pr=e=>e.__ignore instanceof Array,dr=(e,r)=>mr(e)&&((e,r)=>e.__log.includes(r))(e,r),mr=e=>e.__log instanceof Array,fr=(e,r)=>(e=>je(e).xmlns)(e)||(e=>e&&we(e)&&je(we(e)).xmlns)(r),hr="rendering",_r="[rendering]",vr=(e,...r)=>dr(e,hr)&&console.info(_r,...r),yr=(e,t)=>((e,t,n,a,o)=>o(e,`${n} elem:`,r(e),"props:",a,"parent:",t&&r(t)))(e,n(e),t,je(we(e)),vr),xr=(e,r)=>g(e)?br(e,r):yr(e,r),br=(e,t)=>((e,t,n,a)=>a(e,`${n} text:`,w(e),"parent:",t&&r(t)))(e,n(e),t,vr),gr=(e,r)=>{if(_e(e)){const n=((e,r)=>{const n=t(r),a=E(n,e);return i(a,r)})(e,r);return br(n,"render"),n}ur(f(r)),ur(h(Oe(e))),ur(Ne(e));const n=je(e),a=((e,r,n)=>{const a=t(n),o=r?((e,r,t)=>e.createElementNS(r,t))(a,r,e):((e,r)=>e.createElement(r))(a,e);return i(o,n),o})(Oe(e),fr(e,r),r);return er(a,n),qe(a,n),cr(a,n),((e,r)=>{pr(e)||pr(r)&&((e,r)=>{e.__ignore=[...r.__ignore]})(e,r)})(a,r),((e,r)=>{mr(e)||mr(r)&&((e,r)=>{e.__log=[...r.__log]})(e,r)})(a,r),Se(a,e),yr(a,"render"),a},wr=(e,r)=>{try{return e()}catch(e){throw((e,...r)=>{dr(e,hr)&&console.error(_r,...r)})(r,e.message,e.stack),((e,r)=>{rr(e,"error",{error:r})})(r,e),e}},Er=(e,r)=>ge(e)&&wr((()=>Te(e,r)),r)||ye(e)&&be(ue(e.props))||[],Or=e=>Er(we(e),e).map((r=>gr(r,e))),jr=(e,r)=>{return(_e(t=e)&&t?.toString())===w(r);var t},Cr=e=>o(e)&&!v(e),Sr=e=>o(e)&&v(e),Nr=e=>!o(e),Tr=e=>"style"===r(e)||(e=>e.__ignore?.includes(r(e)))(e)||g(e),Rr=(e,r=y("<main></main>"))=>{const t=[gr(e,r)];for(const e of t)Tr(e)||t.push(...Or(e));return t.forEach((e=>N(j(e)))),t},zr=(e,r)=>{if(xr(r,"update"),_e(e))return((e,r)=>(((e,r)=>{e.textContent=r})(r,e),r))(e,r);ur(f(r)),ur(Ne(e));const t=je(e);return lr(r,t),er(r,t),qe(r,t),cr(r,t),Se(r,e),r},Dr=e=>{if(xr(e,"unrender"),g(e))return(e=>n(e)?d(e):e)(e);ur(f(e));const r=je(we(e));var t,a;return!(t=j(e))||Object.values(t).map(C),((e,r)=>{Ze(e,r).reduce(((e,r)=>(((e,r)=>{e.removeAttribute(r)})(e,r),e)),e)})(e,r),((e,r)=>{He(e,r).reduce(((e,r)=>(Je(e,r),e)),e)})(e,r),lr(e,r),We(a=e).filter(Pe).reduce(((e,r)=>(Je(e,r),e)),a),(e=>{n(e)&&d(e)})(e),e},$r=(e,r)=>(xr(r,"replace"),g(r),p(e,r),e),Ar=(e,t)=>!((e,t)=>Oe(e)===r(t))(e,t),kr=(e,r)=>!!ye(e)||(!(!ge(e)||((e,r)=>G(je(e),je(we(r))))(e,r))||(!(!ge(e)||!(e=>je(e)["no-skip"])(e))||!(!_e(e)||jr(e,r)))),Lr=Object.freeze({render:0,update:1,replace:2,unrender:3,skip:4}),Mr=(e,r)=>((e,r)=>ve(e)&&!r)(e,r)?Lr.render:((e,r)=>r&&!ve(e))(e,r)?Lr.unrender:Ar(e,r)?Lr.replace:kr(e,r)?Lr.update:Lr.skip,Pr=(e,r)=>r.find((r=>((e,r)=>Ce(e)===Ce(we(r)))(e,r))),Fr=(e,r,n)=>r===e&&e||e&&r&&_(r,e)||e&&((e,r,n)=>{const a=t(n),o=E(a,e);return _(o,r)})("",e,n),Ir=(e,r)=>{return r[0]&&(e=>null!=e.key)(r[0])?(t=r,n=l(e),a=e,t.forEach(((e,r)=>Fr(((e,r)=>e.childNodes[r])(a,r),Pr(e,n),a))),l(a)):l(e);var t,n,a},Wr=e=>{const r=Er(we(e),e),t=Ir(e,r);return(n=r,a=t,n.length>a.length?n:a).flatMap(((n,a)=>((e,r,t)=>{switch(Mr(e,r)){case Lr.render:return gr(e,t);case Lr.replace:return[$r(gr(e,t),r),Dr(r)];case Lr.update:return zr(e,r);case Lr.unrender:return Dr(r);default:return[]}})(r[a],t[a],e)));var n,a},Hr=e=>l(e).map(Dr),Vr=(e,r=we(e))=>{const t=[zr(r,e)];for(const e of t)Tr(e)||(Cr(e)?t.push(...Or(e)):Sr(e)?t.push(...Wr(e)):Nr(e)&&t.push(...Hr(e)));return t.forEach((e=>N(j(e)))),t},Ur=e=>{const r=[Dr(e)];for(const e of r)Tr(e)||r.push(...Hr(e));return r},Gr=(e,r=y("<main></main>"))=>(r.ownerDocument.__render=r.ownerDocument.__render||Rr,r.ownerDocument.__update=r.ownerDocument.__update||Vr,r.ownerDocument.__unrender=r.ownerDocument.__unrender||Ur,Rr(e,r)[0]);export{Vr as update};export{Ur as unrender};export{Gr as render};const Br=(e,r,t)=>{const n=ce(t,e);return((e,r,t)=>{const n=oe(t),a=ae(n,e);ne(a,r)})(e,r,n),le(n,e).map((t=>((e,r,t)=>{const n=oe(t),a=ae(n,e);if(!V(a.value,r))return ne(a,r),Vr(t)})(e,r,t)))},Kr=(e,r,t,n)=>{if(!se(e,r)){const a=((e,r,t)=>{const n=ce(t,e);if(!n)return r;const a=oe(n);return ae(a,e).value})(r,t,n),o=((e,r)=>({name:e,value:r}))(r,a);((e,r)=>{e[r.name]=r})(e,o)}return[ie(e,r),e=>Br(r,e,n)]},Yr=({name:e,value:r,children:t},n)=>{const[,a]=Kr(te(n),e,r,n);return B(T(n),"setcontext",(()=>a(r,n)),[r]),t},qr=({path:e,error:r,children:t},n)=>(ir(n,"onerror"),sr(n,"onerror",(e=>(e.stopPropagation(),Jr(n,e)))),r?React.createElement("error",null,React.createElement("span",{class:"path"},`Path: ${e}`),React.createElement("pre",{class:"error"},`Error: ${r}`)):t),Jr=(e,t)=>{const n=(e=>e.detail?.error)(t),a=(o=t.target,s=e,c(o,(e=>((e,r)=>e===r)(e,s))));var o,s,i;return Vr(e,React.createElement(qr,{error:n?.message,path:(i=a,i.map(r).reverse().join("/"))}))},Qr=e=>e.ownerDocument.__services=e.ownerDocument.__services||{},Xr=(e,r)=>(((e,r,t)=>{e[r]=t})(Qr(r),e.name,e.value),e.children),Zr=(e,r)=>(e.props.hidden=r,e),et=({suspending:e=!0,fallback:r,children:t})=>{var n;return Zr(r,!e),n=e,t.map((e=>Zr(e,n))),React.createElement(React.Fragment,null,r,...t)},rt=(e,r)=>e?.[r],tt=e=>e.ownerDocument.__services;export{j as getEffects};export{T as setEffects,z as setInitialEffect,R as setInitialFuncEffect};export{B as useEffect};export{rr as dispatchEvent};export{sr as setHtmlEventHandler};export{J as useMemo};export{Z as getStates};export{X as setStates};export{re as useState};export{x as registerDomParser,b as registerLinkeDomParser};export{Yr as Context};const nt=(r,t)=>{K(f(t)),K((e=>"function"==typeof e)(r.loader)?"":"Lazy loader should be function.");const[n,a]=re(X(t),"child",void 0,[]);return B(T(t),"load child",(async()=>{const n=await r.loader(r);a(n);const o=e(t)[0];return o?Vr(o,n):Gr(n,t)}),[r]),n??React.createElement(React.Fragment,null)};export{qr as ErrorBoundary};export{nt as Lazy};export{Xr as Service};export{et as Suspense};export{oe as getContexts};export{te as setContexts};export{Kr as useContext};export{tt as getServices};export{Qr as setServices};export{rt as useService};
//# sourceMappingURL=index.min.js.map