@sitecore-feaas/clientside 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/build/components/FEAASComponent.js +3 -1
  3. package/build/components/FEAASComponent.js.map +1 -1
  4. package/build/components/FEAASElement.js +16 -5
  5. package/build/components/FEAASElement.js.map +1 -1
  6. package/build/dom/rendering.js.map +1 -1
  7. package/build/dom/thumbnail.js +29 -24
  8. package/build/dom/thumbnail.js.map +1 -1
  9. package/build/headless.js +5 -0
  10. package/build/headless.js.map +1 -1
  11. package/build/ui/FEAASExternal.js +15 -13
  12. package/build/ui/FEAASExternal.js.map +1 -1
  13. package/build/ui/FEAASPicker.js +11 -5
  14. package/build/ui/FEAASPicker.js.map +1 -1
  15. package/build/ui/react.js +23 -8
  16. package/build/ui/react.js.map +1 -1
  17. package/build/utils/datapath.js +15 -0
  18. package/build/utils/datapath.js.map +1 -1
  19. package/build/utils/fetch.js +16 -2
  20. package/build/utils/fetch.js.map +1 -1
  21. package/build/utils/settings.js +60 -0
  22. package/build/utils/settings.js.map +1 -0
  23. package/dist/browser/headless.cjs +8 -6
  24. package/dist/browser/headless.cjs.map +4 -4
  25. package/dist/browser/headless.esm.js +8 -6
  26. package/dist/browser/headless.esm.js.map +1 -1
  27. package/dist/browser/index.cjs +8 -6
  28. package/dist/browser/index.cjs.map +4 -4
  29. package/dist/browser/index.esm.js +8 -6
  30. package/dist/browser/index.esm.js.map +1 -1
  31. package/dist/browser/react.cjs +8 -6
  32. package/dist/browser/react.cjs.map +4 -4
  33. package/dist/browser/react.esm.js +8 -6
  34. package/dist/browser/react.esm.js.map +1 -1
  35. package/dist/node/headless.cjs +6 -4
  36. package/dist/node/headless.cjs.map +4 -4
  37. package/dist/node/headless.esm.js +6 -4
  38. package/dist/node/headless.esm.js.map +4 -4
  39. package/dist/node/index.cjs +7 -5
  40. package/dist/node/index.cjs.map +4 -4
  41. package/dist/node/index.esm.js +7 -5
  42. package/dist/node/index.esm.js.map +4 -4
  43. package/dist/node/react.cjs +6 -4
  44. package/dist/node/react.cjs.map +4 -4
  45. package/dist/node/react.esm.js +6 -4
  46. package/dist/node/react.esm.js.map +4 -4
  47. package/headless.cjs +6 -4
  48. package/headless.cjs.map +4 -4
  49. package/headless.js +6 -4
  50. package/headless.js.map +4 -4
  51. package/package.json +1 -1
  52. package/react.cjs +8 -6
  53. package/react.cjs.map +4 -4
  54. package/react.js +8 -6
  55. package/react.js.map +4 -4
  56. package/src/components/FEAASComponent.tsx +10 -3
  57. package/src/components/FEAASElement.tsx +17 -5
  58. package/src/dom/rendering.ts +1 -0
  59. package/src/dom/thumbnail.ts +29 -24
  60. package/src/headless.ts +5 -0
  61. package/src/ui/FEAASExternal.tsx +15 -13
  62. package/src/ui/FEAASPicker.tsx +15 -6
  63. package/src/ui/react.tsx +45 -16
  64. package/src/utils/datapath.ts +17 -0
  65. package/src/utils/fetch.ts +20 -4
  66. package/src/utils/settings.ts +69 -0
  67. package/test/FEAASComponent.react.test.tsx +1 -1
  68. package/test/ServerComponent.test.tsx +33 -0
  69. package/test/settings.test.ts +78 -0
  70. package/types/components/FEAASComponent.d.ts +3 -1
  71. package/types/components/FEAASComponent.d.ts.map +1 -1
  72. package/types/components/FEAASElement.d.ts +1 -0
  73. package/types/components/FEAASElement.d.ts.map +1 -1
  74. package/types/dom/rendering.d.ts.map +1 -1
  75. package/types/dom/thumbnail.d.ts +16 -16
  76. package/types/dom/thumbnail.d.ts.map +1 -1
  77. package/types/headless.d.ts +5 -0
  78. package/types/headless.d.ts.map +1 -1
  79. package/types/tsbuildinfo +1 -1
  80. package/types/ui/FEAASExternal.d.ts +15 -13
  81. package/types/ui/FEAASExternal.d.ts.map +1 -1
  82. package/types/ui/FEAASPicker.d.ts +9 -6
  83. package/types/ui/FEAASPicker.d.ts.map +1 -1
  84. package/types/ui/react.d.ts +7 -2
  85. package/types/ui/react.d.ts.map +1 -1
  86. package/types/ui/tsbuildinfo +1 -1
  87. package/types/utils/datapath.d.ts +2 -0
  88. package/types/utils/datapath.d.ts.map +1 -1
  89. package/types/utils/fetch.d.ts.map +1 -1
  90. package/types/utils/settings.d.ts +13 -0
  91. package/types/utils/settings.d.ts.map +1 -0
  92. /package/test/{FEAASComponent2.test.tsx → FEAASComponentData.test.tsx} +0 -0
@@ -1,7 +1,7 @@
1
- var Be=Object.defineProperty;var Ie=(t,e)=>{for(var r in e)Be(t,r,{get:e[r],enumerable:!0})};function g(t,e=r=>{}){var r;let n=()=>{var i,o;let a=new Promise((u,c)=>{i=l=>{t==null||t(l),u(l)},o=c});var s=Object.assign(a,{resolve:i,reject:o,restart:n,first:r});return r=s,s.catch(e),s};return n()}var We=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,w=class extends We{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=g(e=>{this.payload=e}),this.whenRendered=g(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEvent(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}log(...e){typeof process!="undefined"&&process.env.TESTING||console.log(...e)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,-1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var 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}onError(e,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEvent(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEvent(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:a}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?a?(this.reactRoot||(this.reactRoot=a.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,s){console.error(`FEAAS: ${e.tagName} Error:`,a,s),e.onError(a,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),a=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(a,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[a,s]=n.useReducer(u=>u+1,0);return e.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var D=class extends w{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)}},Y=class extends D{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))}};Y.observedAttributes=["counter"];function A(t){return A=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},A(t)}function me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(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 ve(t,e,r){return e&&ye(t.prototype,e),r&&ye(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function He(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&&P(t,e)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$(t)}function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},P(t,e)}function be(){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 T(t,e,r){return be()?T=Reflect.construct.bind():T=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),c=new u;return a&&P(c,a.prototype),c},T.apply(null,arguments)}function ze(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Q(t){var e=typeof Map=="function"?new Map:void 0;return Q=function(n){if(n===null||!ze(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 T(n,arguments,$(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),P(i,n)},Q(t)}function Je(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(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 Je(t)}function Ve(t){var e=be();return function(){var n=$(t),i;if(e){var o=$(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qe(this,i)}}function Ke(t){return Ge(t)||Ye(t)||ge(t)||Qe()}function Ge(t){if(Array.isArray(t))return X(t)}function Ye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ge(t,e){if(t){if(typeof t=="string")return X(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 X(t,e)}}function X(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 Qe(){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 Xe(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ge(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 C(t,e){return t=t.slice(),t.push(e),t}function Z(t,e){return e=e.slice(),e.unshift(t),e}var Ze=function(t){He(r,t);var e=Ve(r);function r(n){var i;return me(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 ve(r)}(Q(Error));function p(t,e,r,n,i){if(!(this instanceof p))try{return new p(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&&A(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||A(s)!=="object")throw new Ze(s);return s}}p.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&&A(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 c=t;e=c.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=p.toPathString(t)),!(!t&&t!==""||!e)){var l=p.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var h=this._trace(l,e,["$"],o,a,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!u&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,f){var b=i._getPreferredOutput(f);return s&&Array.isArray(b)?d=d.concat(b):d.push(b),d},[]):u?[]:void 0}};p.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:p.toPathArray(t.path);return t.pointer=p.toPointer(r),t.path=typeof t.path=="string"?t.path:p.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return p.toPathString(t[e]);case"pointer":return p.toPointer(t.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:p.toPathString(t.path),e(n,r,t)}};p.prototype._trace=function(t,e,r,n,i,o,a,s){var u=this,c;if(!t.length)return c={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(c,o,"value"),c;var l=t[0],h=t.slice(1),d=[];function f(y){Array.isArray(y)?y.forEach(function(Ue){d.push(Ue)}):d.push(y)}if((typeof l!="string"||s)&&e&&v.call(e,l))f(this._trace(h,e[l],C(r,l),e,l,o,a));else if(l==="*")this._walk(e,function(y){f(u._trace(h,e[y],C(r,y),e,y,o,!0,!0))});else if(l==="..")f(this._trace(h,e,r,n,i,o,a)),this._walk(e,function(y){A(e[y])==="object"&&f(u._trace(t.slice(),e[y],C(r,y),e,y,o,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(l==="~")return c={path:C(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(l==="$")f(this._trace(h,e,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))f(this._slice(l,h,e,r,n,i,o));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var b=l.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(b,e[y],y,r,n,i)&&f(u._trace(h,e[y],C(r,y),e,y,o,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");f(this._trace(Z(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),h),e,r,n,i,o,a))}else if(l[0]==="@"){var m=!1,E=l.slice(1,-2);switch(E){case"scalar":(!e||!["object","function"].includes(A(e)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":A(e)===E&&(m=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(m=!0);break;case"number":Number.isFinite(e)&&(m=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(m=!0);break;case"object":e&&A(e)===E&&(m=!0);break;case"array":Array.isArray(e)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+E)}if(m)return c={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(l[0]==="`"&&e&&v.call(e,l.slice(1))){var _=l.slice(1);f(this._trace(h,e[_],C(r,_),e,_,o,a,!0))}else if(l.includes(",")){var ke=l.split(","),U=Xe(ke),pe;try{for(U.s();!(pe=U.n()).done;){var Le=pe.value;f(this._trace(Z(Le,h),e,r,n,i,o,!0))}}catch(y){U.e(y)}finally{U.f()}}else!s&&e&&v.call(e,l)&&f(this._trace(h,e[l],C(r,l),e,l,o,a,!0))}if(this._hasParentSelector)for(var F=0;F<d.length;F++){var B=d[F];if(B&&B.isParentSelector){var O=this._trace(B.expr,e,B.path,n,i,o,a);if(Array.isArray(O)){d[F]=O[0];for(var je=O.length,G=1;G<je;G++)F++,d.splice(F,0,O[G])}else d[F]=O}}return d};p.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&A(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};p.prototype._slice=function(t,e,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=t.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,h=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),h=h<0?Math.max(0,h+s):Math.min(s,h);for(var d=[],f=l;f<h;f+=c){var b=this._trace(Z(f,e),r,n,i,o,a,!0);b.forEach(function(m){d.push(m)})}return d}};p.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=p.toPathString(n.concat([r])));var s="script:"+t;if(!p.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")),p.cache[s]=new this.vm.Script(u)}try{return p.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+t)}};p.cache={};p.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};p.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};p.toPathArray=function(t){var e=p.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 et=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])}},tt=function(){function t(e){me(this,t),this.code=e}return ve(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];et(i,o,function(l){return typeof r[l]=="function"});var a=i.map(function(l,h){return r[l]}),s=o.reduce(function(l,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+l},"");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(";"),c=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return T(Function,i.concat([c])).apply(void 0,Ke(a))}}]),t}();p.prototype.vm={Script:tt};function te(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=p({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,c)=>c.indexOf(s)===u).reduce((s,u)=>s.length>0?s:p({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function ee(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${M(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):M(t)}function M(t){var e;if(Array.isArray(t))return t.map(M).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 ee(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>ee(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 ee(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var R=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return re(this.childNodes)}set innerHTML(e){this.childNodes=ne(String(e!=null?e:""))}get outerHTML(){return re([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(we(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let a of r)if(we(a,o)){n.push(o);break}for(let a of o.childNodes)i(a)};for(let o of this.childNodes)i(o);return n}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+e;o>=0&&o<n.length;o+=e){let a=n[o];if(!r||a.nodeType===1)return a}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,1),e.parentNode=void 0,e}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(e=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function we(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(e.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(e.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],a=i[3],s=e.getAttribute(o);if(typeof a=="undefined"){if(s===void 0)return!1}else if(s!==a)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function ne(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let a=i[1],u=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(l=>{let[h,d,,f]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:nt(f||"")}}))||[],c=new R(a,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let a=t.indexOf("<"),s=t.slice(0,a!==-1?a:void 0),u=new R("#text",3);if(u.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);t=t.slice(s.length)}}return r}function rt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function nt(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function re(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:a,value:s})=>` ${a}="${rt(String(s))}"`).join(""),o=re(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function it(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&I(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&ot(a,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function ot(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];I(i,i.getAttribute("data-embed-src"))}if(e)return it(t)}function I(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.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}var Tt=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},$t=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Pt=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]+\])$/))===null||e===void 0?void 0:e[0]};function at(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Ae(t){return at(t)+".*"}function Ee(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 st(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=Ee(t);if(i!=0)return;let o=t.parentNode;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 c=a;c<e;c++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,e);c<a;c++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function k(t,e,r,n){var i,o;if(t){var a=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=M(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var s=e.replace("data-path-","");if(e=="data-path-src"){let d=Array.from(t.children).find(f=>f.localName=="picture")||t;a=t.localName=="img"?t:d.querySelector("img, video")}else if(e=="data-path-href")a=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")a=(Array.from(t.children).find(f=>f.localName=="picture")||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")s="innerHTML";else if(e=="data-embed-src")I(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 u in r){var c=r[u];k(t,u,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var l=0;l<d.length;l++)(r==null||!(d[l]in r))&&k(t,d[l],null,n);k(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!a){var h=String((o=t.getAttribute("data-path-placeholder")||a[s])!==null&&o!==void 0?o:a.getAttribute(s));r!=null?s=="innerHTML"?a.innerHTML!=r&&(a.innerHTML=r):a.getAttribute(s)!=r&&a.setAttribute(s,r):s=="innerHTML"?a.innerHTML=h:a.removeAttribute(s)}}}var xe=["data-attributes-keys","data-path-attributes","data-path-scope"];function x(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 l=s.getAttribute("data-path-scope");if(l){let d=Ee(s),f=te(e,l,!1)||[];d==0&&st(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,[Ae(l)]:f[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,f)=>xe.indexOf(d.name)-xe.indexOf(f.name));for(var u=0;u<h.length;u++){let{name:d,value:f}=h[u];d.startsWith("data-path")&&d!="data-path-scope"&&k(s,d,te(e,f,!0),r),d=="data-embed-src"&&k(s,d,s.getAttribute(d),r)}}for(var u=0,c;c=s.childNodes[u++];)Se(c)&&x(c,e,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,e),s}function Se(t){return t.nodeType==1}function L(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++];)Se(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return x(t,r,n)}function Bt(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 a=ne(o);return x(a[0],e,r).outerHTML}else{let a=document.createElement("div");return a.innerHTML=o,x(a,e,r),a.innerHTML}}var _e=["initial","check","updated"],W={};function Ht(){W={}}async function H(t,e,r,n,i=W){return N({url:t,options:e,validator:r,callback:n,cache:i}).then(z).then(o=>o.response)}function ut(t,e=!1){let r=String(t).replace("?head","");var n=W[r];return!n&&!e&&(n=W[r]={phase:null,initial:g(),check:g(),updated:g(),final:g()}),n}var ie=class extends Error{};async function N({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=ut(t);if(_e.indexOf(s.phase)>=_e.indexOf(o))var u=s[o];else s.phase=o}let c=await(u||fetch(t,e));if(!u&&s&&(c.ok?s[o].resolve(c):s[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let l=new Date(c.headers.get("date"))<a||u&&o=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,l))===!1)throw new ie("Response is not valid");return await(n==null?void 0:n(c,o,l)),{url:t,options:e,isCached:l,response:c,validator:r,callback:n,cache:i}}async function z(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:a}=t;if(r){let{response:s}=await N({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return oe(t)}return t}async function oe(t){return N({...t,options:{...t.options,cache:"reload"}},"updated")}var S="https://feaas.blob.core.windows.net";function J(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,a]=e;return{cdn:r,library:n,component:i,version:o,revision:a}}}function qt(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=S?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Vt(t){return`${t.cdn&&t.cdn!=S?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function ae(t){let e=t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,n,i]=e;return{cdn:r,library:n,revision:i}}else{let o=J(t);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Fe(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...J(t.src)}),`${t.cdn||t.hostname||S}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function q(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...ae(t.src)}),`${t.cdn||t.hostname||S}/styles/${t.library}/${t.revision||"published"}.css`}async function j(t,e,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(e),o=await Promise.all([t.instance&&N({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Fe({...t,version:t.instance}),validator:n}).catch(s=>s),N({url:Fe(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),await i(a.response),r?a:z({...a,callback:i}).catch(s=>{if(o[0]==a&&(oe({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),z({...o[1],callback:i});throw s})}async function Kt(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await j(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function se(t,e){return typeof t=="string"&&(t={src:t}),H(q(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>e(i,n)))}function Qt(t,e){return lt(t,e||(e=document.createElement("style"))),e}function lt(t,e){return e||(e=document.createElement("style")),se(t,(r,n)=>{e.textContent=r}).then(()=>e)}function ue(t,e){var r=ct(t);if(!r)var n=dt(t);return se(t,(i,o)=>{n&&(n.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function Ce(t){return new Promise((e,r)=>{ue(t,e).catch(r)})}function ct(t){return document.head.querySelector(`style[data-href="${q(t)}"]`)}function dt(t){let e=q(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function tr(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return x(n,e),r}function Re(t,e){return ht(t,e||(e=document.createElement("div"))),e}async function ht(t,e){return e||(e=document.createElement("div")),e.childNodes.length?x(e,t.data,t):"template"in t?L(e,t.template,t.data,t):j(t,r=>L(e,r,t.data,t)).then(()=>e)}var le=t=>typeof t=="object"&&"jsonpath"in t&&"url"in t,De=async t=>{try{let e=await fetch(t.url,t);return e?await e.json():{}}catch(e){return{}}};async function Ne(t){if(!t)return t;if(console.log(t),le(t))return De(t);let e=Object.keys(t),r=await Promise.all(e.map(n=>le(t[n])?De(t[n]):null).filter(Boolean));return e.reduce((n,i)=>({...n,[i]:le(t[i])?r.shift():t[i]}),{})}function ft(t){var e,r,n,i,o,a,s,u;let c,l=t.getAttribute("src");if(l){let _=J(l);if(!_)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:h,library:d,component:f,version:b,revision:m}=_}let E=t.getAttribute("data");if(E!=null&&E!="")try{c=typeof E=="string"?JSON.parse(E):{}}catch(_){}return{data:c||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:h)!==null&&r!==void 0?r:S,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:f,version:(a=(o=t.getAttribute("version"))!==null&&o!==void 0?o:b)!==null&&a!==void 0?a:"responsive",revision:(u=(s=t.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&u!==void 0?u:"published",hostname:t.getAttribute("hostname"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null,lastModified:t.getAttribute("last-modified"),withStylesheet:t.getAttribute("with-stylesheet")!="false"}}var V=class extends w{setData(e){this.set({data:e})}getProps(){return ft(this)}attributeChangedCallback(e,r,n){r!==n&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(e,r,n),e==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await Ne(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(e),r&&this.advance()}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=g(e=>this.readyData=e,e=>this.onError(e)),this.defaultProps={cdn:S,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=e=>{this.payload=e,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),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())return;let e=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Ce({...this.props,revision:"published"}).then(()=>{r=null,e()});return Promise.all([r,this.whenDataReady.then(()=>e()),j(this.props,n=>{this.payload=n,e()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)x(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;L(this,this.payload,this.readyData)}}};V.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];V.register("feaas-component");function pt(t){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 K=class extends w{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return pt(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=`
1
+ var Ge=Object.defineProperty;var k=(e,t)=>{for(var r in t)Ge(e,r,{get:t[r],enumerable:!0})};function A(e,t=r=>{}){var r;let n=()=>{var i,o;let a=new Promise((l,c)=>{i=u=>{e==null||e(u),l(u)},o=c});var s=Object.assign(a,{resolve:i,reject:o,restart:n,first:r});return r=s,s.catch(t),s};return n()}var Ve=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Ve{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=A(t=>{this.payload=t}),this.whenRendered=A(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}log(...t){typeof process!="undefined"&&process.env.TESTING||console.log(...t)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:a}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?a?(this.reactRoot||(this.reactRoot=a.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,s){console.error(`FEAAS: ${t.tagName} Error:`,a,s),t.onError(a,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),a=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(a,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[a,s]=n.useReducer(l=>l+1,0);return t.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var D=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},Z=class extends D{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))}};Z.observedAttributes=["counter"];var ue={};k(ue,{renderDOMContent:()=>T,renderDOMElement:()=>w,renderHTMLContent:()=>bt,setDOMAttribute:()=>O});var ie={};k(ie,{JSONPath:()=>p,queryScopes:()=>W,serializeCH1RichText:()=>N});function E(e){return E=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},E(e)}function Ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(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 Se(e,t,r){return t&&xe(e.prototype,t),r&&xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ke(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&&j(e,t)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},j(e,t)}function _e(){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 M(e,t,r){return _e()?M=Reflect.construct.bind():M=function(i,o,a){var s=[null];s.push.apply(s,o);var l=Function.bind.apply(i,s),c=new l;return a&&j(c,a.prototype),c},M.apply(null,arguments)}function Ye(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ee(e){var t=typeof Map=="function"?new Map:void 0;return ee=function(n){if(n===null||!Ye(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 M(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),j(i,n)},ee(e)}function Qe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(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 Qe(e)}function Ze(e){var t=_e();return function(){var n=L(e),i;if(t){var o=L(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Xe(this,i)}}function et(e){return tt(e)||rt(e)||Ce(e)||nt()}function tt(e){if(Array.isArray(e))return te(e)}function rt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ce(e,t){if(e){if(typeof e=="string")return te(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 te(e,t)}}function te(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 nt(){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 it(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ce(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(l){throw l},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 l=r.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}}}var b=Object.prototype.hasOwnProperty;function F(e,t){return e=e.slice(),e.push(t),e}function re(e,t){return t=t.slice(),t.unshift(e),t}var ot=function(e){Ke(r,e);var t=Ze(r);function r(n){var i;return Ee(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 Se(r)}(ee(Error));function p(e,t,r,n,i){if(!(this instanceof p))try{return new p(e,t,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&E(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=b.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){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||E(s)!=="object")throw new ot(s);return s}}p.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,l=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&&E(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=e;t=c.json,s=b.call(e,"flatten")?e.flatten:s,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,l=b.call(e,"wrap")?e.wrap:l,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=b.call(e,"parent")?e.parent:o,a=b.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=p.toPathString(e)),!(!e&&e!==""||!t)){var u=p.toPathArray(e);u[0]==="$"&&u.length>1&&u.shift(),this._hasParentSelector=null;var h=this._trace(u,t,["$"],o,a,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!l&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,f){var g=i._getPreferredOutput(f);return s&&Array.isArray(g)?d=d.concat(g):d.push(g),d},[]):l?[]:void 0}};p.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:p.toPathArray(e.path);return e.pointer=p.toPointer(r),e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return p.toPathString(e[t]);case"pointer":return p.toPointer(e.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),t(n,r,e)}};p.prototype._trace=function(e,t,r,n,i,o,a,s){var l=this,c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(c,o,"value"),c;var u=e[0],h=e.slice(1),d=[];function f(m){Array.isArray(m)?m.forEach(function(qe){d.push(qe)}):d.push(m)}if((typeof u!="string"||s)&&t&&b.call(t,u))f(this._trace(h,t[u],F(r,u),t,u,o,a));else if(u==="*")this._walk(t,function(m){f(l._trace(h,t[m],F(r,m),t,m,o,!0,!0))});else if(u==="..")f(this._trace(h,t,r,n,i,o,a)),this._walk(t,function(m){E(t[m])==="object"&&f(l._trace(e.slice(),t[m],F(r,m),t,m,o,!0))});else{if(u==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(u==="~")return c={path:F(r,u),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(u==="$")f(this._trace(h,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(u))f(this._slice(u,h,t,r,n,i,o));else if(u.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var g=u.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(m){l._eval(g,t[m],m,r,n,i)&&f(l._trace(h,t[m],F(r,m),t,m,o,!0))})}else if(u[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");f(this._trace(re(this._eval(u,t,r[r.length-1],r.slice(0,-1),n,i),h),t,r,n,i,o,a))}else if(u[0]==="@"){var y=!1,v=u.slice(1,-2);switch(v){case"scalar":(!t||!["object","function"].includes(E(t)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":E(t)===v&&(y=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(y=!0);break;case"number":Number.isFinite(t)&&(y=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(y=!0);break;case"object":t&&E(t)===v&&(y=!0);break;case"array":Array.isArray(t)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+v)}if(y)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(u[0]==="`"&&t&&b.call(t,u.slice(1))){var _=u.slice(1);f(this._trace(h,t[_],F(r,_),t,_,o,a,!0))}else if(u.includes(",")){var He=u.split(","),B=it(He),Ae;try{for(B.s();!(Ae=B.n()).done;){var ze=Ae.value;f(this._trace(re(ze,h),t,r,n,i,o,!0))}}catch(m){B.e(m)}finally{B.f()}}else!s&&t&&b.call(t,u)&&f(this._trace(h,t[u],F(r,u),t,u,o,a,!0))}if(this._hasParentSelector)for(var C=0;C<d.length;C++){var I=d[C];if(I&&I.isParentSelector){var $=this._trace(I.expr,t,I.path,n,i,o,a);if(Array.isArray($)){d[C]=$[0];for(var Je=$.length,X=1;X<Je;X++)C++,d.splice(C,0,$[X])}else d[C]=$}}return d};p.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&E(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};p.prototype._slice=function(e,t,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1,u=l[0]&&Number.parseInt(l[0])||0,h=l[1]&&Number.parseInt(l[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),h=h<0?Math.max(0,h+s):Math.min(s,h);for(var d=[],f=u;f<h;f+=c){var g=this._trace(re(f,t),r,n,i,o,a,!0);g.forEach(function(y){d.push(y)})}return d}};p.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=p.toPathString(n.concat([r])));var s="script:"+e;if(!p.cache[s]){var l=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&&(l=l.replace(/@path/g,"_$_path")),p.cache[s]=new this.vm.Script(l)}try{return p.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+e)}};p.cache={};p.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};p.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};p.toPathArray=function(e){var t=p.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 at=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])}},st=function(){function e(t){Ee(this,e),this.code=t}return Se(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];at(i,o,function(u){return typeof r[u]=="function"});var a=i.map(function(u,h){return r[u]}),s=o.reduce(function(u,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+u},"");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 l=n.lastIndexOf(";"),c=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return M(Function,i.concat([c])).apply(void 0,et(a))}}]),e}();p.prototype.vm={Script:st};function W(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((s,l)=>l.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=p({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,l,c)=>c.indexOf(s)===l).reduce((s,l)=>s.length>0?s:p({path:l,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function ne(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 e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return ne(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>ne(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 ne(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var R=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return oe(this.childNodes)}set innerHTML(t){this.childNodes=ae(String(t!=null?t:""))}get outerHTML(){return oe([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Fe(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let a of r)if(Fe(a,o)){n.push(o);break}for(let a of o.childNodes)i(a)};for(let o of this.childNodes)i(o);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+t;o>=0&&o<n.length;o+=t){let a=n[o];if(!r||a.nodeType===1)return a}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function Fe(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],a=i[3],s=t.getAttribute(o);if(typeof a=="undefined"){if(s===void 0)return!1}else if(s!==a)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function ae(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let a=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(u=>{let[h,d,,f]=u.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:ut(f||"")}}))||[],c=new R(a,1);if(c.attributes=l,n.length>0){let u=n[n.length-1];u.childNodes.push(c),c.parentNode=u}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let a=e.indexOf("<"),s=e.slice(0,a!==-1?a:void 0),l=new R("#text",3);if(l.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(l),l.parentNode=c}else r.push(l);e=e.slice(s.length)}}return r}function lt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ut(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function oe(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:a,value:s})=>` ${a}="${lt(String(s))}"`).join(""),o=oe(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function ct(e){let t=new e.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&&dt(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function dt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];H(i,i.getAttribute("data-embed-src"))}if(t)return ct(e)}function H(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var le={};k(le,{cleanCollectionBit:()=>z,getHumanizedLabel:()=>mt,getLastPathBit:()=>yt,getQualifier:()=>pt,normalizeCollectionScope:()=>se,parseLimit:()=>ht,parseRange:()=>ft});var ht=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},ft=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},pt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]+\])$/))===null||t===void 0?void 0:t[0]};function z(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function se(e){return z(e)+".*"}function mt(e,t=2){var r=z(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function yt(e){return z(e).split(".").pop()}function De(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function vt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=De(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var a=i+1,s=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(a++,s=l);for(var c=a;c<t;c++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<a;c++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function O(e,t,r,n){var i,o;if(e){var a=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 s=t.replace("data-path-","");if(t=="data-path-src"){let d=Array.from(e.children).find(f=>f.localName=="picture")||e;a=e.localName=="img"?e:d.querySelector("img, video")}else if(t=="data-path-href")a=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")a=(Array.from(e.children).find(f=>f.localName=="picture")||e).querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")s="innerHTML";else if(t=="data-embed-src")H(e,r);else if(t=="data-path-attributes"){let d=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var c=r[l];O(e,l,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var u=0;u<d.length;u++)(r==null||!(d[u]in r))&&O(e,d[u],null,n);O(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!a){var h=String((o=e.getAttribute("data-path-placeholder")||a[s])!==null&&o!==void 0?o:a.getAttribute(s));r!=null?s=="innerHTML"?a.innerHTML!=r&&(a.innerHTML=r):a.getAttribute(s)!=r&&a.setAttribute(s,r):s=="innerHTML"?a.innerHTML=h:a.removeAttribute(s)}}}var Re=["data-attributes-keys","data-path-attributes","data-path-scope"];function w(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 u=s.getAttribute("data-path-scope");if(u){let d=De(s),f=W(t,u,!1)||[];d==0&&vt(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,[se(u)]:f[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,f)=>Re.indexOf(d.name)-Re.indexOf(f.name));for(var l=0;l<h.length;l++){let{name:d,value:f}=h[l];d.startsWith("data-path")&&d!="data-path-scope"&&O(s,d,W(t,f,!0),r),d=="data-embed-src"&&O(s,d,s.getAttribute(d),r)}}for(var l=0,c;c=s.childNodes[l++];)Ne(c)&&w(c,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function Ne(e){return e.nodeType==1}function T(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,l;l=e.childNodes[s++];)Ne(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return w(e,r,n)}function bt(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 a=ae(o);return w(a[0],t,r).outerHTML}else{let a=document.createElement("div");return a.innerHTML=o,w(a,t,r),a.innerHTML}}var Oe=["initial","check","updated"],J={};function Kt(){J={}}async function q(e,t,r,n,i=J){return P({url:e,options:t,validator:r,callback:n,cache:i}).then(G).then(o=>o.response)}function gt(e,t=!1){let r=String(e).replace("?head","");var n=J[r];return!n&&!t&&(n=J[r]={phase:null,initial:A(),check:A(),updated:A(),final:A()}),n}var ce=class extends Error{};async function P({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=gt(e);if(Oe.indexOf(s.phase)>=Oe.indexOf(o))var l=s[o];else s.phase=o}let c=await(l||fetch(e,t));if(!l&&s&&(c.ok?s[o].resolve(c):s[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let u=new Date(c.headers.get("date"))<a||l&&o=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,u))===!1)throw new ce("Response is not valid");return await(n==null?void 0:n(c,o,u)),{url:e,options:t,isCached:u,response:c,validator:r,callback:n,cache:i}}async function G(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:s}=await P({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return de(e)}return e}async function de(e){return P({...e,options:{...e.options,cache:"reload"}},"updated")}var S="https://feaas.blob.core.windows.net";function V(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,a]=t;return{cdn:r,library:n,component:i,version:o,revision:a}}}function Xt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=S?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Zt(e){return`${e.cdn&&e.cdn!=S?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function he(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=V(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Te(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...V(e.src)}),`${e.cdn||e.hostname||S}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function K(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...he(e.src)}),`${e.cdn||e.hostname||S}/styles/${e.library}/${e.revision||"published"}.css`}async function U(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),o=await Promise.all([e.instance&&P({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Te({...e,version:e.instance}),validator:n}).catch(s=>s),P({url:Te(e),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:G({...a,callback:i}).catch(s=>{if(o[0]==a&&(de({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),G({...o[1],callback:i});throw s})}async function er(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await U(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function fe(e,t){return typeof e=="string"&&(e={src:e}),q(K(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function nr(e,t){return wt(e,t||(t=document.createElement("style"))),t}function wt(e,t){return t||(t=document.createElement("style")),fe(e,(r,n)=>{t.textContent=r}).then(()=>t)}function pe(e,t){var r=At(e);if(!r)var n=xt(e);return fe(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function Pe(e){return new Promise((t,r)=>{pe(e,t).catch(r)})}function At(e){return document.head.querySelector(`style[data-href="${K(e)}"]`)}function xt(e){let t=K(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function sr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return w(n,t),r}function $e(e,t){return Et(e,t||(t=document.createElement("div"))),t}async function Et(e,t){return t||(t=document.createElement("div")),t.childNodes.length?w(t,e.data,e):"template"in e?T(t,e.template,e.data,e):U(e,r=>T(t,r,e.data,e)).then(()=>t)}var me=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0},ke=async e=>{try{let t=await fetch(e.url,e);return t?await t.json():{}}catch(t){return{}}};async function Me(e){if(!e)return e;if(me(e))return ke(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>me(e[n])?ke(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:me(e[i])?r.shift():e[i]}),{})}function St(e){var t,r,n,i,o,a,s,l;let c,u=e.getAttribute("src");if(u){let _=V(u);if(!_)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:h,library:d,component:f,version:g,revision:y}=_}let v=e.getAttribute("data");if(v!=null&&v!="")try{c=typeof v=="string"?JSON.parse(v):{}}catch(_){console.error(_)}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:S,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:f,version:(a=(o=e.getAttribute("version"))!==null&&o!==void 0?o:g)!==null&&a!==void 0?a:"responsive",revision:(l=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:y)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var Y=class extends x{setData(t){this.set({data:t})}getProps(){return St(this)}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await Me(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=A(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:S,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Pe({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),U(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)w(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;T(this,this.payload,this.readyData)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];Y.register("feaas-component");function _t(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var Q=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return _t(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
5
5
  #loader {
6
6
  position: absolute;
7
7
  top: 0;
@@ -65,8 +65,10 @@ 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)}};K.observedAttributes=["hidden","opacity"];K.register("feaas-loader");function yt(t){var e,r,n,i;let o=t.getAttribute("src");if(o)var{cdn:a,library:s,revision:u}=ae(o);return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=(e=t==null?void 0:t.getAttribute("revision"))!==null&&e!==void 0?e:u)!==null&&r!==void 0?r:"published",cdn:(i=(n=t==null?void 0:t.getContextAttribute("cdn"))!==null&&n!==void 0?n:t==null?void 0:t.getContextAttribute("hostname"))!==null&&i!==void 0?i:S}}var ce=class extends w{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return yt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return ue(this.props,this.onLoad)}};ce.register("feaas-stylesheet");var he={};Ie(he,{convertBase64toBlob:()=>Oe,generate:()=>Pe,get:()=>mt,getVersionForThumbnail:()=>Te,load:()=>$e,responseToImage:()=>de,upload:()=>Me});var Oe=t=>fetch(t).then(e=>e.blob()),de=t=>t.blob().then(e=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(e)}));async function Te(t){return t.versions.length||await t.versions.fetch(),t.getVersionForWidth(800)}async function mt(t,e,r){try{if(!t.isNew)return await $e(t,e,r)}catch(i){t.sdk.log(`FEAAS: Thumbnail ${t.id}, version: ${(e==null?void 0:e.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await Pe(t,e);return r==null||r(n,!1),n&&!t.isNew&&Oe(n.src).then(i=>Me(t,e,i)),n}async function $e(t,e,r){let n=e?e.getThumbnailURL():t.getThumbnailURL(),i=t.library.stylesheet,o=new Date(Math.max(Number(t.modifiedAt),Number(i.modifiedAt)));t.sdk.log(`FEAAS: Thumbnail ${t.id}/${(e==null?void 0:e.id)||"responsive"}, loading`);var a;return await H(n,{},(s,u)=>{let c=Math.abs(Number(new Date(s.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return u&&!c&&de(s).then(l=>{a=l,r(l,u)}),c},(s,u,c)=>{t.sdk.log(`FEAAS: Thumbnail ${t.id}/${(e==null?void 0:e.id)||"responsive"}, status: ${u}`),de(s).then(l=>{a=l,r(l,c)})},null),a}async function Pe(t,e){let r=e||(t.isNew?null:await Te(t));if(!r||r.isViewEmpty())return null;let{stylesheet:n,datasources:i}=t.library;return await vt(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((a,s)=>Object.assign(a,{[s.id]:s.sample}),{}),n.css,t.sdk)}function vt(t,e,r,n,i,o){let a=document.createElement("iframe");return a.style.position="absolute",a.style.top="-2000px",a.style.left="-2000px",a.style.width=e.props.minWidth+"px",a.style.height="720px",a.style.zIndex="100011",document.body.appendChild(a),new Promise((s,u)=>{let c=document.createElement("script");c.onerror=u,c.src=o.frontend+"/assets/html2canvas.js",c.onload=()=>{var d;(((d=a.contentWindow.document.fonts)===null||d===void 0?void 0:d.ready)||Promise.resolve()).then(function(){return a.contentWindow.html2canvas(h,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,e.props.minWidth))),width:Math.min(1401,Math.max(320,e.props.minWidth)),height:Math.max(1,Math.min(2e3,h.offsetHeight)),windowWidth:e.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(f=>{let b=f.toDataURL("image/jpeg",.6);a.parentElement.removeChild(a);let m=new Image;m.onload=()=>{s(m)},m.onerror=u,m.src=b})})},a.contentWindow.document.head.appendChild(c);let l=a.contentWindow.document.createElement("style");l.textContent=`
68
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};Q.observedAttributes=["hidden","opacity"];Q.register("feaas-loader");function Ct(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:a,library:s,revision:l}=he(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:S}}var ye=class extends x{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Ct(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return pe(this.props,this.onLoad)}};ye.register("feaas-stylesheet");var ve={};k(ve,{clean:()=>Ft,normalize:()=>Le,toFetchArguments:()=>Rt});function Ft(e){let t={},r=(e==null?void 0:e.method)==="GET"||(e==null?void 0:e.method)==="HEAD"||Object.keys((e==null?void 0:e.body)||{}).length===0,n=e.headers&&(Object.keys(e.headers).length===0||Object.keys(e.headers).length===1&&(e.headers["Content-type"]||e.headers["Content-Type"])&&(e.headers["Content-type"]==="application/json"||e.headers["Content-Type"]==="application/json")),i=e.params||Object.keys(e.params||{}).length===0;return e.method&&e.method!=="GET"&&(t={...t,method:e.method}),e.body&&!r&&(t={...t,body:e.body}),t={...t,headers:n?{"Content-type":"application/json"}:e.headers},e.params&&!i&&(t={...t,params:e.params}),{...t,url:e.url||""}}function Rt(e){let t=Le(e),r=null,n=t.headers["Content-Type"]||t.headers["Content-type"],i=n==="application/json",o=n==="multipart/form-data",a=n==="application/x-www-form-urlencoded";i&&(r=JSON.stringify(t.body)),o&&(r=Object.keys(t.body).reduce((u,h)=>(u.append(h,t.body[h]),u),new FormData)),a&&(r=new URLSearchParams(t.body));let s=Object.keys(t.params).length?`?${new URLSearchParams(t.params)}`:"",l=`${t.url}${s}`,c={};return r&&(c.body=r),Object.keys(t.headers).length&&(c.headers=t.headers),t.method!=="GET"&&(c.method=t.method),[l,c]}function Le(e){return{params:(e==null?void 0:e.params)||{},headers:(e==null?void 0:e.headers)||{},jsonpath:(e==null?void 0:e.jsonpath)||"$",method:(e==null?void 0:e.method)||"GET",body:(e==null?void 0:e.body)||{},url:(e==null?void 0:e.url)||""}}var ge={};k(ge,{convertBase64toBlob:()=>je,generate:()=>Ie,get:()=>Dt,getVersionForThumbnail:()=>Ue,load:()=>Be,responseToImage:()=>be,upload:()=>We});var je=e=>fetch(e).then(t=>t.blob()),be=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function Ue(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function Dt(e,t,r){try{if(!e.isNew)return await Be(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await Ie(e,t);return r==null||r(n,!1),n&&!e.isNew&&je(n.src).then(i=>We(e,t,i)),n}async function Be(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var a;return await q(n,{},(s,l)=>{let c=Math.abs(Number(new Date(s.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return l&&!c&&be(s).then(u=>{a=u,r(u,l)}),c},(s,l,c)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),be(s).then(u=>{a=u,r(u,c)})},null),a}async function Ie(e,t){let r=t||(e.isNew?null:await Ue(e));if(!r||r.isViewEmpty())return null;let{stylesheet:n,datasources:i}=e.library;return await Nt(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((a,s)=>Object.assign(a,{[s.id]:s.sample}),{}),n.css,e.sdk)}function Nt(e,t,r,n,i,o){let a=document.createElement("iframe");return a.style.position="absolute",a.style.top="-2000px",a.style.left="-2000px",a.style.width=t.props.minWidth+"px",a.style.height="720px",a.style.zIndex="100011",document.body.appendChild(a),new Promise((s,l)=>{let c=document.createElement("script");c.onerror=l,c.src=o.frontend+"/assets/html2canvas.js",c.onload=()=>{var f;(((f=a.contentWindow.document.fonts)===null||f===void 0?void 0:f.ready)||Promise.resolve()).then(function(){return a.contentWindow.html2canvas(d,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,d.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(g=>{let y=g.toDataURL("image/jpeg",.6);a.parentElement.removeChild(a);let v=new Image;v.onload=()=>{s(v)},v.onerror=l,v.src=y})})},a.contentWindow.document.head.appendChild(c);let u=a.contentWindow.document.createElement("style");u.textContent=`
69
69
  ${i}
70
70
  body, html { padding: 0; margin: 0; overflow: hidden }
71
- `,a.contentWindow.document.head.appendChild(l);let h=Re({template:r,data:n});h.classList.add(...t,"-feaas--preview","-emulate--"+e.details.slug),a.contentWindow.document.body.appendChild(h)})}async function Me(t,e,r){let n=e?e.getThumbnailURL():t.getThumbnailURL(),i=new Date(Math.max(Number(t.modifiedAt),Number(t.library.stylesheet.modifiedAt)));try{await t.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":e?e.id:null,"x-ms-meta-versionRevision":e?e.revision.toString():null,"x-ms-meta-componentId":t.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":t.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":t.createdAt.toUTCString(),"x-ms-meta-modifiedAt":t.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{t.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(o){t.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var fe;typeof window!="undefined"&&(window.FEAASReactElement=D,(fe=window.FEAASLoading)!==null&&fe!==void 0||(window.FEAASLoading=Promise.resolve()));export{V as Component,ft as ComponentProps,g as ControlledPromise,S as DEFAULT_CDN_URL,w as Element,V as FEAASComponent,ft as FEAASComponentsProps,w as FEAASElement,K as FEAASLoader,pt as FEAASLoaderProps,ce as FEAASStylesheet,yt as FEAASStylesheetProps,ie as InvalidResponse,p as JSONPath,K as Loader,Y as MyComponent,ce as Stylesheet,he as Thumbnail,ot as autoloadScripts,at as cleanCollectionBit,Ht as clearFetchCache,dt as createStylesheet,H as fetchAndRevalidate,j as fetchAndRevalidateComponent,se as fetchAndRevalidateStylesheet,oe as fetchBypassingCache,W as fetchCache,Kt as fetchComponent,z as fetchToValidateCache,N as fetchWithCacheAwareness,ct as findStylesheet,qt as getComponentSource,Fe as getComponentURL,ut as getFetchCache,Pt as getQualifier,Vt as getStylesheetSource,q as getStylesheetURL,I as loadScript,ue as loadStylesheet,Ce as loadStylesheetAllowStale,Ae as normalizeCollectionScope,it as observeDOMElement,J as parseComponentSource,Tt as parseLimit,$t as parseRange,ae as parseStylesheetSource,te as queryScopes,Re as renderComponent,tr as renderComponentElement,ht as renderComponentPromise,L as renderDOMContent,x as renderDOMElement,Bt as renderHTMLContent,Qt as renderStylesheet,lt as renderStylesheetPromise,M as serializeCH1RichText,k as setDOMAttribute};
71
+ `;let h=a.contentWindow.document.createElement("style");h.textContent=`
72
+ body, html { padding: 0; margin: 0; overflow: hidden }
73
+ `,a.contentWindow.document.head.appendChild(u),a.contentWindow.document.head.appendChild(h);let d=$e({template:r,data:n});d.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),a.contentWindow.document.body.appendChild(d)})}async function We(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var we;typeof window!="undefined"&&(window.FEAASReactElement=D,(we=window.FEAASLoading)!==null&&we!==void 0||(window.FEAASLoading=Promise.resolve()));export{Y as Component,St as ComponentProps,A as ControlledPromise,S as DEFAULT_CDN_URL,ue as DOM,ve as DataSettings,le as Datapath,ie as Datascope,x as Element,Y as FEAASComponent,St as FEAASComponentsProps,x as FEAASElement,Q as FEAASLoader,_t as FEAASLoaderProps,ye as FEAASStylesheet,Ct as FEAASStylesheetProps,ce as InvalidResponse,p as JSONPath,Q as Loader,Z as MyComponent,ye as Stylesheet,ge as Thumbnail,dt as autoloadScripts,z as cleanCollectionBit,Kt as clearFetchCache,xt as createStylesheet,q as fetchAndRevalidate,U as fetchAndRevalidateComponent,fe as fetchAndRevalidateStylesheet,de as fetchBypassingCache,J as fetchCache,er as fetchComponent,Me as fetchData,G as fetchToValidateCache,P as fetchWithCacheAwareness,At as findStylesheet,Xt as getComponentSource,Te as getComponentURL,gt as getFetchCache,mt as getHumanizedLabel,yt as getLastPathBit,pt as getQualifier,Zt as getStylesheetSource,K as getStylesheetURL,me as isDataSettings,H as loadScript,pe as loadStylesheet,Pe as loadStylesheetAllowStale,se as normalizeCollectionScope,ct as observeDOMElement,V as parseComponentSource,ht as parseLimit,ft as parseRange,he as parseStylesheetSource,W as queryScopes,$e as renderComponent,sr as renderComponentElement,Et as renderComponentPromise,T as renderDOMContent,w as renderDOMElement,bt as renderHTMLContent,nr as renderStylesheet,wt as renderStylesheetPromise,N as serializeCH1RichText,O as setDOMAttribute};
72
74
  //# sourceMappingURL=headless.esm.js.map