@sitecore-feaas/clientside 0.1.46 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/build/dom/html.js +1 -1
  2. package/build/dom/html.js.map +1 -1
  3. package/build/ui/react.js +1 -1
  4. package/build/ui/react.js.map +1 -1
  5. package/dist/browser/headless.cjs +1 -1
  6. package/dist/browser/headless.cjs.map +2 -2
  7. package/dist/browser/headless.esm.js +1 -1
  8. package/dist/browser/headless.esm.js.map +1 -1
  9. package/dist/browser/index.cjs +1 -1
  10. package/dist/browser/index.cjs.map +2 -2
  11. package/dist/browser/index.esm.js +5 -5
  12. package/dist/browser/index.esm.js.map +1 -1
  13. package/dist/browser/react.cjs +2 -2
  14. package/dist/browser/react.cjs.map +2 -2
  15. package/dist/browser/react.esm.js +5 -5
  16. package/dist/browser/react.esm.js.map +1 -1
  17. package/dist/node/headless.cjs +1 -1
  18. package/dist/node/headless.cjs.map +2 -2
  19. package/dist/node/headless.esm.js +1 -1
  20. package/dist/node/headless.esm.js.map +2 -2
  21. package/dist/node/index.cjs +1 -1
  22. package/dist/node/index.cjs.map +2 -2
  23. package/dist/node/index.esm.js +1 -1
  24. package/dist/node/index.esm.js.map +2 -2
  25. package/dist/node/react.cjs +2 -2
  26. package/dist/node/react.cjs.map +2 -2
  27. package/dist/node/react.esm.js +2 -2
  28. package/dist/node/react.esm.js.map +2 -2
  29. package/headless.cjs +1 -1
  30. package/headless.cjs.map +2 -2
  31. package/headless.js +1 -1
  32. package/headless.js.map +2 -2
  33. package/package.json +1 -1
  34. package/react.cjs +2 -2
  35. package/react.cjs.map +2 -2
  36. package/react.js +2 -2
  37. package/react.js.map +2 -2
  38. package/src/dom/html.ts +1 -1
  39. package/src/ui/react.tsx +1 -1
  40. package/test/FEAASComponent.react.test.tsx +39 -153
  41. package/test/dom.test.ts +12 -0
  42. package/types/tsbuildinfo +1 -1
  43. package/types/tsbuildinfo_ui +1 -1
@@ -1,5 +1,5 @@
1
1
  var wt=Object.create;var j=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var _t=(e,t)=>{for(var r in t)j(e,r,{get:t[r],enumerable:!0})},nt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of St(t))!Ct.call(e,i)&&i!==r&&j(e,i,{get:()=>t[i],enumerable:!(n=Et(t,i))||n.enumerable});return e};var Rt=(e,t,r)=>(r=e!=null?wt(xt(e)):{},nt(t||!e||!e.__esModule?j(r,"default",{value:e,enumerable:!0}):r,e)),Nt=e=>nt(j({},"__esModule",{value:!0}),e);var Bt={};_t(Bt,{Base:()=>g,Component:()=>F,ComponentProps:()=>vt,DEFAULT_CDN_URL:()=>b,FEAASBase:()=>g,FEAASComponent:()=>F,FEAASComponentsProps:()=>vt,FEAASLoader:()=>U,FEAASLoaderProps:()=>bt,FEAASStylesheet:()=>q,FEAASStylesheetProps:()=>At,JSONPath:()=>f,Loader:()=>U,MyComponent:()=>H,Stylesheet:()=>q,autoloadScripts:()=>lt,cleanCollectionBit:()=>st,clearFetchCache:()=>Mt,createStylesheet:()=>mt,fetchAndRevalidate:()=>X,fetchAndRevalidateComponent:()=>P,fetchAndRevalidateStylesheet:()=>z,fetchBypassingCache:()=>I,fetchCache:()=>O,fetchComponent:()=>Ft,fetchToValidateCache:()=>M,fetchWithCacheAwareness:()=>C,findStylesheet:()=>yt,getComponentSource:()=>Lt,getComponentURL:()=>tt,getFetchCache:()=>ft,getStylesheetSource:()=>Dt,getStylesheetURL:()=>D,loadScript:()=>k,loadStylesheet:()=>J,loadStylesheetAllowStale:()=>et,normalizeCollectionScope:()=>Y,observeDOMElement:()=>at,parseComponentSource:()=>L,parseStylesheetSource:()=>W,queryScopes:()=>B,renderComponent:()=>Ht,renderComponentElement:()=>jt,renderComponentPromise:()=>gt,renderDOMContent:()=>$,renderDOMElement:()=>v,renderHTMLContent:()=>Ot,renderStylesheet:()=>Ut,renderStylesheetPromise:()=>pt,serializeCH1RichText:()=>N,setDOMAttribute:()=>T});module.exports=Nt(Bt);function w(e,t=r=>{}){var r;let n=()=>{var i,s;let o=new Promise((l,c)=>{i=d=>{e==null||e(d),l(d)},s=c});var a=Object.assign(o,{resolve:i,reject:s,restart:n,first:r});return r=a,a.catch(t),a};return n()}var Tt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,g=class extends Tt{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=w(t=>{this.payload=t}),this.whenRendered=w(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEvent(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}log(...t){console.log(...t)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,-1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var s=t.refs.parent;s;s=s.refs.parent)s.render&&((n=t.refs).parentReact||(n.parentReact=s),t.refs.topReact=s)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEvent(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(s){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEvent(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:s,ReactDOMClient:o}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!s)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):s.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,s)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,a){console.error(`FEAAS: ${t.tagName} Error:`,o,a),t.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},s=this.getReactErrorBoundary(),o=this.getReactWrapper(t);return n.createElement(s,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=s=>{if(t.render){let[o,a]=n.useReducer(l=>l+1,0);return t.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var R=class extends g{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},H=class extends R{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(s=>s+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};H.observedAttributes=["counter"];var it=Rt(require("vm"),1),{hasOwnProperty:m}=Object.prototype;function S(e,t){return e=e.slice(),e.push(t),e}function K(e,t){return t=t.slice(),t.unshift(e),t}var G=class extends Error{constructor(t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=t,this.name="NewError"}};function f(e,t,r,n,i){if(!(this instanceof f))try{return new f(e,t,r,n,i)}catch(o){if(!o.avoidNew)throw o;return o.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);let s=e&&typeof e=="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=m.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){let o={path:s?e.path:t};s?"json"in e&&(o.json=e.json):o.json=r;let a=this.evaluate(o);if(!a||typeof a!="object")throw new G(a);return a}}f.prototype.evaluate=function(e,t,r,n){let i=this.parent,s=this.parentProperty,{flatten:o,wrap:a}=this;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&typeof e=="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!m.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=m.call(e,"flatten")?e.flatten:o,this.currResultType=m.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=m.call(e,"sandbox")?e.sandbox:this.currSandbox,a=m.call(e,"wrap")?e.wrap:a,this.currPreventEval=m.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=m.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=m.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=m.call(e,"parent")?e.parent:i,s=m.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(i=i||null,s=s||null,Array.isArray(e)&&(e=f.toPathString(e)),!e&&e!==""||!t)return;let l=f.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;let c=this._trace(l,t,["$"],i,s,r).filter(function(d){return d&&!d.isParentSelector});return c.length?!a&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((d,p)=>{let h=this._getPreferredOutput(p);return o&&Array.isArray(h)?d=d.concat(h):d.push(h),d},[]):a?[]:void 0};f.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case"all":{let r=Array.isArray(e.path)?e.path:f.toPathArray(e.path);return e.pointer=f.toPointer(r),e.path=typeof e.path=="string"?e.path:f.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return f.toPathString(e[t]);case"pointer":return f.toPointer(e.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(e,t,r){if(t){let n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:f.toPathString(e.path),t(n,r,e)}};f.prototype._trace=function(e,t,r,n,i,s,o,a){let l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:o},this._handleCallback(l,s,"value"),l;let c=e[0],d=e.slice(1),p=[];function h(u){Array.isArray(u)?u.forEach(y=>{p.push(y)}):p.push(u)}if((typeof c!="string"||a)&&t&&m.call(t,c))h(this._trace(d,t[c],S(r,c),t,c,s,o));else if(c==="*")this._walk(t,u=>{h(this._trace(d,t[u],S(r,u),t,u,s,!0,!0))});else if(c==="..")h(this._trace(d,t,r,n,i,s,o)),this._walk(t,u=>{typeof t[u]=="object"&&h(this._trace(e.slice(),t[u],S(r,u),t,u,s,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(c==="~")return l={path:S(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")h(this._trace(d,t,r,null,null,s,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))h(this._slice(c,d,t,r,n,i,s));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let u=c.replace(/^\?\((.*?)\)$/u,"$1");this._walk(t,y=>{this._eval(u,t[y],y,r,n,i)&&h(this._trace(d,t[y],S(r,y),t,y,s,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(K(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),d),t,r,n,i,s,o))}else if(c[0]==="@"){let u=!1,y=c.slice(1,-2);switch(y){case"scalar":(!t||!["object","function"].includes(typeof t))&&(u=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===y&&(u=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(u=!0);break;case"number":Number.isFinite(t)&&(u=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(u=!0);break;case"object":t&&typeof t===y&&(u=!0);break;case"array":Array.isArray(t)&&(u=!0);break;case"other":u=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(u=!0);break;default:throw new TypeError("Unknown value type "+y)}if(u)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&t&&m.call(t,c.slice(1))){let u=c.slice(1);h(this._trace(d,t[u],S(r,u),t,u,s,o,!0))}else if(c.includes(",")){let u=c.split(",");for(let y of u)h(this._trace(K(y,d),t,r,n,i,s,!0))}else!a&&t&&m.call(t,c)&&h(this._trace(d,t[c],S(r,c),t,c,s,o,!0))}if(this._hasParentSelector)for(let u=0;u<p.length;u++){let y=p[u];if(y&&y.isParentSelector){let A=this._trace(y.expr,t,y.path,n,i,s,o);if(Array.isArray(A)){p[u]=A[0];let _=A.length;for(let E=1;E<_;E++)u++,p.splice(u,0,A[E])}else p[u]=A}}return p};f.prototype._walk=function(e,t){if(Array.isArray(e)){let r=e.length;for(let n=0;n<r;n++)t(n)}else e&&typeof e=="object"&&Object.keys(e).forEach(r=>{t(r)})};f.prototype._slice=function(e,t,r,n,i,s,o){if(!Array.isArray(r))return;let a=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1,d=l[0]&&Number.parseInt(l[0])||0,p=l[1]&&Number.parseInt(l[1])||a;d=d<0?Math.max(0,d+a):Math.min(a,d),p=p<0?Math.max(0,p+a):Math.min(a,p);let h=[];for(let u=d;u<p;u+=c)this._trace(K(u,t),r,n,i,s,o,!0).forEach(A=>{h.push(A)});return h};f.prototype._eval=function(e,t,r,n,i,s){this.currSandbox._$_parentProperty=s,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let o=e.includes("@path");o&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));let a="script:"+e;if(!f.cache[a]){let l=e.replace(/@parentProperty/gu,"_$_parentProperty").replace(/@parent/gu,"_$_parent").replace(/@property/gu,"_$_property").replace(/@root/gu,"_$_root").replace(/@([.\s)[])/gu,"_$_v$1");o&&(l=l.replace(/@path/gu,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+e)}};f.cache={};f.toPathString=function(e){let t=e,r=t.length,n="$";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(t[i])||(n+=/^[0-9*]+$/u.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};f.toPointer=function(e){let t=e,r=t.length,n="";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(t[i])||(n+="/"+t[i].toString().replace(/~/gu,"~0").replace(/\//gu,"~1"));return n};f.toPathArray=function(e){let{cache:t}=f;if(t[e])return t[e].concat();let r=[],i=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replace(/[['](\??\(.*?\))[\]']/gu,function(s,o){return"[#"+(r.push(o)-1)+"]"}).replace(/\[['"]([^'\]]*)['"]\]/gu,function(s,o){return"['"+o.replace(/\./gu,"%@%").replace(/~/gu,"%%@@%%")+"']"}).replace(/~/gu,";~;").replace(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replace(/%@%/gu,".").replace(/%%@@%%/gu,"~").replace(/(?:;)?(\^+)(?:;)?/gu,function(s,o){return";"+o.split("").join(";")+";"}).replace(/;;;|;;/gu,";..;").replace(/;$|'?\]|'$/gu,"").split(";").map(function(s){let o=s.match(/#(\d+)/u);return!o||!o[1]?s:r[o[1]]});return t[e]=i,t[e].concat()};f.prototype.vm=it.default;function st(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Y(e){return st(e)+".*"}function B(e,t,r=!1,n=e){var i=t;let s=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of s)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}i=t.substring(a.length+1),n=e[a];break}var o=f({path:i,json:n});return Array.isArray(o)&&(o==null?void 0:o.length)==0&&(o=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((a,l,c)=>c.indexOf(a)===l).reduce((a,l)=>a.length>0?a:f({path:l,json:n}),[])),r&&Array.isArray(o)?o[0]:o}function V(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${N(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):N(e)}function N(e){var t;if(Array.isArray(e))return e.map(N).join(`
2
- `).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return V(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,s)=>V(i,s.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[s.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return V(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var x=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new x(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get innerHTML(){return Z(this.childNodes)}set innerHTML(t){this.childNodes=Q(t)}get outerHTML(){return Z([this])}closest(t){let r=this;for(;r;){if(ot(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=s=>{for(let o of r)if(ot(o,s)){n.push(s);break}for(let o of s.childNodes)i(o)};for(let s of this.childNodes)i(s);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let s=i+t;s>=0&&s<n.length;s+=t){let o=n[s];if(!r||o.nodeType===1)return o}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new x(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ot(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let s=i[1],o=i[3],a=t.getAttribute(s);if(typeof o=="undefined"){if(a===void 0)return!1}else if(a!==o)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function Q(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),s=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(d=>{let[p,h,,u]=d.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:Pt(u||"")}}))||[],c=new x(o,1);if(c.attributes=l,n.length>0){let d=n[n.length-1];d.childNodes.push(c),c.parentNode=d}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(s)n.pop(),e=e.slice(s[0].length);else{let o=e.indexOf("<"),a=e.slice(0,o!==-1?o:void 0),l=new x("#text",3);if(l.textContent=a,n.length>0){let c=n[n.length-1];c.childNodes.push(l),l.parentNode=c}else r.push(l);e=e.slice(a.length)}}return r}function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Pt(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function Z(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:a})=>` ${o}="${$t(String(a))}"`).join(""),s=Z(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function at(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&k(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&lt(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function lt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];k(i,i.getAttribute("data-embed-src"))}if(t)return at(e)}function k(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let s=r.ownerDocument.createElement("script");s.setAttribute("type","module"),s.setAttribute("src",t),r.appendChild(s);break}}function ut(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function kt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=ut(e);if(i!=0)return;let s=e.parentNode;if(s!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var o=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(o++,a=l);for(var c=o;c<t;c++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,t);c<o;c++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function T(e,t,r,n){var i;if(e){var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var o=t.replace("data-path-","");if(t=="data-path-src")s=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")s=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")o="innerHTML";else if(t=="data-embed-src")k(e,r);else if(t=="data-path-attributes"){let p=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var a in r){var l=r[a];T(e,a,typeof l=="object"&&l?JSON.stringify(l):l,n)}for(var c=0;c<p.length;c++)(r==null||!(p[c]in r))&&T(e,p[c],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!s){var d=String(e.getAttribute("data-path-placeholder")||s[o]);r!=null?o=="innerHTML"?s.innerHTML!=r&&(s.innerHTML=r):s.getAttribute(o)!=r&&s.setAttribute(o,r):o=="innerHTML"?s.innerHTML=d:s.removeAttribute(o)}}}var ct=["data-attributes-keys","data-path-attributes","data-path-scope"];function v(e,t,r,n){var i,s,o;let a=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,t))||t),a.nodeType==1){let d=a.getAttribute("data-path-scope");if(d){let h=ut(a),u=B(t,d,!1)||[];h==0&&kt(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,u))===!1?1:u.length,r),t={...t,[Y(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>ct.indexOf(h.name)-ct.indexOf(u.name));for(var l=0;l<p.length;l++){let{name:h,value:u}=p[l];h.startsWith("data-path")&&h!="data-path-scope"&&T(a,h,B(t,u,!0),r),h=="data-embed-src"&&T(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)dt(c)&&v(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,t),a}function dt(e){return e.nodeType==1}function $(e,t,r,n){var i;let s=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=s,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)dt(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return v(e,r,n)}function Ot(e,t,r,n=!1){var i;let s=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let o=Q(s);return v(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,v(o,t,r),o.innerHTML}}var ht=["initial","check","updated"],O={};function Mt(){O={}}async function X(e,t,r,n,i=O){return C({url:e,options:t,validator:r,callback:n,cache:i}).then(M).then(s=>s.response)}function ft(e,t=!1){let r=String(e).replace("?head","");var n=O[r];return!n&&!t&&(n=O[r]={phase:null,initial:w(),check:w(),updated:w(),final:w()}),n}async function C({url:e,options:t,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=ft(e);if(ht.indexOf(a.phase)>=ht.indexOf(s))var l=a[s];else a.phase=s}let c=await(l||fetch(e,t));if(!l&&a&&(c.ok?a[s].resolve(c):a[s].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");if((r==null?void 0:r(c))===!1)throw new Error("Response is not valid");let d=new Date(c.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,s,d)),{url:e,options:t,isCached:d,response:c,validator:r,callback:n,cache:i}}async function M(e){let{url:t,isCached:r,options:n,validator:i,response:s,cache:o}=e;if(r){let{response:a}=await C({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(a.headers.get("last-modified")!=s.headers.get("last-modified"))return I(e)}return e}async function I(e){return C({...e,options:{...e.options,cache:"reload"}},"updated")}var b="https://feaas.blob.core.windows.net";function L(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,s,o]=t;return{cdn:r,library:n,component:i,version:s,revision:o}}}function Lt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=b?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Dt(e){return`${e.cdn&&e.cdn!=b?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function W(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let s=L(e);if(s){var{cdn:r,library:n,revision:i}=s;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function tt(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||b}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function D(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...W(e.src)}),`${e.cdn||e.hostname||b}/styles/${e.library}/${e.revision||"published"}.css`}async function P(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),s=await Promise.all([e.instance&&C({options:{headers:{Accept:"text/html"},credentials:"omit"},url:tt({...e,version:e.instance}),validator:n}).catch(a=>a),C({url:tt(e),validator:n}).catch(a=>a)]),o=s.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw s.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return s[0]==o&&console.log("Using fork!",s),await i(o.response),r?o:M({...o,callback:i}).catch(a=>{if(s[0]==o&&(I({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),M({...s[1],callback:i});throw a})}async function Ft(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await P(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function z(e,t){return typeof e=="string"&&(e={src:e}),X(D(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Ut(e,t){return pt(e,t||(t=document.createElement("style"))),t}function pt(e,t){return t||(t=document.createElement("style")),z(e,(r,n)=>{t.textContent=r}).then(()=>t)}function J(e,t){var r=yt(e);if(!r)var n=mt(e);return z(e,(i,s)=>{n&&(n.textContent=i),t==null||t(i,s)}).then(()=>r||n)}function et(e){return new Promise((t,r)=>{J(e,t).catch(r)})}function yt(e){return document.head.querySelector(`style[data-href="${D(e)}"]`)}function mt(e){let t=D(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function jt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return v(n,t),r}function Ht(e,t){return gt(e,t||(t=document.createElement("div"))),t}async function gt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?v(t,e.data,e):"template"in e?$(t,e.template,e.data,e):P(e,r=>$(t,r,e.data,e)).then(()=>t)}function vt(e=this){var t,r,n,i,s,o,a,l;let c,d=e.getAttribute("src");if(d){let E=L(d);if(!E)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:h,component:u,version:y,revision:A}=E}let _=e.getAttribute("data");if(_!=null&&_!="")try{c=typeof _=="string"?JSON.parse(_):{}}catch(E){}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:b,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:u,version:(o=(s=e.getAttribute("version"))!==null&&s!==void 0?s:y)!==null&&o!==void 0?o:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:A)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var F=class extends g{setData(t){this.set({data:t})}getProps(){return vt(this)}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n))}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.defaultProps={cdn:b,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=t=>{this.payload=t,this.advance()},this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(!this.getOriginal()){if(this.props.withStylesheet)var t=et({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,P(this.props,r=>{this.payload=r,t||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)v(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;$(this,this.payload,this.props.data)}}};F.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];F.register("feaas-component");function bt(e=this){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var U=class extends g{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return bt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
2
+ `).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return V(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,s)=>V(i,s.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[s.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return V(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var x=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new x(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get innerHTML(){return Z(this.childNodes)}set innerHTML(t){this.childNodes=Q(String(t!=null?t:""))}get outerHTML(){return Z([this])}closest(t){let r=this;for(;r;){if(ot(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=s=>{for(let o of r)if(ot(o,s)){n.push(s);break}for(let o of s.childNodes)i(o)};for(let s of this.childNodes)i(s);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let s=i+t;s>=0&&s<n.length;s+=t){let o=n[s];if(!r||o.nodeType===1)return o}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new x(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ot(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let s=i[1],o=i[3],a=t.getAttribute(s);if(typeof o=="undefined"){if(a===void 0)return!1}else if(a!==o)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function Q(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),s=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(d=>{let[p,h,,u]=d.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:Pt(u||"")}}))||[],c=new x(o,1);if(c.attributes=l,n.length>0){let d=n[n.length-1];d.childNodes.push(c),c.parentNode=d}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(s)n.pop(),e=e.slice(s[0].length);else{let o=e.indexOf("<"),a=e.slice(0,o!==-1?o:void 0),l=new x("#text",3);if(l.textContent=a,n.length>0){let c=n[n.length-1];c.childNodes.push(l),l.parentNode=c}else r.push(l);e=e.slice(a.length)}}return r}function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Pt(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function Z(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:a})=>` ${o}="${$t(String(a))}"`).join(""),s=Z(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function at(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&k(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&lt(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function lt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];k(i,i.getAttribute("data-embed-src"))}if(t)return at(e)}function k(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let s=r.ownerDocument.createElement("script");s.setAttribute("type","module"),s.setAttribute("src",t),r.appendChild(s);break}}function ut(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function kt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=ut(e);if(i!=0)return;let s=e.parentNode;if(s!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var o=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(o++,a=l);for(var c=o;c<t;c++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,t);c<o;c++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function T(e,t,r,n){var i;if(e){var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var o=t.replace("data-path-","");if(t=="data-path-src")s=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")s=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")o="innerHTML";else if(t=="data-embed-src")k(e,r);else if(t=="data-path-attributes"){let p=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var a in r){var l=r[a];T(e,a,typeof l=="object"&&l?JSON.stringify(l):l,n)}for(var c=0;c<p.length;c++)(r==null||!(p[c]in r))&&T(e,p[c],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!s){var d=String(e.getAttribute("data-path-placeholder")||s[o]);r!=null?o=="innerHTML"?s.innerHTML!=r&&(s.innerHTML=r):s.getAttribute(o)!=r&&s.setAttribute(o,r):o=="innerHTML"?s.innerHTML=d:s.removeAttribute(o)}}}var ct=["data-attributes-keys","data-path-attributes","data-path-scope"];function v(e,t,r,n){var i,s,o;let a=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,t))||t),a.nodeType==1){let d=a.getAttribute("data-path-scope");if(d){let h=ut(a),u=B(t,d,!1)||[];h==0&&kt(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,u))===!1?1:u.length,r),t={...t,[Y(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>ct.indexOf(h.name)-ct.indexOf(u.name));for(var l=0;l<p.length;l++){let{name:h,value:u}=p[l];h.startsWith("data-path")&&h!="data-path-scope"&&T(a,h,B(t,u,!0),r),h=="data-embed-src"&&T(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)dt(c)&&v(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,t),a}function dt(e){return e.nodeType==1}function $(e,t,r,n){var i;let s=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=s,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)dt(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return v(e,r,n)}function Ot(e,t,r,n=!1){var i;let s=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let o=Q(s);return v(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,v(o,t,r),o.innerHTML}}var ht=["initial","check","updated"],O={};function Mt(){O={}}async function X(e,t,r,n,i=O){return C({url:e,options:t,validator:r,callback:n,cache:i}).then(M).then(s=>s.response)}function ft(e,t=!1){let r=String(e).replace("?head","");var n=O[r];return!n&&!t&&(n=O[r]={phase:null,initial:w(),check:w(),updated:w(),final:w()}),n}async function C({url:e,options:t,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=ft(e);if(ht.indexOf(a.phase)>=ht.indexOf(s))var l=a[s];else a.phase=s}let c=await(l||fetch(e,t));if(!l&&a&&(c.ok?a[s].resolve(c):a[s].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");if((r==null?void 0:r(c))===!1)throw new Error("Response is not valid");let d=new Date(c.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,s,d)),{url:e,options:t,isCached:d,response:c,validator:r,callback:n,cache:i}}async function M(e){let{url:t,isCached:r,options:n,validator:i,response:s,cache:o}=e;if(r){let{response:a}=await C({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(a.headers.get("last-modified")!=s.headers.get("last-modified"))return I(e)}return e}async function I(e){return C({...e,options:{...e.options,cache:"reload"}},"updated")}var b="https://feaas.blob.core.windows.net";function L(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,s,o]=t;return{cdn:r,library:n,component:i,version:s,revision:o}}}function Lt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=b?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Dt(e){return`${e.cdn&&e.cdn!=b?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function W(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let s=L(e);if(s){var{cdn:r,library:n,revision:i}=s;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function tt(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||b}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function D(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...W(e.src)}),`${e.cdn||e.hostname||b}/styles/${e.library}/${e.revision||"published"}.css`}async function P(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),s=await Promise.all([e.instance&&C({options:{headers:{Accept:"text/html"},credentials:"omit"},url:tt({...e,version:e.instance}),validator:n}).catch(a=>a),C({url:tt(e),validator:n}).catch(a=>a)]),o=s.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw s.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return s[0]==o&&console.log("Using fork!",s),await i(o.response),r?o:M({...o,callback:i}).catch(a=>{if(s[0]==o&&(I({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),M({...s[1],callback:i});throw a})}async function Ft(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await P(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function z(e,t){return typeof e=="string"&&(e={src:e}),X(D(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Ut(e,t){return pt(e,t||(t=document.createElement("style"))),t}function pt(e,t){return t||(t=document.createElement("style")),z(e,(r,n)=>{t.textContent=r}).then(()=>t)}function J(e,t){var r=yt(e);if(!r)var n=mt(e);return z(e,(i,s)=>{n&&(n.textContent=i),t==null||t(i,s)}).then(()=>r||n)}function et(e){return new Promise((t,r)=>{J(e,t).catch(r)})}function yt(e){return document.head.querySelector(`style[data-href="${D(e)}"]`)}function mt(e){let t=D(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function jt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return v(n,t),r}function Ht(e,t){return gt(e,t||(t=document.createElement("div"))),t}async function gt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?v(t,e.data,e):"template"in e?$(t,e.template,e.data,e):P(e,r=>$(t,r,e.data,e)).then(()=>t)}function vt(e=this){var t,r,n,i,s,o,a,l;let c,d=e.getAttribute("src");if(d){let E=L(d);if(!E)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:h,component:u,version:y,revision:A}=E}let _=e.getAttribute("data");if(_!=null&&_!="")try{c=typeof _=="string"?JSON.parse(_):{}}catch(E){}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:b,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:u,version:(o=(s=e.getAttribute("version"))!==null&&s!==void 0?s:y)!==null&&o!==void 0?o:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:A)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var F=class extends g{setData(t){this.set({data:t})}getProps(){return vt(this)}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n))}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.defaultProps={cdn:b,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=t=>{this.payload=t,this.advance()},this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(!this.getOriginal()){if(this.props.withStylesheet)var t=et({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,P(this.props,r=>{this.payload=r,t||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)v(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;$(this,this.payload,this.props.data)}}};F.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];F.register("feaas-component");function bt(e=this){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var U=class extends g{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return bt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
3
  #loader {
4
4
  position: absolute;
5
5
  top: 0;