@sitecore-feaas/clientside 0.1.19 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/build/basic.js +5 -1
  2. package/build/basic.js.map +1 -1
  3. package/build/cloud.js +40 -7
  4. package/build/cloud.js.map +1 -1
  5. package/build/components/FEAASBase.js +60 -21
  6. package/build/components/FEAASBase.js.map +1 -1
  7. package/build/components/FEAASComponent.js +35 -1
  8. package/build/components/FEAASComponent.js.map +1 -1
  9. package/build/components/FEAASElement.js +14 -0
  10. package/build/components/FEAASElement.js.map +1 -0
  11. package/build/components/FEAASLoader.js +13 -1
  12. package/build/components/FEAASLoader.js.map +1 -1
  13. package/build/components/FEAASStylesheet.js.map +1 -1
  14. package/build/dom.js +6 -0
  15. package/build/dom.js.map +1 -1
  16. package/build/fetch.js +48 -45
  17. package/build/fetch.js.map +1 -1
  18. package/build/ui/FEAASContext.js +12 -13
  19. package/build/ui/FEAASContext.js.map +1 -1
  20. package/build/ui/FEAASEditor.js +448 -76
  21. package/build/ui/FEAASEditor.js.map +1 -1
  22. package/build/ui/FEAASPicker.js +9 -59
  23. package/build/ui/FEAASPicker.js.map +1 -1
  24. package/dist/browser/basic.esm.js +5 -5
  25. package/dist/browser/basic.esm.js.map +1 -1
  26. package/dist/browser/basic.js +5 -5
  27. package/dist/browser/basic.js.map +1 -1
  28. package/dist/browser/index.esm.js +5 -10
  29. package/dist/browser/index.esm.js.map +1 -1
  30. package/dist/browser/index.js +5 -10
  31. package/dist/browser/index.js.map +1 -1
  32. package/dist/node/basic.esm.js +3 -3
  33. package/dist/node/basic.esm.js.map +1 -1
  34. package/dist/node/basic.js +3 -3
  35. package/dist/node/basic.js.map +1 -1
  36. package/dist/node/index.esm.js +3 -8
  37. package/dist/node/index.esm.js.map +1 -1
  38. package/dist/node/index.js +3 -8
  39. package/dist/node/index.js.map +1 -1
  40. package/examples/index.html +8 -49
  41. package/package.json +1 -6
  42. package/src/basic.ts +8 -1
  43. package/src/cloud.ts +43 -13
  44. package/src/components/FEAASBase.tsx +73 -20
  45. package/src/components/{FEAASComponent.ts → FEAASComponent.tsx} +37 -1
  46. package/src/components/FEAASElement.tsx +21 -0
  47. package/src/components/{FEAASLoader.ts → FEAASLoader.tsx} +14 -1
  48. package/src/components/{FEAASStylesheet.ts → FEAASStylesheet.tsx} +0 -0
  49. package/src/dom.ts +5 -0
  50. package/src/fetch.ts +82 -51
  51. package/src/ui/FEAASContext.tsx +13 -14
  52. package/src/ui/FEAASEditor.tsx +598 -144
  53. package/src/ui/FEAASPicker.tsx +18 -65
  54. package/test/components.ts +19 -0
  55. package/types/basic.d.ts +3 -0
  56. package/types/basic.d.ts.map +1 -1
  57. package/types/cloud.d.ts +8 -1
  58. package/types/cloud.d.ts.map +1 -1
  59. package/types/components/FEAASBase.d.ts +18 -4
  60. package/types/components/FEAASBase.d.ts.map +1 -1
  61. package/types/components/FEAASComponent.d.ts +7 -0
  62. package/types/components/FEAASComponent.d.ts.map +1 -1
  63. package/types/components/FEAASElement.d.ts +12 -0
  64. package/types/components/FEAASElement.d.ts.map +1 -0
  65. package/types/components/FEAASLoader.d.ts +6 -0
  66. package/types/components/FEAASLoader.d.ts.map +1 -1
  67. package/types/components/FEAASStylesheet.d.ts +2 -2
  68. package/types/components/FEAASStylesheet.d.ts.map +1 -1
  69. package/types/dom.d.ts.map +1 -1
  70. package/types/fetch.d.ts +42 -1
  71. package/types/fetch.d.ts.map +1 -1
  72. package/types/tsbuildinfo +1 -1
  73. package/types/tsbuildinfo_ui +1 -1
  74. package/types/ui/FEAASContext.d.ts +4 -4
  75. package/types/ui/FEAASContext.d.ts.map +1 -1
  76. package/types/ui/FEAASEditor.d.ts +71 -5
  77. package/types/ui/FEAASEditor.d.ts.map +1 -1
  78. package/types/ui/FEAASPicker.d.ts +15 -34
  79. package/types/ui/FEAASPicker.d.ts.map +1 -1
@@ -1,7 +1,7 @@
1
- var W=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var me=(e,t)=>{for(var r in t)W(e,r,{get:t[r],enumerable:!0})},Ae=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of be(t))!ge.call(e,i)&&i!==r&&W(e,i,{get:()=>t[i],enumerable:!(n=ve(t,i))||n.enumerable});return e};var we=e=>Ae(W({},"__esModule",{value:!0}),e);var We={};me(We,{Base:()=>m,Component:()=>P,FEAASBase:()=>m,FEAASComponent:()=>P,FEAASComponentsProps:()=>le,FEAASLoader:()=>k,FEAASLoaderProps:()=>Ue,FEAASStylesheet:()=>I,FEAASStylesheetProps:()=>he,JSONPath:()=>d,Loader:()=>k,Stylesheet:()=>I,autoloadScripts:()=>se,cleanCollectionBit:()=>ne,fetchAndRevalidate:()=>M,loadScript:()=>B,normalizeCollectionScope:()=>ie,observeDOMElement:()=>ae,queryScopes:()=>Y,renderComponent:()=>Ie,renderComponentElement:()=>je,renderComponentPromise:()=>ce,renderDOMContent:()=>C,renderDOMElement:()=>_,renderStylesheet:()=>Be,renderStylesheetPromise:()=>ue,serializeCH1RichText:()=>O,setDOMAttribute:()=>S});module.exports=we(We);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 X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(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 Z(e,t,r){return t&&Q(e.prototype,t),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fe(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&&R(e,t)}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},D(e)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},R(e,t)}function ee(){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 x(e,t,r){return ee()?x=Reflect.construct.bind():x=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),h=new u;return a&&R(h,a.prototype),h},x.apply(null,arguments)}function _e(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function q(e){var t=typeof Map=="function"?new Map:void 0;return q=function(n){if(n===null||!_e(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 x(n,arguments,D(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),R(i,n)},q(e)}function Se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(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 Se(e)}function xe(e){var t=ee();return function(){var n=D(e),i;if(t){var o=D(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ee(this,i)}}function De(e){return Re(e)||Ce(e)||te(e)||Oe()}function Re(e){if(Array.isArray(e))return J(e)}function Ce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function te(e,t){if(e){if(typeof e=="string")return J(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 J(e,t)}}function J(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 Oe(){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 Pe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=te(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[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(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 z(e,t){return t=t.slice(),t.unshift(e),t}var ke=function(e){Fe(r,e);var t=xe(r);function r(n){var i;return X(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 Z(r)}(q(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 ke(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 h=e;t=h.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 l=this._trace(c,t,["$"],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(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,h;if(!e.length)return h={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(h,o,"value"),h;var c=e[0],l=e.slice(1),f=[];function y(p){Array.isArray(p)?p.forEach(function(ye){f.push(ye)}):f.push(p)}if((typeof c!="string"||s)&&t&&v.call(t,c))y(this._trace(l,t[c],F(r,c),t,c,o,a));else if(c==="*")this._walk(t,function(p){y(u._trace(l,t[p],F(r,p),t,p,o,!0,!0))});else if(c==="..")y(this._trace(l,t,r,n,i,o,a)),this._walk(t,function(p){g(t[p])==="object"&&y(u._trace(e.slice(),t[p],F(r,p),t,p,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:l,isParentSelector:!0};if(c==="~")return h={path:F(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(h,o,"property"),h;if(c==="$")y(this._trace(l,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,l,t,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(t,function(p){u._eval(A,t[p],p,r,n,i)&&y(u._trace(l,t[p],F(r,p),t,p,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(z(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),l),t,r,n,i,o,a))}else if(c[0]==="@"){var b=!1,$=c.slice(1,-2);switch($){case"scalar":(!t||!["object","function"].includes(g(t)))&&(b=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===$&&(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)===$&&(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 "+$)}if(b)return h={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(h,o,"value"),h}else if(c[0]==="`"&&t&&v.call(t,c.slice(1))){var H=c.slice(1);y(this._trace(l,t[H],F(r,H),t,H,o,a,!0))}else if(c.includes(",")){var fe=c.split(","),T=Pe(fe),G;try{for(T.s();!(G=T.n()).done;){var de=G.value;y(this._trace(z(de,l),t,r,n,i,o,!0))}}catch(p){T.e(p)}finally{T.f()}}else!s&&t&&v.call(t,c)&&y(this._trace(l,t[c],F(r,c),t,c,o,a,!0))}if(this._hasParentSelector)for(var w=0;w<f.length;w++){var L=f[w];if(L&&L.isParentSelector){var E=this._trace(L.expr,t,L.path,n,i,o,a);if(Array.isArray(E)){f[w]=E[0];for(var pe=E.length,U=1;U<pe;U++)w++,f.splice(w,0,E[U])}else f[w]=E}}return f};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(":"),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(z(y,t),r,n,i,o,a,!0);A.forEach(function(b){f.push(b)})}return f}};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(h){throw new Error("jsonPath: "+h.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 $e=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])}},Te=function(){function e(t){X(this,e),this.code=t}return Z(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];$e(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 x(Function,i.concat([h])).apply(void 0,De(a))}}]),e}();d.prototype.vm={Script:Te};async function M(e,t,r,n){let i=new Date,o=await fetch(e,t);if(!o.ok)throw new Error("Fetch failed");let a=new Date(o.headers.get("date"));var s=o;if(n(o,"cached"),a<i){let u=await fetch(e+"?"+Math.random(),{...t,method:"HEAD",cache:"no-cache"});if(u.headers.get("last-modified")!=o.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");s=await fetch(e,{...t,cache:"reload"})}}if(r(s)===!1)throw new Error("Response is not valid");return o!==s&&n(s,"valid"),s}function Le({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 Me({cdn:e="https://feaascomponentsapidev.blob.core.windows.net",hostname:t,library:r,revision:n="published"}){return`${e||t}/styles/${r}/${n}.css`}async function j(e,t){return M(Le(e),{headers:{Accept:"text/html"}},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(t)})}async function N(e,t){return M(Me(e),{headers:{Accept:"text/css"}},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(t)})}function je(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return _(n,t),r}function ne(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ie(e){return ne(e)+".*"}function oe(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 Ne(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=oe(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 h=a;h<t;h++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var h=Math.max(1,t);h<a;h++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function Y(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(/^.*?\.\$\./,"")].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(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=O(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")B(e,r);else if(t=="data-path-attributes"){let l=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];for(var s in r){var u=r[s];S(e,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(e,l[h],null,n);S(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 ae(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&B(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&se(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function se(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];B(i,i.getAttribute("data-embed-src"))}if(t)return ae(e)}function B(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 re=["data-attributes-keys","data-path-attributes","data-path-scope"];function _(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 h=s.getAttribute("data-path-scope");if(h){let l=oe(s),f=Y(t,h,!1)||[];l==0&&Ne(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,f))===!1?1:f.length,r),t={...t,[ie(h)]:f[l]}}let c=Array.prototype.slice.call(s.attributes).sort((l,f)=>re.indexOf(l.name)-re.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,Y(t,f,!0),r),l=="data-embed-src"&&S(s,l,s.getAttribute(l),r)}}for(var u=0;u<s.children.length;u++)_(s.children[u],t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function C(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;return e.innerHTML=o,e.classList.add("-feaas"),_(e,r,n)}function Be(e,t){return ue(e,t||(t=document.createElement("style"))),t}function ue(e,t){return t||(t=document.createElement("style")),N(e,r=>{t.textContent=r}).then(()=>t)}function Ie(e,t){return ce(e,t||(t=document.createElement("div"))),t}async function ce(e,t){return t||(t=document.createElement("div")),t.childNodes.length?_(t,e.data,e):"template"in e?C(t,e.template,e.data,e):j(e,r=>C(t,r,e.data,e)).then(()=>t)}function V(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${O(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):O(e)}function O(e){var t;if(Array.isArray(e))return e.map(O).join(`
4
- `).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return V(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>V(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return V(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var He=typeof HTMLElement=="undefined"?class{}:HTMLElement,m=class extends He{constructor(){super(...arguments),this.connected=null,this.refs={},this.descendants=[],this.onLoad=t=>{t!=null&&(this.payload=t,this.render())}}getProps(t){return{}}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(t){switch(t.type){case"feaasConnected":this.nestedCallback(t);break;case"feaasDisconnected":this.unnestedCallback(t);break}}unnestedCallback(t){let r=t.composedPath()[0],n=this.descendants.indexOf(r);n!=-1&&(console.log("FEAAS: Unnest",this,r),this.descendants.splice(n,-1),this.refs[r.getComponentName()]=null,r.refs.parent==this&&(r.refs.parent=null),r.refs.top==this&&(r.refs.top=r.refs.parent))}nestedCallback(t){var r,n;let i=t.composedPath()[0];if(this.descendants.indexOf(i)==-1&&(this.descendants.push(i),console.log("FEAAS: Nest",this,i),this.refs[i.getComponentName()]=i,i.refs.top=this,(r=i.refs).parent||(r.parent=this),i.renderReact))for(var a=i.refs.parent;a;a=a.refs.parent)a.renderReact&&((n=i.refs).parentReact||(n.parentReact=a),i.refs.topReact=a)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}async reify(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))}load(){return Promise.resolve(null)}render(t=!1){var r,n,i;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:o,ReactDOM:a}=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?a.render(o.createElement(this.getReactWrapper()),this.getReactRoot()):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:this.tagName+"-"+o,slot:i.getAttribute("slot")}));return this.renderReact({...this.props,children:n},this.payload)}getReactWrapper(t=this,r=t.tagName){let n=t.reactWrapper||(t.reactWrapper=i=>{if(t.renderReact){let{React:o,ReactDOM:a}=t.payload||{},[s,u]=o.useReducer(h=>h+1,0);return t.forceUpdateReact=u,a.createPortal(o.createElement(o.Fragment,null,t.invokeReactRendering()),t.getReactRoot())}else return t.render()});return Object.assign(n,{displayName:r}),n}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return 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){var n,i;return(i=(n=r.closest(`[${t}]`))===null||n===void 0?void 0:n.getAttribute(t))!==null&&i!==void 0?i:this.getAttribute(t)}static register(t){typeof window!="undefined"&&!window.customElements.get(t)&&window.customElements.define(t,this)}};function le(e=this){let t,r=e.getAttribute("data");if(r!=null)try{t=typeof r=="string"?JSON.parse(r):{}}catch(n){}return{data:t!=null?t:{},library:e.getAttribute("library"),component:e.getAttribute("component"),version:e.getAttribute("version"),revision:e.getAttribute("revision"),hostname:e.getAttribute("hostname"),cdn:e.getContextAttribute("cdn"),template:e.getAttribute("template"),suspended:e.getAttribute("suspended")!=null}}var P=class extends m{setData(t){this.set({data:t})}getProps(){return le(this)}attributeChangedCallback(t,r,n){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(t,r,n)}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(!this.getOriginal())try{j(this.props,this.onLoad)}catch(t){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}}render(){if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)_(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;C(this,this.payload,this.props.data)}}};P.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];P.register("feaas-component");function Ue(e=this){return{hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var k=class extends m{attributeChangedCallback(t,r,n){t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
1
+ var J=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var _t=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))!_t.call(t,i)&&i!==r&&J(t,i,{get:()=>e[i],enumerable:!(n=Ft(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:()=>O,renderComponent:()=>Jt,renderComponentElement:()=>Wt,renderComponentPromise:()=>pt,renderDOMContent:()=>P,renderDOMElement:()=>_,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.render())},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.renderReact))for(var o=e.refs.parent;o;o=o.refs.parent)o.renderReact&&((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.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))}load(){return Promise.resolve(null)}render(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.renderReact({...this.props,children:n},this.payload)}getReactWrapper(e=this,r=e.tagName){let n=e.reactWrapper||(e.reactWrapper=i=>{if(e.renderReact){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.render()});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")]).then(([e,r])=>({React:e,ReactDOM:r}))}};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&&k(t,e)}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},k(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&&k(h,a.prototype),h},C.apply(null,arguments)}function kt(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||!kt(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}}),k(i,n)},K(t)}function Ot(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 Ot(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 V(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 V(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 V(t,e)}}function V(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
+ 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 F(t,e){return t=t.slice(),t.push(e),t}function G(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],F(r,c),e,c,o,a));else if(c==="*")this._walk(e,function(p){y(u._trace(l,e[p],F(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],F(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:F(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],F(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(G(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],F(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(G(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],F(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(G(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(O).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 O(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),O({...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),O({...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 _(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 _(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++)_(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 _(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?_(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
+ `).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}`)}}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)_(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;
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)}};k.observedAttributes=["hidden"];k.register("feaas-loader");function he(e=this){var t;return{library:e==null?void 0:e.getContextAttribute("library"),revision:(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:"published",cdn:(e==null?void 0:e.getContextAttribute("cdn"))||(e==null?void 0:e.getContextAttribute("hostname"))}}var I=class extends m{getProps(){return he(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}async load(){N(this.props,this.onLoad)}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};I.register("feaas-stylesheet");var K;typeof window!="undefined"&&((K=window.FEAASLoading)!==null&&K!==void 0||(window.FEAASLoading=Promise.resolve()));
68
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}render(){this.loader.style.opacity=String(this.props.opacity)}};N.observedAttributes=["hidden","opacity"];N.register("feaas-loader");function bt(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 W=class extends m{getProps(){return bt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}async load(){U(this.props,this.onLoad)}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};W.register("feaas-stylesheet");var Z;typeof window!="undefined"&&(window.FEAASElement=R,(Z=window.FEAASLoading)!==null&&Z!==void 0||(window.FEAASLoading=Promise.resolve()));
69
69
  //# sourceMappingURL=basic.js.map