@sitecore-feaas/clientside 0.1.21 → 0.1.22

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.
@@ -1,6 +1,6 @@
1
- var J=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var St=(t,e)=>{for(var r in e)J(t,r,{get:e[r],enumerable:!0})},xt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Et(e))!Ft.call(t,i)&&i!==r&&J(t,i,{get:()=>e[i],enumerable:!(n=_t(e,i))||n.enumerable});return t};var Rt=t=>xt(J({},"__esModule",{value:!0}),t);var Kt={};St(Kt,{Base:()=>m,Component:()=>T,FEAASBase:()=>m,FEAASComponent:()=>T,FEAASComponentsProps:()=>yt,FEAASLoader:()=>N,FEAASLoaderProps:()=>vt,FEAASStylesheet:()=>W,FEAASStylesheetProps:()=>bt,JSONPath:()=>d,Loader:()=>N,Stylesheet:()=>W,autoloadScripts:()=>ft,cleanCollectionBit:()=>ut,fetchAndRevalidate:()=>Y,fetchAndValidate:()=>E,invalidateRequest:()=>B,loadScript:()=>H,normalizeCollectionScope:()=>ct,observeDOMElement:()=>ht,queryScopes:()=>X,refetchAndValidate:()=>k,renderComponent:()=>Jt,renderComponentElement:()=>Wt,renderComponentPromise:()=>pt,renderDOMContent:()=>P,renderDOMElement:()=>F,renderStylesheet:()=>zt,renderStylesheetPromise:()=>dt,serializeCH1RichText:()=>$,setDOMAttribute:()=>S});module.exports=Rt(Kt);var Ct=typeof HTMLElement=="undefined"?class{}:HTMLElement,m=class extends Ct{constructor(){super(),this.connected=!1,this.refs={},this.descendants=[],this.onLoad=e=>{e!=null&&(this.payload=e,this.update())},this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this)}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.initialize()}initialize(){let e=this.getParent();if(!(e&&!e.connected)&&!this.connected)return this.connected=!0,console.log("FEAAS: Connected",this.tagName,this),this.dispatchEvent(new Event("feaasConnected",{bubbles:!0,composed:!0})),this.getElements().map(r=>r.initialize()),this.set(),!0}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}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)}disconnectedCallback(){this.connected&&(console.log("FEAAS: Disconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasConnected":r!=this&&this.nestedCallback(r);break;case"feaasDisconnected":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(console.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),console.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 o=e.refs.parent;o;o=o.refs.parent)o.render&&((n=e.refs).parentReact||(n.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}async reify(){this.payload!==void 0?this.update():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))}load(){return Promise.resolve(null)}update(e=!1){var r,n,i;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:o,ReactDOM:a,ReactDOMClient:s}=this.payload||{};if(!o)throw new Error(`${this.tagName}: React is not present in payload`);if(!a)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(o.createElement(this.getReactWrapper(),{z:"root"}))):this.forceUpdateReact?(r=this.forceUpdateReact)===null||r===void 0||r.call(this):(i=(n=this.refs.topReact).forceUpdateReact)===null||i===void 0||i.call(n)}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{},n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+o,slot:i.getAttribute("slot")}));return this.render({...this.props,children:n},this.payload)}getReactWrapper(e=this,r=e.tagName){let n=e.reactWrapper||(e.reactWrapper=i=>{if(e.render){let{React:o,ReactDOM:a}=e.payload||{},[s,u]=o.useReducer(h=>h+1,0);return e.forceUpdateReact=u,a.createPortal(o.createElement(o.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()});return Object.assign(n,{displayName:r}),n}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRootElement(){return this.getRoot()}set(e){this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r];this.props[r]==null?this.removeAttribute(r):(typeof n=="string"||typeof n=="number")&&this.getAttribute(r)!=String(n)&&this.setAttribute(r,String(n))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}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){typeof window!="undefined"&&!window.customElements.get(e)&&window.customElements.define(e,this)}};var R=class extends m{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"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom/client")]).then(([e,r,n])=>({React:e,ReactDOM:r,ReactDOMClient:n}))}render({},{React:e}){return e.createElement(e.Fragment,null)}};function g(t){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nt(t,e,r){return e&&et(t.prototype,e),r&&et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Dt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},O(t,e)}function it(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(t,e,r){return it()?C=Reflect.construct.bind():C=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),h=new u;return a&&O(h,a.prototype),h},C.apply(null,arguments)}function Ot(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K(t){var e=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!Ot(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return C(n,arguments,D(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),O(i,n)},K(t)}function kt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kt(t)}function $t(t){var e=it();return function(){var n=D(t),i;if(e){var o=D(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pt(this,i)}}function Tt(t){return Nt(t)||Mt(t)||ot(t)||Lt()}function Nt(t){if(Array.isArray(t))return G(t)}function Mt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ot(t,e){if(t){if(typeof t=="string")return G(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(t,e)}}function G(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var J=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var St=(t,e)=>{for(var r in e)J(t,r,{get:e[r],enumerable:!0})},xt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _t(e))!Ft.call(t,i)&&i!==r&&J(t,i,{get:()=>e[i],enumerable:!(n=Et(e,i))||n.enumerable});return t};var Rt=t=>xt(J({},"__esModule",{value:!0}),t);var Kt={};St(Kt,{Base:()=>m,Component:()=>T,FEAASBase:()=>m,FEAASComponent:()=>T,FEAASComponentsProps:()=>yt,FEAASLoader:()=>N,FEAASLoaderProps:()=>vt,FEAASStylesheet:()=>W,FEAASStylesheetProps:()=>bt,JSONPath:()=>d,Loader:()=>N,Stylesheet:()=>W,autoloadScripts:()=>ft,cleanCollectionBit:()=>ut,fetchAndRevalidate:()=>Y,fetchAndValidate:()=>_,invalidateRequest:()=>B,loadScript:()=>H,normalizeCollectionScope:()=>ct,observeDOMElement:()=>ht,queryScopes:()=>X,refetchAndValidate:()=>k,renderComponent:()=>Jt,renderComponentElement:()=>Wt,renderComponentPromise:()=>pt,renderDOMContent:()=>P,renderDOMElement:()=>F,renderStylesheet:()=>zt,renderStylesheetPromise:()=>dt,serializeCH1RichText:()=>$,setDOMAttribute:()=>S});module.exports=Rt(Kt);var Ct=typeof HTMLElement=="undefined"?class{}:HTMLElement,m=class extends Ct{constructor(){super(),this.connected=!1,this.refs={},this.descendants=[],this.onLoad=e=>{e!=null&&(this.payload=e,this.update())},this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this)}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.initialize()}initialize(){let e=this.getParent();if(!(e&&!e.connected)&&!this.connected)return this.connected=!0,console.log("FEAAS: Connected",this.tagName,this),this.dispatchEvent(new Event("feaasConnected",{bubbles:!0,composed:!0})),this.getElements().map(r=>r.initialize()),this.set(),!0}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}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)}disconnectedCallback(){this.connected&&(console.log("FEAAS: Disconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasConnected":r!=this&&this.nestedCallback(r);break;case"feaasDisconnected":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(console.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),console.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 o=e.refs.parent;o;o=o.refs.parent)o.render&&((n=e.refs).parentReact||(n.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}async reify(){this.payload!==void 0?this.update():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))}load(){return Promise.resolve(null)}update(e=!1){var r,n,i;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:o,ReactDOM:a,ReactDOMClient:s}=this.payload||{};if(!o)throw new Error(`${this.tagName}: React is not present in payload`);if(!a)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(o.createElement(this.getReactWrapper()))):a.render(o.createElement(this.getReactWrapper()),this.getReactRootElement()):this.forceUpdateReact?(r=this.forceUpdateReact)===null||r===void 0||r.call(this):(i=(n=this.refs.topReact).forceUpdateReact)===null||i===void 0||i.call(n)}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{},n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+o,slot:i.getAttribute("slot")}));return this.render({...this.props,children:n},this.payload)}getReactWrapper(e=this,r=e.tagName){let n=e.reactWrapper||(e.reactWrapper=i=>{if(e.render){let{React:o,ReactDOM:a}=e.payload||{},[s,u]=o.useReducer(h=>h+1,0);return e.forceUpdateReact=u,a.createPortal(o.createElement(o.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()});return Object.assign(n,{displayName:r}),n}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRootElement(){return this.getRoot()}set(e){this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r];this.props[r]==null?this.removeAttribute(r):(typeof n=="string"||typeof n=="number")&&this.getAttribute(r)!=String(n)&&this.setAttribute(r,String(n))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}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){typeof window!="undefined"&&!window.customElements.get(e)&&window.customElements.define(e,this)}};var R=class extends m{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"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom/client")]).then(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}};function g(t){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nt(t,e,r){return e&&et(t.prototype,e),r&&et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Dt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},O(t,e)}function it(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(t,e,r){return it()?C=Reflect.construct.bind():C=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),h=new u;return a&&O(h,a.prototype),h},C.apply(null,arguments)}function Ot(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K(t){var e=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!Ot(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return C(n,arguments,D(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),O(i,n)},K(t)}function kt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kt(t)}function $t(t){var e=it();return function(){var n=D(t),i;if(e){var o=D(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pt(this,i)}}function Tt(t){return Nt(t)||Mt(t)||ot(t)||Lt()}function Nt(t){if(Array.isArray(t))return G(t)}function Mt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ot(t,e){if(t){if(typeof t=="string")return G(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(t,e)}}function G(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ot(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}}}var v=Object.prototype.hasOwnProperty;function _(t,e){return t=t.slice(),t.push(e),t}function V(t,e){return e=e.slice(),e.unshift(t),e}var Bt=function(t){Dt(r,t);var e=$t(r);function r(n){var i;return rt(this,r),i=e.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return nt(r)}(K(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&g(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=v.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){var a={path:o?t.path:e};o?"json"in t&&(a.json=t.json):a.json=r;var s=this.evaluate(a);if(!s||g(s)!=="object")throw new Bt(s);return s}}d.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,u=this.wrap;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&&g(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(!v.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,s=v.call(t,"flatten")?t.flatten:s,this.currResultType=v.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=v.call(t,"sandbox")?t.sandbox:this.currSandbox,u=v.call(t,"wrap")?t.wrap:u,this.currPreventEval=v.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=v.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=v.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=v.call(t,"parent")?t.parent:o,a=v.call(t,"parentProperty")?t.parentProperty:a,t=t.path}if(o=o||null,a=a||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var l=this._trace(c,e,["$"],o,a,r).filter(function(f){return f&&!f.isParentSelector});return l.length?!u&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce(function(f,y){var A=i._getPreferredOutput(y);return s&&Array.isArray(A)?f=f.concat(A):f.push(A),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,o,a,s){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(h,o,"value"),h;var c=t[0],l=t.slice(1),f=[];function y(p){Array.isArray(p)?p.forEach(function(wt){f.push(wt)}):f.push(p)}if((typeof c!="string"||s)&&e&&v.call(e,c))y(this._trace(l,e[c],_(r,c),e,c,o,a));else if(c==="*")this._walk(e,function(p){y(u._trace(l,e[p],_(r,p),e,p,o,!0,!0))});else if(c==="..")y(this._trace(l,e,r,n,i,o,a)),this._walk(e,function(p){g(e[p])==="object"&&y(u._trace(t.slice(),e[p],_(r,p),e,p,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:l,isParentSelector:!0};if(c==="~")return h={path:_(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(h,o,"property"),h;if(c==="$")y(this._trace(l,e,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,l,e,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var A=c.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(p){u._eval(A,e[p],p,r,n,i)&&y(u._trace(l,e[p],_(r,p),e,p,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(V(this._eval(c,e,r[r.length-1],r.slice(0,-1),n,i),l),e,r,n,i,o,a))}else if(c[0]==="@"){var b=!1,M=c.slice(1,-2);switch(M){case"scalar":(!e||!["object","function"].includes(g(e)))&&(b=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===M&&(b=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(b=!0);break;case"number":Number.isFinite(e)&&(b=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(b=!0);break;case"object":e&&g(e)===M&&(b=!0);break;case"array":Array.isArray(e)&&(b=!0);break;case"other":b=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(b=!0);break;default:throw new TypeError("Unknown value type "+M)}if(b)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,o,"value"),h}else if(c[0]==="`"&&e&&v.call(e,c.slice(1))){var q=c.slice(1);y(this._trace(l,e[q],_(r,q),e,q,o,a,!0))}else if(c.includes(",")){var mt=c.split(","),L=jt(mt),tt;try{for(L.s();!(tt=L.n()).done;){var gt=tt.value;y(this._trace(V(gt,l),e,r,n,i,o,!0))}}catch(p){L.e(p)}finally{L.f()}}else!s&&e&&v.call(e,c)&&y(this._trace(l,e[c],_(r,c),e,c,o,a,!0))}if(this._hasParentSelector)for(var w=0;w<f.length;w++){var j=f[w];if(j&&j.isParentSelector){var x=this._trace(j.expr,e,j.path,n,i,o,a);if(Array.isArray(x)){f[w]=x[0];for(var At=x.length,z=1;z<At;z++)w++,f.splice(w,0,x[z])}else f[w]=x}}return f};d.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&g(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};d.prototype._slice=function(t,e,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,l=u[1]&&Number.parseInt(u[1])||s;c=c<0?Math.max(0,c+s):Math.min(s,c),l=l<0?Math.max(0,l+s):Math.min(s,l);for(var f=[],y=c;y<l;y+=h){var A=this._trace(V(y,e),r,n,i,o,a,!0);A.forEach(function(b){f.push(b)})}return f}};d.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var a=t.includes("@path");a&&(this.currSandbox._$_path=d.toPathString(n.concat([r])));var s="script:"+t;if(!d.cache[s]){var u=t.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");a&&(u=u.replace(/@path/g,"_$_path")),d.cache[s]=new this.vm.Script(u)}try{return d.cache[s].runInNewContext(this.currSandbox)}catch(h){throw new Error("jsonPath: "+h.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,a){return"[#"+(r.push(a)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,a){return"['"+a.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,a){return";"+a.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var a=o.match(/#([0-9]+)/);return!a||!a[1]?o:r[a[1]]});return e[t]=i,e[t].concat()};var It=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var a=e[o];n(a)&&r.push(e.splice(o--,1)[0])}},Ut=function(){function t(e){rt(this,t),this.code=e}return nt(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];It(i,o,function(c){return typeof r[c]=="function"});var a=i.map(function(c,l){return r[c]}),s=o.reduce(function(c,l){var f=r[l].toString();return/function/.test(f)||(f="function "+f),"var "+l+"="+f+";"+c},"");n=s+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),h=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return C(Function,i.concat([h])).apply(void 0,Tt(a))}}]),t}();d.prototype.vm={Script:Ut};async function Y(t,e,r,n){return E({url:t,options:e,validator:r,callback:n}).then(k).then(i=>i.response)}async function E({url:t,options:e,validator:r,callback:n},i="initial"){let o=new Date;console.log("fetch",i,t);let a=await fetch(t,e);if(!a.ok)throw new Error("Fetch failed");if((r==null?void 0:r(a))===!1)throw new Error("Response is not valid");let s=new Date(a.headers.get("date"))<o;return n==null||n(a,i),{url:t,options:e,isCached:s,response:a,validator:r}}async function k(t){let{url:e,isCached:r,options:n,validator:i,response:o,callback:a}=t;if(r){let{response:s}=await E({url:e+"?"+Math.random(),options:{...n,method:"HEAD",cache:"no-cache"},validator:i},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return B(t)}return t}async function B(t){let{url:e,options:r,validator:n,callback:i}=t;return E({url:e,options:{...r,cache:"reload"},validator:n,callback:i},"updated")}function at({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:e,library:r,component:n,version:i,revision:o="published"}){return`${t||e}/components/${r}/${n}/${i}/${o}.html`}function Ht({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:e,library:r,revision:n="published"}){return`${t||e}/styles/${r}/${n}.css`}async function I(t,e){let r=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,n=a=>{a.text().then(e)},i=await Promise.all([t.instance&&E({options:{headers:{Accept:"text/html"}},url:at({...t,version:t.instance}),validator:r}).catch(a=>a),E({url:at(t),validator:r}).catch(a=>a)]),o=i.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw i.find(s=>s&&s instanceof Error)||new Error("Can not fetch component");return i[0]==o&&console.log("Using fork!",i),n(o.response),k({...o,callback:n}).catch(a=>{if(i[0]==o&&(B({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(i[1]instanceof Error)))return n(i[1].response),k({...i[1],callback:n});throw a})}async function U(t,e){return Y(Ht(t),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})}function Wt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return F(n,e),r}function ut(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ct(t){return ut(t)+".*"}function lt(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 qt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=lt(t);if(i!=0)return;let o=t.parentElement;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var a=i+1,s=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(a++,s=u);for(var h=a;h<e;h++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var h=Math.max(1,e);h<a;h++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function X(t,e,r=!1,n=t){var i=e;let o=Object.keys(t).sort((s,u)=>u.length-s.length);for(let s of o)if(e.startsWith(s)){if(s==e){if(r)return t[s];continue}i=e.substring(s.length+1),n=t[s];break}var a=d({path:i,json:n});return Array.isArray(a)&&(a==null?void 0:a.length)==0&&(a=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,"")].filter((s,u,h)=>h.indexOf(s)===u).reduce((s,u)=>s.length>0?s:d({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function S(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=$(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")o=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")H(t,r);else if(e=="data-path-attributes"){let l=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];for(var s in r){var u=r[s];S(t,s,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var h=0;h<l.length;h++)(r==null||!(l[h]in r))&&S(t,l[h],null,n);S(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var c=String(t.getAttribute("data-path-placeholder")||o[a]);r!=null?a=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(a)!=r&&o.setAttribute(a,r):a=="innerHTML"?o.innerHTML=c:o.removeAttribute(a)}}}function ht(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&H(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&ft(a,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function ft(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];H(i,i.getAttribute("data-embed-src"))}if(e)return ht(t)}function H(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 o=r.ownerDocument.createElement("script");o.type="module",o.src=e,r.appendChild(o);break}}var st=["data-attributes-keys","data-path-attributes","data-path-scope"];function F(t,e,r,n){var i,o,a;let s=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,e))||e),s.nodeType==1){let h=s.getAttribute("data-path-scope");if(h){let l=lt(s),f=X(e,h,!1)||[];l==0&&qt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,f))===!1?1:f.length,r),e={...e,[ct(h)]:f[l]}}let c=Array.prototype.slice.call(s.attributes).sort((l,f)=>st.indexOf(l.name)-st.indexOf(f.name));for(var u=0;u<c.length;u++){let{name:l,value:f}=c[u];l.startsWith("data-path")&&l!="data-path-scope"&&S(s,l,X(e,f,!0),r),l=="data-embed-src"&&S(s,l,s.getAttribute(l),r)}}for(var u=0;u<s.children.length;u++)F(s.children[u],e,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,e),s}function P(t,e,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=o,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(let s of t.children)s.className=s.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1");return F(t,r,n)}function zt(t,e){return dt(t,e||(e=document.createElement("style"))),e}function dt(t,e){return e||(e=document.createElement("style")),U(t,r=>{e.textContent=r}).then(()=>e)}function Jt(t,e){return pt(t,e||(e=document.createElement("div"))),e}async function pt(t,e){return e||(e=document.createElement("div")),e.childNodes.length?F(e,t.data,t):"template"in t?P(e,t.template,t.data,t):I(t,r=>P(e,r,t.data,t)).then(()=>e)}function Q(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${$(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):$(t)}function $(t){var e;if(Array.isArray(t))return t.map($).join(`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}}}var v=Object.prototype.hasOwnProperty;function E(t,e){return t=t.slice(),t.push(e),t}function V(t,e){return e=e.slice(),e.unshift(t),e}var Bt=function(t){Dt(r,t);var e=$t(r);function r(n){var i;return rt(this,r),i=e.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return nt(r)}(K(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&g(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=v.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){var a={path:o?t.path:e};o?"json"in t&&(a.json=t.json):a.json=r;var s=this.evaluate(a);if(!s||g(s)!=="object")throw new Bt(s);return s}}d.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,u=this.wrap;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&&g(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(!v.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,s=v.call(t,"flatten")?t.flatten:s,this.currResultType=v.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=v.call(t,"sandbox")?t.sandbox:this.currSandbox,u=v.call(t,"wrap")?t.wrap:u,this.currPreventEval=v.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=v.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=v.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=v.call(t,"parent")?t.parent:o,a=v.call(t,"parentProperty")?t.parentProperty:a,t=t.path}if(o=o||null,a=a||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var l=this._trace(c,e,["$"],o,a,r).filter(function(f){return f&&!f.isParentSelector});return l.length?!u&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce(function(f,y){var A=i._getPreferredOutput(y);return s&&Array.isArray(A)?f=f.concat(A):f.push(A),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,o,a,s){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(h,o,"value"),h;var c=t[0],l=t.slice(1),f=[];function y(p){Array.isArray(p)?p.forEach(function(wt){f.push(wt)}):f.push(p)}if((typeof c!="string"||s)&&e&&v.call(e,c))y(this._trace(l,e[c],E(r,c),e,c,o,a));else if(c==="*")this._walk(e,function(p){y(u._trace(l,e[p],E(r,p),e,p,o,!0,!0))});else if(c==="..")y(this._trace(l,e,r,n,i,o,a)),this._walk(e,function(p){g(e[p])==="object"&&y(u._trace(t.slice(),e[p],E(r,p),e,p,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:l,isParentSelector:!0};if(c==="~")return h={path:E(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(h,o,"property"),h;if(c==="$")y(this._trace(l,e,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,l,e,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var A=c.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(p){u._eval(A,e[p],p,r,n,i)&&y(u._trace(l,e[p],E(r,p),e,p,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(V(this._eval(c,e,r[r.length-1],r.slice(0,-1),n,i),l),e,r,n,i,o,a))}else if(c[0]==="@"){var b=!1,M=c.slice(1,-2);switch(M){case"scalar":(!e||!["object","function"].includes(g(e)))&&(b=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===M&&(b=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(b=!0);break;case"number":Number.isFinite(e)&&(b=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(b=!0);break;case"object":e&&g(e)===M&&(b=!0);break;case"array":Array.isArray(e)&&(b=!0);break;case"other":b=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(b=!0);break;default:throw new TypeError("Unknown value type "+M)}if(b)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,o,"value"),h}else if(c[0]==="`"&&e&&v.call(e,c.slice(1))){var q=c.slice(1);y(this._trace(l,e[q],E(r,q),e,q,o,a,!0))}else if(c.includes(",")){var mt=c.split(","),L=jt(mt),tt;try{for(L.s();!(tt=L.n()).done;){var gt=tt.value;y(this._trace(V(gt,l),e,r,n,i,o,!0))}}catch(p){L.e(p)}finally{L.f()}}else!s&&e&&v.call(e,c)&&y(this._trace(l,e[c],E(r,c),e,c,o,a,!0))}if(this._hasParentSelector)for(var w=0;w<f.length;w++){var j=f[w];if(j&&j.isParentSelector){var x=this._trace(j.expr,e,j.path,n,i,o,a);if(Array.isArray(x)){f[w]=x[0];for(var At=x.length,z=1;z<At;z++)w++,f.splice(w,0,x[z])}else f[w]=x}}return f};d.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&g(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};d.prototype._slice=function(t,e,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,l=u[1]&&Number.parseInt(u[1])||s;c=c<0?Math.max(0,c+s):Math.min(s,c),l=l<0?Math.max(0,l+s):Math.min(s,l);for(var f=[],y=c;y<l;y+=h){var A=this._trace(V(y,e),r,n,i,o,a,!0);A.forEach(function(b){f.push(b)})}return f}};d.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var a=t.includes("@path");a&&(this.currSandbox._$_path=d.toPathString(n.concat([r])));var s="script:"+t;if(!d.cache[s]){var u=t.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");a&&(u=u.replace(/@path/g,"_$_path")),d.cache[s]=new this.vm.Script(u)}try{return d.cache[s].runInNewContext(this.currSandbox)}catch(h){throw new Error("jsonPath: "+h.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,a){return"[#"+(r.push(a)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,a){return"['"+a.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,a){return";"+a.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var a=o.match(/#([0-9]+)/);return!a||!a[1]?o:r[a[1]]});return e[t]=i,e[t].concat()};var It=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var a=e[o];n(a)&&r.push(e.splice(o--,1)[0])}},Ut=function(){function t(e){rt(this,t),this.code=e}return nt(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];It(i,o,function(c){return typeof r[c]=="function"});var a=i.map(function(c,l){return r[c]}),s=o.reduce(function(c,l){var f=r[l].toString();return/function/.test(f)||(f="function "+f),"var "+l+"="+f+";"+c},"");n=s+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),h=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return C(Function,i.concat([h])).apply(void 0,Tt(a))}}]),t}();d.prototype.vm={Script:Ut};async function Y(t,e,r,n){return _({url:t,options:e,validator:r,callback:n}).then(k).then(i=>i.response)}async function _({url:t,options:e,validator:r,callback:n},i="initial"){let o=new Date;console.log("fetch",i,t);let a=await fetch(t,e);if(!a.ok)throw new Error("Fetch failed");if((r==null?void 0:r(a))===!1)throw new Error("Response is not valid");let s=new Date(a.headers.get("date"))<o;return n==null||n(a,i),{url:t,options:e,isCached:s,response:a,validator:r}}async function k(t){let{url:e,isCached:r,options:n,validator:i,response:o,callback:a}=t;if(r){let{response:s}=await _({url:e+"?"+Math.random(),options:{...n,method:"HEAD",cache:"no-cache"},validator:i},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return B(t)}return t}async function B(t){let{url:e,options:r,validator:n,callback:i}=t;return _({url:e,options:{...r,cache:"reload"},validator:n,callback:i},"updated")}function at({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:e,library:r,component:n,version:i,revision:o="published"}){return`${t||e}/components/${r}/${n}/${i}/${o}.html`}function Ht({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:e,library:r,revision:n="published"}){return`${t||e}/styles/${r}/${n}.css`}async function I(t,e){let r=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,n=a=>{a.text().then(e)},i=await Promise.all([t.instance&&_({options:{headers:{Accept:"text/html"}},url:at({...t,version:t.instance}),validator:r}).catch(a=>a),_({url:at(t),validator:r}).catch(a=>a)]),o=i.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw i.find(s=>s&&s instanceof Error)||new Error("Can not fetch component");return i[0]==o&&console.log("Using fork!",i),n(o.response),k({...o,callback:n}).catch(a=>{if(i[0]==o&&(B({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(i[1]instanceof Error)))return n(i[1].response),k({...i[1],callback:n});throw a})}async function U(t,e){return Y(Ht(t),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})}function Wt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return F(n,e),r}function ut(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ct(t){return ut(t)+".*"}function lt(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 qt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=lt(t);if(i!=0)return;let o=t.parentElement;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var a=i+1,s=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(a++,s=u);for(var h=a;h<e;h++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var h=Math.max(1,e);h<a;h++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function X(t,e,r=!1,n=t){var i=e;let o=Object.keys(t).sort((s,u)=>u.length-s.length);for(let s of o)if(e.startsWith(s)){if(s==e){if(r)return t[s];continue}i=e.substring(s.length+1),n=t[s];break}var a=d({path:i,json:n});return Array.isArray(a)&&(a==null?void 0:a.length)==0&&(a=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,"")].filter((s,u,h)=>h.indexOf(s)===u).reduce((s,u)=>s.length>0?s:d({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function S(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=$(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")o=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")H(t,r);else if(e=="data-path-attributes"){let l=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];for(var s in r){var u=r[s];S(t,s,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var h=0;h<l.length;h++)(r==null||!(l[h]in r))&&S(t,l[h],null,n);S(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var c=String(t.getAttribute("data-path-placeholder")||o[a]);r!=null?a=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(a)!=r&&o.setAttribute(a,r):a=="innerHTML"?o.innerHTML=c:o.removeAttribute(a)}}}function ht(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&H(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&ft(a,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function ft(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];H(i,i.getAttribute("data-embed-src"))}if(e)return ht(t)}function H(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 o=r.ownerDocument.createElement("script");o.type="module",o.src=e,r.appendChild(o);break}}var st=["data-attributes-keys","data-path-attributes","data-path-scope"];function F(t,e,r,n){var i,o,a;let s=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,e))||e),s.nodeType==1){let h=s.getAttribute("data-path-scope");if(h){let l=lt(s),f=X(e,h,!1)||[];l==0&&qt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,f))===!1?1:f.length,r),e={...e,[ct(h)]:f[l]}}let c=Array.prototype.slice.call(s.attributes).sort((l,f)=>st.indexOf(l.name)-st.indexOf(f.name));for(var u=0;u<c.length;u++){let{name:l,value:f}=c[u];l.startsWith("data-path")&&l!="data-path-scope"&&S(s,l,X(e,f,!0),r),l=="data-embed-src"&&S(s,l,s.getAttribute(l),r)}}for(var u=0;u<s.children.length;u++)F(s.children[u],e,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,e),s}function P(t,e,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=o,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(let s of t.children)s.className=s.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1");return F(t,r,n)}function zt(t,e){return dt(t,e||(e=document.createElement("style"))),e}function dt(t,e){return e||(e=document.createElement("style")),U(t,r=>{e.textContent=r}).then(()=>e)}function Jt(t,e){return pt(t,e||(e=document.createElement("div"))),e}async function pt(t,e){return e||(e=document.createElement("div")),e.childNodes.length?F(e,t.data,t):"template"in t?P(e,t.template,t.data,t):I(t,r=>P(e,r,t.data,t)).then(()=>e)}function Q(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${$(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):$(t)}function $(t){var e;if(Array.isArray(t))return t.map($).join(`
4
4
  `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return Q(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>Q(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return Q(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}function yt(t=this){let e,r=t.getAttribute("data");if(r!=null)try{e=typeof r=="string"?JSON.parse(r):{}}catch(n){}return{data:e!=null?e:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null}}var T=class extends m{constructor(){super(),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}setData(e){this.set({data:e})}getProps(){return yt(this)}attributeChangedCallback(e,r,n){r!==n&&(this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,r,n))}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}edit(){let e=this.getEditor();if(e!=null&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==e;)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())try{I(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}}update(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)F(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;P(this,this.payload,this.props.data)}}};T.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable"];T.register("feaas-component");function vt(t=this){return{opacity:t!=null&&t.getAttribute("opacity")?parseFloat(t==null?void 0:t.getAttribute("opacity")):1,hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var N=class extends m{getProps(){return vt(this)}attributeChangedCallback(e,r,n){if(r!==n)return e=="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(e,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=`
5
5
  #loader {
6
6
  position: absolute;