and-component-library
Version:
Distribution of AND Web Components
3 lines (2 loc) • 10.8 kB
JavaScript
function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function i(t){return 0===Object.keys(t).length}function c(t,e,n,o){if(t){const r=l(t,e,n,o);return t[0](r)}}function l(t,e,n,o){return t[1]&&o?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](o(e))):n.ctx}function d(t,e,n,o,r,s,i){const c=function(t,e,n,o){if(t[2]&&o){const r=t[2](o(n));if(void 0===e.dirty)return r;if("object"==typeof r){const t=[],n=Math.max(e.dirty.length,r.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|r[o];return t}return e.dirty|r}return e.dirty}(e,o,r,s);if(c){const r=l(e,n,o,i);t.p(r,c)}}function u(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function $(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function p(t){return document.createTextNode(t)}function m(){return p(" ")}function h(){return p("")}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let w;function x(t){w=t}function b(t){(function(){if(!w)throw new Error("Function called outside component initialization");return w})().$$.on_mount.push(t)}const y=[],v=[],_=[],k=[],M=Promise.resolve();let z=!1;function A(t){_.push(t)}let C=!1;const E=new Set;function q(){if(!C){C=!0;do{for(let t=0;t<y.length;t+=1){const e=y[t];x(e),L(e.$$)}for(x(null),y.length=0;v.length;)v.pop()();for(let t=0;t<_.length;t+=1){const e=_[t];E.has(e)||(E.add(e),e())}_.length=0}while(y.length);for(;k.length;)k.pop()();z=!1,C=!1,E.clear()}}function L(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(A)}}const N=new Set;let T,H;function O(){T={r:0,c:[],p:T}}function S(){T.r||o(T.c),T=T.p}function j(t,e){t&&t.i&&(N.delete(t),t.i(e))}function P(t,e,n,o){if(t&&t.o){if(N.has(t))return;N.add(t),T.c.push(()=>{N.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}function B(t){t&&t.c()}function R(t,n,s){const{fragment:i,on_mount:c,on_destroy:l,after_update:d}=t.$$;i&&i.m(n,s),A(()=>{const n=c.map(e).filter(r);l?l.push(...n):o(n),t.$$.on_mount=[]}),d.forEach(A)}function F(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function I(t,e){-1===t.$$.dirty[0]&&(y.push(t),z||(z=!0,M.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function D(e,r,s,i,c,l,d=[-1]){const u=w;x(e);const a=r.props||{},f=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:n(),dirty:d,skip_bound:!1};let p=!1;if(f.ctx=s?s(e,a,(t,n,...o)=>{const r=o.length?o[0]:n;return f.ctx&&c(f.ctx[t],f.ctx[t]=r)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](r),p&&I(e,t)),n}):[],f.update(),p=!0,o(f.before_update),f.fragment=!!i&&i(f.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);f.fragment&&f.fragment.l(t),t.forEach($)}else f.fragment&&f.fragment.c();r.intro&&j(e.$$.fragment),R(e,r.target,r.anchor),q()}x(u)}"function"==typeof HTMLElement&&(H=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}$destroy(){F(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!i(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class G{$destroy(){F(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!i(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const J=t=>({matches:1&t}),K=t=>({matches:t[0]});function Q(t){let e;const n=t[3].default,o=c(n,t,t[2],K);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,[e]){o&&o.p&&5&e&&d(o,n,t,t[2],e,J,K)},i(t){e||(j(o,t),e=!0)},o(t){P(o,t),e=!1},d(t){o&&o.d(t)}}}function U(t,e,n){let o,r,{$$slots:s={},$$scope:i}=e,{query:c}=e,l=!1,d=!1;function u(){o&&r&&o.removeListener(r)}return b(()=>(n(6,l=!0),()=>{u()})),t.$$set=t=>{"query"in t&&n(1,c=t.query),"$$scope"in t&&n(2,i=t.$$scope)},t.$$.update=()=>{66&t.$$.dirty&&l&&(u(),function(t){o=window.matchMedia(t),r=t=>n(0,d=t.matches),o.addListener(r),n(0,d=o.matches)}(c))},[d,c,i,s]}class V extends G{constructor(t){super(),D(this,t,U,Q,s,{query:1})}}function W(t){let e;const n=t[1].default,o=c(n,t,t[2],null);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,e){o&&o.p&&4&e&&d(o,n,t,t[2],e,null,null)},i(t){e||(j(o,t),e=!0)},o(t){P(o,t),e=!1},d(t){o&&o.d(t)}}}function X(t){let e,n,o=t[3]&&W(t);return{c(){o&&o.c(),e=h()},m(t,r){o&&o.m(t,r),a(t,e,r),n=!0},p(t,n){t[3]?o?(o.p(t,n),8&n&&j(o,1)):(o=W(t),o.c(),j(o,1),o.m(e.parentNode,e)):o&&(O(),P(o,1,1,()=>{o=null}),S())},i(t){n||(j(o),n=!0)},o(t){P(o),n=!1},d(t){o&&o.d(t),t&&$(e)}}}function Y(t){let e,n;return e=new V({props:{query:t[0],$$slots:{default:[X,({matches:t})=>({3:t}),({matches:t})=>t?8:0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(t,o){R(e,t,o),n=!0},p(t,[n]){const o={};12&n&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){n||(j(e.$$.fragment,t),n=!0)},o(t){P(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function Z(t,e,n){let{$$slots:o={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(2,r=t.$$scope)},["(min-width: 992px)",o,r]}class tt extends G{constructor(t){super(),D(this,t,Z,Y,s,{})}}function et(t){let e;const n=t[1].default,o=c(n,t,t[2],null);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,e){o&&o.p&&4&e&&d(o,n,t,t[2],e,null,null)},i(t){e||(j(o,t),e=!0)},o(t){P(o,t),e=!1},d(t){o&&o.d(t)}}}function nt(t){let e,n,o=t[3]&&et(t);return{c(){o&&o.c(),e=h()},m(t,r){o&&o.m(t,r),a(t,e,r),n=!0},p(t,n){t[3]?o?(o.p(t,n),8&n&&j(o,1)):(o=et(t),o.c(),j(o,1),o.m(e.parentNode,e)):o&&(O(),P(o,1,1,()=>{o=null}),S())},i(t){n||(j(o),n=!0)},o(t){P(o),n=!1},d(t){o&&o.d(t),t&&$(e)}}}function ot(t){let e,n;return e=new V({props:{query:t[0],$$slots:{default:[nt,({matches:t})=>({3:t}),({matches:t})=>t?8:0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(t,o){R(e,t,o),n=!0},p(t,[n]){const o={};12&n&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){n||(j(e.$$.fragment,t),n=!0)},o(t){P(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function rt(t,e,n){let{$$slots:o={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(2,r=t.$$scope)},["(max-width: 991px)",o,r]}class st extends G{constructor(t){super(),D(this,t,rt,ot,s,{})}}function it(e){let n,o,r;return{c(){n=f("button"),o=f("img"),o.src!==(r="data:image/svg+xml,%3csvg width='1em' height='1em' viewBox='0 0 16 16' class='dropdown' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M13.468 12.37C12.758 11.226 11.195 10 8 10s-4.757 1.225-5.468 2.37A6.987 6.987 0 0 0 8 15a6.987 6.987 0 0 0 5.468-2.63z' /%3e %3cpath fill-rule='evenodd' d='M8 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z' /%3e %3cpath fill-rule='evenodd' d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z' /%3e%3c/svg%3e")&&g(o,"src","data:image/svg+xml,%3csvg width='1em' height='1em' viewBox='0 0 16 16' class='dropdown' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M13.468 12.37C12.758 11.226 11.195 10 8 10s-4.757 1.225-5.468 2.37A6.987 6.987 0 0 0 8 15a6.987 6.987 0 0 0 5.468-2.63z' /%3e %3cpath fill-rule='evenodd' d='M8 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z' /%3e %3cpath fill-rule='evenodd' d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z' /%3e%3c/svg%3e"),g(o,"alt","Profile icon dropdown menu"),g(n,"class","dropbtn")},m(t,e){a(t,n,e),u(n,o)},p:t,d(t){t&&$(n)}}}function ct(t){let e;return{c(){e=f("hr"),g(e,"class","menu-separator")},m(t,n){a(t,e,n)},d(t){t&&$(e)}}}function lt(t){let e;return{c(){e=f("slot"),e.innerHTML="<b>No profile logged in items</b>",g(e,"name","loggedInSlot")},m(t,n){a(t,e,n)},d(t){t&&$(e)}}}function dt(t){let e;return{c(){e=f("slot"),e.innerHTML="<b>No profile logged out items</b>",g(e,"name","loggedOutSlot")},m(t,n){a(t,e,n)},d(t){t&&$(e)}}}function ut(t){let e;return{c(){e=f("hr"),g(e,"class","menu-separator")},m(t,n){a(t,e,n)},d(t){t&&$(e)}}}function at(e){let n,o,r,s,i,c,l,d,p,h;o=new tt({props:{$$slots:{default:[it]},$$scope:{ctx:e}}}),i=new st({props:{$$slots:{default:[ct]},$$scope:{ctx:e}}});let w=e[1]&<(),x=!e[1]&&dt();return p=new st({props:{$$slots:{default:[ut]},$$scope:{ctx:e}}}),{c(){n=f("div"),B(o.$$.fragment),r=m(),s=f("div"),B(i.$$.fragment),c=m(),w&&w.c(),l=m(),x&&x.c(),d=m(),B(p.$$.fragment),this.c=t,g(s,"class","dropdown-content"),g(n,"id",e[0]),g(n,"class","dropdown")},m(t,e){a(t,n,e),R(o,n,null),u(n,r),u(n,s),R(i,s,null),u(s,c),w&&w.m(s,null),u(s,l),x&&x.m(s,null),u(s,d),R(p,s,null),h=!0},p(t,[e]){const r={};4&e&&(r.$$scope={dirty:e,ctx:t}),o.$set(r);const c={};4&e&&(c.$$scope={dirty:e,ctx:t}),i.$set(c),t[1]?w||(w=lt(),w.c(),w.m(s,l)):w&&(w.d(1),w=null),t[1]?x&&(x.d(1),x=null):x||(x=dt(),x.c(),x.m(s,d));const u={};4&e&&(u.$$scope={dirty:e,ctx:t}),p.$set(u),(!h||1&e)&&g(n,"id",t[0])},i(t){h||(j(o.$$.fragment,t),j(i.$$.fragment,t),j(p.$$.fragment,t),h=!0)},o(t){P(o.$$.fragment,t),P(i.$$.fragment,t),P(p.$$.fragment,t),h=!1},d(t){t&&$(n),F(o),F(i),w&&w.d(),x&&x.d(),F(p)}}}function $t(t,e,n){let{id:o="and-nav-profile-id"}=e,{loggedin:r}=e;return t.$$set=t=>{"id"in t&&n(0,o=t.id),"loggedin"in t&&n(1,r=t.loggedin)},[o,r]}class ft extends H{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url(https://fonts.googleapis.com/css2?family=Poppins);:root{--step:50}.dropdown{margin-left:auto}@media(min-width: 992px){.dropdown{overflow:hidden;margin-right:6rem}}.dropbtn{font-size:18px;font-size:torem(18px);border:none;outline:none;color:#323232;padding:0.875rem 1rem;background-color:inherit;font-family:"Poppins", sans-serif;margin:0}.dropdown-content{display:block}@media(min-width: 992px){.dropdown-content{display:none;position:absolute;background-color:white;min-width:10rem;box-shadow:0rem 0.5rem 1rem 0rem rgba(0, 0, 0, 0.2);z-index:1}}.dropdown:hover .dropdown-content{display:block}.menu-separator{border-width:0;margin-top:1rem;border-top:1px solid #323232;margin-left:0.875rem;width:82vw}</style>',D(this,{target:this.shadowRoot},$t,at,s,{id:0,loggedin:1}),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),q()))}static get observedAttributes(){return["id","loggedin"]}get id(){return this.$$.ctx[0]}set id(t){this.$set({id:t}),q()}get loggedin(){return this.$$.ctx[1]}set loggedin(t){this.$set({loggedin:t}),q()}}customElements.define("and-profile",ft);export default ft;
//# sourceMappingURL=Profile.js.map