UNPKG

@kit-data-manager/pid-component

Version:

The PID-Component is a web component that can be used to evaluate and display FAIR Digital Objects, PIDs, ORCiDs, and possibly other identifiers in a user-friendly way. It is easily extensible to support other identifier types.

20 lines 31.6 kB
/*! * * Copyright 2024 Karlsruhe Institute of Technology. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ const e="pid-component";const t={hydratedSelectorName:"hydrated",lazyLoad:true,slotRelocation:true,updatable:true};const n=()=>{};const r="";var i=Object.defineProperty;var s=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:true})};var l="http://www.w3.org/2000/svg";var o="http://www.w3.org/1999/xhtml";var f=(e=>{e["Undefined"]="undefined";e["Null"]="null";e["String"]="string";e["Number"]="number";e["SpecialNumber"]="number";e["Boolean"]="boolean";e["BigInt"]="bigint";return e})(f||{});var a=(e=>{e["Array"]="array";e["Date"]="date";e["Map"]="map";e["Object"]="object";e["RegularExpression"]="regexp";e["Set"]="set";e["Channel"]="channel";e["Symbol"]="symbol";return e})(a||{});var c="type";var u="value";var v="serialized:";var d=e=>{if(e.__stencil__getHostRef){return e.__stencil__getHostRef()}return void 0};var p=(e,t)=>{e.__stencil__getHostRef=()=>t;t.t=e};var h=(e,t)=>{const n={i:0,$hostElement$:e,l:t,o:new Map};{n.u=new Promise((e=>n.v=e))}{n.p=new Promise((e=>n.h=e));e["s-p"]=[];e["s-rc"]=[]}const r=n;e.__stencil__getHostRef=()=>r;return r};var $=(e,t)=>t in e;var y=(e,t)=>(0,console.error)(e,t);var m=new Map;var b=(e,t,n)=>{const r=e.$.replace(/-/g,"_");const i=e.m;if(!i){return void 0}const s=m.get(i);if(s){return s[r]} /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${i}.entry.js${""}`).then((e=>{{m.set(i,e)}return e[r]}),(e=>{y(e,t.$hostElement$)}))};var w=new Map;var g="r";var S="o";var j="s";var O="t";var k="c";var N="s-id";var x="sty-id";var C="c-id";var E="{visibility:hidden}.hydrated{visibility:inherit}";var I="slot-fb{display:contents}slot-fb[hidden]{display:none}";var M=typeof window!=="undefined"?window:{};var R={i:0,S:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)};var L=(()=>{var e;let t=false;try{(e=M.document)==null?void 0:e.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=true}}))}catch(e){}return t})();var P=e=>Promise.resolve(e);var T=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false})();var U=false;var A=[];var D=[];var F=(e,t)=>n=>{e.push(n);if(!U){U=true;if(t&&R.i&4){_(V)}else{R.raf(V)}}};var W=e=>{for(let t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){y(e)}}e.length=0};var V=()=>{W(A);{W(D);if(U=A.length>0){R.raf(V)}}};var _=e=>P().then(e);var z=F(D,true);var B=e=>{e=typeof e;return e==="object"||e==="function"};function H(e){var t,n,r;return(r=(n=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:n.getAttribute("content"))!=null?r:void 0}var J=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var Y=class e{static fromLocalValue(t){const n=t[c];const r=u in t?t[u]:void 0;switch(n){case"string":return r;case"boolean":return r;case"bigint":return BigInt(r);case"undefined":return void 0;case"null":return null;case"number":if(r==="NaN")return NaN;if(r==="-0")return-0;if(r==="Infinity")return Infinity;if(r==="-Infinity")return-Infinity;return r;case"array":return r.map((t=>e.fromLocalValue(t)));case"date":return new Date(r);case"map":const t=new Map;for(const[n,i]of r){const r=typeof n==="object"&&n!==null?e.fromLocalValue(n):n;const s=e.fromLocalValue(i);t.set(r,s)}return t;case"object":const i={};for(const[t,n]of r){i[t]=e.fromLocalValue(n)}return i;case"regexp":const{pattern:s,flags:l}=r;return new RegExp(s,l);case"set":const o=new Set;for(const t of r){o.add(e.fromLocalValue(t))}return o;case"symbol":return Symbol(r);default:throw new Error(`Unsupported type: ${n}`)}}static fromLocalValueArray(t){return t.map((t=>e.fromLocalValue(t)))}static isLocalValueObject(e){if(typeof e!=="object"||e===null){return false}if(!e.hasOwnProperty(c)){return false}const t=e[c];const n=Object.values({...f,...a}).includes(t);if(!n){return false}if(t!=="null"&&t!=="undefined"){return e.hasOwnProperty(u)}return true}};var q={};s(q,{err:()=>K,map:()=>Q,ok:()=>G,unwrap:()=>X,unwrapErr:()=>Z});var G=e=>({isOk:true,isErr:false,value:e});var K=e=>({isOk:false,isErr:true,value:e});function Q(e,t){if(e.isOk){const n=t(e.value);if(n instanceof Promise){return n.then((e=>G(e)))}else{return G(n)}}if(e.isErr){const t=e.value;return K(t)}throw"should never get here"}var X=e=>{if(e.isOk){return e.value}else{throw e.value}};var Z=e=>{if(e.isErr){return e.value}else{throw e.value}};function ee(e){if(typeof e!=="string"||!e.startsWith(v)){return e}return Y.fromLocalValue(JSON.parse(atob(e.slice(v.length))))}function te(e){const t=this.attachShadow({mode:"open"});if(T){const e=new CSSStyleSheet;e.replaceSync(r);t.adoptedStyleSheets.push(e)}}var ne=e=>{const t=ce(e,"childNodes");if(e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"){ie(t,e.tagName).forEach((e=>{if(e.nodeType===1&&e.tagName==="SLOT-FB"){if(se(e,fe(e),false).length){e.hidden=true}else{e.hidden=false}}}))}let n=0;for(n=0;n<t.length;n++){const e=t[n];if(e.nodeType===1&&ce(e,"childNodes").length){ne(e)}}};var re=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n]["s-nr"]||void 0;if(r&&r.isConnected){t.push(r)}}return t};function ie(e,t,n){let r=0;let i=[];let s;for(;r<e.length;r++){s=e[r];if(s["s-sr"]&&(!t||s["s-hn"]===t)&&n===void 0){i.push(s)}i=[...i,...ie(s.childNodes,t,n)]}return i}var se=(e,t,n=true)=>{const r=[];if(n&&e["s-sr"]||!e["s-sr"])r.push(e);let i=e;while(i=i.nextSibling){if(fe(i)===t&&(n||!i["s-sr"]))r.push(i)}return r};var le=(e,t)=>{if(e.nodeType===1){if(e.getAttribute("slot")===null&&t===""){return true}if(e.getAttribute("slot")===t){return true}return false}if(e["s-sn"]===t){return true}return t===""};var oe=(e,t,n,r)=>{if(e["s-ol"]&&e["s-ol"].isConnected){return}const i=document.createTextNode("");i["s-nr"]=e;if(!t["s-cr"]||!t["s-cr"].parentNode)return;const s=t["s-cr"].parentNode;const l=ce(s,"appendChild");if(typeof r!=="undefined"){i["s-oo"]=r;const e=ce(s,"childNodes");const t=[i];e.forEach((e=>{if(e["s-nr"])t.push(e)}));t.sort(((e,t)=>{if(!e["s-oo"]||e["s-oo"]<(t["s-oo"]||0))return-1;else if(!t["s-oo"]||t["s-oo"]<e["s-oo"])return 1;return 0}));t.forEach((e=>l.call(s,e)))}else{l.call(s,i)}e["s-ol"]=i;e["s-sh"]=t["s-hn"]};var fe=e=>typeof e["s-sn"]==="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function ae(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;const t=t=>function(e){const n=[];const r=this["s-sn"];if(e==null?void 0:e.flatten){console.error(`\n Flattening is not supported for Stencil non-shadow slots. \n You can use \`.childNodes\` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n `)}const i=this["s-cr"].parentElement;const s=i.__childNodes?i.childNodes:re(i.childNodes);s.forEach((e=>{if(r===fe(e)){n.push(e)}}));if(t){return n.filter((e=>e.nodeType===1))}return n}.bind(e);e.assignedElements=t(true);e.assignedNodes=t(false)}function ce(e,t){if("__"+t in e){const n=e["__"+t];if(typeof n!=="function")return n;return n.bind(e)}else{if(typeof e[t]!=="function")return e[t];return e[t].bind(e)}}var ue=(e,t="")=>{{return()=>{}}};var ve=(e,t)=>{{return()=>{}}};var de=(e,t,...n)=>{let r=null;let i=null;let s=null;let l=false;let o=false;const f=[];const a=t=>{for(let n=0;n<t.length;n++){r=t[n];if(Array.isArray(r)){a(r)}else if(r!=null&&typeof r!=="boolean"){if(l=typeof e!=="function"&&!B(r)){r=String(r)}if(l&&o){f[f.length-1].j+=r}else{f.push(l?pe(null,r):r)}o=l}}};a(n);if(t){if(t.key){i=t.key}if(t.name){s=t.name}{const e=t.className||t.class;if(e){t.class=typeof e!=="object"?e:Object.keys(e).filter((t=>e[t])).join(" ")}}}const c=pe(e,null);c.O=t;if(f.length>0){c.k=f}{c.N=i}{c.C=s}return c};var pe=(e,t)=>{const n={i:0,I:e,j:t,M:null,k:null};{n.O=null}{n.N=null}{n.C=null}return n};var he={};var $e=e=>e&&e.I===he;var ye=(e,t,n,r)=>{var i;const s=ue("hydrateClient",t);const l=e.shadowRoot;const o=[];const f=[];const a=[];const c=l?[]:null;const u=pe(t,null);u.M=e;const v=Object.entries(((i=r.l)==null?void 0:i.R)||{});v.forEach((([t,[n,i]])=>{var s;if(!(n&31)){return}const l=i||t;const o=e.getAttribute(l);if(o!==null){const e=ke(o,n);(s=r==null?void 0:r.o)==null?void 0:s.set(t,e)}}));if(M.document&&(!R.L||!R.L.size)){be(M.document.body,R.L=new Map)}e[N]=n;e.removeAttribute(N);r.P=me(u,o,f,c,e,e,n,a);let d=0;const p=o.length;let h;for(d;d<p;d++){h=o[d];const n=h.T+"."+h.U;const r=R.L.get(n);const i=h.M;if(!l){i["s-hn"]=t.toUpperCase();if(h.I==="slot"){i["s-cr"]=e["s-cr"]}}if(h.I==="slot"){h.C=h.M["s-sn"]||h.M["name"]||null;if(h.k){h.i|=2;if(!h.M.childNodes.length){h.k.forEach((e=>{h.M.appendChild(e.M)}))}}else{h.i|=1}}if(r&&r.isConnected){if(l&&r["s-en"]===""){r.parentNode.insertBefore(i,r.nextSibling)}r.parentNode.removeChild(r);if(!l){i["s-oo"]=parseInt(h.U)}}R.L.delete(n)}const $=[];const y=a.length;let m=0;let b;let w;let g;let S;for(m;m<y;m++){b=a[m];if(!b||!b.length)continue;g=b.length;w=0;for(w;w<g;w++){S=b[w];if(!$[S.hostId]){$[S.hostId]=R.L.get(S.hostId)}if(!$[S.hostId])continue;const e=$[S.hostId];if(!e.shadowRoot||!l){S.slot["s-cr"]=e["s-cr"];if(!S.slot["s-cr"]&&e.shadowRoot){S.slot["s-cr"]=e}else{S.slot["s-cr"]=(e.__childNodes||e.childNodes)[0]}oe(S.node,S.slot,false,S.node["s-oo"])}if(e.shadowRoot&&S.node.parentElement!==e){e.appendChild(S.node)}}}if(l&&!l.childNodes.length){let t=0;const n=c.length;if(n){for(t;t<n;t++){l.appendChild(c[t])}Array.from(e.childNodes).forEach((e=>{if(typeof e["s-sn"]!=="string"){if(e.nodeType===1&&e.slot&&e.hidden){e.removeAttribute("hidden")}else if(e.nodeType===8||e.nodeType===3&&!e.wholeText.trim()){e.parentNode.removeChild(e)}}}))}}R.L.delete(e["s-id"]);r.$hostElement$=e;s()};var me=(e,t,n,r,i,s,l,o=[])=>{let f;let a;let c;let u;if(s.nodeType===1){f=s.getAttribute(C);if(f){a=f.split(".");if(a[0]===l||a[0]==="0"){c=we({i:0,T:a[0],U:a[1],A:a[2],D:a[3],I:s.tagName.toLowerCase(),M:s,O:{class:s.className||""}});t.push(c);s.removeAttribute(C);if(!e.k){e.k=[]}const i=c.M.getAttribute("s-sn");if(typeof i==="string"){if(c.I==="slot-fb"){ge(i,a[2],c,s,e,t,n,r,o)}c.M["s-sn"]=i;c.M.removeAttribute("s-sn")}if(c.D!==void 0){e.k[c.D]=c}e=c;if(r&&c.A==="0"){r[c.D]=c.M}}}if(s.shadowRoot){for(u=s.shadowRoot.childNodes.length-1;u>=0;u--){me(e,t,n,r,i,s.shadowRoot.childNodes[u],l,o)}}const v=s.__childNodes||s.childNodes;for(u=v.length-1;u>=0;u--){me(e,t,n,r,i,v[u],l,o)}}else if(s.nodeType===8){a=s.nodeValue.split(".");if(a[1]===l||a[1]==="0"){f=a[0];c=we({T:a[1],U:a[2],A:a[3],D:a[4]||"0",M:s,O:null,k:null,N:null,C:null,I:null,j:null});if(f===O){c.M=je(s,3);if(c.M&&c.M.nodeType===3){c.j=c.M.textContent;t.push(c);s.remove();if(l===c.T){if(!e.k){e.k=[]}e.k[c.D]=c}if(r&&c.A==="0"){r[c.D]=c.M}}}else if(f===k){c.M=je(s,8);if(c.M&&c.M.nodeType===8){t.push(c);s.remove()}}else if(c.T===l){if(f===j){const i=s["s-sn"]=a[5]||"";ge(i,a[2],c,s,e,t,n,r,o)}else if(f===g){if(r){s.remove()}else{i["s-cr"]=s;s["s-cn"]=true}}}}}else if(e&&e.I==="style"){const t=pe(null,s.textContent);t.M=s;t.D="0";e.k=[t]}else{if(s.nodeType===3&&!s.wholeText.trim()){s.remove()}}return e};var be=(e,t)=>{if(e.nodeType===1){const n=e[N]||e.getAttribute(N);if(n){t.set(n,e)}let r=0;if(e.shadowRoot){for(;r<e.shadowRoot.childNodes.length;r++){be(e.shadowRoot.childNodes[r],t)}}const i=e.__childNodes||e.childNodes;for(r=0;r<i.length;r++){be(i[r],t)}}else if(e.nodeType===8){const n=e.nodeValue.split(".");if(n[0]===S){t.set(n[1]+"."+n[2],e);e.nodeValue="";e["s-en"]=n[3]}}};var we=e=>{const t={i:0,T:null,U:null,A:null,D:"0",M:null,O:null,k:null,N:null,C:null,I:null,j:null};return{...t,...e}};function ge(e,t,n,r,i,s,l,o,f){r["s-sr"]=true;n.C=e||null;n.I="slot";const a=(i==null?void 0:i.M)?i.M["s-id"]||i.M.getAttribute("s-id"):"";if(o&&M.document){const s=n.M=M.document.createElement(n.I);if(n.C){n.M.setAttribute("name",e)}if(a&&a!==n.T){i.M.insertBefore(s,i.M.children[0])}else{r.parentNode.insertBefore(n.M,r)}Se(f,t,e,r,n.T);r.remove();if(n.A==="0"){o[n.D]=n.M}}else{const l=n.M;const o=a&&a!==n.T&&i.M.shadowRoot;Se(f,t,e,r,o?a:n.T);ae(r);if(o){i.M.insertBefore(l,i.M.children[0])}s.push(n)}l.push(n);if(!i.k){i.k=[]}i.k[n.D]=n}var Se=(e,t,n,r,i)=>{let s=r.nextSibling;e[t]=e[t]||[];while(s&&((s["getAttribute"]&&s.getAttribute("slot")||s["s-sn"])===n||n===""&&!s["s-sn"]&&(s.nodeType===8&&s.nodeValue.indexOf(".")!==1||s.nodeType===3))){s["s-sn"]=n;e[t].push({slot:r,node:s,hostId:i});s=s.nextSibling}};var je=(e,t)=>{let n=e;do{n=n.nextSibling}while(n&&(n.nodeType!==t||!n.nodeValue));return n};var Oe=e=>{const t=J(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};Oe("::slotted");Oe(":host");Oe(":host-context");var ke=(e,t)=>{if(typeof e==="string"&&(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))){try{e=JSON.parse(e);return e}catch(e){}}if(typeof e==="string"&&e.startsWith(v)){e=ee(e);return e}if(e!=null&&!B(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&2){return typeof e==="string"?parseFloat(e):typeof e==="number"?e:NaN}if(t&1){return String(e)}return e}return e};var Ne=e=>d(e).$hostElement$;var xe=(e,t,n)=>{const r=Ne(e);return{emit:e=>Ce(r,t,{bubbles:true,composed:true,cancelable:true,detail:e})}};var Ce=(e,t,n)=>{const r=R.ce(t,n);e.dispatchEvent(r);return r};var Ee=new WeakMap;var Ie=(e,t,n)=>{let r=w.get(e);if(T&&n){r=r||new CSSStyleSheet;if(typeof r==="string"){r=t}else{r.replaceSync(t)}}else{r=t}w.set(e,r)};var Me=(e,t,n)=>{var r;const i=Le(t);const s=w.get(i);if(!M.document){return i}e=e.nodeType===11?e:M.document;if(s){if(typeof s==="string"){e=e.head||e;let n=Ee.get(e);let l;if(!n){Ee.set(e,n=new Set)}if(!n.has(i)){if(e.host&&(l=e.querySelector(`[${x}="${i}"]`))){l.innerHTML=s}else{l=document.querySelector(`[${x}="${i}"]`)||M.document.createElement("style");l.innerHTML=s;const n=(r=R.F)!=null?r:H(M.document);if(n!=null){l.setAttribute("nonce",n)}if(!(t.i&1)){if(e.nodeName==="HEAD"){const t=e.querySelectorAll("link[rel=preconnect]");const n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(l,(n==null?void 0:n.parentNode)===e?n:null)}else if("host"in e){if(T){const t=new CSSStyleSheet;t.replaceSync(s);e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");if(t){t.innerHTML=s+t.innerHTML}else{e.prepend(l)}}}else{e.append(l)}}if(t.i&1){e.insertBefore(l,null)}}if(t.i&4){l.innerHTML+=I}if(n){n.add(i)}}}else if(!e.adoptedStyleSheets.includes(s)){e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]}}return i};var Re=e=>{const t=e.l;const n=e.$hostElement$;const r=t.i;const i=ue("attachStyles",t.$);const s=Me(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);if(r&10){n["s-sc"]=s;n.classList.add(s+"-h")}i()};var Le=(e,t)=>"sc-"+e.$;var Pe=e=>e.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{");var Te=()=>{if(!M.document){return}const e=M.document.querySelectorAll(`[${x}]`);let t=0;for(;t<e.length;t++){Ie(e[t].getAttribute(x),Pe(e[t].innerHTML),true)}};var Ue=(e,t,n,r,i,s,l)=>{if(n===r){return}let o=$(e,t);let f=t.toLowerCase();if(t==="class"){const t=e.classList;const i=De(n);let s=De(r);if(e["s-si"]&&l){s.push(e["s-si"]);i.forEach((t=>{if(t.startsWith(e["s-si"]))s.push(t)}));s=[...new Set(s)];t.add(...s)}else{t.remove(...i.filter((e=>e&&!s.includes(e))));t.add(...s.filter((e=>e&&!i.includes(e))))}}else if(t==="style"){{for(const t in n){if(!r||r[t]==null){if(t.includes("-")){e.style.removeProperty(t)}else{e.style[t]=""}}}}for(const t in r){if(!n||r[t]!==n[t]){if(t.includes("-")){e.style.setProperty(t,r[t])}else{e.style[t]=r[t]}}}}else if(t==="key");else if(t==="ref"){if(r){r(e)}}else if(!o&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"){t=t.slice(3)}else if($(M,f)){t=f.slice(2)}else{t=f[2]+t.slice(3)}if(n||r){const i=t.endsWith(Fe);t=t.replace(We,"");if(n){R.rel(e,t,n,i)}if(r){R.ael(e,t,r,i)}}}else{const l=B(r);if((o||l&&r!==null)&&!i){try{if(!e.tagName.includes("-")){const i=r==null?"":r;if(t==="list"){o=false}else if(n==null||e[t]!=i){if(typeof e.__lookupSetter__(t)==="function"){e[t]=i}else{e.setAttribute(t,i)}}}else if(e[t]!==r){e[t]=r}}catch(e){}}if(r==null||r===false){if(r!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!o||s&4||i)&&!l&&e.nodeType===1){r=r===true?"":r;{e.setAttribute(t,r)}}}};var Ae=/\s/;var De=e=>{if(typeof e==="object"&&e&&"baseVal"in e){e=e.baseVal}if(!e||typeof e!=="string"){return[]}return e.split(Ae)};var Fe="Capture";var We=new RegExp(Fe+"$");var Ve=(e,t,n,r)=>{const i=t.M.nodeType===11&&t.M.host?t.M.host:t.M;const s=e&&e.O||{};const l=t.O||{};{for(const e of _e(Object.keys(s))){if(!(e in l)){Ue(i,e,s[e],void 0,n,t.i,r)}}}for(const e of _e(Object.keys(l))){Ue(i,e,s[e],l[e],n,t.i,r)}};function _e(e){return e.includes("ref")?[...e.filter((e=>e!=="ref")),"ref"]:e}var ze;var Be;var He=false;var Je=false;var Ye=false;var qe=false;var Ge=(e,n,r)=>{var i;const s=n.k[r];let f=0;let a;let c;let u;if(!He){Ye=true;if(s.I==="slot"){s.i|=s.k?2:1}}if(s.j!==null){a=s.M=M.document.createTextNode(s.j)}else if(s.i&1){a=s.M=M.document.createTextNode("");{Ve(null,s,qe)}}else{if(!qe){qe=s.I==="svg"}if(!M.document){throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.")}a=s.M=M.document.createElementNS(qe?l:o,!He&&t.slotRelocation&&s.i&2?"slot-fb":s.I);if(qe&&s.I==="foreignObject"){qe=false}{Ve(null,s,qe)}if(s.k){for(f=0;f<s.k.length;++f){c=Ge(e,s,f);if(c){a.appendChild(c)}}}{if(s.I==="svg"){qe=false}else if(a.tagName==="foreignObject"){qe=true}}}a["s-hn"]=Be;{if(s.i&(2|1)){a["s-sr"]=true;a["s-cr"]=ze;a["s-sn"]=s.C||"";a["s-rf"]=(i=s.O)==null?void 0:i.ref;ae(a);u=e&&e.k&&e.k[r];if(u&&u.I===s.I&&e.M){{Ke(e.M,false)}}}}return a};var Ke=(e,t)=>{R.i|=1;const n=Array.from(e.__childNodes||e.childNodes);for(let e=n.length-1;e>=0;e--){const r=n[e];if(r["s-hn"]!==Be&&r["s-ol"]){lt(tt(r).parentNode,r,tt(r));r["s-ol"].remove();r["s-ol"]=void 0;r["s-sh"]=void 0;Ye=true}if(t){Ke(r,t)}}R.i&=-2};var Qe=(e,t,n,r,i,s)=>{let l=e["s-cr"]&&e["s-cr"].parentNode||e;let o;if(l.shadowRoot&&l.tagName===Be){l=l.shadowRoot}for(;i<=s;++i){if(r[i]){o=Ge(null,n,i);if(o){r[i].M=o;lt(l,o,tt(t))}}}};var Xe=(e,t,n)=>{for(let r=t;r<=n;++r){const t=e[r];if(t){const e=t.M;st(t);if(e){{Je=true;if(e["s-ol"]){e["s-ol"].remove()}else{Ke(e,true)}}e.remove()}}}};var Ze=(e,t,n,r,i=false)=>{let s=0;let l=0;let o=0;let f=0;let a=t.length-1;let c=t[0];let u=t[a];let v=r.length-1;let d=r[0];let p=r[v];let h;let $;while(s<=a&&l<=v){if(c==null){c=t[++s]}else if(u==null){u=t[--a]}else if(d==null){d=r[++l]}else if(p==null){p=r[--v]}else if(et(c,d,i)){nt(c,d,i);c=t[++s];d=r[++l]}else if(et(u,p,i)){nt(u,p,i);u=t[--a];p=r[--v]}else if(et(c,p,i)){if(c.I==="slot"||p.I==="slot"){Ke(c.M.parentNode,false)}nt(c,p,i);lt(e,c.M,u.M.nextSibling);c=t[++s];p=r[--v]}else if(et(u,d,i)){if(c.I==="slot"||p.I==="slot"){Ke(u.M.parentNode,false)}nt(u,d,i);lt(e,u.M,c.M);u=t[--a];d=r[++l]}else{o=-1;{for(f=s;f<=a;++f){if(t[f]&&t[f].N!==null&&t[f].N===d.N){o=f;break}}}if(o>=0){$=t[o];if($.I!==d.I){h=Ge(t&&t[l],n,o)}else{nt($,d,i);t[o]=void 0;h=$.M}d=r[++l]}else{h=Ge(t&&t[l],n,l);d=r[++l]}if(h){{lt(tt(c.M).parentNode,h,tt(c.M))}}}}if(s>a){Qe(e,r[v+1]==null?null:r[v+1].M,n,r,l,v)}else if(l>v){Xe(t,s,a)}};var et=(e,t,n=false)=>{if(e.I===t.I){if(e.I==="slot"){return e.C===t.C}if(!n){return e.N===t.N}if(n&&!e.N&&t.N){e.N=t.N}return true}return false};var tt=e=>e&&e["s-ol"]||e;var nt=(e,n,r=false)=>{const i=n.M=e.M;const s=e.k;const l=n.k;const o=n.I;const f=n.j;let a;if(f===null){{qe=o==="svg"?true:o==="foreignObject"?false:qe}{Ve(e,n,qe,r)}if(s!==null&&l!==null){Ze(i,s,n,l,r)}else if(l!==null){if(e.j!==null){i.textContent=""}Qe(i,null,n,l,0,l.length-1)}else if(!r&&t.updatable&&s!==null){Xe(s,0,s.length-1)}if(qe&&o==="svg"){qe=false}}else if(a=i["s-cr"]){a.parentNode.textContent=f}else if(e.j!==f){i.data=f}};var rt=[];var it=e=>{let t;let n;let r;const i=e.__childNodes||e.childNodes;for(const e of i){if(e["s-sr"]&&(t=e["s-cr"])&&t.parentNode){n=t.parentNode.__childNodes||t.parentNode.childNodes;const i=e["s-sn"];for(r=n.length-1;r>=0;r--){t=n[r];if(!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&true){if(le(t,i)){let n=rt.find((e=>e.W===t));Je=true;t["s-sn"]=t["s-sn"]||i;if(n){n.W["s-sh"]=e["s-hn"];n.V=e}else{t["s-sh"]=e["s-hn"];rt.push({V:e,W:t})}if(t["s-sr"]){rt.map((e=>{if(le(e.W,t["s-sn"])){n=rt.find((e=>e.W===t));if(n&&!e.V){e.V=n.V}}}))}}else if(!rt.some((e=>e.W===t))){rt.push({W:t})}}}}if(e.nodeType===1){it(e)}}};var st=e=>{{e.O&&e.O.ref&&e.O.ref(null);e.k&&e.k.map(st)}};var lt=(e,t,n)=>{{return e==null?void 0:e.insertBefore(t,n)}};var ot=(e,t,n=false)=>{var r,i,s,l;const o=e.$hostElement$;const f=e.l;const a=e.P||pe(null,null);const c=$e(t);const u=c?t:de(null,null,t);Be=o.tagName;if(n&&u.O){for(const e of Object.keys(u.O)){if(o.hasAttribute(e)&&!["key","ref","style","class"].includes(e)){u.O[e]=o[e]}}}u.I=null;u.i|=4;e.P=u;u.M=a.M=o.shadowRoot||o;He=!!(f.i&1)&&!(f.i&128);{ze=o["s-cr"];Je=false}nt(a,u,n);{R.i|=1;if(Ye){it(u.M);for(const e of rt){const t=e.W;if(!t["s-ol"]&&M.document){const e=M.document.createTextNode("");e["s-nr"]=t;lt(t.parentNode,t["s-ol"]=e,t)}}for(const e of rt){const t=e.W;const o=e.V;if(o){const e=o.parentNode;let n=o.nextSibling;{let s=(r=t["s-ol"])==null?void 0:r.previousSibling;while(s){let r=(i=s["s-nr"])!=null?i:null;if(r&&r["s-sn"]===t["s-sn"]&&e===(r.__parentNode||r.parentNode)){r=r.nextSibling;while(r===t||(r==null?void 0:r["s-sr"])){r=r==null?void 0:r.nextSibling}if(!r||!r["s-nr"]){n=r;break}}s=s.previousSibling}}const l=t.__parentNode||t.parentNode;const f=t.__nextSibling||t.nextSibling;if(!n&&e!==l||f!==n){if(t!==n){if(!t["s-hn"]&&t["s-ol"]){t["s-hn"]=t["s-ol"].parentNode.nodeName}lt(e,t,n);if(t.nodeType===1&&t.tagName!=="SLOT-FB"){t.hidden=(s=t["s-ih"])!=null?s:false}}}t&&typeof o["s-rf"]==="function"&&o["s-rf"](o)}else{if(t.nodeType===1){if(n){t["s-ih"]=(l=t.hidden)!=null?l:false}t.hidden=true}}}}if(Je){ne(u.M)}R.i&=-2;rt.length=0}ze=void 0};var ft=(e,t)=>{if(t&&!e._&&t["s-p"]){const n=t["s-p"].push(new Promise((r=>e._=()=>{t["s-p"].splice(n-1,1);r()})))}};var at=(e,t)=>{{e.i|=16}if(e.i&4){e.i|=512;return}ft(e,e.B);const n=()=>ct(e,t);return z(n)};var ct=(e,t)=>{const n=e.$hostElement$;const r=ue("scheduleUpdate",e.l.$);const i=e.t;if(!i){throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let s;if(t){{e.i|=256;if(e.H){e.H.map((([e,t])=>yt(i,e,t,n)));e.H=void 0}}s=yt(i,"componentWillLoad",void 0,n)}else{s=yt(i,"componentWillUpdate",void 0,n)}s=ut(s,(()=>yt(i,"componentWillRender",void 0,n)));r();return ut(s,(()=>dt(e,i,t)))};var ut=(e,t)=>vt(e)?e.then(t).catch((e=>{console.error(e);t()})):t();var vt=e=>e instanceof Promise||e&&e.then&&typeof e.then==="function";var dt=async(e,t,n)=>{var r;const i=e.$hostElement$;const s=ue("update",e.l.$);const l=i["s-rc"];if(n){Re(e)}const o=ue("render",e.l.$);{pt(e,t,i,n)}if(l){l.map((e=>e()));i["s-rc"]=void 0}o();s();{const t=(r=i["s-p"])!=null?r:[];const n=()=>ht(e);if(t.length===0){n()}else{Promise.all(t).then(n);e.i|=4;t.length=0}}};var pt=(e,t,n,r)=>{try{t=t.render();{e.i&=-17}{e.i|=2}{{{ot(e,t,r)}}}}catch(t){y(t,e.$hostElement$)}return null};var ht=e=>{const t=e.l.$;const n=e.$hostElement$;const r=ue("postUpdate",t);const i=e.t;const s=e.B;yt(i,"componentDidRender",void 0,n);if(!(e.i&64)){e.i|=64;{mt(n)}yt(i,"componentDidLoad",void 0,n);r();{e.h(n);if(!s){$t()}}}else{yt(i,"componentDidUpdate",void 0,n);r()}{e.v(n)}{if(e._){e._();e._=void 0}if(e.i&512){_((()=>at(e,false)))}e.i&=-517}};var $t=t=>{_((()=>Ce(M,"appload",{detail:{namespace:e}})))};var yt=(e,t,n,r)=>{if(e&&e[t]){try{return e[t](n)}catch(e){y(e,r)}}return void 0};var mt=e=>{var n;return e.classList.add((n=t.hydratedSelectorName)!=null?n:"hydrated")};var bt=(e,t)=>d(e).o.get(t);var wt=(e,t,n,r)=>{const i=d(e);if(!i){throw new Error(`Couldn't find host element for "${r.$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`)}const s=i.$hostElement$;const l=i.o.get(t);const o=i.i;const f=i.t;n=ke(n,r.R[t][0]);const a=Number.isNaN(l)&&Number.isNaN(n);const c=n!==l&&!a;if((!(o&8)||l===void 0)&&c){i.o.set(t,n);if(f){if(r.J&&o&128){const e=r.J[t];if(e){e.map((e=>{try{f[e](n,l,t)}catch(e){y(e,s)}}))}}if((o&(2|16))===2){if(f.componentShouldUpdate){if(f.componentShouldUpdate(n,l,t)===false){return}}at(i,false)}}}};var gt=(e,n,r)=>{var i,s;const l=e.prototype;if(n.R||(n.J||e.watchers)){if(e.watchers&&!n.J){n.J=e.watchers}const o=Object.entries((i=n.R)!=null?i:{});o.map((([e,[t]])=>{if(t&31||r&2&&t&32){const{get:i,set:s}=Object.getOwnPropertyDescriptor(l,e)||{};if(i)n.R[e][0]|=2048;if(s)n.R[e][0]|=4096;if(r&1||!i){Object.defineProperty(l,e,{get(){{if((n.R[e][0]&2048)===0){return bt(this,e)}const t=d(this);const r=t?t.t:l;if(!r)return;return r[e]}},configurable:true,enumerable:true})}Object.defineProperty(l,e,{set(i){const l=d(this);if(s){const r=t&32?this[e]:l.$hostElement$[e];if(typeof r==="undefined"&&l.o.get(e)){i=l.o.get(e)}else if(!l.o.get(e)&&r){l.o.set(e,r)}s.apply(this,[ke(i,t)]);i=t&32?this[e]:l.$hostElement$[e];wt(this,e,i,n);return}{if((r&1)===0||(n.R[e][0]&4096)===0){wt(this,e,i,n);if(r&1&&!l.t){l.p.then((()=>{if(n.R[e][0]&4096&&l.t[e]!==l.o.get(e)){l.t[e]=i}}))}return}const s=()=>{const r=l.t[e];if(!l.o.get(e)&&r){l.o.set(e,r)}l.t[e]=ke(i,t);wt(this,e,l.t[e],n)};if(l.t){s()}else{l.p.then((()=>s()))}}}})}else if(r&1&&t&64){Object.defineProperty(l,e,{value(...t){var n;const r=d(this);return(n=r==null?void 0:r.u)==null?void 0:n.then((()=>{var n;return(n=r.t)==null?void 0:n[e](...t)}))}})}}));if(r&1){const r=new Map;l.attributeChangedCallback=function(e,i,s){R.jmp((()=>{var o;const f=r.get(e);if(this.hasOwnProperty(f)&&t.lazyLoad){s=this[f];delete this[f]}else if(l.hasOwnProperty(f)&&typeof this[f]==="number"&&this[f]==s){return}else if(f==null){const t=d(this);const r=t==null?void 0:t.i;if(r&&!(r&8)&&r&128&&s!==i){const r=t.t;const l=(o=n.J)==null?void 0:o[e];l==null?void 0:l.forEach((t=>{if(r[t]!=null){r[t].call(r,s,i,e)}}))}return}const a=Object.getOwnPropertyDescriptor(l,f);s=s===null&&typeof this[f]==="boolean"?false:s;if(s!==this[f]&&(!a.get||!!a.set)){this[f]=s}}))};e.observedAttributes=Array.from(new Set([...Object.keys((s=n.J)!=null?s:{}),...o.filter((([e,t])=>t[0]&15)).map((([e,t])=>{const n=t[1]||e;r.set(n,e);return n}))]))}}return e};var St=async(e,t,n,r)=>{let i;if((t.i&32)===0){t.i|=32;const r=n.m;if(r){const r=b(n,t);if(r&&"then"in r){const e=ve();i=await r;e()}else{i=r}if(!i){throw new Error(`Constructor for "${n.$}#${t.Y}" was not found`)}if(!i.isProxied){{n.J=i.watchers}gt(i,n,2);i.isProxied=true}const s=ue("createInstance",n.$);{t.i|=8}try{new i(t)}catch(t){y(t,e)}{t.i&=-9}{t.i|=128}s();jt(t.t,e)}else{i=e.constructor;const n=e.localName;customElements.whenDefined(n).then((()=>t.i|=128))}if(i&&i.style){let e;if(typeof i.style==="string"){e=i.style}const t=Le(n);if(!w.has(t)){const r=ue("registerStyles",n.$);Ie(t,e,!!(n.i&1));r()}}}const s=t.B;const l=()=>at(t,true);if(s&&s["s-rc"]){s["s-rc"].push(l)}else{l()}};var jt=(e,t)=>{{yt(e,"connectedCallback",void 0,t)}};var Ot=e=>{if((R.i&1)===0){const t=d(e);const n=t.l;const r=ue("connectedCallback",n.$);if(!(t.i&1)){t.i|=1;let r;{r=e.getAttribute(N);if(r){if(n.i&1){const t=Me(e.shadowRoot,n);e.classList.remove(t+"-h",t+"-s")}ye(e,n.$,r,t)}}if(!r){if(n.i&(4|8)){kt(e)}}{let n=e;while(n=n.parentNode||n.host){if(n.nodeType===1&&n.hasAttribute("s-id")&&n["s-p"]||n["s-p"]){ft(t,t.B=n);break}}}if(n.R){Object.entries(n.R).map((([t,[n]])=>{if(n&31&&e.hasOwnProperty(t)){const n=e[t];delete e[t];e[t]=n}}))}{St(e,t,n)}}else{Et(e,t,n.q);if(t==null?void 0:t.t){jt(t.t,e)}else if(t==null?void 0:t.p){t.p.then((()=>jt(t.t,e)))}}r()}};var kt=e=>{if(!M.document){return}const t=e["s-cr"]=M.document.createComment("");t["s-cn"]=true;lt(e,t,e.firstChild)};var Nt=(e,t)=>{{yt(e,"disconnectedCallback",void 0,t||e)}};var xt=async e=>{if((R.i&1)===0){const t=d(e);{if(t.G){t.G.map((e=>e()));t.G=void 0}}if(t==null?void 0:t.t){Nt(t.t,e)}else if(t==null?void 0:t.p){t.p.then((()=>Nt(t.t,e)))}}if(Ee.has(e)){Ee.delete(e)}if(e.shadowRoot&&Ee.has(e.shadowRoot)){Ee.delete(e.shadowRoot)}};var Ct=(e,t={})=>{var n;if(!M.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}const r=ue();const i=[];const s=t.exclude||[];const l=M.customElements;const o=M.document.head;const f=o.querySelector("meta[charset]");const a=M.document.createElement("style");const c=[];let u;let v=true;Object.assign(R,t);R.S=new URL(t.resourcesUrl||"./",M.document.baseURI).href;{R.i|=2}{Te()}let p=false;e.map((e=>{e[1].map((t=>{var n;const r={i:t[0],$:t[1],R:t[2],q:t[3]};if(r.i&4){p=true}{r.R=t[2]}{r.q=t[3]}{r.J=(n=t[4])!=null?n:{}}const o=r.$;const f=class extends HTMLElement{constructor(e){super(e);this.hasRegisteredEventListeners=false;e=this;h(e,r);if(r.i&1){{if(!e.shadowRoot){te.call(e,r)}else{if(e.shadowRoot.mode!=="open"){throw new Error(`Unable to re-use existing shadow root for ${r.$}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}}}}connectedCallback(){const e=d(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true;Et(this,e,r.q)}if(u){clearTimeout(u);u=null}if(v){c.push(this)}else{R.jmp((()=>Ot(this)))}}disconnectedCallback(){R.jmp((()=>xt(this)));R.raf((()=>{var e;const t=d(this);const n=c.findIndex((e=>e===this));if(n>-1){c.splice(n,1)}if(((e=t==null?void 0:t.P)==null?void 0:e.M)instanceof Node&&!t.P.M.isConnected){delete t.P.M}}))}componentOnReady(){return d(this).p}};r.m=e[0];if(!s.includes(o)&&!l.get(o)){i.push(o);l.define(o,gt(f,r,1))}}))}));if(i.length>0){if(p){a.textContent+=I}{a.textContent+=i.sort()+E}if(a.innerHTML.length){a.setAttribute("data-styles","");const e=(n=R.F)!=null?n:H(M.document);if(e!=null){a.setAttribute("nonce",e)}o.insertBefore(a,f?f.nextSibling:o.firstChild)}}v=false;if(c.length){c.map((e=>e.connectedCallback()))}else{{R.jmp((()=>u=setTimeout($t,30)))}}r()};var Et=(e,t,n,r)=>{if(n&&M.document){n.map((([n,r,i])=>{const s=e;const l=It(t,i);const o=Mt(n);R.ael(s,r,l,o);(t.G=t.G||[]).push((()=>R.rel(s,r,l,o)))}))}};var It=(e,t)=>n=>{var r;try{{if(e.i&256){(r=e.t)==null?void 0:r[t](n)}else{(e.H=e.H||[]).push([t,n])}}}catch(t){y(t,e.$hostElement$)}};var Mt=e=>L?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0;var Rt=e=>R.F=e;export{he as H,Ne as a,Ct as b,xe as c,n as g,de as h,P as p,p as r,Rt as s}; //# sourceMappingURL=p-DzUQJMIf.js.map