@sitecore-feaas/clientside 0.1.27 → 0.1.28
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/cloud.js +5 -5
- package/build/cloud.js.map +1 -1
- package/build/components/FEAASComponent.js +2 -1
- package/build/components/FEAASComponent.js.map +1 -1
- package/dist/browser/basic.esm.js +3 -3
- package/dist/browser/basic.esm.js.map +1 -1
- package/dist/browser/basic.js +5 -5
- package/dist/browser/basic.js.map +1 -1
- package/dist/browser/index.esm.js +4 -4
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/index.js +4 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/node/basic.esm.js +3 -3
- package/dist/node/basic.esm.js.map +3 -3
- package/dist/node/basic.js +3 -3
- package/dist/node/basic.js.map +3 -3
- package/dist/node/index.esm.js +3 -3
- package/dist/node/index.esm.js.map +3 -3
- package/dist/node/index.js +3 -3
- package/dist/node/index.js.map +3 -3
- package/package.json +1 -1
- package/src/cloud.ts +7 -6
- package/src/components/FEAASComponent.tsx +4 -1
- package/types/cloud.d.ts +14 -3
- package/types/cloud.d.ts.map +1 -1
- package/types/components/FEAASComponent.d.ts +6 -0
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/fetch.d.ts +2 -2
- package/types/fetch.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/tsbuildinfo_ui +1 -1
package/dist/browser/basic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var K=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var Dt=(e,t)=>{for(var r in t)K(e,r,{get:t[r],enumerable:!0})},Ct=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xt(t))!Rt.call(e,i)&&i!==r&&K(e,i,{get:()=>t[i],enumerable:!(n=St(t,i))||n.enumerable});return e};var kt=e=>Ct(K({},"__esModule",{value:!0}),e);var Qt={};Dt(Qt,{Base:()=>m,Component:()=>M,FEAASBase:()=>m,FEAASComponent:()=>M,FEAASComponentsProps:()=>mt,FEAASLoader:()=>L,FEAASLoaderProps:()=>gt,FEAASStylesheet:()=>q,FEAASStylesheetProps:()=>At,JSONPath:()=>d,Loader:()=>L,MyComponent:()=>H,Stylesheet:()=>q,autoloadScripts:()=>pt,cleanCollectionBit:()=>lt,fetchAndRevalidate:()=>Q,fetchAndRevalidateComponent:()=>x,fetchAndValidate:()=>_,fetchComponentHTML:()=>zt,fetchStylesheet:()=>T,getComponentURL:()=>X,getStylesheetURL:()=>ut,invalidateRequest:()=>U,loadScript:()=>W,normalizeCollectionScope:()=>ht,observeDOMElement:()=>dt,queryScopes:()=>tt,refetchAndValidate:()=>P,renderComponent:()=>Yt,renderComponentElement:()=>Jt,renderComponentPromise:()=>bt,renderDOMContent:()=>$,renderDOMElement:()=>A,renderHTMLContent:()=>Vt,renderStylesheet:()=>Gt,renderStylesheetPromise:()=>vt,serializeCH1RichText:()=>N,setDOMAttribute:()=>R});module.exports=kt(Qt);var Ot=typeof HTMLElement=="undefined"?class{}:HTMLElement,m=class extends Ot{getProps(t){return{}}constructor(){super(),this.connected=!1,this.refs={},this.descendants=[],this.onLoad=t=>{t!=null&&(this.payload=t,this.update())},this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.initialize()}initialize(){let t=this.getParent();if(!(t&&!t.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=>{var n;return(n=r.initialize)===null||n===void 0?void 0:n.call(r)}),this.set(),!0}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}disconnectedCallback(){this.connected&&(console.log("FEAAS: Disconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasConnected":r!=this&&this.nestedCallback(r);break;case"feaasDisconnected":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(console.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),console.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}async reify(){this.payload!==void 0?this.update():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))}load(){return Promise.resolve(null)}update(t=!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:t,ReactDOM:r}=this.payload||{},n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>t.createElement(this.getReactWrapper(i),{key:i.tagName+"-"+i.getUID(),slot:i.getAttribute("slot")}));return this.render({...this.props,children:n},this.payload)}getReactWrapper(t=this,r=t.tagName){let n=t.reactWrapper||(t.reactWrapper=i=>{if(t.render){let{React:o,ReactDOM:a}=t.payload||{},[s,u]=o.useReducer(l=>l+1,0);return t.forceUpdateReact=u,a.createPortal(o.createElement(o.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()});return Object.assign(n,{key:this.tagName+"-"+this.getUID(),displayName:r}),n}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){this.overrides={...this.overrides,...t},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(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){typeof window!="undefined"&&!window.customElements.get(t)&&window.customElements.define(t,this)}};var S=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")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},H=class extends S{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};H.observedAttributes=["counter"];function g(e){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(e)}function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ot(e,t,r){return t&&nt(e.prototype,t),r&&nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(e)}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},O(e,t)}function at(){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(e,t,r){return at()?C=Reflect.construct.bind():C=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&O(l,a.prototype),l},C.apply(null,arguments)}function Tt(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function V(e){var t=typeof Map=="function"?new Map:void 0;return V=function(n){if(n===null||!Tt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return C(n,arguments,k(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),O(i,n)},V(e)}function $t(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nt(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $t(e)}function Mt(e){var t=at();return function(){var n=k(e),i;if(t){var o=k(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Nt(this,i)}}function Lt(e){return jt(e)||Bt(e)||st(e)||It()}function jt(e){if(Array.isArray(e))return G(e)}function Bt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function st(e,t){if(e){if(typeof e=="string")return G(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(e,t)}}function G(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
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(e)},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 F(e,t){return e=e.slice(),e.push(t),e}function Y(e,t){return t=t.slice(),t.unshift(e),t}var Ut=function(e){Pt(r,e);var t=Mt(r);function r(n){var i;return it(this,r),i=t.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 ot(r)}(V(Error));function d(e,t,r,n,i){if(!(this instanceof d))try{return new d(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&g(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=v.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){var a={path:o?e.path:t};o?"json"in e&&(a.json=e.json):a.json=r;var s=this.evaluate(a);if(!s||g(s)!=="object")throw new Ut(s);return s}}d.prototype.evaluate=function(e,t,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,t=t||this.json,e=e||this.path,e&&g(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(!v.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=e;t=l.json,s=v.call(e,"flatten")?e.flatten:s,this.currResultType=v.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=v.call(e,"sandbox")?e.sandbox:this.currSandbox,u=v.call(e,"wrap")?e.wrap:u,this.currPreventEval=v.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=v.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=v.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=v.call(e,"parent")?e.parent:o,a=v.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=d.toPathString(e)),!(!e&&e!==""||!t)){var c=d.toPathArray(e);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var f=this._trace(c,t,["$"],o,a,r).filter(function(h){return h&&!h.isParentSelector});return f.length?!u&&f.length===1&&!f[0].hasArrExpr?this._getPreferredOutput(f[0]):f.reduce(function(h,p){var w=i._getPreferredOutput(p);return s&&Array.isArray(w)?h=h.concat(w):h.push(w),h},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(r),e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),t(n,r,e)}};d.prototype._trace=function(e,t,r,n,i,o,a,s){var u=this,l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(l,o,"value"),l;var c=e[0],f=e.slice(1),h=[];function p(y){Array.isArray(y)?y.forEach(function(_t){h.push(_t)}):h.push(y)}if((typeof c!="string"||s)&&t&&v.call(t,c))p(this._trace(f,t[c],F(r,c),t,c,o,a));else if(c==="*")this._walk(t,function(y){p(u._trace(f,t[y],F(r,y),t,y,o,!0,!0))});else if(c==="..")p(this._trace(f,t,r,n,i,o,a)),this._walk(t,function(y){g(t[y])==="object"&&p(u._trace(e.slice(),t[y],F(r,y),t,y,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:f,isParentSelector:!0};if(c==="~")return l={path:F(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if(c==="$")p(this._trace(f,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))p(this._slice(c,f,t,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var w=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(t,function(y){u._eval(w,t[y],y,r,n,i)&&p(u._trace(f,t[y],F(r,y),t,y,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Y(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),f),t,r,n,i,o,a))}else if(c[0]==="@"){var b=!1,j=c.slice(1,-2);switch(j){case"scalar":(!t||!["object","function"].includes(g(t)))&&(b=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===j&&(b=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(b=!0);break;case"number":Number.isFinite(t)&&(b=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(b=!0);break;case"object":t&&g(t)===j&&(b=!0);break;case"array":Array.isArray(t)&&(b=!0);break;case"other":b=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(b=!0);break;default:throw new TypeError("Unknown value type "+j)}if(b)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if(c[0]==="`"&&t&&v.call(t,c.slice(1))){var z=c.slice(1);p(this._trace(f,t[z],F(r,z),t,z,o,a,!0))}else if(c.includes(",")){var wt=c.split(","),B=Ht(wt),rt;try{for(B.s();!(rt=B.n()).done;){var Et=rt.value;p(this._trace(Y(Et,f),t,r,n,i,o,!0))}}catch(y){B.e(y)}finally{B.f()}}else!s&&t&&v.call(t,c)&&p(this._trace(f,t[c],F(r,c),t,c,o,a,!0))}if(this._hasParentSelector)for(var E=0;E<h.length;E++){var I=h[E];if(I&&I.isParentSelector){var D=this._trace(I.expr,t,I.path,n,i,o,a);if(Array.isArray(D)){h[E]=D[0];for(var Ft=D.length,J=1;J<Ft;J++)E++,h.splice(E,0,D[J])}else h[E]=D}}return h};d.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&g(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};d.prototype._slice=function(e,t,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=e.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;c=c<0?Math.max(0,c+s):Math.min(s,c),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var h=[],p=c;p<f;p+=l){var w=this._trace(Y(p,t),r,n,i,o,a,!0);w.forEach(function(b){h.push(b)})}return h}};d.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var a=e.includes("@path");a&&(this.currSandbox._$_path=d.toPathString(n.concat([r])));var s="script:"+e;if(!d.cache[s]){var u=e.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(l){throw new Error("jsonPath: "+l.message+": "+e)}};d.cache={};d.toPathString=function(e){for(var t=e,r=t.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(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};d.toPointer=function(e){for(var t=e,r=t.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(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(e){var t=d.cache;if(t[e])return t[e].concat();var r=[],n=e.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 t[e]=i,t[e].concat()};var Wt=function(t,r,n){for(var i=t.length,o=0;o<i;o++){var a=t[o];n(a)&&r.push(t.splice(o--,1)[0])}},qt=function(){function e(t){it(this,e),this.code=t}return ot(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Wt(i,o,function(c){return typeof r[c]=="function"});var a=i.map(function(c,f){return r[c]}),s=o.reduce(function(c,f){var h=r[f].toString();return/function/.test(h)||(h="function "+h),"var "+f+"="+h+";"+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(";"),l=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return C(Function,i.concat([l])).apply(void 0,Lt(a))}}]),e}();d.prototype.vm={Script:qt};async function Q(e,t,r,n){return _({url:e,options:t,validator:r,callback:n}).then(P).then(i=>i.response)}async function _({url:e,options:t,validator:r,callback:n},i="initial"){let o=new Date,a=await fetch(e,t);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:e,options:t,isCached:s,response:a,validator:r}}async function P(e){let{url:t,isCached:r,options:n,validator:i,response:o,callback:a}=e;if(r){let{response:s}=await _({url:t+"?"+Math.random(),options:{...n,method:"HEAD",cache:"no-cache"},validator:i},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return U(e)}return e}async function U(e){let{url:t,options:r,validator:n,callback:i}=e;return _({url:t,options:{...r,cache:"reload"},validator:n,callback:i},"updated")}function X({cdn:e="https://feaascomponentsapidev.blob.core.windows.net",hostname:t,library:r,component:n,version:i,revision:o="published"}){return`${e||t}/components/${r}/${n}/${i}/${o}.html`}function ut({cdn:e="https://feaascomponentsapidev.blob.core.windows.net",hostname:t,library:r,revision:n="published"}){return`${e||t}/styles/${r}/${n}.css`}async function x(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>{s.text().then(t)},o=await Promise.all([e.instance&&_({options:{headers:{Accept:"text/html"}},url:X({...e,version:e.instance}),validator:n}).catch(s=>s),_({url:X(e),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),i(a.response),P({...a,callback:i}).catch(s=>{if(o[0]==a&&(U({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),P({...o[1],callback:i});throw s})}async function zt(e){var t;return await x(e,r=>{t=r},!1),t}async function T(e,t){return Q(ut(e),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(t)})}function Jt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function lt(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ht(e){return lt(e)+".*"}function ft(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Kt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=ft(e);if(i!=0)return;let o=e.parentElement;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var a=i+1,s=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(a++,s=u);for(var l=a;l<t;l++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var l=Math.max(1,t);l<a;l++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function tt(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((s,u)=>u.length-s.length);for(let s of o)if(t.startsWith(s)){if(s==t){if(r)return e[s];continue}i=t.substring(s.length+1),n=e[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(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((s,u,l)=>l.indexOf(s)===u).reduce((s,u)=>s.length>0?s:d({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function R(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src")o=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")W(e,r);else if(t=="data-path-attributes"){let f=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var s in r){var u=r[s];R(e,s,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var l=0;l<f.length;l++)(r==null||!(f[l]in r))&&R(e,f[l],null,n);R(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var c=String(e.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 dt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&W(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&pt(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function pt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];W(i,i.getAttribute("data-embed-src"))}if(t)return dt(e)}function W(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.type="module",o.src=t,r.appendChild(o);break}}var ct=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,o,a;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let c=s.getAttribute("data-path-scope");if(c){let h=ft(s),p=tt(t,c,!1)||[];h==0&&Kt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,p))===!1?1:p.length,r),t={...t,[ht(c)]:p[h]}}let f=Array.prototype.slice.call(s.attributes).sort((h,p)=>ct.indexOf(h.name)-ct.indexOf(p.name));for(var u=0;u<f.length;u++){let{name:h,value:p}=f[u];h.startsWith("data-path")&&h!="data-path-scope"&&R(s,h,tt(t,p,!0),r),h=="data-embed-src"&&R(s,h,s.getAttribute(h),r)}}for(var u=0,l;l=s.childNodes[u++];)yt(l)&&A(l,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function yt(e){return e.nodeType==1}function $(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,u;u=e.childNodes[s++];)yt(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Vt(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let{parseHTML:a}=require("linkedom"),{document:s}=a(o);return A(s,t,r).toString()}else{let a=document.createElement("div");return a.innerHTML=o,A(a,t,r),a.innerHTML}}function Gt(e,t){return vt(e,t||(t=document.createElement("style"))),t}function vt(e,t){return t||(t=document.createElement("style")),T(e,r=>{t.textContent=r}).then(()=>t)}function Yt(e,t){return bt(e,t||(t=document.createElement("div"))),t}async function bt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?$(t,e.template,e.data,e):x(e,r=>$(t,r,e.data,e)).then(()=>t)}function Z(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${N(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):N(e)}function N(e){var t;if(Array.isArray(e))return e.map(N).join(`
|
|
4
|
-
`).trim();if(typeof
|
|
1
|
+
var K=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var Dt=(t,e)=>{for(var r in e)K(t,r,{get:e[r],enumerable:!0})},Ct=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xt(e))!Rt.call(t,i)&&i!==r&&K(t,i,{get:()=>e[i],enumerable:!(n=St(e,i))||n.enumerable});return t};var kt=t=>Ct(K({},"__esModule",{value:!0}),t);var Qt={};Dt(Qt,{Base:()=>m,Component:()=>M,FEAASBase:()=>m,FEAASComponent:()=>M,FEAASComponentsProps:()=>mt,FEAASLoader:()=>L,FEAASLoaderProps:()=>gt,FEAASStylesheet:()=>q,FEAASStylesheetProps:()=>At,JSONPath:()=>f,Loader:()=>L,MyComponent:()=>U,Stylesheet:()=>q,autoloadScripts:()=>pt,cleanCollectionBit:()=>lt,fetchAndRevalidate:()=>Q,fetchAndRevalidateComponent:()=>x,fetchAndValidate:()=>_,fetchComponent:()=>zt,fetchStylesheet:()=>T,getComponentURL:()=>X,getStylesheetURL:()=>ut,invalidateRequest:()=>H,loadScript:()=>W,normalizeCollectionScope:()=>ht,observeDOMElement:()=>ft,queryScopes:()=>tt,refetchAndValidate:()=>P,renderComponent:()=>Yt,renderComponentElement:()=>Jt,renderComponentPromise:()=>bt,renderDOMContent:()=>$,renderDOMElement:()=>A,renderHTMLContent:()=>Vt,renderStylesheet:()=>Gt,renderStylesheetPromise:()=>vt,serializeCH1RichText:()=>N,setDOMAttribute:()=>R});module.exports=kt(Qt);var Ot=typeof HTMLElement=="undefined"?class{}:HTMLElement,m=class extends Ot{getProps(e){return{}}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)}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=>{var n;return(n=r.initialize)===null||n===void 0?void 0:n.call(r)}),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:i.tagName+"-"+i.getUID(),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(l=>l+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,{key:this.tagName+"-"+this.getUID(),displayName:r}),n}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){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 S=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")]).then(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},U=class extends S{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(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};U.observedAttributes=["counter"];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 it(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(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 ot(t,e,r){return e&&nt(t.prototype,e),r&&nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pt(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 k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(t)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},O(t,e)}function at(){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 at()?C=Reflect.construct.bind():C=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&O(l,a.prototype),l},C.apply(null,arguments)}function Tt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function V(t){var e=typeof Map=="function"?new Map:void 0;return V=function(n){if(n===null||!Tt(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,k(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),O(i,n)},V(t)}function $t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nt(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 $t(t)}function Mt(t){var e=at();return function(){var n=k(t),i;if(e){var o=k(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Nt(this,i)}}function Lt(t){return jt(t)||Bt(t)||st(t)||It()}function jt(t){if(Array.isArray(t))return G(t)}function Bt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function st(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 It(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ut(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=st(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 F(t,e){return t=t.slice(),t.push(e),t}function Y(t,e){return e=e.slice(),e.unshift(t),e}var Ht=function(t){Pt(r,t);var e=Mt(r);function r(n){var i;return it(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 ot(r)}(V(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(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 Ht(s);return s}}f.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 l=t;e=l.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=f.toPathString(t)),!(!t&&t!==""||!e)){var c=f.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var d=this._trace(c,e,["$"],o,a,r).filter(function(h){return h&&!h.isParentSelector});return d.length?!u&&d.length===1&&!d[0].hasArrExpr?this._getPreferredOutput(d[0]):d.reduce(function(h,p){var w=i._getPreferredOutput(p);return s&&Array.isArray(w)?h=h.concat(w):h.push(w),h},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(r),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return f.toPathString(t[e]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),e(n,r,t)}};f.prototype._trace=function(t,e,r,n,i,o,a,s){var u=this,l;if(!t.length)return l={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(l,o,"value"),l;var c=t[0],d=t.slice(1),h=[];function p(y){Array.isArray(y)?y.forEach(function(_t){h.push(_t)}):h.push(y)}if((typeof c!="string"||s)&&e&&v.call(e,c))p(this._trace(d,e[c],F(r,c),e,c,o,a));else if(c==="*")this._walk(e,function(y){p(u._trace(d,e[y],F(r,y),e,y,o,!0,!0))});else if(c==="..")p(this._trace(d,e,r,n,i,o,a)),this._walk(e,function(y){g(e[y])==="object"&&p(u._trace(t.slice(),e[y],F(r,y),e,y,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(c==="~")return l={path:F(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if(c==="$")p(this._trace(d,e,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))p(this._slice(c,d,e,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var w=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(y){u._eval(w,e[y],y,r,n,i)&&p(u._trace(d,e[y],F(r,y),e,y,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Y(this._eval(c,e,r[r.length-1],r.slice(0,-1),n,i),d),e,r,n,i,o,a))}else if(c[0]==="@"){var b=!1,j=c.slice(1,-2);switch(j){case"scalar":(!e||!["object","function"].includes(g(e)))&&(b=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===j&&(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)===j&&(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 "+j)}if(b)return l={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if(c[0]==="`"&&e&&v.call(e,c.slice(1))){var z=c.slice(1);p(this._trace(d,e[z],F(r,z),e,z,o,a,!0))}else if(c.includes(",")){var wt=c.split(","),B=Ut(wt),rt;try{for(B.s();!(rt=B.n()).done;){var Et=rt.value;p(this._trace(Y(Et,d),e,r,n,i,o,!0))}}catch(y){B.e(y)}finally{B.f()}}else!s&&e&&v.call(e,c)&&p(this._trace(d,e[c],F(r,c),e,c,o,a,!0))}if(this._hasParentSelector)for(var E=0;E<h.length;E++){var I=h[E];if(I&&I.isParentSelector){var D=this._trace(I.expr,e,I.path,n,i,o,a);if(Array.isArray(D)){h[E]=D[0];for(var Ft=D.length,J=1;J<Ft;J++)E++,h.splice(E,0,D[J])}else h[E]=D}}return h};f.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)})};f.prototype._slice=function(t,e,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=t.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,d=u[1]&&Number.parseInt(u[1])||s;c=c<0?Math.max(0,c+s):Math.min(s,c),d=d<0?Math.max(0,d+s):Math.min(s,d);for(var h=[],p=c;p<d;p+=l){var w=this._trace(Y(p,e),r,n,i,o,a,!0);w.forEach(function(b){h.push(b)})}return h}};f.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=f.toPathString(n.concat([r])));var s="script:"+t;if(!f.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")),f.cache[s]=new this.vm.Script(u)}try{return f.cache[s].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+t)}};f.cache={};f.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};f.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};f.toPathArray=function(t){var e=f.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 Wt=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])}},qt=function(){function t(e){it(this,t),this.code=e}return ot(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Wt(i,o,function(c){return typeof r[c]=="function"});var a=i.map(function(c,d){return r[c]}),s=o.reduce(function(c,d){var h=r[d].toString();return/function/.test(h)||(h="function "+h),"var "+d+"="+h+";"+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(";"),l=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return C(Function,i.concat([l])).apply(void 0,Lt(a))}}]),t}();f.prototype.vm={Script:qt};async function Q(t,e,r,n){return _({url:t,options:e,validator:r,callback:n}).then(P).then(i=>i.response)}async function _({url:t,options:e,validator:r,callback:n},i="initial"){let o=new Date,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 P(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 H(t)}return t}async function H(t){let{url:e,options:r,validator:n,callback:i}=t;return _({url:e,options:{...r,cache:"reload"},validator:n,callback:i},"updated")}function X({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 ut({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:e,library:r,revision:n="published"}){return`${t||e}/styles/${r}/${n}.css`}async function x(t,e,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>{s.text().then(e)},o=await Promise.all([t.instance&&_({options:{headers:{Accept:"text/html"}},url:X({...t,version:t.instance}),validator:n}).catch(s=>s),_({url:X(t),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),i(a.response),P({...a,callback:i}).catch(s=>{if(o[0]==a&&(H({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),P({...o[1],callback:i});throw s})}async function zt(t){var e;let{response:r}=await x(t,n=>{e=n},!1);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function T(t,e){return Q(ut(t),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})}function Jt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,e),r}function lt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ht(t){return lt(t)+".*"}function dt(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 Kt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=dt(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 l=a;l<e;l++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var l=Math.max(1,e);l<a;l++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function tt(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=f({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(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((s,u,l)=>l.indexOf(s)===u).reduce((s,u)=>s.length>0?s:f({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function R(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(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")W(t,r);else if(e=="data-path-attributes"){let d=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var s in r){var u=r[s];R(t,s,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var l=0;l<d.length;l++)(r==null||!(d[l]in r))&&R(t,d[l],null,n);R(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 ft(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&W(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&pt(a,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function pt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];W(i,i.getAttribute("data-embed-src"))}if(e)return ft(t)}function W(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 ct=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(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 c=s.getAttribute("data-path-scope");if(c){let h=dt(s),p=tt(e,c,!1)||[];h==0&&Kt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,p))===!1?1:p.length,r),e={...e,[ht(c)]:p[h]}}let d=Array.prototype.slice.call(s.attributes).sort((h,p)=>ct.indexOf(h.name)-ct.indexOf(p.name));for(var u=0;u<d.length;u++){let{name:h,value:p}=d[u];h.startsWith("data-path")&&h!="data-path-scope"&&R(s,h,tt(e,p,!0),r),h=="data-embed-src"&&R(s,h,s.getAttribute(h),r)}}for(var u=0,l;l=s.childNodes[u++];)yt(l)&&A(l,e,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,e),s}function yt(t){return t.nodeType==1}function $(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(var s=0,u;u=t.childNodes[s++];)yt(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(t,r,n)}function Vt(t,e,r,n=!1){var i;let o=((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{parseHTML:a}=require("linkedom"),{document:s}=a(o);return A(s,e,r).toString()}else{let a=document.createElement("div");return a.innerHTML=o,A(a,e,r),a.innerHTML}}function Gt(t,e){return vt(t,e||(e=document.createElement("style"))),e}function vt(t,e){return e||(e=document.createElement("style")),T(t,r=>{e.textContent=r}).then(()=>e)}function Yt(t,e){return bt(t,e||(e=document.createElement("div"))),e}async function bt(t,e){return e||(e=document.createElement("div")),e.childNodes.length?A(e,t.data,t):"template"in t?$(e,t.template,t.data,t):x(t,r=>$(e,r,t.data,t)).then(()=>e)}function Z(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${N(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):N(t)}function N(t){var e;if(Array.isArray(t))return t.map(N).join(`
|
|
4
|
+
`).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return Z(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>Z(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 Z(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}function mt(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,lastModified:t.getAttribute("last-modified")}}var M=class extends m{setData(e){this.set({data:e})}getProps(){return mt(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}constructor(){super(),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}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{x(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)A(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;$(this,this.payload,this.props.data)}}};M.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable"];M.register("feaas-component");function gt(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 L=class extends m{getProps(){return gt(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;
|
|
7
7
|
top: 0;
|
|
@@ -65,5 +65,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
65
65
|
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
66
66
|
></circle>
|
|
67
67
|
</svg>
|
|
68
|
-
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};L.observedAttributes=["hidden","opacity"];L.register("feaas-loader");function At(
|
|
68
|
+
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};L.observedAttributes=["hidden","opacity"];L.register("feaas-loader");function At(t=this){var e;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(e=t==null?void 0:t.getAttribute("revision"))!==null&&e!==void 0?e:"published",cdn:(t==null?void 0:t.getContextAttribute("cdn"))||(t==null?void 0:t.getContextAttribute("hostname"))}}var q=class extends m{getProps(){return At(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}async load(){T(this.props,this.onLoad)}update(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};q.register("feaas-stylesheet");var et;typeof window!="undefined"&&(window.FEAASElement=S,(et=window.FEAASLoading)!==null&&et!==void 0||(window.FEAASLoading=Promise.resolve()));
|
|
69
69
|
//# sourceMappingURL=basic.js.map
|