@sitecore-feaas/clientside 0.5.19 → 0.5.20-alpha.0
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/build/components/FEAASElement.js +3 -1
- package/build/components/FEAASElement.js.map +1 -1
- package/dist/browser/headless.cjs +7 -7
- package/dist/browser/headless.cjs.map +4 -4
- package/dist/browser/headless.esm.js +7 -7
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +7 -7
- package/dist/browser/index.cjs.map +4 -4
- package/dist/browser/index.esm.js +7 -7
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +8 -8
- package/dist/browser/react.cjs.map +4 -4
- package/dist/browser/react.esm.js +5 -5
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +6 -6
- package/dist/node/headless.cjs.map +4 -4
- package/dist/node/headless.esm.js +6 -6
- package/dist/node/headless.esm.js.map +4 -4
- package/dist/node/index.cjs +5 -5
- package/dist/node/index.cjs.map +4 -4
- package/dist/node/index.esm.js +5 -5
- package/dist/node/index.esm.js.map +4 -4
- package/dist/node/react.cjs +6 -6
- package/dist/node/react.cjs.map +4 -4
- package/dist/node/react.esm.js +5 -5
- package/dist/node/react.esm.js.map +4 -4
- package/headless.cjs +6 -6
- package/headless.cjs.map +4 -4
- package/headless.js +6 -6
- package/headless.js.map +4 -4
- package/package.json +4 -4
- package/react.cjs +8 -8
- package/react.cjs.map +4 -4
- package/react.js +8 -8
- package/react.js.map +4 -4
- package/src/components/FEAASComponent.tsx +1 -1
- package/src/components/FEAASElement.tsx +3 -1
- package/src/ui/FEAASPicker.tsx +1 -1
- package/test/FEAASComponent.react.test.tsx +6 -9
- package/test/ServerComponent.test.tsx +1 -1
- package/types/components/FEAASComponent.d.ts +1 -1
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/components/FEAASElement.d.ts.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var Oe=Object.defineProperty;var j=(t,e)=>{for(var r in e)Oe(t,r,{get:e[r],enumerable:!0})};function S(t,e=r=>{}){var r;let n=()=>{var i,s;let o=new Promise((l,c)=>{i=d=>{t==null||t(d),l(d)},s=c});var a=Object.assign(o,{resolve:i,reject:s,restart:n,first:r});return r=a,a.catch(e),a};return n()}var De=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends De{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(e=>{this.payload=e}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(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(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var s=e.refs.parent;s;s=s.refs.parent)s.render&&((n=e.refs).parentReact||(n.parentReact=s),e.refs.topReact=s)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);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.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;if(!this.connected)return;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,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.getAttribute("hydrate")=="false"&&this.firstElementChild||(!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&&this.connected?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,s)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=e.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: ${e.tagName} Error:`,o,a),e.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},s=this.getReactErrorBoundary(),o=this.getReactWrapper(e);return n.createElement(s,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=s=>{if(e.render){let[o,a]=n.useReducer(l=>l+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.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(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),s=this.props[r],o=i?JSON.stringify(s):String(s),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(d)):d}catch(p){var n=null}s==null||o===l?this.removeAttribute(c):(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||i)&&n!=o&&this.setAttribute(c,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var _=class extends x{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(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},G=class extends _{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(s=>s+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};G.observedAttributes=["counter"];var ne={};j(ne,{renderDOMContent:()=>$,renderDOMElement:()=>w,renderHTMLContent:()=>Ve,setDOMAttribute:()=>N});var Q={};j(Q,{JSONPath:()=>m,queryObject:()=>P,queryObjectRaw:()=>fe,queryScopes:()=>F,serializeCH1RichText:()=>T});import Pe from"vm";var{hasOwnProperty:b}=Object.prototype;function R(t,e){return t=t.slice(),t.push(e),t}function K(t,e){return e=e.slice(),e.unshift(t),e}var Y=class extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}};function m(t,e,r,n,i){if(!(this instanceof m))try{return new m(t,e,r,n,i)}catch(o){if(!o.avoidNew)throw o;return o.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);let s=t&&typeof t=="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){let o={path:s?t.path:e};s?"json"in t&&(o.json=t.json):o.json=r;let a=this.evaluate(o);if(!a||typeof a!="object")throw new Y(a);return a}}m.prototype.evaluate=function(t,e,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,e=e||this.json,t=t||this.path,t&&typeof t=="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=t),o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,a=b.call(t,"wrap")?t.wrap:a,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,i=b.call(t,"parent")?t.parent:i,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(i=i||null,s=s||null,Array.isArray(t)&&(t=m.toPathString(t)),!t&&t!==""||!e)return;let l=m.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;let c=this._trace(l,e,["$"],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};m.prototype._getPreferredOutput=function(t){let e=this.currResultType;switch(e){case"all":{let r=Array.isArray(t.path)?t.path:m.toPathArray(t.path);return t.pointer=m.toPointer(r),t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return m.toPathString(t[e]);case"pointer":return m.toPointer(t.path);default:throw new TypeError("Unknown result type")}};m.prototype._handleCallback=function(t,e,r){if(e){let n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),e(n,r,t)}};m.prototype._trace=function(t,e,r,n,i,s,o,a){let l;if(!t.length)return l={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:o},this._handleCallback(l,s,"value"),l;let c=t[0],d=t.slice(1),p=[];function h(u){Array.isArray(u)?u.forEach(f=>{p.push(f)}):p.push(u)}if((typeof c!="string"||a)&&e&&b.call(e,c))h(this._trace(d,e[c],R(r,c),e,c,s,o));else if(c==="*")this._walk(e,u=>{h(this._trace(d,e[u],R(r,u),e,u,s,!0,!0))});else if(c==="..")h(this._trace(d,e,r,n,i,s,o)),this._walk(e,u=>{typeof e[u]=="object"&&h(this._trace(t.slice(),e[u],R(r,u),e,u,s,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(c==="~")return l={path:R(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")h(this._trace(d,e,r,null,null,s,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))h(this._slice(c,d,e,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(e,f=>{this._eval(u,e[f],f,r,n,i)&&h(this._trace(d,e[f],R(r,f),e,f,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,e,r[r.length-1],r.slice(0,-1),n,i),d),e,r,n,i,s,o))}else if(c[0]==="@"){let u=!1,f=c.slice(1,-2);switch(f){case"scalar":(!e||!["object","function"].includes(typeof e))&&(u=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===f&&(u=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(u=!0);break;case"number":Number.isFinite(e)&&(u=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(u=!0);break;case"object":e&&typeof e===f&&(u=!0);break;case"array":Array.isArray(e)&&(u=!0);break;case"other":u=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(u=!0);break;default:throw new TypeError("Unknown value type "+f)}if(u)return l={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&e&&b.call(e,c.slice(1))){let u=c.slice(1);h(this._trace(d,e[u],R(r,u),e,u,s,o,!0))}else if(c.includes(",")){let u=c.split(",");for(let f of u)h(this._trace(K(f,d),e,r,n,i,s,!0))}else!a&&e&&b.call(e,c)&&h(this._trace(d,e[c],R(r,c),e,c,s,o,!0))}if(this._hasParentSelector)for(let u=0;u<p.length;u++){let f=p[u];if(f&&f.isParentSelector){let g=this._trace(f.expr,e,f.path,n,i,s,o);if(Array.isArray(g)){p[u]=g[0];let y=g.length;for(let A=1;A<y;A++)u++,p.splice(u,0,g[A])}else p[u]=g}}return p};m.prototype._walk=function(t,e){if(Array.isArray(t)){let r=t.length;for(let n=0;n<r;n++)e(n)}else t&&typeof t=="object"&&Object.keys(t).forEach(r=>{e(r)})};m.prototype._slice=function(t,e,r,n,i,s,o){if(!Array.isArray(r))return;let a=r.length,l=t.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,e),r,n,i,s,o,!0).forEach(g=>{h.push(g)});return h};m.prototype._eval=function(t,e,r,n,i,s){this.currSandbox._$_parentProperty=s,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;let o=t.includes("@path");o&&(this.currSandbox._$_path=m.toPathString(n.concat([r])));let a="script:"+t;if(!m.cache[a]){let l=t.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")),m.cache[a]=new this.vm.Script(l)}try{return m.cache[a].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+t)}};m.cache={};m.toPathString=function(t){let e=t,r=e.length,n="$";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(e[i])||(n+=/^[0-9*]+$/u.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};m.toPointer=function(t){let e=t,r=e.length,n="";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(e[i])||(n+="/"+e[i].toString().replace(/~/gu,"~0").replace(/\//gu,"~1"));return n};m.toPathArray=function(t){let{cache:e}=m;if(e[t])return e[t].concat();let r=[],i=t.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 e[t]=i,e[t].concat()};m.prototype.vm=Pe;function fe(t,e){try{return m({path:e,json:t})}catch(r){return[]}}function P(t,e,r=!0){let n=fe(t,e)||[];return r?n.flat(1/0):n}function F(t,e,r=!1,n=t,i=!0){var s=e;let o=Object.keys(t).sort((l,c)=>c.length-l.length);for(let l of o)if(e.startsWith(l)){if(l==e){if(r)return t[l];continue}s=e.substring(l.length+1),n=t[l];break}var a=P(n,s,i);return a.length==0&&(a=[s.replace(/^.*?\./,"_."),s.replace(/^.*?\./,""),s.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),s.replace(/^.*?\.\$([\.\[])/,"_$1"),s.replace(/^.*?\.\$([\.\[])/,"$$$1"),s.replace(/^[^.]+$/,"_")].filter((l,c,d)=>d.indexOf(l)===c).reduce((l,c)=>l.length>0?l:P(n,c,i),[])),r?a[0]:a}function X(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${T(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):T(t)}function T(t){var e;if(Array.isArray(t))return t.map(T).join(`
|
|
2
|
-
`).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return X(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,s)=>X(i,s.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[s.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return X(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var C=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new C(i)},createDocumentFragment(){return new C(null,11)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return Z(this.childNodes)}set innerHTML(e){this.childNodes=ee(String(e!=null?e:""))}get outerHTML(){return Z([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(pe(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=s=>{for(let o of r)if(pe(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(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let s=i+e;s>=0&&s<n.length;s+=e){let o=n[s];if(!r||o.nodeType===1)return o}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,1),e.parentNode=void 0,e}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(e=!1){let r=new C(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function pe(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(e.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(e.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=e.getAttribute(s);if(typeof o=="undefined"){if(a===void 0)return!1}else if(a!==o)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function ee(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),s=t.match(/^<\/([\w-]+)>/);if(i){let o=i[1].toLowerCase(),l=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(d=>{let[p,h,,u]=d.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:Le(u||"")}}))||[],c=new C(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);["img","input","br"].includes(o)||n.push(c),t=t.slice(i[0].length)}else if(s)n.pop(),t=t.slice(s[0].length);else{let o=t.indexOf("<"),a=t.slice(0,o!==-1?o:void 0),l=new C("#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);t=t.slice(a.length)}}return r}function Me(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Le(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Z(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:o,value:a})=>` ${o}="${Me(String(a))}"`).join(""),s=Z(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function ke(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&U(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&je(o,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function je(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];U(i,i.getAttribute("data-embed-src"))}if(e)return ke(t)}function U(t,e){for(var r=t;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")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let s=r.ownerDocument.createElement("script");s.setAttribute("type","module"),s.setAttribute("src",e),r.appendChild(s);break}}var re={};j(re,{adjustNumbers:()=>We,cleanCollectionBit:()=>I,getHumanizedLabel:()=>He,getLastPathBit:()=>Be,getQualifier:()=>Ie,normalizeCollectionScope:()=>te,parseLimit:()=>Fe,parseRange:()=>Ue});var Fe=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},Ue=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[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},Ie=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function I(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function te(t){return I(t)+".*"}function We(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+e)))}function He(t,e=2){var r=I(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-e).join(" ")}function Be(t){return I(t).split(".").pop()}var Je=["January","February","March","April","May","June","July","August","September","October","November","December"],me=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=Je[t.getMonth()],n=t.getDate();return`${r} ${n}, ${e}`},ye=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function ve(t){let e=t.getAttribute("data-path-scope");for(var r=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==e&&r++;return r}function ze(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=ve(t);if(i!=0)return;let s=t.parentNode;if(s!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var o=i+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(o++,a=l);for(var c=o;c<e;c++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,e);c<o;c++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function N(t,e,r,n){var i,s,o;if(!t)return;var a=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=T(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var l=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let y=Array.from(t.children).find(A=>A.localName=="picture")||t;a=t.localName=="img"?t:y.querySelector("img, video")}else if(e=="data-path-href")a=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")l="innerHTML";else if(e=="data-embed-src")U(t,r);else if(e=="data-path-attributes"){if(!Array.isArray(r)){let y=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var d=r[c];N(t,c,typeof d=="object"&&d?JSON.stringify(d):d,n)}for(var p=0;p<y.length;p++)(r==null||!(y[p]in r))&&N(t,y[p],null,n);N(t,"data-attributes-keys",Object.keys(r||{}).join(","))}if(t.tagName=="FEAAS-EXTERNAL"){let y=String(t.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";N(t,"datasources",JSON.stringify({[y]:r}))}return}if(typeof r=="boolean"&&(r=r?"":null),!a)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var u=String((o=(s=t.getAttribute("data-path-placeholder")||a[l])!==null&&s!==void 0?s:a.getAttribute(l))!==null&&o!==void 0?o:"");l=="innerHTML"?a.innerHTML=u:u?a.setAttribute(l,u):a.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var f=String(r),g=a;g.parentElement&&g.localName.match(/^(a|var|strong|em|i|b)$/);)g=g.parentElement;g.localName.match(/p|h\d|button|time|li/)&&(f=f.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(g.getAttribute("class")).includes("-inline--time")&&ye(f)&&(f=me(new Date(f))),a.innerHTML!=f&&(a.innerHTML=f)}else a.getAttribute(l)!=r&&a.setAttribute(l,r);else a.removeAttribute(l)}var ge=["data-attributes-keys","data-path-attributes","data-path-scope"];function w(t,e,r,n){var i,s,o;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let d=a.getAttribute("data-path-scope");if(d){let h=ve(a),u=F(e,d,!1);h==0&&ze(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,u))===!1?1:u.length,r),e={...e,[te(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>ge.indexOf(h.name)-ge.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"&&N(a,h,F(e,u,!0,void 0,a.tagName!="FEAAS-EXTERNAL"),r),h=="data-embed-src"&&N(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)be(c)&&w(c,e,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,e),a}function be(t){return t.nodeType==1}function $(t,e,r,n){var i;let s=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=s,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,l;l=t.childNodes[a++];)be(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return w(t,r,n)}function Ve(t,e,r,n=!1){var i;let s=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,t,e))||t;if(typeof document=="undefined"||n){let o=ee(s);return w(o[0],e,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,w(o,e,r),o.innerHTML}}var Ae=["initial","check","updated"],W={};function _t(){W={}}async function H(t,e,r,n,i=W){return O({url:t,options:e,validator:r,callback:n,cache:i}).then(B).then(s=>s.response)}async function O({url:t,options:e,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=qe(t);if(Ae.indexOf(a.phase)>=Ae.indexOf(s))var l=a[s];else a.phase=s}let c=await(l||fetch(t,e));if(!l&&a&&(c.ok?a[s].resolve(c):a[s].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let d=new Date(c.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(c,d))===!1)throw new ie("Response is not valid");return await(n==null?void 0:n(c,s,d)),{url:t,options:e,isCached:d,response:c,validator:r,callback:n,cache:i}}function qe(t,e=!1){let r=String(t).replace("?head","");var n=W[r];return!n&&!e&&(n=W[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var ie=class extends Error{};async function B(t){let{url:e,isCached:r,options:n,validator:i,response:s,cache:o}=t;if(r){let{response:a}=await O({url:e+(e.toString().includes("?")?"&":"?")+"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 se(t)}return t}async function se(t){return O({...t,options:{...t.options,cache:"reload"}},"updated")}var E="https://feaas.blob.core.windows.net";function J(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,s,o]=e;return{cdn:r,library:n,component:i,version:s,revision:o}}}function Ot(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=E?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Dt(t){return`${t.cdn&&t.cdn!=E?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function M(t){let e=t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,n,i]=e;return{cdn:r,library:n,revision:i}}else{let s=J(t);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 we(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...J(t.src)}),`${t.cdn||t.hostname||E}/components/${t.library}/${t.component}/${t.version||"responsive"}/${t.revision||"published"}.html`}function z(t){if(typeof t=="string"&&(t={src:t}),"src"in t){if(String(t.src).includes("v1/files/components/styles"))return t.src;t={...M(t.src)}}return`${t.cdn||t.hostname||E}/styles/${t.library}/${t.revision=="staged"?"staged":t.revision=="saved"?"saved":"published"}.css`}async function L(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),s=await Promise.all([t.instance&&O({options:{headers:{Accept:"text/html"},credentials:"omit"},url:we({...t,version:t.instance}),validator:n}).catch(a=>a),O({url:we(t),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:B({...o,callback:i}).catch(a=>{if(s[0]==o&&(se({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),B({...s[1],callback:i});throw a})}async function Pt(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await L(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function oe(t,e){return H(z(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>e(i,n)))}function kt(t,e){return Ge(t,e||(e=document.createElement("style"))),e}function Ge(t,e){return e||(e=document.createElement("style")),oe(t,(r,n)=>{e.textContent=r}).then(()=>e)}var Ke=new WeakSet;function ae(t,e){var r,n=Ye(t);if(n){if(Ke.has(n))return Promise.resolve(n);t=n.getAttribute("data-href")||n.getAttribute("href")}return oe(t,(i,s)=>{s=="initial"&&n||(r||(r=!n||n.tagName=="LINK"?Xe(t):n),r.textContent=i),e==null||e(i,s)}).then(()=>r||n)}function Se(t){return new Promise((e,r)=>{ae(t,e).catch(r)})}function Ye(t){let e=z(t),{library:r}=M(e),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${e}"],
|
|
3
|
-
link[rel="stylesheet"][href="${
|
|
1
|
+
var Ot=Object.defineProperty;var j=(e,t)=>{for(var r in t)Ot(e,r,{get:t[r],enumerable:!0})};import{createRoot as Dt}from"react-dom/client";function S(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 Pt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Pt{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),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.dispatchEventIndirectly(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)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}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;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}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.dispatchEventIndirectly(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.dispatchEventIndirectly(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;if(!this.connected)return;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.getAttribute("hydrate")=="false"&&this.firstElementChild||(!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):Dt(this.getReactRootElement()).render(this.getReactElement()):this.forceUpdateReact&&this.connected?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.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&&i.connected).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 i=this.isJSONAttribute(r),s=this.props[r],o=i?JSON.stringify(s):String(s),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(d)):d}catch(p){var n=null}s==null||o===l?this.removeAttribute(c):(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||i)&&n!=o&&this.setAttribute(c,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}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 _=class extends x{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)}},G=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(s=>s+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};G.observedAttributes=["counter"];var nt={};j(nt,{renderDOMContent:()=>$,renderDOMElement:()=>w,renderHTMLContent:()=>qt,setDOMAttribute:()=>N});var Q={};j(Q,{JSONPath:()=>m,queryObject:()=>P,queryObjectRaw:()=>ft,queryScopes:()=>F,serializeCH1RichText:()=>T});import Mt from"vm";var{hasOwnProperty:b}=Object.prototype;function R(e,t){return e=e.slice(),e.push(t),e}function K(e,t){return t=t.slice(),t.unshift(e),t}var Y=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 m(e,t,r,n,i){if(!(this instanceof m))try{return new m(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=b.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 Y(a);return a}}m.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(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=b.call(e,"flatten")?e.flatten:o,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,a=b.call(e,"wrap")?e.wrap:a,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=b.call(e,"parent")?e.parent:i,s=b.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(i=i||null,s=s||null,Array.isArray(e)&&(e=m.toPathString(e)),!e&&e!==""||!t)return;let l=m.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};m.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case"all":{let r=Array.isArray(e.path)?e.path:m.toPathArray(e.path);return e.pointer=m.toPointer(r),e.path=typeof e.path=="string"?e.path:m.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return m.toPathString(e[t]);case"pointer":return m.toPointer(e.path);default:throw new TypeError("Unknown result type")}};m.prototype._handleCallback=function(e,t,r){if(t){let n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:m.toPathString(e.path),t(n,r,e)}};m.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(f=>{p.push(f)}):p.push(u)}if((typeof c!="string"||a)&&t&&b.call(t,c))h(this._trace(d,t[c],R(r,c),t,c,s,o));else if(c==="*")this._walk(t,u=>{h(this._trace(d,t[u],R(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],R(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:R(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,f=>{this._eval(u,t[f],f,r,n,i)&&h(this._trace(d,t[f],R(r,f),t,f,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,f=c.slice(1,-2);switch(f){case"scalar":(!t||!["object","function"].includes(typeof t))&&(u=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===f&&(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===f&&(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 "+f)}if(u)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&t&&b.call(t,c.slice(1))){let u=c.slice(1);h(this._trace(d,t[u],R(r,u),t,u,s,o,!0))}else if(c.includes(",")){let u=c.split(",");for(let f of u)h(this._trace(K(f,d),t,r,n,i,s,!0))}else!a&&t&&b.call(t,c)&&h(this._trace(d,t[c],R(r,c),t,c,s,o,!0))}if(this._hasParentSelector)for(let u=0;u<p.length;u++){let f=p[u];if(f&&f.isParentSelector){let g=this._trace(f.expr,t,f.path,n,i,s,o);if(Array.isArray(g)){p[u]=g[0];let y=g.length;for(let A=1;A<y;A++)u++,p.splice(u,0,g[A])}else p[u]=g}}return p};m.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)})};m.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(g=>{h.push(g)});return h};m.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=m.toPathString(n.concat([r])));let a="script:"+e;if(!m.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")),m.cache[a]=new this.vm.Script(l)}try{return m.cache[a].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+e)}};m.cache={};m.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};m.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};m.toPathArray=function(e){let{cache:t}=m;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()};m.prototype.vm=Mt;function ft(e,t){try{return m({path:t,json:e})}catch(r){return[]}}function P(e,t,r=!0){let n=ft(e,t)||[];return r?n.flat(1/0):n}function F(e,t,r=!1,n=e,i=!0){var s=t;let o=Object.keys(e).sort((l,c)=>c.length-l.length);for(let l of o)if(t.startsWith(l)){if(l==t){if(r)return e[l];continue}s=t.substring(l.length+1),n=e[l];break}var a=P(n,s,i);return a.length==0&&(a=[s.replace(/^.*?\./,"_."),s.replace(/^.*?\./,""),s.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),s.replace(/^.*?\.\$([\.\[])/,"_$1"),s.replace(/^.*?\.\$([\.\[])/,"$$$1"),s.replace(/^[^.]+$/,"_")].filter((l,c,d)=>d.indexOf(l)===c).reduce((l,c)=>l.length>0?l:P(n,c,i),[])),r?a[0]:a}function X(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${T(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):T(e)}function T(e){var t;if(Array.isArray(e))return e.map(T).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 X(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,s)=>X(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 X(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var C=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new C(i)},createDocumentFragment(){return new C(null,11)}},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 Z(this.childNodes)}set innerHTML(t){this.childNodes=tt(String(t!=null?t:""))}get outerHTML(){return Z([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(pt(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(pt(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 C(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 pt(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 tt(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),s=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1].toLowerCase(),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:kt(u||"")}}))||[],c=new C(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);["img","input","br"].includes(o)||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 C("#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 Lt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function kt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Z(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:a})=>` ${o}="${Lt(String(a))}"`).join(""),s=Z(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function jt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&U(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&Ft(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function Ft(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];U(i,i.getAttribute("data-embed-src"))}if(t)return jt(e)}function U(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 rt={};j(rt,{adjustNumbers:()=>Ht,cleanCollectionBit:()=>I,getHumanizedLabel:()=>Bt,getLastPathBit:()=>Jt,getQualifier:()=>Wt,normalizeCollectionScope:()=>et,parseLimit:()=>Ut,parseRange:()=>It});var Ut=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},It=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},Wt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function I(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function et(e){return I(e)+".*"}function Ht(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function Bt(e,t=2){var r=I(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function Jt(e){return I(e).split(".").pop()}var zt=["January","February","March","April","May","June","July","August","September","October","November","December"],mt=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=zt[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},yt=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function vt(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 Vt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=vt(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 N(e,t,r,n){var i,s,o;if(!e)return;var a=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=T(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var l=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let y=Array.from(e.children).find(A=>A.localName=="picture")||e;a=e.localName=="img"?e:y.querySelector("img, video")}else if(t=="data-path-href")a=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")l="innerHTML";else if(t=="data-embed-src")U(e,r);else if(t=="data-path-attributes"){if(!Array.isArray(r)){let y=((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 d=r[c];N(e,c,typeof d=="object"&&d?JSON.stringify(d):d,n)}for(var p=0;p<y.length;p++)(r==null||!(y[p]in r))&&N(e,y[p],null,n);N(e,"data-attributes-keys",Object.keys(r||{}).join(","))}if(e.tagName=="FEAAS-EXTERNAL"){let y=String(e.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";N(e,"datasources",JSON.stringify({[y]:r}))}return}if(typeof r=="boolean"&&(r=r?"":null),!a)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var u=String((o=(s=e.getAttribute("data-path-placeholder")||a[l])!==null&&s!==void 0?s:a.getAttribute(l))!==null&&o!==void 0?o:"");l=="innerHTML"?a.innerHTML=u:u?a.setAttribute(l,u):a.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var f=String(r),g=a;g.parentElement&&g.localName.match(/^(a|var|strong|em|i|b)$/);)g=g.parentElement;g.localName.match(/p|h\d|button|time|li/)&&(f=f.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(g.getAttribute("class")).includes("-inline--time")&&yt(f)&&(f=mt(new Date(f))),a.innerHTML!=f&&(a.innerHTML=f)}else a.getAttribute(l)!=r&&a.setAttribute(l,r);else a.removeAttribute(l)}var gt=["data-attributes-keys","data-path-attributes","data-path-scope"];function w(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=vt(a),u=F(t,d,!1);h==0&&Vt(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,[et(d)]:u[h]}}let p=Array.prototype.slice.call(a.attributes).sort((h,u)=>gt.indexOf(h.name)-gt.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"&&N(a,h,F(t,u,!0,void 0,a.tagName!="FEAAS-EXTERNAL"),r),h=="data-embed-src"&&N(a,h,a.getAttribute(h),r)}}for(var l=0,c;c=a.childNodes[l++];)bt(c)&&w(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,t),a}function bt(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++];)bt(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return w(e,r,n)}function qt(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=tt(s);return w(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,w(o,t,r),o.innerHTML}}var At=["initial","check","updated"],W={};function $e(){W={}}async function H(e,t,r,n,i=W){return O({url:e,options:t,validator:r,callback:n,cache:i}).then(B).then(s=>s.response)}async function O({url:e,options:t,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=Gt(e);if(At.indexOf(a.phase)>=At.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");let d=new Date(c.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(c,d))===!1)throw new it("Response is not valid");return await(n==null?void 0:n(c,s,d)),{url:e,options:t,isCached:d,response:c,validator:r,callback:n,cache:i}}function Gt(e,t=!1){let r=String(e).replace("?head","");var n=W[r];return!n&&!t&&(n=W[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var it=class extends Error{};async function B(e){let{url:t,isCached:r,options:n,validator:i,response:s,cache:o}=e;if(r){let{response:a}=await O({url:t+(t.toString().includes("?")?"&":"?")+"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 st(e)}return e}async function st(e){return O({...e,options:{...e.options,cache:"reload"}},"updated")}var E="https://feaas.blob.core.windows.net";function J(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 Pe(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=E?`${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 Me(e){return`${e.cdn&&e.cdn!=E?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function M(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=J(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 wt(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...J(e.src)}),`${e.cdn||e.hostname||E}/components/${e.library}/${e.component}/${e.version||"responsive"}/${e.revision||"published"}.html`}function z(e){if(typeof e=="string"&&(e={src:e}),"src"in e){if(String(e.src).includes("v1/files/components/styles"))return e.src;e={...M(e.src)}}return`${e.cdn||e.hostname||E}/styles/${e.library}/${e.revision=="staged"?"staged":e.revision=="saved"?"saved":"published"}.css`}async function L(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&&O({options:{headers:{Accept:"text/html"},credentials:"omit"},url:wt({...e,version:e.instance}),validator:n}).catch(a=>a),O({url:wt(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:B({...o,callback:i}).catch(a=>{if(s[0]==o&&(st({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),B({...s[1],callback:i});throw a})}async function Le(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await L(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function ot(e,t){return H(z(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 Fe(e,t){return Kt(e,t||(t=document.createElement("style"))),t}function Kt(e,t){return t||(t=document.createElement("style")),ot(e,(r,n)=>{t.textContent=r}).then(()=>t)}var Yt=new WeakSet;function at(e,t){var r,n=Xt(e);if(n){if(Yt.has(n))return Promise.resolve(n);e=n.getAttribute("data-href")||n.getAttribute("href")}return ot(e,(i,s)=>{s=="initial"&&n||(r||(r=!n||n.tagName=="LINK"?Qt(e):n),r.textContent=i),t==null||t(i,s)}).then(()=>r||n)}function St(e){return new Promise((t,r)=>{at(e,t).catch(r)})}function Xt(e){let t=z(e),{library:r}=M(t),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${t}"],
|
|
3
|
+
link[rel="stylesheet"][href="${t}"],
|
|
4
4
|
style[data-href*="${n}"],
|
|
5
|
-
link[rel="stylesheet"][href*="${n}"]`)}function
|
|
5
|
+
link[rel="stylesheet"][href*="${n}"]`)}function Qt(e){let t=z(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function He(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return w(n,t),r}function xt(e,t){return Zt(e,t||(t=document.createElement("div"))),t}async function Zt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?w(t,e.data,e):"template"in e?$(t,e.template,e.data,e):L(e,r=>$(t,r,e.data,e)).then(()=>t)}import{customizeDataSettings as te}from"@sitecore/byoc";function ee(e){let{params:t,method:r,headers:n,body:i,url:s}=v(e);var o={url:s},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(o.headers=a),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(t).length>0&&(o={...o,params:t}),o}var D=e=>{if(!e||typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function Et(e){let{url:t,headers:r,params:n,method:i,body:s}=v(e),o,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(o=JSON.stringify(s)),a==="multipart/form-data"&&(o=Object.keys(s).reduce((c,d)=>(c.append(d,s[d]),c),new FormData)),a==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(s)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:o,method:i}]}function v(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var lt=async(e,t)=>{let r=te(t,e);if(r instanceof Promise)return r;let n=e;r&&(n=v(r));try{let[i,s]=Et(n),a=await(await v.fetchImplementation(i,{...s,method:s.method.toLowerCase()})).json();return n.jsonpath&&n.jsonpath!="$"?P(a,n.jsonpath):a}catch(i){return{}}};async function Ct(e){if(!e)return e;if(D(e))return lt(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>D(e[n])?lt(e[n],n):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:D(e[i])?r.shift():e[i]}),{})}function re(e){return e?D(e)||Object.values(e).some(D):!1}v.clean=ee;v.toFetchArguments=Et;v.fetchOne=lt;v.fetch=Ct;v.isDataSettings=D;v.hasDataSettings=re;v.fetchImplementation=(...e)=>fetch(...e);function ne(e){var t,r,n,i,s,o,a,l;let c,d=e.getAttribute("src");if(d){let k=J(d);if(!k)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:h,component:u,version:f,revision:g}=k}let y=e.getAttribute("data");if(y!=null&&y!="")try{c=typeof y=="string"?JSON.parse(y):{}}catch(k){console.error(k)}let A=e.getAttribute("fetch");return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:E,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:f)!==null&&o!==void 0?o:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:g)!==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"),fetch:A=="false"||A==null&&e.hasAttribute("fetch")?[]:A==null||A=="true"?["data","template","stylesheet"]:A.split(/(\s+|\-)+/g).filter(Boolean)}}var V=class extends x{setData(t){this.set({data:t})}getProps(){return ne(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0,this.alreadyRendered&&this.connected&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(t,r,n),t=="data"&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!v.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await v.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(r=>this.readyData=r,r=>this.onError(r)),this.defaultProps={cdn:E,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=r=>{this.payload=r,this.advance()};let t=this.getAttribute("data");this.getAttribute("data")||this.whenDataReady.resolve({}),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(){var t;if(this.getOriginal())return;let r=()=>{this.payload!=null&&(n||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var n=St({...this.props}).then(()=>{n=null,r()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var i=L(this.props,s=>{this.payload=s,this.needsRefresh=!0,r()})}else this.payload=(t=this.props.template)!==null&&t!==void 0?t:this.innerHTML;return Promise.all([n,this.whenDataReady.then(()=>r()),i]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh))if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)w(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;$(this,this.payload,this.readyData)}}};V.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet","fetch"];V.register("feaas-component");function ie(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 q=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return ie(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=`
|
|
6
6
|
#loader {
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: 0;
|
|
@@ -66,10 +66,10 @@ var Oe=Object.defineProperty;var j=(t,e)=>{for(var r in e)Oe(t,r,{get:e[r],enume
|
|
|
66
66
|
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
67
67
|
></circle>
|
|
68
68
|
</svg>
|
|
69
|
-
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};q.observedAttributes=["hidden","opacity"];q.register("feaas-loader");function
|
|
69
|
+
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};q.observedAttributes=["hidden","opacity"];q.register("feaas-loader");function se(e){var t,r,n,i;let s=e.getAttribute("src");if(s)var{cdn:o,library:a,revision:l}=M(s);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==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:E}}var ct=class extends x{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return se(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return at(this.props,this.onLoad)}};ct.register("feaas-stylesheet");var ut={};j(ut,{convertBase64toBlob:()=>Rt,generate:()=>Tt,get:()=>oe,getVersionForThumbnail:()=>Nt,load:()=>_t,responseToImage:()=>dt,upload:()=>$t});var Rt=e=>fetch(e).then(t=>t.blob()),dt=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 Nt(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function oe(e,t,r){try{if(!e.isNew)return await _t(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&&Rt(n.src).then(i=>$t(e,t,i)),n}async function _t(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,s=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 o;return await H(n,{},(a,l)=>{let c=Math.abs(Number(new Date(a.headers.get("x-ms-meta-componentRenderedAt")))-Number(s))<2e3;return l&&!c&&dt(a).then(d=>{o=d,r(d,l)}),c},(a,l,c)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),dt(a).then(d=>{o=d,r(d,c)})},null),o}async function Tt(e,t,r){let n=t||(e.isNew?null:await Nt(e));if(!n||n.isViewEmpty())return null;let i=r||e.library.stylesheets.first,{datasources:s}=e.sdk;return await ae(n.classList,i.getBreakpointForWidth(800,n.getBreakpoints()),n.view,s.reduce((a,l)=>Object.assign(a,{[l.id]:l.sample}),{}),i.css,e.sdk)}function ae(e,t,r,n,i,s){let o=document.createElement("iframe");return o.style.position="absolute",o.style.top="-2000px",o.style.left="-2000px",o.style.width=t.props.minWidth+"px",o.style.height="720px",o.style.zIndex="100011",document.body.appendChild(o),new Promise((a,l)=>{let c=document.createElement("script");c.onerror=l,c.src=s.frontend+"/assets/html2canvas.js",c.onload=()=>{var u;(((u=o.contentWindow.document.fonts)===null||u===void 0?void 0:u.ready)||Promise.resolve()).then(function(){return o.contentWindow.html2canvas(h,{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,h.offsetHeight)),windowWidth:t.props.minWidth||t.props.maxWidth+"px",windowHeight:1e3,proxy:s.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(f=>{let g=f.toDataURL("image/jpeg",.6);o.parentElement.removeChild(o);let y=new Image;y.onload=()=>{a(y)},y.onerror=l,y.src=g})})},o.contentWindow.document.head.appendChild(c);let d=o.contentWindow.document.createElement("style");d.textContent=`
|
|
70
70
|
${i}
|
|
71
71
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
72
72
|
`;let p=o.contentWindow.document.createElement("style");p.textContent=`
|
|
73
73
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
74
|
-
`,o.contentWindow.document.head.appendChild(d),o.contentWindow.document.head.appendChild(p);let h=
|
|
74
|
+
`,o.contentWindow.document.head.appendChild(d),o.contentWindow.document.head.appendChild(p);let h=xt({template:r,data:n});h.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),o.contentWindow.document.body.appendChild(h)})}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(s){e.sdk.log("FEAAS: Thumbnail failed to upload",n,s)}return n}import{registerDatasource as Rr,registerComponent as Nr,getComponent as _r,customizeDataSettings as Tr}from"@sitecore/byoc";var ht;typeof window!="undefined"&&(window.FEAASReactElement=_,(ht=window.FEAASLoading)!==null&&ht!==void 0||(window.FEAASLoading=Promise.resolve()));export{V as Component,ne as ComponentProps,S as ControlledPromise,E as DEFAULT_CDN_URL,nt as DOM,rt as DataPath,Q as DataScope,v as DataSettings,x as Element,V as FEAASComponent,ne as FEAASComponentsProps,x as FEAASElement,q as FEAASLoader,ie as FEAASLoaderProps,ct as FEAASStylesheet,se as FEAASStylesheetProps,it as InvalidResponse,m as JSONPath,q as Loader,G as MyComponent,ct as Stylesheet,ut as Thumbnail,Pt as WebComponent,Ht as adjustNumbers,Ft as autoloadScripts,I as cleanCollectionBit,$e as clearFetchCache,Qt as createStylesheet,Tr as customizeDataSettings,H as fetchAndRevalidate,L as fetchAndRevalidateComponent,ot as fetchAndRevalidateStylesheet,st as fetchBypassingCache,W as fetchCache,Le as fetchComponent,Ct as fetchData,B as fetchToValidateCache,O as fetchWithCacheAwareness,Xt as findStylesheet,_r as getComponent,Pe as getComponentSource,wt as getComponentURL,Gt as getFetchCache,Bt as getHumanizedLabel,Jt as getLastPathBit,Wt as getQualifier,Me as getStylesheetSource,z as getStylesheetURL,U as loadScript,at as loadStylesheet,St as loadStylesheetAllowStale,et as normalizeCollectionScope,jt as observeDOMElement,J as parseComponentSource,Ut as parseLimit,It as parseRange,M as parseStylesheetSource,P as queryObject,ft as queryObjectRaw,F as queryScopes,Nr as registerComponent,Rr as registerDatasource,xt as renderComponent,He as renderComponentElement,Zt as renderComponentPromise,$ as renderDOMContent,w as renderDOMElement,qt as renderHTMLContent,Fe as renderStylesheet,Kt as renderStylesheetPromise,T as serializeCH1RichText,N as setDOMAttribute};
|
|
75
75
|
//# sourceMappingURL=headless.esm.js.map
|