@sitecore-feaas/clientside 0.1.29 → 0.1.30

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 (39) hide show
  1. package/build/components/FEAASComponent.js +1 -1
  2. package/build/components/FEAASComponent.js.map +1 -1
  3. package/build/dom/stylesheet.js +1 -1
  4. package/build/dom/stylesheet.js.map +1 -1
  5. package/build/ui/react.js.map +1 -1
  6. package/dist/browser/headless.esm.js +1 -1
  7. package/dist/browser/headless.esm.js.map +1 -1
  8. package/dist/browser/headless.js +1 -1
  9. package/dist/browser/headless.js.map +1 -1
  10. package/dist/browser/index.esm.js +5 -3
  11. package/dist/browser/index.esm.js.map +1 -1
  12. package/dist/browser/index.js +1 -1
  13. package/dist/browser/index.js.map +1 -1
  14. package/dist/browser/react.esm.js +69 -0
  15. package/dist/browser/react.esm.js.map +1 -0
  16. package/dist/browser/react.js +5 -3
  17. package/dist/browser/react.js.map +1 -1
  18. package/dist/node/headless.esm.js +1 -1
  19. package/dist/node/headless.esm.js.map +2 -2
  20. package/dist/node/headless.js +1 -1
  21. package/dist/node/headless.js.map +2 -2
  22. package/dist/node/index.esm.js +3 -3
  23. package/dist/node/index.esm.js.map +4 -4
  24. package/dist/node/index.js +1 -1
  25. package/dist/node/index.js.map +2 -2
  26. package/dist/node/react.esm.js +67 -0
  27. package/dist/node/react.esm.js.map +7 -0
  28. package/dist/node/react.js +1 -1
  29. package/dist/node/react.js.map +2 -2
  30. package/package.json +1 -1
  31. package/scripts/build.js +5 -4
  32. package/src/components/FEAASComponent.tsx +1 -1
  33. package/src/dom/stylesheet.ts +1 -1
  34. package/src/ui/react.tsx +1 -2
  35. package/test/FEAASStylesheet.test.tsx +22 -1
  36. package/types/tsbuildinfo +1 -1
  37. package/types/tsbuildinfo_ui +1 -1
  38. package/types/ui/react.d.ts +1 -1
  39. package/types/ui/react.d.ts.map +1 -1
@@ -1,5 +1,5 @@
1
1
  var nt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});function E(e,t=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,c)=>{i=d=>{e==null||e(d),l(d)},o=c});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}var it=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,v=class extends it{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=E(t=>{this.payload=t}),this.whenRendered=E(()=>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 o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}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(o){}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:o,ReactDOMClient:s}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.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,o)=>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(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${t.tagName} Error:`,s,a),t.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[s,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!=null&&r.customElements.get(t)||r.customElements.define(t,this)}};var _=class extends v{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)}},U=class extends _{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(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};U.observedAttributes=["counter"];import ot from"vm";var{hasOwnProperty:m}=Object.prototype;function w(e,t){return e=e.slice(),e.push(t),e}function j(e,t){return t=t.slice(),t.unshift(e),t}var B=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(s){if(!s.avoidNew)throw s;return s.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);let o=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 s={path:o?e.path:t};o?"json"in e&&(s.json=e.json):s.json=r;let a=this.evaluate(s);if(!a||typeof a!="object")throw new B(a);return a}}f.prototype.evaluate=function(e,t,r,n){let i=this.parent,o=this.parentProperty,{flatten:s,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),s=m.call(e,"flatten")?e.flatten:s,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,o=m.call(e,"parentProperty")?e.parentProperty:o,e=e.path}if(i=i||null,o=o||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,o,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 s&&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,o,s,a){let l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(l,o,"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],w(r,c),t,c,o,s));else if(c==="*")this._walk(t,u=>{h(this._trace(d,t[u],w(r,u),t,u,o,!0,!0))});else if(c==="..")h(this._trace(d,t,r,n,i,o,s)),this._walk(t,u=>{typeof t[u]=="object"&&h(this._trace(e.slice(),t[u],w(r,u),t,u,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(c==="~")return l={path:w(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if(c==="$")h(this._trace(d,t,r,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))h(this._slice(c,d,t,r,n,i,o));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],w(r,y),t,y,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(j(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),d),t,r,n,i,o,s))}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,o,"value"),l}else if(c[0]==="`"&&t&&m.call(t,c.slice(1))){let u=c.slice(1);h(this._trace(d,t[u],w(r,u),t,u,o,s,!0))}else if(c.includes(",")){let u=c.split(",");for(let y of u)h(this._trace(j(y,d),t,r,n,i,o,!0))}else!a&&t&&m.call(t,c)&&h(this._trace(d,t[c],w(r,c),t,c,o,s,!0))}if(this._hasParentSelector)for(let u=0;u<p.length;u++){let y=p[u];if(y&&y.isParentSelector){let b=this._trace(y.expr,t,y.path,n,i,o,s);if(Array.isArray(b)){p[u]=b[0];let S=b.length;for(let $=1;$<S;$++)u++,p.splice(u,0,b[$])}else p[u]=b}}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,o,s){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(j(u,t),r,n,i,o,s,!0).forEach(b=>{h.push(b)});return h};f.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let s=e.includes("@path");s&&(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");s&&(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(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[['"]([^'\]]*)['"]\]/gu,function(o,s){return"['"+s.replace(/\./gu,"%@%").replace(/~/gu,"%%@@%%")+"']"}).replace(/~/gu,";~;").replace(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replace(/%@%/gu,".").replace(/%%@@%%/gu,"~").replace(/(?:;)?(\^+)(?:;)?/gu,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/gu,";..;").replace(/;$|'?\]|'$/gu,"").split(";").map(function(o){let s=o.match(/#(\d+)/u);return!s||!s[1]?o:r[s[1]]});return t[e]=i,t[e].concat()};f.prototype.vm=ot;function st(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function G(e){return st(e)+".*"}function I(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of o)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}i=t.substring(a.length+1),n=e[a];break}var s=f({path:i,json:n});return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[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(s)?s[0]:s}function H(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${C(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):C(e)}function C(e){var t;if(Array.isArray(e))return e.map(C).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 H(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>H(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return H(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function at(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&O(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&lt(s,!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];O(i,i.getAttribute("data-embed-src"))}if(t)return at(e)}function O(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 o=r.ownerDocument.createElement("script");o.type="module",o.src=t,r.appendChild(o);break}}function V(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 ct(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=V(e);if(i!=0)return;let o=e.parentElement;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var c=s;c<t;c++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,t);c<s;c++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function R(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=C(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var s=t.replace("data-path-","");if(t=="data-path-src")o=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=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")s="innerHTML";else if(t=="data-embed-src")O(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];R(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))&&R(e,p[c],null,n);R(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var d=String(e.getAttribute("data-path-placeholder")||o[s]);r!=null?s=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(s)!=r&&o.setAttribute(s,r):s=="innerHTML"?o.innerHTML=d:o.removeAttribute(s)}}}var Y=["data-attributes-keys","data-path-attributes","data-path-scope"];function g(e,t,r,n){var i,o,s;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=V(a),u=I(t,d,!1)||[];h==0&&ct(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,u))===!1?1:u.length,r),t={...t,[G(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>Y.indexOf(h.name)-Y.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"&&R(a,h,I(t,u,!0),r),h=="data-embed-src"&&R(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)Z(c)&&g(c,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function Z(e){return e.nodeType==1}function P(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)Z(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return g(e,r,n)}function Mt(e,t,r,n=!1){var i;let o=((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{parseHTML:s}=nt("linkedom"),{document:a}=s(o);return g(a,t,r).toString()}else{let s=document.createElement("div");return s.innerHTML=o,g(s,t,r),s.innerHTML}}var Q=["initial","check","updated"],T={};function Dt(){T={}}async function X(e,t,r,n,i=T){return x({url:e,options:t,validator:r,callback:n,cache:i}).then(M).then(o=>o.response)}function ut(e,t=!1){let r=String(e).replace("?head","");var n=T[r];return!n&&!t&&(n=T[r]={phase:null,initial:E(),check:E(),updated:E(),final:E()}),n}async function x({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=ut(e);if(Q.indexOf(a.phase)>=Q.indexOf(o))var l=a[o];else a.phase=o}let c=await(l||fetch(e,t));if(!l&&a&&(c.ok?a[o].resolve(c):a[o].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"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,o)),{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:o,cache:s}=e;if(r){let{response:a}=await x({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return W(e)}return e}async function W(e){return x({...e,options:{...e.options,cache:"reload"}},"updated")}var A="https://feaascomponentsapidev.blob.core.windows.net";function L(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/([^\/]+?)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function jt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=A?`${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 Bt(e){return`${e.cdn&&e.cdn!=A?`${e.cdn}/styles`:""}/${e.library}/${e.revision=="published"?"":e.revision}`.replace(/^\/|\/$|(?<!:)\/\//g,"")}function et(e){let t=e.match(/^(?:(.*?)\/styles)?\/([^\/]+)\/([^\/]+)(?:.css?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}}function tt(e){return"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||A}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function N(e){return"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||A}/styles/${e.library}/${e.revision||"published"}.css`}async function k(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),o=await Promise.all([e.instance&&x({options:{headers:{Accept:"text/html"}},url:tt({...e,version:e.instance}),validator:n}).catch(a=>a),x({url:tt(e),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:M({...s,callback:i}).catch(a=>{if(o[0]==s&&(W({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),M({...o[1],callback:i});throw a})}async function Ht(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await k(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(N(e),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function zt(e,t){return dt(e,t||(t=document.createElement("style"))),t}function dt(e,t){return t||(t=document.createElement("style")),z(e,(r,n)=>{t.textContent=r}).then(()=>t)}function J(e,t){var r=ht(e);if(!r)var n=ft(e);return z(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function rt(e){return new Promise((t,r)=>{J(e,t).catch(r)})}function ht(e){return document.head.querySelector(`style[data-href="${N(e)}"]`)}function ft(e){let t=N(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Gt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return g(n,t),r}function Yt(e,t){return pt(e,t||(t=document.createElement("div"))),t}async function pt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?g(t,e.data,e):"template"in e?P(t,e.template,e.data,e):k(e,r=>P(t,r,e.data,e)).then(()=>t)}function yt(e=this){var t,r,n,i,o,s,a,l;let c,d=e.getAttribute("src");if(d)var{cdn:p,library:h,component:u,version:y,revision:b}=L(d);let S=e.getAttribute("data");if(S!=null&&S!="")try{c=typeof S=="string"?JSON.parse(S):{}}catch($){}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:A,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:u,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:y)!==null&&s!==void 0?s:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:b)!==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 D=class extends v{setData(t){this.set({data:t})}getProps(){return yt(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:A,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=rt(this.props).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,k(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)g(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;P(this,this.payload,this.props.data)}}};D.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];D.register("feaas-component");function mt(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 F=class extends v{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return mt(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 H(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>H(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return H(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function at(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&O(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&lt(s,!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];O(i,i.getAttribute("data-embed-src"))}if(t)return at(e)}function O(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 o=r.ownerDocument.createElement("script");o.type="module",o.src=t,r.appendChild(o);break}}function V(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 ct(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=V(e);if(i!=0)return;let o=e.parentElement;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var c=s;c<t;c++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,t);c<s;c++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function R(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=C(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var s=t.replace("data-path-","");if(t=="data-path-src")o=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=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")s="innerHTML";else if(t=="data-embed-src")O(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];R(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))&&R(e,p[c],null,n);R(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var d=String(e.getAttribute("data-path-placeholder")||o[s]);r!=null?s=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(s)!=r&&o.setAttribute(s,r):s=="innerHTML"?o.innerHTML=d:o.removeAttribute(s)}}}var Y=["data-attributes-keys","data-path-attributes","data-path-scope"];function g(e,t,r,n){var i,o,s;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=V(a),u=I(t,d,!1)||[];h==0&&ct(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,u))===!1?1:u.length,r),t={...t,[G(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>Y.indexOf(h.name)-Y.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"&&R(a,h,I(t,u,!0),r),h=="data-embed-src"&&R(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)Z(c)&&g(c,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function Z(e){return e.nodeType==1}function P(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)Z(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return g(e,r,n)}function Mt(e,t,r,n=!1){var i;let o=((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{parseHTML:s}=nt("linkedom"),{document:a}=s(o);return g(a,t,r).toString()}else{let s=document.createElement("div");return s.innerHTML=o,g(s,t,r),s.innerHTML}}var Q=["initial","check","updated"],T={};function Dt(){T={}}async function X(e,t,r,n,i=T){return x({url:e,options:t,validator:r,callback:n,cache:i}).then(M).then(o=>o.response)}function ut(e,t=!1){let r=String(e).replace("?head","");var n=T[r];return!n&&!t&&(n=T[r]={phase:null,initial:E(),check:E(),updated:E(),final:E()}),n}async function x({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=ut(e);if(Q.indexOf(a.phase)>=Q.indexOf(o))var l=a[o];else a.phase=o}let c=await(l||fetch(e,t));if(!l&&a&&(c.ok?a[o].resolve(c):a[o].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"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,o)),{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:o,cache:s}=e;if(r){let{response:a}=await x({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return W(e)}return e}async function W(e){return x({...e,options:{...e.options,cache:"reload"}},"updated")}var A="https://feaascomponentsapidev.blob.core.windows.net";function L(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/([^\/]+?)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function jt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=A?`${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 Bt(e){return`${e.cdn&&e.cdn!=A?`${e.cdn}/styles`:""}/${e.library}/${e.revision=="published"?"":e.revision}`.replace(/^\/|\/$|(?<!:)\/\//g,"")}function et(e){let t=e.match(/^(?:(.*?)\/styles)?\/([^\/]+)\/([^\/]+)(?:.css?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}}function tt(e){return"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||A}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function N(e){return"src"in e&&(e={...L(e.src)}),`${e.cdn||e.hostname||A}/styles/${e.library}/${e.revision||"published"}.css`}async function k(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),o=await Promise.all([e.instance&&x({options:{headers:{Accept:"text/html"}},url:tt({...e,version:e.instance}),validator:n}).catch(a=>a),x({url:tt(e),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:M({...s,callback:i}).catch(a=>{if(o[0]==s&&(W({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),M({...o[1],callback:i});throw a})}async function Ht(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await k(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(N(e),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function zt(e,t){return dt(e,t||(t=document.createElement("style"))),t}function dt(e,t){return t||(t=document.createElement("style")),z(e,(r,n)=>{t.textContent=r}).then(()=>t)}function J(e,t){var r=ht(e);if(!r)var n=ft(e);return z({...e},(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function rt(e){return new Promise((t,r)=>{J(e,t).catch(r)})}function ht(e){return document.head.querySelector(`style[data-href="${N(e)}"]`)}function ft(e){let t=N(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Gt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return g(n,t),r}function Yt(e,t){return pt(e,t||(t=document.createElement("div"))),t}async function pt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?g(t,e.data,e):"template"in e?P(t,e.template,e.data,e):k(e,r=>P(t,r,e.data,e)).then(()=>t)}function yt(e=this){var t,r,n,i,o,s,a,l;let c,d=e.getAttribute("src");if(d)var{cdn:p,library:h,component:u,version:y,revision:b}=L(d);let S=e.getAttribute("data");if(S!=null&&S!="")try{c=typeof S=="string"?JSON.parse(S):{}}catch($){}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:A,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:u,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:y)!==null&&s!==void 0?s:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:b)!==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 D=class extends v{setData(t){this.set({data:t})}getProps(){return yt(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:A,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=rt({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,k(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)g(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;P(this,this.payload,this.props.data)}}};D.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];D.register("feaas-component");function mt(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 F=class extends v{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return mt(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;