UNPKG

11.9 kBJavaScriptView Raw
1const e="bulmil";let t,l,n=!1,o=!1,s=!1,r=0,i=!1;const c="undefined"!=typeof window?window:{},a=c.CSS,f=c.document||{head:{}},$={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,l,n)=>e.addEventListener(t,l,n),rel:(e,t,l,n)=>e.removeEventListener(t,l,n)},u=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),m=new WeakMap,h=e=>"sc-"+e.o,p={},y=e=>"object"==(e=typeof e)||"function"===e,b=(e,t,...l)=>{let n=null,o=null,s=!1,r=!1,i=[];const c=t=>{for(let l=0;l<t.length;l++)n=t[l],Array.isArray(n)?c(n):null!=n&&"boolean"!=typeof n&&((s="function"!=typeof e&&!y(n))&&(n+=""),s&&r?i[i.length-1].s+=n:i.push(s?w(null,n):n),r=s)};if(c(l),t){t.name&&(o=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter(t=>e[t]).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,i,v);const a=w(e,null);return a.i=t,i.length>0&&(a.$=i),a.u=o,a},w=(e,t)=>({t:0,m:e,s:t,h:null,$:null,i:null,u:null}),g={},v={forEach:(e,t)=>e.map(k).forEach(t),map:(e,t)=>e.map(k).map(t).map(M)},k=e=>({vattrs:e.i,vchildren:e.$,vkey:e.p,vname:e.u,vtag:e.m,vtext:e.s}),M=e=>{const t=w(e.vtag,e.vtext);return t.i=e.vattrs,t.$=e.vchildren,t.p=e.vkey,t.u=e.vname,t},j=(e,t,l,n,o,s)=>{if(l!==n){let i=oe(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,o=x(l),s=x(n);t.remove(...o.filter(e=>e&&!s.includes(e))),t.add(...s.filter(e=>e&&!o.includes(e)))}else if(i||"o"!==t[0]||"n"!==t[1]){const c=y(n);if((i||c&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{let o=null==n?"":n;"list"===t?i=!1:null!=l&&e[t]==o||(e[t]=o)}}catch(r){}null==n||!1===n?!1===n&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&s||o)&&!c&&e.setAttribute(t,n=!0===n?"":n)}else t="-"===t[2]?t.slice(3):oe(c,a)?a.slice(2):a[2]+t.slice(3),l&&$.rel(e,t,l,!1),n&&$.ael(e,t,n,!1)}},S=/\s/,x=e=>e?e.split(S):[],C=(e,t,l,n)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.i||p,r=t.i||p;for(n in s)n in r||j(o,n,s[n],void 0,l,t.t);for(n in r)j(o,n,s[n],r[n],l,t.t)},O=(e,o,r)=>{let i,c,a,$=o.$[r],u=0;if(n||(s=!0,"slot"===$.m&&($.t|=$.$?2:1)),null!==$.s)i=$.h=f.createTextNode($.s);else if(1&$.t)i=$.h=f.createTextNode("");else if(i=$.h=f.createElement(2&$.t?"slot-fb":$.m),C(null,$,!1),$.$)for(u=0;u<$.$.length;++u)c=O(e,$,u),c&&i.appendChild(c);return i["s-hn"]=l,3&$.t&&(i["s-sr"]=!0,i["s-cr"]=t,i["s-sn"]=$.u||"",a=e&&e.$&&e.$[r],a&&a.m===$.m&&e.h&&R(e.h,!1)),i},R=(e,t)=>{$.t|=1;const n=e.childNodes;for(let o=n.length-1;o>=0;o--){const e=n[o];e["s-hn"]!==l&&e["s-ol"]&&(P(e).insertBefore(e,I(e)),e["s-ol"].remove(),e["s-ol"]=void 0,s=!0),t&&R(e,t)}$.t&=-2},T=(e,t,l,n,o,s)=>{let r,i=e["s-cr"]&&e["s-cr"].parentNode||e;for(;o<=s;++o)n[o]&&(r=O(null,l,o),r&&(n[o].h=r,i.insertBefore(r,I(t))))},_=(e,t,l,n,s)=>{for(;t<=l;++t)(n=e[t])&&(o=!0,(s=n.h)["s-ol"]?s["s-ol"].remove():R(s,!0),s.remove())},E=(e,t)=>e.m===t.m&&("slot"!==e.m||e.u===t.u),I=e=>e&&e["s-ol"]||e,P=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,N=(e,t)=>{const l=t.h=e.h,n=e.$,o=t.$,s=t.s;let r;null===s?("slot"===t.m||C(e,t,!1),null!==n&&null!==o?((e,t,l,n)=>{let o,s=0,r=0,i=t.length-1,c=t[0],a=t[i],f=n.length-1,$=n[0],u=n[f];for(;s<=i&&r<=f;)null==c?c=t[++s]:null==a?a=t[--i]:null==$?$=n[++r]:null==u?u=n[--f]:E(c,$)?(N(c,$),c=t[++s],$=n[++r]):E(a,u)?(N(a,u),a=t[--i],u=n[--f]):E(c,u)?("slot"!==c.m&&"slot"!==u.m||R(c.h.parentNode,!1),N(c,u),e.insertBefore(c.h,a.h.nextSibling),c=t[++s],u=n[--f]):E(a,$)?("slot"!==c.m&&"slot"!==u.m||R(a.h.parentNode,!1),N(a,$),e.insertBefore(a.h,c.h),a=t[--i],$=n[++r]):(o=O(t&&t[r],l,r),$=n[++r],o&&P(c.h).insertBefore(o,I(c.h)));s>i?T(e,null==n[f+1]?null:n[f+1].h,l,n,r,f):r>f&&_(t,s,i)})(l,n,t,o):null!==o?(null!==e.s&&(l.textContent=""),T(l,null,t,o,0,o.length-1)):null!==n&&_(n,0,n.length-1)):(r=l["s-cr"])?r.parentNode.textContent=s:e.s!==s&&(l.data=s)},U=e=>{let t,l,n,o,s,r,i=e.childNodes;for(l=0,n=i.length;l<n;l++)if(t=i[l],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<n;o++)if(i[o]["s-hn"]!==t["s-hn"])if(r=i[o].nodeType,""!==s){if(1===r&&s===i[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===r||3===r&&""!==i[o].textContent.trim()){t.hidden=!0;break}U(t)}},A=[],F=e=>{let t,l,n,s,r,i,c=0,a=e.childNodes,f=a.length;for(;c<f;c++){if(t=a[c],t["s-sr"]&&(l=t["s-cr"]))for(n=l.parentNode.childNodes,s=t["s-sn"],i=n.length-1;i>=0;i--)l=n[i],l["s-cn"]||l["s-nr"]||l["s-hn"]===t["s-hn"]||(H(l,s)?(r=A.find(e=>e.g===l),o=!0,l["s-sn"]=l["s-sn"]||s,r?r.v=t:A.push({v:t,g:l}),l["s-sr"]&&A.map(e=>{H(e.g,l["s-sn"])&&(r=A.find(e=>e.g===l),r&&!e.v&&(e.v=r.v))})):A.some(e=>e.g===l)||A.push({g:l}));1===t.nodeType&&F(t)}},H=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,L=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise(t=>e.k=t))},W=(e,t)=>{if(e.t|=16,!(4&e.t))return L(e,e.M),pe(()=>q(e,t));e.t|=512},q=(e,t)=>{const l=e.j;return G(void 0,()=>V(e,l,t))},V=(e,r,i)=>{const c=e.S,a=c["s-rc"];i&&(e=>{const t=e.C;((e,t)=>{let l=h(t),n=ce.get(l);if(e=11===e.nodeType?e:f,n)if("string"==typeof n){let t,o=m.get(e=e.head||e);o||m.set(e,o=new Set),o.has(l)||(e.host&&(t=e.querySelector(`[sty-id="${l}"]`))?t.innerHTML=n:(t=f.createElement("style"),t.innerHTML=n,e.insertBefore(t,e.querySelector("link"))),o&&o.add(l))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n])})(e.S.getRootNode(),t)})(e),((e,r)=>{const i=e.S,c=e.C,a=e.O||w(null,null),u=(e=>e&&e.m===g)(r)?r:b(null,null,r);if(l=i.tagName,c.R&&(u.i=u.i||{},c.R.map(([e,t])=>u.i[t]=i[e])),u.m=null,u.t|=4,e.O=u,u.h=a.h=i,t=i["s-cr"],n=0!=(1&c.t),o=!1,N(a,u),$.t|=1,s){let e,t,l,n,o,s;F(u.h);let r=0;for(;r<A.length;r++)e=A[r],t=e.g,t["s-ol"]||(l=f.createTextNode(""),l["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=l,t));for(r=0;r<A.length;r++)if(e=A[r],t=e.g,e.v){for(n=e.v.parentNode,o=e.v.nextSibling,l=t["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===t["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),n.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&U(u.h),$.t&=-2,A.length=0})(e,z(e,r)),a&&(a.map(e=>e()),c["s-rc"]=void 0);{const t=c["s-p"],l=()=>B(e);0===t.length?l():(Promise.all(t).then(l),e.t|=4,t.length=0)}},z=(e,t)=>{try{t=t.render(),e.t&=-17,e.t|=2}catch(l){se(l)}return t},B=e=>{const t=e.S,l=e.M;64&e.t||(e.t|=64,J(t),e.T(t),l||D()),e.k&&(e.k(),e.k=void 0),512&e.t&&he(()=>W(e,!1)),e.t&=-517},D=()=>{J(f.documentElement),$.t|=2,he(()=>(e=>{const t=new CustomEvent("appload",{detail:{namespace:"bulmil"}});return e.dispatchEvent(t),t})(c))},G=(e,t)=>e&&e.then?e.then(t):t(),J=e=>e.classList.add("hydrated"),K=(e,t,l,n,o,s,r)=>{let i,c,a,f;if(1===s.nodeType){for(i=s.getAttribute("c-id"),i&&(c=i.split("."),c[0]!==r&&"0"!==c[0]||(a={t:0,_:c[0],I:c[1],P:c[2],N:c[3],m:s.tagName.toLowerCase(),h:s,i:null,$:null,p:null,u:null,s:null},t.push(a),s.removeAttribute("c-id"),e.$||(e.$=[]),e.$[a.N]=a,e=a,n&&"0"===a.P&&(n[a.N]=a.h))),f=s.childNodes.length-1;f>=0;f--)K(e,t,l,n,o,s.childNodes[f],r);if(s.shadowRoot)for(f=s.shadowRoot.childNodes.length-1;f>=0;f--)K(e,t,l,n,o,s.shadowRoot.childNodes[f],r)}else if(8===s.nodeType)c=s.nodeValue.split("."),c[1]!==r&&"0"!==c[1]||(i=c[0],a={t:0,_:c[1],I:c[2],P:c[3],N:c[4],h:s,i:null,$:null,p:null,u:null,m:null,s:null},"t"===i?(a.h=s.nextSibling,a.h&&3===a.h.nodeType&&(a.s=a.h.textContent,t.push(a),s.remove(),e.$||(e.$=[]),e.$[a.N]=a,n&&"0"===a.P&&(n[a.N]=a.h))):a._===r&&("s"===i?(a.m="slot",s["s-sn"]=c[5]?a.u=c[5]:"",s["s-sr"]=!0,l.push(a),e.$||(e.$=[]),e.$[a.N]=a):"r"===i&&(o["s-cr"]=s,s["s-cn"]=!0)));else if(e&&"style"===e.m){const t=w(null,s.textContent);t.h=s,t.N="0",e.$=[t]}},Q=(e,t)=>{if(1===e.nodeType){let l=0;for(;l<e.childNodes.length;l++)Q(e.childNodes[l],t);if(e.shadowRoot)for(l=0;l<e.shadowRoot.childNodes.length;l++)Q(e.shadowRoot.childNodes[l],t)}else if(8===e.nodeType){const l=e.nodeValue.split(".");"o"===l[0]&&(t.set(l[1]+"."+l[2],e),e.nodeValue="",e["s-en"]=l[3])}},X=(e,t,l)=>{if(t.U){const n=Object.entries(t.U),o=e.prototype;if(n.map(([e,[n]])=>{(31&n||2&l&&32&n)&&Object.defineProperty(o,e,{get(){return((e,t)=>te(this).A.get(t))(0,e)},set(l){((e,t,l,n)=>{const o=te(this),s=o.A.get(t),r=o.t,i=o.j;l=((e,t)=>null==e||y(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,n.U[t][0]),8&r&&void 0!==s||l===s||(o.A.set(t,l),i&&2==(18&r)&&W(o,!1))})(0,e,l,t)},configurable:!0,enumerable:!0})}),1&l){const l=new Map;o.attributeChangedCallback=function(e,t,n){$.jmp(()=>{const t=l.get(e);this[t]=(null!==n||"boolean"!=typeof this[t])&&n})},e.observedAttributes=n.filter(([e,t])=>15&t[0]).map(([e,n])=>{const o=n[1]||e;return l.set(o,e),512&n[0]&&t.R.push([e,o]),o})}}return e},Y=e=>{const t=e["s-cr"]=f.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},Z=(e,t={})=>{const l=[],n=t.exclude||[],o=c.customElements,s=f.head,r=s.querySelector("meta[charset]"),i=f.createElement("style"),a=[];let u,m=!0;Object.assign($,t),$.l=new URL(t.resourcesUrl||"./",f.baseURI).href,t.syncQueue&&($.t|=4),$.t|=2,e.map(e=>e[1].map(t=>{const s={t:t[0],o:t[1],U:t[2],F:t[3]};s.U=t[2],s.R=[];const r=s.o,i=class extends HTMLElement{constructor(e){super(e),ne(e=this,s)}connectedCallback(){u&&(clearTimeout(u),u=null),m?a.push(this):$.jmp(()=>(e=>{if(0==(1&$.t)){const t=te(e),l=t.C,n=()=>{};if(!(1&t.t)){let n;t.t|=1,n=e.getAttribute("s-id"),n&&((e,t,l,n)=>{const o=e.shadowRoot,s=[],r=n.O=w(t,null);$.H||Q(f.body,$.H=new Map),e["s-id"]=l,e.removeAttribute("s-id"),K(r,s,[],null,e,e,l),s.map(e=>{const l=e._+"."+e.I,n=$.H.get(l),s=e.h;n&&""===n["s-en"]&&n.parentNode.insertBefore(s,n.nextSibling),o||(s["s-hn"]=t,n&&(s["s-ol"]=n,s["s-ol"]["s-nr"]=s)),$.H.delete(l)})})(e,l.o,n,t),n||12&l.t&&Y(e);{let l=e;for(;l=l.parentNode||l.host;)if(1===l.nodeType&&l.hasAttribute("s-id")&&l["s-p"]||l["s-p"]){L(t,t.M=l);break}}l.U&&Object.entries(l.U).map(([t,[l]])=>{if(31&l&&e.hasOwnProperty(t)){const l=e[t];delete e[t],e[t]=l}}),he(()=>(async(e,t,l,n,o)=>{if(0==(32&t.t)){t.t|=32;{if((o=ie(l)).then){const e=()=>{};o=await o,e()}o.isProxied||(X(o,l,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(i){se(i)}t.t&=-9,e()}if(o.style){let e=o.style;const t=h(l);if(!ce.has(t)){const n=()=>{};((e,t,l)=>{let n=ce.get(e);d&&l?(n=n||new CSSStyleSheet,n.replace(t)):n=t,ce.set(e,n)})(t,e,!!(1&l.t)),n()}}}const s=t.M,r=()=>W(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,l))}n()}})(this))}disconnectedCallback(){$.jmp(()=>{})}forceUpdate(){(()=>{{const e=te(this);e.S.isConnected&&2==(18&e.t)&&W(e,!1)}})()}componentOnReady(){return te(this).L}};s.W=e[0],n.includes(r)||o.get(r)||(l.push(r),o.define(r,X(i,s,1)))})),i.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",i.setAttribute("data-styles",""),s.insertBefore(i,r?r.nextSibling:s.firstChild),m=!1,a.length?a.map(e=>e.connectedCallback()):$.jmp(()=>u=setTimeout(D,30))},ee=new WeakMap,te=e=>ee.get(e),le=(e,t)=>ee.set(t.j=e,t),ne=(e,t)=>{const l={t:0,S:e,C:t,A:new Map};return l.L=new Promise(e=>l.T=e),e["s-p"]=[],e["s-rc"]=[],ee.set(e,l)},oe=(e,t)=>t in e,se=e=>console.error(e),re=new Map,ie=e=>{const t=e.o.replace(/-/g,"_"),l=e.W,n=re.get(l);return n?n[t]:__sc_import_bulmil(`./${l}.entry.js`).then(e=>(re.set(l,e),e[t]),se)},ce=new Map,ae=[],fe=[],$e=[],ue=(e,t)=>l=>{e.push(l),i||(i=!0,t&&4&$.t?he(me):$.raf(me))},de=(e,t)=>{let l=0,n=0;for(;l<e.length&&(n=performance.now())<t;)try{e[l++](n)}catch(o){se(o)}l===e.length?e.length=0:0!==l&&e.splice(0,l)},me=()=>{r++,(e=>{for(let l=0;l<e.length;l++)try{e[l](performance.now())}catch(t){se(t)}e.length=0})(ae);{const e=2==(6&$.t)?performance.now()+14*Math.ceil(.1*r):1/0;de(fe,e),de($e,e),fe.length>0&&($e.push(...fe),fe.length=0),(i=ae.length+fe.length+$e.length>0)?$.raf(me):r=0}},he=e=>u().then(e),pe=ue(fe,!0);export{a as C,g as H,e as N,u as a,Z as b,f as d,b as h,$ as p,le as r,c as w}
\No newline at end of file