@sitecore-feaas/clientside 0.1.54 → 0.1.56
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.
- package/README.md +20 -20
- package/build/components/FEAASComponent.js +1 -1
- package/build/components/FEAASComponent.js.map +1 -1
- package/build/components/FEAASLoader.js +1 -1
- package/build/components/FEAASLoader.js.map +1 -1
- package/build/components/FEAASStylesheet.js +1 -1
- package/build/components/FEAASStylesheet.js.map +1 -1
- package/build/dom/thumbnail.js +247 -0
- package/build/dom/thumbnail.js.map +1 -0
- package/build/fetch.js +4 -2
- package/build/fetch.js.map +1 -1
- package/build/headless.js +1 -0
- package/build/headless.js.map +1 -1
- package/build/ui/FEAASContext.js +8 -3
- package/build/ui/FEAASContext.js.map +1 -1
- package/build/ui/FEAASEditor.js +5 -5
- package/build/ui/FEAASEditor.js.map +1 -1
- package/build/ui/FEAASExternal.js +8 -9
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/FEAASPicker.js +5 -3
- package/build/ui/FEAASPicker.js.map +1 -1
- package/build/utils/promise.js.map +1 -1
- package/dist/browser/headless.cjs +8 -5
- package/dist/browser/headless.cjs.map +4 -4
- package/dist/browser/headless.esm.js +8 -5
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +8 -5
- package/dist/browser/index.cjs.map +4 -4
- package/dist/browser/index.esm.js +8 -5
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +8 -5
- package/dist/browser/react.cjs.map +4 -4
- package/dist/browser/react.esm.js +8 -5
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +6 -3
- package/dist/node/headless.cjs.map +4 -4
- package/dist/node/headless.esm.js +6 -3
- package/dist/node/headless.esm.js.map +4 -4
- package/dist/node/index.cjs +6 -3
- package/dist/node/index.cjs.map +4 -4
- package/dist/node/index.esm.js +6 -3
- package/dist/node/index.esm.js.map +4 -4
- package/dist/node/react.cjs +6 -3
- package/dist/node/react.cjs.map +4 -4
- package/dist/node/react.esm.js +6 -3
- package/dist/node/react.esm.js.map +4 -4
- package/headless.cjs +6 -3
- package/headless.cjs.map +4 -4
- package/headless.js +6 -3
- package/headless.js.map +4 -4
- package/package.json +2 -1
- package/react.cjs +8 -5
- package/react.cjs.map +4 -4
- package/react.js +8 -5
- package/react.js.map +4 -4
- package/src/components/FEAASComponent.tsx +1 -1
- package/src/components/FEAASLoader.tsx +1 -1
- package/src/components/FEAASStylesheet.tsx +1 -1
- package/src/dom/thumbnail.ts +293 -0
- package/src/fetch.ts +5 -3
- package/src/headless.ts +1 -0
- package/src/ui/FEAASContext.tsx +9 -3
- package/src/ui/FEAASEditor.tsx +5 -5
- package/src/ui/FEAASExternal.tsx +7 -8
- package/src/ui/FEAASPicker.tsx +7 -2
- package/src/utils/promise.ts +2 -2
- package/test/FEAASComponent.react.test.tsx +3 -6
- package/types/components/FEAASComponent.d.ts +1 -1
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/components/FEAASLoader.d.ts +1 -1
- package/types/components/FEAASLoader.d.ts.map +1 -1
- package/types/components/FEAASStylesheet.d.ts +1 -1
- package/types/components/FEAASStylesheet.d.ts.map +1 -1
- package/types/dom/thumbnail.d.ts +82 -0
- package/types/dom/thumbnail.d.ts.map +1 -0
- package/types/fetch.d.ts +6 -4
- package/types/fetch.d.ts.map +1 -1
- package/types/headless.d.ts +1 -0
- package/types/headless.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/tsbuildinfo_ui +1 -1
- package/types/ui/FEAASContext.d.ts +9 -5
- package/types/ui/FEAASContext.d.ts.map +1 -1
- package/types/ui/FEAASEditor.d.ts +2 -2
- package/types/ui/FEAASEditor.d.ts.map +1 -1
- package/types/ui/FEAASExternal.d.ts +1 -1
- package/types/ui/FEAASExternal.d.ts.map +1 -1
- package/types/ui/FEAASPicker.d.ts +2 -2
- package/types/ui/FEAASPicker.d.ts.map +1 -1
- package/types/utils/promise.d.ts +1 -1
- package/types/utils/promise.d.ts.map +1 -1
package/headless.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var wt=Object.create;var B=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)B(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&&B(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?B(r,"default",{value:e,enumerable:!0}):r,e)),Nt=e=>nt(B({},"__esModule",{value:!0}),e);var zt={};_t(zt,{Base:()=>v,Component:()=>F,ComponentProps:()=>gt,DEFAULT_CDN_URL:()=>b,FEAASBase:()=>v,FEAASComponent:()=>F,FEAASComponentsProps:()=>gt,FEAASLoader:()=>U,FEAASLoaderProps:()=>bt,FEAASStylesheet:()=>q,FEAASStylesheetProps:()=>At,JSONPath:()=>f,Loader:()=>U,MyComponent:()=>H,Stylesheet:()=>q,autoloadScripts:()=>at,cleanCollectionBit:()=>lt,clearFetchCache:()=>Ft,createStylesheet:()=>mt,fetchAndRevalidate:()=>X,fetchAndRevalidateComponent:()=>P,fetchAndRevalidateStylesheet:()=>z,fetchBypassingCache:()=>I,fetchCache:()=>O,fetchComponent:()=>Ht,fetchToValidateCache:()=>M,fetchWithCacheAwareness:()=>C,findStylesheet:()=>yt,getComponentSource:()=>Ut,getComponentURL:()=>tt,getFetchCache:()=>ft,getQualifier:()=>Mt,getStylesheetSource:()=>Bt,getStylesheetURL:()=>D,loadScript:()=>k,loadStylesheet:()=>J,loadStylesheetAllowStale:()=>et,normalizeCollectionScope:()=>Z,observeDOMElement:()=>ot,parseComponentSource:()=>L,parseLimit:()=>kt,parseRange:()=>Ot,parseStylesheetSource:()=>W,queryScopes:()=>j,renderComponent:()=>Wt,renderComponentElement:()=>It,renderComponentPromise:()=>vt,renderDOMContent:()=>$,renderDOMElement:()=>g,renderHTMLContent:()=>Dt,renderStylesheet:()=>jt,renderStylesheetPromise:()=>pt,serializeCH1RichText:()=>N,setDOMAttribute:()=>T});module.exports=Nt(zt);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,v=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 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)}},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 V=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 V(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 j(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 G(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 G(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,s)=>G(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 G(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 localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return Y(this.childNodes)}set innerHTML(t){this.childNodes=Q(String(t!=null?t:""))}get outerHTML(){return Y([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(st(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(st(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 st(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Pt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Y(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=Y(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function ot(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&&at(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function at(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 ot(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}}var kt=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ot=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Mt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]+\])$/))===null||t===void 0?void 0:t[0]};function lt(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Z(e){return lt(e)+".*"}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 Lt(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,s;if(e){var o=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 a=t.replace("data-path-","");if(t=="data-path-src"){let h=Array.from(e.children).find(u=>u.localName=="picture")||e;o=e.localName=="img"?e:h.querySelector("img, video")}else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=(Array.from(e.children).find(u=>u.localName=="picture")||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")a="innerHTML";else if(t=="data-embed-src")k(e,r);else if(t=="data-path-attributes"){let h=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var c=r[l];T(e,l,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var d=0;d<h.length;d++)(r==null||!(h[d]in r))&&T(e,h[d],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var p=String((s=e.getAttribute("data-path-placeholder")||o[a])!==null&&s!==void 0?s:o.getAttribute(a));r!=null?a=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(a)!=r&&o.setAttribute(a,r):a=="innerHTML"?o.innerHTML=p:o.removeAttribute(a)}}}var ct=["data-attributes-keys","data-path-attributes","data-path-scope"];function g(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=j(t,d,!1)||[];h==0&&Lt(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,[Z(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,j(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)&&g(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 g(e,r,n)}function Dt(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 g(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,g(o,t,r),o.innerHTML}}var ht=["initial","check","updated"],O={};function Ft(){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 Ut(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 Bt(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 Ht(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 jt(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 It(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 Wt(e,t){return vt(e,t||(t=document.createElement("div"))),t}async function vt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?g(t,e.data,e):"template"in e?$(t,e.template,e.data,e):P(e,r=>$(t,r,e.data,e)).then(()=>t)}function gt(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 v{setData(t){this.set({data:t})}getProps(){return gt(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)g(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 v{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=`
|
|
1
|
+
var Mt=Object.create;var B=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var at=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},lt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kt(t))!Lt.call(e,i)&&i!==r&&B(e,i,{get:()=>t[i],enumerable:!(n=Pt(t,i))||n.enumerable});return e};var Dt=(e,t,r)=>(r=e!=null?Mt(Ot(e)):{},lt(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e)),Ut=e=>lt(B({},"__esModule",{value:!0}),e);var te={};at(te,{Base:()=>v,Component:()=>F,ComponentProps:()=>Et,DEFAULT_CDN_URL:()=>A,FEAASBase:()=>v,FEAASComponent:()=>F,FEAASComponentsProps:()=>Et,FEAASLoader:()=>W,FEAASLoaderProps:()=>St,FEAASStylesheet:()=>K,FEAASStylesheetProps:()=>Ct,InvalidResponse:()=>I,JSONPath:()=>f,Loader:()=>W,MyComponent:()=>j,Stylesheet:()=>K,Thumbnail:()=>G,autoloadScripts:()=>ht,cleanCollectionBit:()=>ft,clearFetchCache:()=>Vt,createStylesheet:()=>wt,fetchAndRevalidate:()=>O,fetchAndRevalidateComponent:()=>M,fetchAndRevalidateStylesheet:()=>V,fetchBypassingCache:()=>z,fetchCache:()=>k,fetchComponent:()=>Gt,fetchToValidateCache:()=>L,fetchWithCacheAwareness:()=>C,findStylesheet:()=>At,getComponentSource:()=>qt,getComponentURL:()=>rt,getFetchCache:()=>vt,getQualifier:()=>It,getStylesheetSource:()=>Kt,getStylesheetURL:()=>U,loadScript:()=>P,loadStylesheet:()=>q,loadStylesheetAllowStale:()=>nt,normalizeCollectionScope:()=>et,observeDOMElement:()=>ut,parseComponentSource:()=>D,parseLimit:()=>jt,parseRange:()=>Ht,parseStylesheetSource:()=>J,queryScopes:()=>H,renderComponent:()=>it,renderComponentElement:()=>Qt,renderComponentPromise:()=>xt,renderDOMContent:()=>$,renderDOMElement:()=>b,renderHTMLContent:()=>Jt,renderStylesheet:()=>Yt,renderStylesheetPromise:()=>bt,serializeCH1RichText:()=>N,setDOMAttribute:()=>T});module.exports=Ut(te);function w(e,t=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((c,l)=>{i=u=>{e==null||e(u),c(u)},o=l});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}var Ft=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,v=class extends Ft{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 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(c=>c+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 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)}},j=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(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};j.observedAttributes=["counter"];var ct=Dt(require("vm"),1),{hasOwnProperty:g}=Object.prototype;function E(e,t){return e=e.slice(),e.push(t),e}function Y(e,t){return t=t.slice(),t.unshift(e),t}var Q=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=g.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 Q(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(!g.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=g.call(e,"flatten")?e.flatten:s,this.currResultType=g.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=g.call(e,"sandbox")?e.sandbox:this.currSandbox,a=g.call(e,"wrap")?e.wrap:a,this.currPreventEval=g.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=g.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=g.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=g.call(e,"parent")?e.parent:i,o=g.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 c=f.toPathArray(e);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;let l=this._trace(c,t,["$"],i,o,r).filter(function(u){return u&&!u.isParentSelector});return l.length?!a&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((u,p)=>{let h=this._getPreferredOutput(p);return s&&Array.isArray(h)?u=u.concat(h):u.push(h),u},[]):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 c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(c,o,"value"),c;let l=e[0],u=e.slice(1),p=[];function h(d){Array.isArray(d)?d.forEach(m=>{p.push(m)}):p.push(d)}if((typeof l!="string"||a)&&t&&g.call(t,l))h(this._trace(u,t[l],E(r,l),t,l,o,s));else if(l==="*")this._walk(t,d=>{h(this._trace(u,t[d],E(r,d),t,d,o,!0,!0))});else if(l==="..")h(this._trace(u,t,r,n,i,o,s)),this._walk(t,d=>{typeof t[d]=="object"&&h(this._trace(e.slice(),t[d],E(r,d),t,d,o,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if(l==="~")return c={path:E(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(l==="$")h(this._trace(u,t,r,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))h(this._slice(l,u,t,r,n,i,o));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let d=l.replace(/^\?\((.*?)\)$/u,"$1");this._walk(t,m=>{this._eval(d,t[m],m,r,n,i)&&h(this._trace(u,t[m],E(r,m),t,m,o,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Y(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),u),t,r,n,i,o,s))}else if(l[0]==="@"){let d=!1,m=l.slice(1,-2);switch(m){case"scalar":(!t||!["object","function"].includes(typeof t))&&(d=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===m&&(d=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(d=!0);break;case"number":Number.isFinite(t)&&(d=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(d=!0);break;case"object":t&&typeof t===m&&(d=!0);break;case"array":Array.isArray(t)&&(d=!0);break;case"other":d=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(d=!0);break;default:throw new TypeError("Unknown value type "+m)}if(d)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(l[0]==="`"&&t&&g.call(t,l.slice(1))){let d=l.slice(1);h(this._trace(u,t[d],E(r,d),t,d,o,s,!0))}else if(l.includes(",")){let d=l.split(",");for(let m of d)h(this._trace(Y(m,u),t,r,n,i,o,!0))}else!a&&t&&g.call(t,l)&&h(this._trace(u,t[l],E(r,l),t,l,o,s,!0))}if(this._hasParentSelector)for(let d=0;d<p.length;d++){let m=p[d];if(m&&m.isParentSelector){let y=this._trace(m.expr,t,m.path,n,i,o,s);if(Array.isArray(y)){p[d]=y[0];let _=y.length;for(let x=1;x<_;x++)d++,p.splice(d,0,y[x])}else p[d]=y}}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,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1,u=c[0]&&Number.parseInt(c[0])||0,p=c[1]&&Number.parseInt(c[1])||a;u=u<0?Math.max(0,u+a):Math.min(a,u),p=p<0?Math.max(0,p+a):Math.min(a,p);let h=[];for(let d=u;d<p;d+=l)this._trace(Y(d,t),r,n,i,o,s,!0).forEach(y=>{h.push(y)});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 c=e.replace(/@parentProperty/gu,"_$_parentProperty").replace(/@parent/gu,"_$_parent").replace(/@property/gu,"_$_property").replace(/@root/gu,"_$_root").replace(/@([.\s)[])/gu,"_$_v$1");s&&(c=c.replace(/@path/gu,"_$_path")),f.cache[a]=new this.vm.Script(c)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.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=ct.default;function H(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((a,c)=>c.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,c,l)=>l.indexOf(a)===c).reduce((a,c)=>a.length>0?a:f({path:c,json:n}),[])),r&&Array.isArray(s)?s[0]:s}function Z(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 Z(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>Z(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 Z(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var S=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new S(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 localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return X(this.childNodes)}set innerHTML(t){this.childNodes=tt(String(t!=null?t:""))}get outerHTML(){return X([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(dt(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(dt(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);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 o=i+t;o>=0&&o<n.length;o+=t){let s=n[o];if(!r||s.nodeType===1)return s}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 S(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 dt(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 o=i[1],s=i[3],a=t.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function tt(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let s=i[1],c=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(u=>{let[p,h,,d]=u.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:Bt(d||"")}}))||[],l=new S(s,1);if(l.attributes=c,n.length>0){let u=n[n.length-1];u.childNodes.push(l),l.parentNode=u}else r.push(l);n.push(l),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let s=e.indexOf("<"),a=e.slice(0,s!==-1?s:void 0),c=new S("#text",3);if(c.textContent=a,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);e=e.slice(a.length)}}return r}function Wt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Bt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function X(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:s,value:a})=>` ${s}="${Wt(String(a))}"`).join(""),o=X(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function ut(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&P(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&ht(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function ht(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];P(i,i.getAttribute("data-embed-src"))}if(t)return ut(e)}function P(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.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var jt=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ht=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},It=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]+\])$/))===null||t===void 0?void 0:t[0]};function ft(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function et(e){return ft(e)+".*"}function mt(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 zt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=mt(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,c=e;c=c.nextElementSibling;)c.getAttribute("data-path-scope")==n&&(s++,a=c);for(var l=s;l<t;l++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var l=Math.max(1,t);l<s;l++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function T(e,t,r,n){var i,o;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 a=t.replace("data-path-","");if(t=="data-path-src"){let h=Array.from(e.children).find(d=>d.localName=="picture")||e;s=e.localName=="img"?e:h.querySelector("img, video")}else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")s=(Array.from(e.children).find(d=>d.localName=="picture")||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")a="innerHTML";else if(t=="data-embed-src")P(e,r);else if(t=="data-path-attributes"){let h=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var l=r[c];T(e,c,typeof l=="object"&&l?JSON.stringify(l):l,n)}for(var u=0;u<h.length;u++)(r==null||!(h[u]in r))&&T(e,h[u],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!s){var p=String((o=e.getAttribute("data-path-placeholder")||s[a])!==null&&o!==void 0?o:s.getAttribute(a));r!=null?a=="innerHTML"?s.innerHTML!=r&&(s.innerHTML=r):s.getAttribute(a)!=r&&s.setAttribute(a,r):a=="innerHTML"?s.innerHTML=p:s.removeAttribute(a)}}}var pt=["data-attributes-keys","data-path-attributes","data-path-scope"];function b(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 u=a.getAttribute("data-path-scope");if(u){let h=mt(a),d=H(t,u,!1)||[];h==0&&zt(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,d))===!1?1:d.length,r),t={...t,[et(u)]:d[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,d)=>pt.indexOf(h.name)-pt.indexOf(d.name));for(var c=0;c<p.length;c++){let{name:h,value:d}=p[c];h.startsWith("data-path")&&h!="data-path-scope"&&T(a,h,H(t,d,!0),r),h=="data-embed-src"&&T(a,h,a.getAttribute(h),r)}}for(var c=0,l;l=a.childNodes[c++];)yt(l)&&b(l,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function yt(e){return e.nodeType==1}function $(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,c;c=e.childNodes[a++];)yt(c)&&(c.className=c.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return b(e,r,n)}function Jt(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 s=tt(o);return b(s[0],t,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,b(s,t,r),s.innerHTML}}var gt=["initial","check","updated"],k={};function Vt(){k={}}async function O(e,t,r,n,i=k){return C({url:e,options:t,validator:r,callback:n,cache:i}).then(L).then(o=>o.response)}function vt(e,t=!1){let r=String(e).replace("?head","");var n=k[r];return!n&&!t&&(n=k[r]={phase:null,initial:w(),check:w(),updated:w(),final:w()}),n}var I=class extends Error{};async function C({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=vt(e);if(gt.indexOf(a.phase)>=gt.indexOf(o))var c=a[o];else a.phase=o}let l=await(c||fetch(e,t));if(!c&&a&&(l.ok?a[o].resolve(l):a[o].reject(new Error("Fetch failed"))),!l.ok)throw new Error("Fetch failed");let u=new Date(l.headers.get("date"))<s||c&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(l,u))===!1)throw new I("Response is not valid");return await(n==null?void 0:n(l,o,u)),{url:e,options:t,isCached:u,response:l,validator:r,callback:n,cache:i}}async function L(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:s}=e;if(r){let{response:a}=await C({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 z(e)}return e}async function z(e){return C({...e,options:{...e.options,cache:"reload"}},"updated")}var A="https://feaas.blob.core.windows.net";function D(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function qt(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 Kt(e){return`${e.cdn&&e.cdn!=A?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function J(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 o=D(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function rt(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...D(e.src)}),`${e.cdn||e.hostname||A}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function U(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...J(e.src)}),`${e.cdn||e.hostname||A}/styles/${e.library}/${e.revision||"published"}.css`}async function M(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&&C({options:{headers:{Accept:"text/html"},credentials:"omit"},url:rt({...e,version:e.instance}),validator:n}).catch(a=>a),C({url:rt(e),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(c=>c&&c instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:L({...s,callback:i}).catch(a=>{if(o[0]==s&&(z({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),L({...o[1],callback:i});throw a})}async function Gt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await M(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function V(e,t){return typeof e=="string"&&(e={src:e}),O(U(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 Yt(e,t){return bt(e,t||(t=document.createElement("style"))),t}function bt(e,t){return t||(t=document.createElement("style")),V(e,(r,n)=>{t.textContent=r}).then(()=>t)}function q(e,t){var r=At(e);if(!r)var n=wt(e);return V(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function nt(e){return new Promise((t,r)=>{q(e,t).catch(r)})}function At(e){return document.head.querySelector(`style[data-href="${U(e)}"]`)}function wt(e){let t=U(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Qt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return b(n,t),r}function it(e,t){return xt(e,t||(t=document.createElement("div"))),t}async function xt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?b(t,e.data,e):"template"in e?$(t,e.template,e.data,e):M(e,r=>$(t,r,e.data,e)).then(()=>t)}function Et(e){var t,r,n,i,o,s,a,c;let l,u=e.getAttribute("src");if(u){let x=D(u);if(!x)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:p,library:h,component:d,version:m,revision:y}=x}let _=e.getAttribute("data");if(_!=null&&_!="")try{l=typeof _=="string"?JSON.parse(_):{}}catch(x){}return{data:l||{},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:d,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:m)!==null&&s!==void 0?s:"responsive",revision:(c=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:y)!==null&&c!==void 0?c:"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 v{setData(t){this.set({data:t})}getProps(){return Et(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=nt({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,M(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)b(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 St(e){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 W=class extends v{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return St(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;
|
|
@@ -63,5 +63,8 @@ var wt=Object.create;var B=Object.defineProperty;var Et=Object.getOwnPropertyDes
|
|
|
63
63
|
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
64
64
|
></circle>
|
|
65
65
|
</svg>
|
|
66
|
-
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};
|
|
66
|
+
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};W.observedAttributes=["hidden","opacity"];W.register("feaas-loader");function Ct(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:s,library:a,revision:c}=J(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:c)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:A}}var K=class extends v{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Ct(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return q(this.props,this.onLoad)}};K.register("feaas-stylesheet");var G={};at(G,{convertBase64toBlob:()=>_t,generate:()=>Tt,get:()=>Zt,getVersionForThumbnail:()=>Rt,load:()=>Nt,responseToImage:()=>st,upload:()=>$t});var _t=e=>fetch(e).then(t=>t.blob()),st=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function Rt(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function Zt(e,t,r){try{if(!e.isNew)return await Nt(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await Tt(e,t);return r==null||r(n,!1),n&&!e.isNew&&_t(n.src).then(i=>$t(e,t,i)),n}async function Nt(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var s;return await O(n,{},(a,c)=>{let l=Math.abs(Number(new Date(a.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return c&&!l&&st(a).then(u=>{s=u,r(u,c)}),l},(a,c,l)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${c}`),st(a).then(u=>{s=u,r(u,l)})},null),s}async function Tt(e,t){let r=t||(e.isNew?null:await Rt(e));if(!r||r.isViewEmpty())return null;let{stylesheet:n,datasources:i}=e.library;return await Xt(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((s,a)=>Object.assign(s,{[a.id]:a.sample}),{}),n.css,e.sdk)}function Xt(e,t,r,n,i,o){let s=document.createElement("iframe");return s.style.position="absolute",s.style.top="-2000px",s.style.left="-2000px",s.style.width=t.props.minWidth+"px",s.style.height="720px",s.style.zIndex="100011",document.body.appendChild(s),new Promise((a,c)=>{let l=document.createElement("script");l.onerror=c,l.src=o.frontend+"/assets/html2canvas.js",l.onload=()=>{var h;(((h=s.contentWindow.document.fonts)===null||h===void 0?void 0:h.ready)||Promise.resolve()).then(function(){return s.contentWindow.html2canvas(p,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,p.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(d=>{let m=d.toDataURL("image/jpeg",.6);s.parentElement.removeChild(s);let y=new Image;y.onload=()=>{a(y)},y.onerror=c,y.src=m})})},s.contentWindow.document.head.appendChild(l);let u=s.contentWindow.document.createElement("style");u.textContent=`
|
|
67
|
+
${i}
|
|
68
|
+
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
69
|
+
`,s.contentWindow.document.head.appendChild(u);let p=it({template:r,data:n});p.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),s.contentWindow.document.body.appendChild(p)})}async function $t(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var ot;typeof window!="undefined"&&(window.FEAASElement=R,(ot=window.FEAASLoading)!==null&&ot!==void 0||(window.FEAASLoading=Promise.resolve()));0&&(module.exports={Base,Component,ComponentProps,DEFAULT_CDN_URL,FEAASBase,FEAASComponent,FEAASComponentsProps,FEAASLoader,FEAASLoaderProps,FEAASStylesheet,FEAASStylesheetProps,InvalidResponse,JSONPath,Loader,MyComponent,Stylesheet,Thumbnail,autoloadScripts,cleanCollectionBit,clearFetchCache,createStylesheet,fetchAndRevalidate,fetchAndRevalidateComponent,fetchAndRevalidateStylesheet,fetchBypassingCache,fetchCache,fetchComponent,fetchToValidateCache,fetchWithCacheAwareness,findStylesheet,getComponentSource,getComponentURL,getFetchCache,getQualifier,getStylesheetSource,getStylesheetURL,loadScript,loadStylesheet,loadStylesheetAllowStale,normalizeCollectionScope,observeDOMElement,parseComponentSource,parseLimit,parseRange,parseStylesheetSource,queryScopes,renderComponent,renderComponentElement,renderComponentPromise,renderDOMContent,renderDOMElement,renderHTMLContent,renderStylesheet,renderStylesheetPromise,serializeCH1RichText,setDOMAttribute});
|
|
67
70
|
//# sourceMappingURL=headless.js.map
|