@sitecore-feaas/clientside 0.5.13-alpha.1 → 0.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var ur=Object.create;var Bt=Object.defineProperty;var hr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var fr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var nt=(t,e)=>{for(var r in e)Bt(t,r,{get:e[r],enumerable:!0})},Pe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pr(e))!mr.call(t,i)&&i!==r&&Bt(t,i,{get:()=>e[i],enumerable:!(n=hr(e,i))||n.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?ur(fr(t)):{},Pe(e||!t||!t.__esModule?Bt(r,"default",{value:t,enumerable:!0}):r,t)),vr=t=>Pe(Bt({},"__esModule",{value:!0}),t);var Gr={};nt(Gr,{Component:()=>_e,ComponentProps:()=>me,Context:()=>K,ControlledPromise:()=>F,DEFAULT_CDN_URL:()=>T,DOM:()=>Nt,DataPath:()=>Ft,DataScope:()=>Rt,DataSettings:()=>x,Element:()=>C,External:()=>L,ExternalComponent:()=>zr,ExternalComponentBundle:()=>Hr,FEAASComponent:()=>pt,FEAASComponentsProps:()=>me,FEAASContext:()=>K,FEAASContextProps:()=>xe,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ce,FEAASElement:()=>C,FEAASExternalPropsObject:()=>Re,FEAASLoader:()=>ft,FEAASLoaderProps:()=>ve,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ee,FEAASReactComponent:()=>Oe,FEAASReactServerComponent:()=>cr,FEAASReactStylesheet:()=>lr,FEAASStylesheet:()=>Mt,FEAASStylesheetProps:()=>ge,HTMLNodeToReact:()=>De,InvalidResponse:()=>Dt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>Ot,NextExternalComponent:()=>Jr,Picker:()=>vt,ReactExternalComponent:()=>Vr,ServerComponent:()=>Yr,Stylesheet:()=>qr,Thumbnail:()=>Lt,WebComponent:()=>ce,adjustNumbers:()=>ne,autoloadScripts:()=>Zt,cleanCollectionBit:()=>st,clearFetchCache:()=>Ge,createStylesheet:()=>pe,enableNextClientsideComponents:()=>Ur,fetchAndRevalidate:()=>dt,fetchAndRevalidateComponent:()=>et,fetchAndRevalidateStylesheet:()=>Pt,fetchBypassingCache:()=>kt,fetchCache:()=>ct,fetchComponent:()=>zt,fetchData:()=>Wt,fetchToValidateCache:()=>ut,fetchWithCacheAwareness:()=>Y,findStylesheet:()=>he,getComponent:()=>or,getComponentSource:()=>Ke,getComponentURL:()=>ht,getFetchCache:()=>de,getFramePosition:()=>Ae,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,getStylesheetSource:()=>Ht,getStylesheetURL:()=>G,linkComponents:()=>sr,loadScript:()=>ot,loadStylesheet:()=>Tt,loadStylesheetAllowStale:()=>Vt,normalizeCollectionScope:()=>_t,normalizeFetchAttribute:()=>Ne,observeDOMElement:()=>Qt,parseComponentSource:()=>q,parseLimit:()=>te,parseRange:()=>ee,parseStylesheetSource:()=>U,queryObject:()=>tt,queryObjectRaw:()=>It,queryScopes:()=>it,registerComponent:()=>ar,renderComponent:()=>Jt,renderComponentElement:()=>Qe,renderComponentPromise:()=>fe,renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>Je,renderStylesheet:()=>Xe,renderStylesheetPromise:()=>ue,serializeCH1RichText:()=>z,setContextProperties:()=>Wr,setDOMAttribute:()=>I,setElementImplementation:()=>Ir});module.exports=vr(Gr);var $=Et(require("react"),1),w=Et(require("@sitecore/byoc/react"),1);var Nt={};nt(Nt,{renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>ze,setDOMAttribute:()=>I});var Rt={};nt(Rt,{JSONPath:()=>f,queryObject:()=>tt,queryObjectRaw:()=>It,queryScopes:()=>it,serializeCH1RichText:()=>z});function M(t){return M=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},M(t)}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Te(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 Le(t,e,r){return e&&Te(t.prototype,e),r&&Te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gr(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&&St(t,e)}function wt(t){return wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wt(t)}function St(t,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},St(t,e)}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 xt(t,e,r){return $e()?xt=Reflect.construct.bind():xt=function(i,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(i,a),d=new l;return s&&St(d,s.prototype),d},xt.apply(null,arguments)}function yr(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function qt(t){var e=typeof Map=="function"?new Map:void 0;return qt=function(n){if(n===null||!yr(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 xt(n,arguments,wt(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),St(i,n)},qt(t)}function br(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ar(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 br(t)}function Cr(t){var e=$e();return function(){var n=wt(t),i;if(e){var o=wt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ar(this,i)}}function Er(t){return xr(t)||wr(t)||je(t)||Sr()}function xr(t){if(Array.isArray(t))return Gt(t)}function wr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function je(t,e){if(t){if(typeof t=="string")return Gt(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 Gt(t,e)}}function Gt(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 Sr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var ur=Object.create;var It=Object.defineProperty;var hr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var fr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var nt=(t,e)=>{for(var r in e)It(t,r,{get:e[r],enumerable:!0})},Pe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pr(e))!mr.call(t,i)&&i!==r&&It(t,i,{get:()=>e[i],enumerable:!(n=hr(e,i))||n.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?ur(fr(t)):{},Pe(e||!t||!t.__esModule?It(r,"default",{value:t,enumerable:!0}):r,t)),vr=t=>Pe(It({},"__esModule",{value:!0}),t);var Gr={};nt(Gr,{Component:()=>_e,ComponentProps:()=>me,Context:()=>K,ControlledPromise:()=>F,DEFAULT_CDN_URL:()=>T,DOM:()=>Nt,DataPath:()=>Ft,DataScope:()=>Rt,DataSettings:()=>x,Element:()=>C,External:()=>L,ExternalComponent:()=>zr,ExternalComponentBundle:()=>Hr,FEAASComponent:()=>pt,FEAASComponentsProps:()=>me,FEAASContext:()=>K,FEAASContextProps:()=>xe,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ce,FEAASElement:()=>C,FEAASExternalPropsObject:()=>Re,FEAASLoader:()=>ft,FEAASLoaderProps:()=>ve,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ee,FEAASReactComponent:()=>Oe,FEAASReactServerComponent:()=>cr,FEAASReactStylesheet:()=>lr,FEAASStylesheet:()=>Mt,FEAASStylesheetProps:()=>ge,HTMLNodeToReact:()=>De,InvalidResponse:()=>Dt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>Ot,NextExternalComponent:()=>Jr,Picker:()=>vt,ReactExternalComponent:()=>Vr,ServerComponent:()=>Yr,Stylesheet:()=>qr,Thumbnail:()=>Lt,WebComponent:()=>ce,adjustNumbers:()=>ne,autoloadScripts:()=>Zt,cleanCollectionBit:()=>st,clearFetchCache:()=>Ge,createStylesheet:()=>pe,enableNextClientsideComponents:()=>Ur,fetchAndRevalidate:()=>dt,fetchAndRevalidateComponent:()=>et,fetchAndRevalidateStylesheet:()=>Pt,fetchBypassingCache:()=>kt,fetchCache:()=>ct,fetchComponent:()=>zt,fetchData:()=>Wt,fetchToValidateCache:()=>ut,fetchWithCacheAwareness:()=>Y,findStylesheet:()=>he,getComponent:()=>or,getComponentSource:()=>Ke,getComponentURL:()=>ht,getFetchCache:()=>de,getFramePosition:()=>Ae,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,getStylesheetSource:()=>Ht,getStylesheetURL:()=>G,linkComponents:()=>sr,loadScript:()=>ot,loadStylesheet:()=>Tt,loadStylesheetAllowStale:()=>Vt,normalizeCollectionScope:()=>_t,normalizeFetchAttribute:()=>Ne,observeDOMElement:()=>Qt,parseComponentSource:()=>q,parseLimit:()=>te,parseRange:()=>ee,parseStylesheetSource:()=>U,queryObject:()=>tt,queryObjectRaw:()=>Bt,queryScopes:()=>it,registerComponent:()=>ar,renderComponent:()=>Jt,renderComponentElement:()=>Qe,renderComponentPromise:()=>fe,renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>Je,renderStylesheet:()=>Xe,renderStylesheetPromise:()=>ue,serializeCH1RichText:()=>z,setContextProperties:()=>Wr,setDOMAttribute:()=>B,setElementImplementation:()=>Br});module.exports=vr(Gr);var $=Et(require("react"),1),w=Et(require("@sitecore/byoc/react"),1);var Nt={};nt(Nt,{renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>ze,setDOMAttribute:()=>B});var Rt={};nt(Rt,{JSONPath:()=>f,queryObject:()=>tt,queryObjectRaw:()=>Bt,queryScopes:()=>it,serializeCH1RichText:()=>z});function M(t){return M=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},M(t)}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Te(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 Le(t,e,r){return e&&Te(t.prototype,e),r&&Te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gr(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&&St(t,e)}function wt(t){return wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wt(t)}function St(t,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},St(t,e)}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 xt(t,e,r){return $e()?xt=Reflect.construct.bind():xt=function(i,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(i,a),d=new l;return s&&St(d,s.prototype),d},xt.apply(null,arguments)}function yr(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function qt(t){var e=typeof Map=="function"?new Map:void 0;return qt=function(n){if(n===null||!yr(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 xt(n,arguments,wt(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),St(i,n)},qt(t)}function br(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ar(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 br(t)}function Cr(t){var e=$e();return function(){var n=wt(t),i;if(e){var o=wt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ar(this,i)}}function Er(t){return xr(t)||wr(t)||je(t)||Sr()}function xr(t){if(Array.isArray(t))return Gt(t)}function wr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function je(t,e){if(t){if(typeof t=="string")return Gt(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 Gt(t,e)}}function Gt(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 Sr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=je(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(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,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var R=Object.prototype.hasOwnProperty;function Z(t,e){return t=t.slice(),t.push(e),t}function Kt(t,e){return e=e.slice(),e.unshift(t),e}var _r=function(t){gr(r,t);var e=Cr(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 Le(r)}(qt(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(t,e,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&M(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=R.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 s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;var a=this.evaluate(s);if(!a||M(a)!=="object")throw new _r(a);return a}}f.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,s=this.parentProperty,a=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,e=e||this.json,t=t||this.path,t&&M(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(!R.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var d=t;e=d.json,a=R.call(t,"flatten")?t.flatten:a,this.currResultType=R.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=R.call(t,"sandbox")?t.sandbox:this.currSandbox,l=R.call(t,"wrap")?t.wrap:l,this.currPreventEval=R.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=R.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=R.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=R.call(t,"parent")?t.parent:o,s=R.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(o=o||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!e)){var c=f.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var h=this._trace(c,e,["$"],o,s,r).filter(function(u){return u&&!u.isParentSelector});return h.length?!l&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(u,p){var m=i._getPreferredOutput(p);return a&&Array.isArray(m)?u=u.concat(m):u.push(m),u},[]):l?[]:void 0}};f.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(r),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return f.toPathString(t[e]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),e(n,r,t)}};f.prototype._trace=function(t,e,r,n,i,o,s,a){var l=this,d;if(!t.length)return d={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(d,o,"value"),d;var c=t[0],h=t.slice(1),u=[];function p(b){Array.isArray(b)?b.forEach(function(y){u.push(y)}):u.push(b)}if((typeof c!="string"||a)&&e&&R.call(e,c))p(this._trace(h,e[c],Z(r,c),e,c,o,s));else if(c==="*")this._walk(e,function(b){p(l._trace(h,e[b],Z(r,b),e,b,o,!0,!0))});else if(c==="..")p(this._trace(h,e,r,n,i,o,s)),this._walk(e,function(b){M(e[b])==="object"&&p(l._trace(t.slice(),e[b],Z(r,b),e,b,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(c==="~")return d={path:Z(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(d,o,"property"),d;if(c==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))p(this._slice(c,h,e,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var m=c.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(b){l._eval(m,e[b],b,r,n,i)&&p(l._trace(h,e[b],Z(r,b),e,b,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Kt(this._eval(c,e,r[r.length-1],r.slice(0,-1),n,i),h),e,r,n,i,o,s))}else if(c[0]==="@"){var v=!1,g=c.slice(1,-2);switch(g){case"scalar":(!e||!["object","function"].includes(M(e)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":M(e)===g&&(v=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(v=!0);break;case"number":Number.isFinite(e)&&(v=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(v=!0);break;case"object":e&&M(e)===g&&(v=!0);break;case"array":Array.isArray(e)&&(v=!0);break;case"other":v=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(v=!0);break;default:throw new TypeError("Unknown value type "+g)}if(v)return d={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(d,o,"value"),d}else if(c[0]==="`"&&e&&R.call(e,c.slice(1))){var E=c.slice(1);p(this._trace(h,e[E],Z(r,E),e,E,o,s,!0))}else if(c.includes(",")){var D=c.split(","),j=Rr(D),rt;try{for(j.s();!(rt=j.n()).done;){var $t=rt.value;p(this._trace(Kt($t,h),e,r,n,i,o,!0))}}catch(b){j.e(b)}finally{j.f()}}else!a&&e&&R.call(e,c)&&p(this._trace(h,e[c],Z(r,c),e,c,o,s,!0))}if(this._hasParentSelector)for(var k=0;k<u.length;k++){var W=u[k];if(W&&W.isParentSelector){var O=this._trace(W.expr,e,W.path,n,i,o,s);if(Array.isArray(O)){u[k]=O[0];for(var gt=O.length,X=1;X<gt;X++)k++,u.splice(k,0,O[X])}else u[k]=O}}return u};f.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&M(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};f.prototype._slice=function(t,e,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,l=t.split(":"),d=l[2]&&Number.parseInt(l[2])||1,c=l[0]&&Number.parseInt(l[0])||0,h=l[1]&&Number.parseInt(l[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),h=h<0?Math.max(0,h+a):Math.min(a,h);for(var u=[],p=c;p<h;p+=d){var m=this._trace(Kt(p,e),r,n,i,o,s,!0);m.forEach(function(v){u.push(v)})}return u}};f.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var s=t.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+t;if(!f.cache[a]){var l=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");s&&(l=l.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(d){throw new Error("jsonPath: "+d.message+": "+t)}};f.cache={};f.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};f.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(t){var e=f.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return e[t]=i,e[t].concat()};var Fr=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var s=e[o];n(s)&&r.push(e.splice(o--,1)[0])}},Nr=function(){function t(e){Me(this,t),this.code=e}return Le(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Fr(i,o,function(c){return typeof r[c]=="function"});var s=i.map(function(c,h){return r[c]}),a=o.reduce(function(c,h){var u=r[h].toString();return/function/.test(u)||(u="function "+u),"var "+h+"="+u+";"+c},"");n=a+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(";"),d=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return xt(Function,i.concat([d])).apply(void 0,Er(s))}}]),t}();f.prototype.vm={Script:Nr};function It(t,e){try{return f({path:e,json:t})}catch(r){return[]}}function tt(t,e,r=!0){let n=It(t,e)||[];return r?n.flat(1/0):n}function it(t,e,r=!1,n=t,i=!0){var o=e;let s=Object.keys(t).sort((l,d)=>d.length-l.length);for(let l of s)if(e.startsWith(l)){if(l==e){if(r)return t[l];continue}o=e.substring(l.length+1),n=t[l];break}var a=tt(n,o,i);return a.length==0&&(a=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter((l,d,c)=>c.indexOf(l)===d).reduce((l,d)=>l.length>0?l:tt(n,d,i),[])),r?a[0]:a}function Xt(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${z(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):z(t)}function z(t){var e;if(Array.isArray(t))return t.map(z).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 Xt(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>Xt(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 Xt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}function Qt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&ot(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&Zt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Zt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];ot(i,i.getAttribute("data-embed-src"))}if(e)return Qt(t)}function ot(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 Ft={};nt(Ft,{adjustNumbers:()=>ne,cleanCollectionBit:()=>st,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,normalizeCollectionScope:()=>_t,parseLimit:()=>te,parseRange:()=>ee});var te=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},ee=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},re=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function st(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function _t(t){return st(t)+".*"}function ne(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+e)))}function ie(t,e=2){var r=st(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-e).join(" ")}function oe(t){return st(t).split(".").pop()}var Or=["January","February","March","April","May","June","July","August","September","October","November","December"],Be=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=Or[t.getMonth()],n=t.getDate();return`${r} ${n}, ${e}`},Ie=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function We(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 Dr(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=We(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 s=i+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var d=s;d<e;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,e);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function I(t,e,r,n){var i,o,s;if(!t)return;var a=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=z(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var l=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let g=Array.from(t.children).find(E=>E.localName=="picture")||t;a=t.localName=="img"?t:g.querySelector("img, video")}else if(e=="data-path-href")a=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")l="innerHTML";else if(e=="data-embed-src")ot(t,r);else if(e=="data-path-attributes"){if(!Array.isArray(r)){let g=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var d in r){var c=r[d];I(t,d,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var h=0;h<g.length;h++)(r==null||!(g[h]in r))&&I(t,g[h],null,n);I(t,"data-attributes-keys",Object.keys(r||{}).join(","))}if(t.tagName=="FEAAS-EXTERNAL"){let g=String(t.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";I(t,"datasources",JSON.stringify({[g]:r}))}return}if(typeof r=="boolean"&&(r=r?"":null),!a)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var p=String((s=(o=t.getAttribute("data-path-placeholder")||a[l])!==null&&o!==void 0?o:a.getAttribute(l))!==null&&s!==void 0?s:"");l=="innerHTML"?a.innerHTML=p:p?a.setAttribute(l,p):a.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var m=String(r),v=a;v.parentElement&&v.localName.match(/^(a|var|strong|em|i|b)$/);)v=v.parentElement;v.localName.match(/p|h\d|button|time|li/)&&(m=m.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(v.getAttribute("class")).includes("-inline--time")&&Ie(m)&&(m=Be(new Date(m))),a.innerHTML!=m&&(a.innerHTML=m)}else a.getAttribute(l)!=r&&a.setAttribute(l,r);else a.removeAttribute(l)}var Ue=["data-attributes-keys","data-path-attributes","data-path-scope"];function _(t,e,r,n){var i,o,s;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let c=a.getAttribute("data-path-scope");if(c){let u=We(a),p=it(e,c,!1);u==0&&Dr(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,p))===!1?1:p.length,r),e={...e,[_t(c)]:p[u]}}let h=Array.prototype.slice.call(a.attributes).sort((u,p)=>Ue.indexOf(u.name)-Ue.indexOf(p.name));for(var l=0;l<h.length;l++){let{name:u,value:p}=h[l];u.startsWith("data-path")&&u!="data-path-scope"&&I(a,u,it(e,p,!0,void 0,a.tagName!="FEAAS-EXTERNAL"),r),u=="data-embed-src"&&I(a,u,a.getAttribute(u),r)}}for(var l=0,d;d=a.childNodes[l++];)He(d)&&_(d,e,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,e),a}function He(t){return t.nodeType==1}function V(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 a=0,l;l=t.childNodes[a++];)He(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return _(t,r,n)}function ze(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 s=Ut(o);return _(s[0],e,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,_(s,e,r),s.innerHTML}}var J=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new J(i)},createDocumentFragment(){return new J(null,11)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return se(this.childNodes)}set innerHTML(e){this.childNodes=Ut(String(e!=null?e:""))}get outerHTML(){return se([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Ve(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(Ve(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};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 s=n[o];if(!r||s.nodeType===1)return s}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 J(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 Ve(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],s=i[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function Ut(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let s=i[1].toLowerCase(),l=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(c=>{let[h,u,,p]=c.match(/([\w-]+)(="([^"]*)")?/);return{name:u,value:Pr(p||"")}}))||[],d=new J(s,1);if(d.attributes=l,n.length>0){let c=n[n.length-1];c.childNodes.push(d),d.parentNode=c}else r.push(d);["img","input","br"].includes(s)||n.push(d),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),l=new J("#text",3);if(l.textContent=a,n.length>0){let d=n[n.length-1];d.childNodes.push(l),l.parentNode=d}else r.push(l);t=t.slice(a.length)}}return r}function kr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Pr(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function se(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:s,value:a})=>` ${s}="${kr(String(a))}"`).join(""),o=se(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Je(t,e,r){return ae(t,e,r)[0].outerHTML}function ae(t,e,r){var n;let i=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,t,e))||t;return Ut(i).map(s=>_(s,e,r))}function Tr(t){let{params:e,method:r,headers:n,body:i,url:o}=x(t);var s={url:o},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(s.headers=a),r!=="GET"&&(s.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(s.body=i),Object.keys(e).length>0&&(s={...s,params:e}),s}var at=t=>{if(!t||typeof t.url!="string")return!1;for(var e in t)if(!(e=="body"||e=="params"||e=="headers"||e=="url"||e==="method"||e=="jsonpath"&&typeof t[e]=="string"))return!1;return!0};function Ye(t){let{url:e,headers:r,params:n,method:i,body:o}=x(t),s,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((d,c)=>(d.append(c,o[c]),d),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${e}${l}`,{headers:r,body:s,method:i}]}function x(t){let e={};for(let r in(t==null?void 0:t.headers)||{})if(t.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());e[n]=t.headers[r]}return e.Accept||(e.Accept="application/json"),{params:(t==null?void 0:t.params)||{},headers:e,jsonpath:String((t==null?void 0:t.jsonpath)||"$"),method:((t==null?void 0:t.method)||"GET").toUpperCase(),body:(t==null?void 0:t.body)||{},url:String((t==null?void 0:t.url)||"")}}var le=async t=>{try{let[e,r]=Ye(t),i=await(await x.fetchImplementation(e,{...r,method:r.method.toLowerCase()})).json();return t.jsonpath&&t.jsonpath!="$"?tt(i,t.jsonpath):i}catch(e){return{}}};async function Wt(t){if(!t)return t;if(at(t))return le(t);let e=Object.keys(t),r=await Promise.all(e.map(n=>at(t[n])?le(t[n]):null).filter(Boolean));return e.reduce((n,i)=>({...n,[i]:at(t[i])?r.shift():t[i]}),{})}function Mr(t){return t?at(t)||Object.values(t).some(at):!1}x.clean=Tr;x.toFetchArguments=Ye;x.fetchOne=le;x.fetch=Wt;x.isDataSettings=at;x.hasDataSettings=Mr;x.fetchImplementation=(...t)=>fetch(...t);var we={};nt(we,{Component:()=>pt,ComponentProps:()=>me,Context:()=>K,ControlledPromise:()=>F,DEFAULT_CDN_URL:()=>T,DOM:()=>Nt,DataPath:()=>Ft,DataScope:()=>Rt,DataSettings:()=>x,Element:()=>C,FEAASComponent:()=>pt,FEAASComponentsProps:()=>me,FEAASContext:()=>K,FEAASContextProps:()=>xe,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ce,FEAASElement:()=>C,FEAASLoader:()=>ft,FEAASLoaderProps:()=>ve,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ee,FEAASStylesheet:()=>Mt,FEAASStylesheetProps:()=>ge,InvalidResponse:()=>Dt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>Ot,Picker:()=>vt,Stylesheet:()=>Mt,Thumbnail:()=>Lt,WebComponent:()=>ce,adjustNumbers:()=>ne,autoloadScripts:()=>Zt,cleanCollectionBit:()=>st,clearFetchCache:()=>Ge,createStylesheet:()=>pe,fetchAndRevalidate:()=>dt,fetchAndRevalidateComponent:()=>et,fetchAndRevalidateStylesheet:()=>Pt,fetchBypassingCache:()=>kt,fetchCache:()=>ct,fetchComponent:()=>zt,fetchData:()=>Wt,fetchToValidateCache:()=>ut,fetchWithCacheAwareness:()=>Y,findStylesheet:()=>he,getComponentSource:()=>Ke,getComponentURL:()=>ht,getFetchCache:()=>de,getFramePosition:()=>Ae,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,getStylesheetSource:()=>Ht,getStylesheetURL:()=>G,loadScript:()=>ot,loadStylesheet:()=>Tt,loadStylesheetAllowStale:()=>Vt,normalizeCollectionScope:()=>_t,observeDOMElement:()=>Qt,parseComponentSource:()=>q,parseLimit:()=>te,parseRange:()=>ee,parseStylesheetSource:()=>U,queryObject:()=>tt,queryObjectRaw:()=>It,queryScopes:()=>it,renderComponent:()=>Jt,renderComponentElement:()=>Qe,renderComponentPromise:()=>fe,renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>ze,renderStylesheet:()=>Xe,renderStylesheetPromise:()=>ue,serializeCH1RichText:()=>z,setDOMAttribute:()=>I});function F(t,e=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,d)=>{i=c=>{t==null||t(c),l(c)},o=d});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(e),a};return n()}var ce=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,C=class extends ce{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=F(e=>{this.payload=e}),this.whenRendered=F(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var 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.dispatchEventIndirectly(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.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;if(!this.connected)return;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=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.getAttribute("hydrate")=="false"&&this.firstElementChild||(!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact&&this.connected?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,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(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(s,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[s,a]=n.useReducer(l=>l+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),o=this.props[r],s=i?JSON.stringify(o):String(o),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c=this.getAttribute(d);try{var n=i?JSON.stringify(JSON.parse(c)):c}catch(h){var n=null}o==null||s===l?this.removeAttribute(d):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=s&&this.setAttribute(d,s)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var lt=class extends C{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)}},Ot=class extends lt{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))}};Ot.observedAttributes=["counter"];var qe=["initial","check","updated"],ct={};function Ge(){ct={}}async function dt(t,e,r,n,i=ct){return Y({url:t,options:e,validator:r,callback:n,cache:i}).then(ut).then(o=>o.response)}async function Y({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=de(t);if(qe.indexOf(a.phase)>=qe.indexOf(o))var l=a[o];else a.phase=o}let d=await(l||fetch(t,e));if(!l&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let c=new Date(d.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,c))===!1)throw new Dt("Response is not valid");return await(n==null?void 0:n(d,o,c)),{url:t,options:e,isCached:c,response:d,validator:r,callback:n,cache:i}}function de(t,e=!1){let r=String(t).replace("?head","");var n=ct[r];return!n&&!e&&(n=ct[r]={phase:null,initial:F(),check:F(),updated:F(),final:F()}),n}var Dt=class extends Error{};async function ut(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:s}=t;if(r){let{response:a}=await Y({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return kt(t)}return t}async function kt(t){return Y({...t,options:{...t.options,cache:"reload"}},"updated")}var T="https://feaas.blob.core.windows.net";function q(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,s]=e;return{cdn:r,library:n,component:i,version:o,revision:s}}}function Ke(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=T?`${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 Ht(t){return`${t.cdn&&t.cdn!=T?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function U(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=q(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 ht(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...q(t.src)}),`${t.cdn||t.hostname||T}/components/${t.library}/${t.component}/${t.version||"responsive"}/${t.revision||"published"}.html`}function G(t){if(typeof t=="string"&&(t={src:t}),"src"in t){if(String(t.src).includes("v1/files/components/styles"))return t.src;t={...U(t.src)}}return`${t.cdn||t.hostname||T}/styles/${t.library}/${t.revision=="staged"?"staged":t.revision=="saved"?"saved":"published"}.css`}async function et(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&Y({options:{headers:{Accept:"text/html"},credentials:"omit"},url:ht({...t,version:t.instance}),validator:n}).catch(a=>a),Y({url:ht(t),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:ut({...s,callback:i}).catch(a=>{if(o[0]==s&&(kt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),ut({...o[1],callback:i});throw a})}async function zt(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await et(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function Pt(t,e){return dt(G(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 Xe(t,e){return ue(t,e||(e=document.createElement("style"))),e}function ue(t,e){return e||(e=document.createElement("style")),Pt(t,(r,n)=>{e.textContent=r}).then(()=>e)}var Lr=new WeakSet;function Tt(t,e){var r,n=he(t);if(n){if(Lr.has(n))return Promise.resolve(n);t=n.getAttribute("data-href")||n.getAttribute("href")}return Pt(t,(i,o)=>{o=="initial"&&n||(r||(r=!n||n.tagName=="LINK"?pe(t):n),r.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function Vt(t){return new Promise((e,r)=>{Tt(t,e).catch(r)})}function he(t){let e=G(t),{library:r}=U(e),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${e}"],
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var R=Object.prototype.hasOwnProperty;function Z(t,e){return t=t.slice(),t.push(e),t}function Kt(t,e){return e=e.slice(),e.unshift(t),e}var _r=function(t){gr(r,t);var e=Cr(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 Le(r)}(qt(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(t,e,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&M(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=R.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 s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;var a=this.evaluate(s);if(!a||M(a)!=="object")throw new _r(a);return a}}f.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,s=this.parentProperty,a=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,e=e||this.json,t=t||this.path,t&&M(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(!R.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var d=t;e=d.json,a=R.call(t,"flatten")?t.flatten:a,this.currResultType=R.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=R.call(t,"sandbox")?t.sandbox:this.currSandbox,l=R.call(t,"wrap")?t.wrap:l,this.currPreventEval=R.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=R.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=R.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=R.call(t,"parent")?t.parent:o,s=R.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(o=o||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!e)){var c=f.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var h=this._trace(c,e,["$"],o,s,r).filter(function(u){return u&&!u.isParentSelector});return h.length?!l&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(u,p){var m=i._getPreferredOutput(p);return a&&Array.isArray(m)?u=u.concat(m):u.push(m),u},[]):l?[]:void 0}};f.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(r),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return f.toPathString(t[e]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),e(n,r,t)}};f.prototype._trace=function(t,e,r,n,i,o,s,a){var l=this,d;if(!t.length)return d={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(d,o,"value"),d;var c=t[0],h=t.slice(1),u=[];function p(b){Array.isArray(b)?b.forEach(function(y){u.push(y)}):u.push(b)}if((typeof c!="string"||a)&&e&&R.call(e,c))p(this._trace(h,e[c],Z(r,c),e,c,o,s));else if(c==="*")this._walk(e,function(b){p(l._trace(h,e[b],Z(r,b),e,b,o,!0,!0))});else if(c==="..")p(this._trace(h,e,r,n,i,o,s)),this._walk(e,function(b){M(e[b])==="object"&&p(l._trace(t.slice(),e[b],Z(r,b),e,b,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(c==="~")return d={path:Z(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(d,o,"property"),d;if(c==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))p(this._slice(c,h,e,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var m=c.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(b){l._eval(m,e[b],b,r,n,i)&&p(l._trace(h,e[b],Z(r,b),e,b,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Kt(this._eval(c,e,r[r.length-1],r.slice(0,-1),n,i),h),e,r,n,i,o,s))}else if(c[0]==="@"){var v=!1,g=c.slice(1,-2);switch(g){case"scalar":(!e||!["object","function"].includes(M(e)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":M(e)===g&&(v=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(v=!0);break;case"number":Number.isFinite(e)&&(v=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(v=!0);break;case"object":e&&M(e)===g&&(v=!0);break;case"array":Array.isArray(e)&&(v=!0);break;case"other":v=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(v=!0);break;default:throw new TypeError("Unknown value type "+g)}if(v)return d={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(d,o,"value"),d}else if(c[0]==="`"&&e&&R.call(e,c.slice(1))){var E=c.slice(1);p(this._trace(h,e[E],Z(r,E),e,E,o,s,!0))}else if(c.includes(",")){var D=c.split(","),j=Rr(D),rt;try{for(j.s();!(rt=j.n()).done;){var $t=rt.value;p(this._trace(Kt($t,h),e,r,n,i,o,!0))}}catch(b){j.e(b)}finally{j.f()}}else!a&&e&&R.call(e,c)&&p(this._trace(h,e[c],Z(r,c),e,c,o,s,!0))}if(this._hasParentSelector)for(var k=0;k<u.length;k++){var W=u[k];if(W&&W.isParentSelector){var O=this._trace(W.expr,e,W.path,n,i,o,s);if(Array.isArray(O)){u[k]=O[0];for(var gt=O.length,X=1;X<gt;X++)k++,u.splice(k,0,O[X])}else u[k]=O}}return u};f.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&M(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};f.prototype._slice=function(t,e,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,l=t.split(":"),d=l[2]&&Number.parseInt(l[2])||1,c=l[0]&&Number.parseInt(l[0])||0,h=l[1]&&Number.parseInt(l[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),h=h<0?Math.max(0,h+a):Math.min(a,h);for(var u=[],p=c;p<h;p+=d){var m=this._trace(Kt(p,e),r,n,i,o,s,!0);m.forEach(function(v){u.push(v)})}return u}};f.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var s=t.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+t;if(!f.cache[a]){var l=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");s&&(l=l.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(d){throw new Error("jsonPath: "+d.message+": "+t)}};f.cache={};f.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};f.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(t){var e=f.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return e[t]=i,e[t].concat()};var Fr=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var s=e[o];n(s)&&r.push(e.splice(o--,1)[0])}},Nr=function(){function t(e){Me(this,t),this.code=e}return Le(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Fr(i,o,function(c){return typeof r[c]=="function"});var s=i.map(function(c,h){return r[c]}),a=o.reduce(function(c,h){var u=r[h].toString();return/function/.test(u)||(u="function "+u),"var "+h+"="+u+";"+c},"");n=a+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(";"),d=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return xt(Function,i.concat([d])).apply(void 0,Er(s))}}]),t}();f.prototype.vm={Script:Nr};function Bt(t,e){try{return f({path:e,json:t})}catch(r){return[]}}function tt(t,e,r=!0){let n=Bt(t,e)||[];return r?n.flat(1/0):n}function it(t,e,r=!1,n=t,i=!0){var o=e;let s=Object.keys(t).sort((l,d)=>d.length-l.length);for(let l of s)if(e.startsWith(l)){if(l==e){if(r)return t[l];continue}o=e.substring(l.length+1),n=t[l];break}var a=tt(n,o,i);return a.length==0&&(a=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter((l,d,c)=>c.indexOf(l)===d).reduce((l,d)=>l.length>0?l:tt(n,d,i),[])),r?a[0]:a}function Xt(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${z(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):z(t)}function z(t){var e;if(Array.isArray(t))return t.map(z).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 Xt(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>Xt(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 Xt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}function Qt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&ot(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&Zt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Zt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];ot(i,i.getAttribute("data-embed-src"))}if(e)return Qt(t)}function ot(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 Ft={};nt(Ft,{adjustNumbers:()=>ne,cleanCollectionBit:()=>st,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,normalizeCollectionScope:()=>_t,parseLimit:()=>te,parseRange:()=>ee});var te=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},ee=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},re=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function st(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function _t(t){return st(t)+".*"}function ne(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+e)))}function ie(t,e=2){var r=st(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-e).join(" ")}function oe(t){return st(t).split(".").pop()}var Or=["January","February","March","April","May","June","July","August","September","October","November","December"],Ie=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=Or[t.getMonth()],n=t.getDate();return`${r} ${n}, ${e}`},Be=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function We(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 Dr(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=We(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 s=i+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var d=s;d<e;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,e);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function B(t,e,r,n){var i,o,s;if(!t)return;var a=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=z(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var l=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let g=Array.from(t.children).find(E=>E.localName=="picture")||t;a=t.localName=="img"?t:g.querySelector("img, video")}else if(e=="data-path-href")a=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")l="innerHTML";else if(e=="data-embed-src")ot(t,r);else if(e=="data-path-attributes"){if(!Array.isArray(r)){let g=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var d in r){var c=r[d];B(t,d,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var h=0;h<g.length;h++)(r==null||!(g[h]in r))&&B(t,g[h],null,n);B(t,"data-attributes-keys",Object.keys(r||{}).join(","))}if(t.tagName=="FEAAS-EXTERNAL"){let g=String(t.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";B(t,"datasources",JSON.stringify({[g]:r}))}return}if(typeof r=="boolean"&&(r=r?"":null),!a)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var p=String((s=(o=t.getAttribute("data-path-placeholder")||a[l])!==null&&o!==void 0?o:a.getAttribute(l))!==null&&s!==void 0?s:"");l=="innerHTML"?a.innerHTML=p:p?a.setAttribute(l,p):a.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var m=String(r),v=a;v.parentElement&&v.localName.match(/^(a|var|strong|em|i|b)$/);)v=v.parentElement;v.localName.match(/p|h\d|button|time|li/)&&(m=m.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(v.getAttribute("class")).includes("-inline--time")&&Be(m)&&(m=Ie(new Date(m))),a.innerHTML!=m&&(a.innerHTML=m)}else a.getAttribute(l)!=r&&a.setAttribute(l,r);else a.removeAttribute(l)}var Ue=["data-attributes-keys","data-path-attributes","data-path-scope"];function _(t,e,r,n){var i,o,s;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let c=a.getAttribute("data-path-scope");if(c){let u=We(a),p=it(e,c,!1);u==0&&Dr(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,p))===!1?1:p.length,r),e={...e,[_t(c)]:p[u]}}let h=Array.prototype.slice.call(a.attributes).sort((u,p)=>Ue.indexOf(u.name)-Ue.indexOf(p.name));for(var l=0;l<h.length;l++){let{name:u,value:p}=h[l];u.startsWith("data-path")&&u!="data-path-scope"&&B(a,u,it(e,p,!0,void 0,a.tagName!="FEAAS-EXTERNAL"),r),u=="data-embed-src"&&B(a,u,a.getAttribute(u),r)}}for(var l=0,d;d=a.childNodes[l++];)He(d)&&_(d,e,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,e),a}function He(t){return t.nodeType==1}function V(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 a=0,l;l=t.childNodes[a++];)He(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return _(t,r,n)}function ze(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 s=Ut(o);return _(s[0],e,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,_(s,e,r),s.innerHTML}}var J=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new J(i)},createDocumentFragment(){return new J(null,11)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return se(this.childNodes)}set innerHTML(e){this.childNodes=Ut(String(e!=null?e:""))}get outerHTML(){return se([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Ve(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(Ve(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};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 s=n[o];if(!r||s.nodeType===1)return s}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 J(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 Ve(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],s=i[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function Ut(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let s=i[1].toLowerCase(),l=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(c=>{let[h,u,,p]=c.match(/([\w-]+)(="([^"]*)")?/);return{name:u,value:Pr(p||"")}}))||[],d=new J(s,1);if(d.attributes=l,n.length>0){let c=n[n.length-1];c.childNodes.push(d),d.parentNode=c}else r.push(d);["img","input","br"].includes(s)||n.push(d),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),l=new J("#text",3);if(l.textContent=a,n.length>0){let d=n[n.length-1];d.childNodes.push(l),l.parentNode=d}else r.push(l);t=t.slice(a.length)}}return r}function kr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Pr(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function se(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:s,value:a})=>` ${s}="${kr(String(a))}"`).join(""),o=se(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Je(t,e,r){return ae(t,e,r)[0].outerHTML}function ae(t,e,r){var n;let i=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,t,e))||t;return Ut(i).map(s=>_(s,e,r))}function Tr(t){let{params:e,method:r,headers:n,body:i,url:o}=x(t);var s={url:o},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(s.headers=a),r!=="GET"&&(s.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(s.body=i),Object.keys(e).length>0&&(s={...s,params:e}),s}var at=t=>{if(!t||typeof t.url!="string")return!1;for(var e in t)if(!(e=="body"||e=="params"||e=="headers"||e=="url"||e==="method"||e=="jsonpath"&&typeof t[e]=="string"))return!1;return!0};function Ye(t){let{url:e,headers:r,params:n,method:i,body:o}=x(t),s,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((d,c)=>(d.append(c,o[c]),d),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${e}${l}`,{headers:r,body:s,method:i}]}function x(t){let e={};for(let r in(t==null?void 0:t.headers)||{})if(t.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());e[n]=t.headers[r]}return e.Accept||(e.Accept="application/json"),{params:(t==null?void 0:t.params)||{},headers:e,jsonpath:String((t==null?void 0:t.jsonpath)||"$"),method:((t==null?void 0:t.method)||"GET").toUpperCase(),body:(t==null?void 0:t.body)||{},url:String((t==null?void 0:t.url)||"")}}var le=async t=>{try{let[e,r]=Ye(t),i=await(await x.fetchImplementation(e,{...r,method:r.method.toLowerCase()})).json();return t.jsonpath&&t.jsonpath!="$"?tt(i,t.jsonpath):i}catch(e){return{}}};async function Wt(t){if(!t)return t;if(at(t))return le(t);let e=Object.keys(t),r=await Promise.all(e.map(n=>at(t[n])?le(t[n]):null).filter(Boolean));return e.reduce((n,i)=>({...n,[i]:at(t[i])?r.shift():t[i]}),{})}function Mr(t){return t?at(t)||Object.values(t).some(at):!1}x.clean=Tr;x.toFetchArguments=Ye;x.fetchOne=le;x.fetch=Wt;x.isDataSettings=at;x.hasDataSettings=Mr;x.fetchImplementation=(...t)=>fetch(...t);var we={};nt(we,{Component:()=>pt,ComponentProps:()=>me,Context:()=>K,ControlledPromise:()=>F,DEFAULT_CDN_URL:()=>T,DOM:()=>Nt,DataPath:()=>Ft,DataScope:()=>Rt,DataSettings:()=>x,Element:()=>C,FEAASComponent:()=>pt,FEAASComponentsProps:()=>me,FEAASContext:()=>K,FEAASContextProps:()=>xe,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ce,FEAASElement:()=>C,FEAASLoader:()=>ft,FEAASLoaderProps:()=>ve,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ee,FEAASStylesheet:()=>Mt,FEAASStylesheetProps:()=>ge,InvalidResponse:()=>Dt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>Ot,Picker:()=>vt,Stylesheet:()=>Mt,Thumbnail:()=>Lt,WebComponent:()=>ce,adjustNumbers:()=>ne,autoloadScripts:()=>Zt,cleanCollectionBit:()=>st,clearFetchCache:()=>Ge,createStylesheet:()=>pe,fetchAndRevalidate:()=>dt,fetchAndRevalidateComponent:()=>et,fetchAndRevalidateStylesheet:()=>Pt,fetchBypassingCache:()=>kt,fetchCache:()=>ct,fetchComponent:()=>zt,fetchData:()=>Wt,fetchToValidateCache:()=>ut,fetchWithCacheAwareness:()=>Y,findStylesheet:()=>he,getComponentSource:()=>Ke,getComponentURL:()=>ht,getFetchCache:()=>de,getFramePosition:()=>Ae,getHumanizedLabel:()=>ie,getLastPathBit:()=>oe,getQualifier:()=>re,getStylesheetSource:()=>Ht,getStylesheetURL:()=>G,loadScript:()=>ot,loadStylesheet:()=>Tt,loadStylesheetAllowStale:()=>Vt,normalizeCollectionScope:()=>_t,observeDOMElement:()=>Qt,parseComponentSource:()=>q,parseLimit:()=>te,parseRange:()=>ee,parseStylesheetSource:()=>U,queryObject:()=>tt,queryObjectRaw:()=>Bt,queryScopes:()=>it,renderComponent:()=>Jt,renderComponentElement:()=>Qe,renderComponentPromise:()=>fe,renderDOMContent:()=>V,renderDOMElement:()=>_,renderHTMLContent:()=>ze,renderStylesheet:()=>Xe,renderStylesheetPromise:()=>ue,serializeCH1RichText:()=>z,setDOMAttribute:()=>B});function F(t,e=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,d)=>{i=c=>{t==null||t(c),l(c)},o=d});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(e),a};return n()}var ce=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,C=class extends ce{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=F(e=>{this.payload=e}),this.whenRendered=F(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var 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.dispatchEventIndirectly(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.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;if(!this.connected)return;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=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.getAttribute("hydrate")=="false"&&this.firstElementChild||(!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact&&this.connected?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,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(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(s,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[s,a]=n.useReducer(l=>l+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),o=this.props[r],s=i?JSON.stringify(o):String(o),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c=this.getAttribute(d);try{var n=i?JSON.stringify(JSON.parse(c)):c}catch(h){var n=null}o==null||s===l?this.removeAttribute(d):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=s&&this.setAttribute(d,s)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var lt=class extends C{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)}},Ot=class extends lt{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))}};Ot.observedAttributes=["counter"];var qe=["initial","check","updated"],ct={};function Ge(){ct={}}async function dt(t,e,r,n,i=ct){return Y({url:t,options:e,validator:r,callback:n,cache:i}).then(ut).then(o=>o.response)}async function Y({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=de(t);if(qe.indexOf(a.phase)>=qe.indexOf(o))var l=a[o];else a.phase=o}let d=await(l||fetch(t,e));if(!l&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let c=new Date(d.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,c))===!1)throw new Dt("Response is not valid");return await(n==null?void 0:n(d,o,c)),{url:t,options:e,isCached:c,response:d,validator:r,callback:n,cache:i}}function de(t,e=!1){let r=String(t).replace("?head","");var n=ct[r];return!n&&!e&&(n=ct[r]={phase:null,initial:F(),check:F(),updated:F(),final:F()}),n}var Dt=class extends Error{};async function ut(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:s}=t;if(r){let{response:a}=await Y({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return kt(t)}return t}async function kt(t){return Y({...t,options:{...t.options,cache:"reload"}},"updated")}var T="https://feaas.blob.core.windows.net";function q(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,s]=e;return{cdn:r,library:n,component:i,version:o,revision:s}}}function Ke(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=T?`${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 Ht(t){return`${t.cdn&&t.cdn!=T?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function U(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=q(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 ht(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...q(t.src)}),`${t.cdn||t.hostname||T}/components/${t.library}/${t.component}/${t.version||"responsive"}/${t.revision||"published"}.html`}function G(t){if(typeof t=="string"&&(t={src:t}),"src"in t){if(String(t.src).includes("v1/files/components/styles"))return t.src;t={...U(t.src)}}return`${t.cdn||t.hostname||T}/styles/${t.library}/${t.revision=="staged"?"staged":t.revision=="saved"?"saved":"published"}.css`}async function et(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&Y({options:{headers:{Accept:"text/html"},credentials:"omit"},url:ht({...t,version:t.instance}),validator:n}).catch(a=>a),Y({url:ht(t),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:ut({...s,callback:i}).catch(a=>{if(o[0]==s&&(kt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),ut({...o[1],callback:i});throw a})}async function zt(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await et(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function Pt(t,e){return dt(G(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 Xe(t,e){return ue(t,e||(e=document.createElement("style"))),e}function ue(t,e){return e||(e=document.createElement("style")),Pt(t,(r,n)=>{e.textContent=r}).then(()=>e)}var Lr=new WeakSet;function Tt(t,e){var r,n=he(t);if(n){if(Lr.has(n))return Promise.resolve(n);t=n.getAttribute("data-href")||n.getAttribute("href")}return Pt(t,(i,o)=>{o=="initial"&&n||(r||(r=!n||n.tagName=="LINK"?pe(t):n),r.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function Vt(t){return new Promise((e,r)=>{Tt(t,e).catch(r)})}function he(t){let e=G(t),{library:r}=U(e),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${e}"],
5
5
  link[rel="stylesheet"][href="${e}"],
6
6
  style[data-href*="${n}"],
7
7
  link[rel="stylesheet"][href*="${n}"]`)}function pe(t){let e=G(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function Qe(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return _(n,e),r}function Jt(t,e){return fe(t,e||(e=document.createElement("div"))),e}async function fe(t,e){return e||(e=document.createElement("div")),e.childNodes.length?_(e,t.data,t):"template"in t?V(e,t.template,t.data,t):et(t,r=>V(e,r,t.data,t)).then(()=>e)}function me(t){var e,r,n,i,o,s,a,l;let d,c=t.getAttribute("src");if(c){let D=q(c);if(!D)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:h,library:u,component:p,version:m,revision:v}=D}let g=t.getAttribute("data");if(g!=null&&g!="")try{d=typeof g=="string"?JSON.parse(g):{}}catch(D){console.error(D)}let E=t.getAttribute("fetch");return{data:d||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:h)!==null&&r!==void 0?r:T,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:u,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:p,version:(s=(o=t.getAttribute("version"))!==null&&o!==void 0?o:m)!==null&&s!==void 0?s:"responsive",revision:(l=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:v)!==null&&l!==void 0?l:"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"),fetch:E=="false"?[]:E==null||E=="true"?["data","template","stylesheet"]:E.split(/(\s+|\-)+/g).filter(Boolean)}}var pt=class extends C{setData(e){this.set({data:e})}getProps(){return me(this)}isJSONAttribute(e){return e=="data"}attributeChangedCallback(e,r,n){r!==n&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0,this.alreadyRendered&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(e,r,n),e=="data"&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!x.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await x.fetch(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=F(r=>this.readyData=r,r=>this.onError(r)),this.defaultProps={cdn:T,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=r=>{this.payload=r,this.advance()};let e=this.getAttribute("data");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(){var e;if(this.getOriginal())return;let r=()=>{this.payload!=null&&(n||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var n=Vt({...this.props}).then(()=>{n=null,r()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var i=et(this.props,o=>{this.payload=o,this.needsRefresh=!0,r()})}else this.payload=(e=this.props.template)!==null&&e!==void 0?e:this.innerHTML;return Promise.all([n,this.whenDataReady.then(()=>r()),i]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh))if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)_(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;V(this,this.payload,this.readyData)}}};pt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];pt.register("feaas-component");function ve(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 ft=class extends C{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return ve(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=`
@@ -73,5 +73,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
73
73
  body, html { padding: 0; margin: 0; overflow: hidden }
74
74
  `;let h=s.contentWindow.document.createElement("style");h.textContent=`
75
75
  body, html { padding: 0; margin: 0; overflow: hidden }
76
- `,s.contentWindow.document.head.appendChild(c),s.contentWindow.document.head.appendChild(h);let u=Jt({template:r,data:n});u.classList.add(...t,"-feaas--preview","-emulate--"+e.details.slug),s.contentWindow.document.body.appendChild(u)})}async function nr(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 be;typeof window!="undefined"&&(window.FEAASReactElement=lt,(be=window.FEAASLoading)!==null&&be!==void 0||(window.FEAASLoading=Promise.resolve()));function Ae(t){let e=[];if(t){let r=t.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let o=0;o<n.frames.length;o++)if(n.frames[o]===r){for(let s of n.document.getElementsByTagName("iframe"))if(s.contentWindow===r){i=s.getBoundingClientRect();let a=s.contentWindow.getComputedStyle(s);e.push({left:i.left+parseInt(a.borderLeftWidth),top:i.top+parseInt(a.borderTopWidth)})}r=n;break}}}return e.reduce((r,n)=>({left:r.left+n.left,top:r.top+n.top}),{left:0,top:0})}function Ce(t){var e;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(e=t==null?void 0:t.getAttribute("src"))!==null&&e!==void 0?e:"/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),instance:t==null?void 0:t.getAttribute("instance"),forked:t==null?void 0:t.getAttribute("forked"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for"),state:(t==null?void 0:t.getAttribute("state"))||"idle",changed:(t==null?void 0:t.getAttribute("changed"))!=null}}var mt=class extends C{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(e,r={component:e.getAttribute("component"),version:e.getAttribute("version"),revision:e.getAttribute("revision"),instance:e.getAttribute("instance")})=>{if(!this.closing&&(!this.target||e==null))return this.set(r),this.target=e,!0},this.onChromeMeasureElement=(e,r=e.getBoundingClientRect())=>e.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Ae(e.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:e,root:r})=>{!this.chrome||this.props.hidden||(e?(this.chrome.wrapper.style.width=e.width+16*2+"px",this.chrome.wrapper.style.height=e.height+16*1+64+"px",this.chrome.wrapper.style.left=e.left-16+"px",this.chrome.wrapper.style.top=e.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=e=>{var r;switch((r=e.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let n=this.getPlaceholder();this.setTarget(n.editable,e.data)&&(this.loader=n.loader,document.body.appendChild(n.clipper),this.editedUID=e.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=e.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var e;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!((e=this.target)===null||e===void 0)&&e.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(e,r)=>{this.versionContext=e,this.setVersionContext=r},this.onEditorStateChange=(e,r)=>{this.editorContext=e,this.setEditorContext=r,e.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Ce(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(e){this.iframe=e}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let e=this.iframe.clientWidth,r=this.iframe.clientHeight,n=this.iframe.getBoundingClientRect(),i=this.getPlaceholder(),o=document.body.getBoundingClientRect(),s=this.measurements[this.editedUID];s&&(Object.assign(i.clipper.style,{position:"absolute",top:n.top+this.iframe.clientTop-o.top+"px",left:n.left+this.iframe.clientLeft-o.left+"px",width:e+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(i.positionable.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(i.loader.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",height:s.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?this.placeholder:(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader),this.placeholder)}attributeChangedCallback(e,r,n){r!==n&&(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))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(e){return e.forkOriginId==null&&this.props.instance!=null}cleanup(){var e;this.placeholder&&((e=this.placeholder.clipper)===null||e===void 0||e.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(e){console.log("Editor is not ready")}setEditorContext(e){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}render({children:e,component:r,version:n,instance:i},{Editor:o,VersionStatusList:s,VersionStatusButton:a,Version:l,VersionMenu:d,EditorUIUndo:c,EditorUIMode:h,React:{useEffect:u,useMemo:p,useState:m,useContext:v},Chakra:{HStack:g,Box:E,Button:D,MenuItem:j},Chrome:rt,ReactDOM:$t,useSDK:k,useLibrary:W,useSlots:O,useModelObserver:gt,ConfirmationContext:X,VersionContext:b}){if(!this.payload)return;let{React:y}=this.payload,jt=k(),yt=W(),[A,B]=m(),{setConfirm:H}=v(X),bt=i||n;A&&(this.component=A),u(()=>{if(this.props.hidden)return;let S=yt.components.getItem(r).clone();return S.versions.search({ids:[n,i].filter(Boolean),componentIds:[r]}).then(Q=>{S.versions.setItems(Q);let P=S.findVersion(i,["staged","published"]),Ct=S.findVersion(n,["staged","published"]);if(P)P.deletedAt?(P.getDraft().changeAndNotify(Ct.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",P.id));else if(this.removeAttribute("forked"),this.shouldFork(Ct)){console.error("FEAAS Editor: Forking");let Yt=Ct.fork(i).id;this.setAttribute("instance",Yt)}else console.error("FEAAS Editor: Regular");B(S)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),B(null)},400)}},[n,this.props.hidden]);let ke=gt(A==null?void 0:A.versions,[]).filter(S=>S.id==bt),At=ke[0];At&&!this.props.hidden&&(this.version=At),u(()=>(this.unfork=()=>{H({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let S=A.findVersion(n,["staged","published"]);A.findVersion(i).unstage().unpublish().changeAndNotify(S.toProperties()),A.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(A.findVersion(bt).revert(),A.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{H({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{H({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{var S,Q;(Q=(S=A.findVersion(bt).commitData({view:this.editorContext.editor.getData({rootName:bt}),model:""}))===null||S===void 0?void 0:S.stage())===null||Q===void 0||Q.publish(),this.removeAttribute("changed"),this.setAttribute("forked",bt),A.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[A]);let dr=p(()=>this.target,[A]);return p(()=>A&&O(e,({picker:S,children:Q})=>y.createElement(E,{ref:P=>{this.chrome=P?{positionable:P,wrapper:P.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},y.createElement(E,{className:"editor-wrapper",position:"absolute",left:0,top:0},y.createElement(o,{datasources:jt.datasources,sdk:jt,library:yt,component:A,versions:ke,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:Q,chrome:({editor:P})=>P&&y.createElement(rt,null),children:({isArchivedDisplayed:P,editor:Ct,status:Yt})=>y.createElement(E,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},y.createElement(E,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),At&&y.createElement(l,{version:At,node:dr,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:y.createElement(g,{justifyContent:"space-between"},y.createElement(c,{size:"sm",editor:Yt=="ready"?Ct:null}),y.createElement(h,{size:"sm"})),middle:(Kr,Xr)=>[!1],right:y.createElement(y.Fragment,null,y.createElement(D,{variant:"secondary",size:"sm",onClick:this.close},"Close"),y.createElement(D,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),y.createElement(d,{isDisabled:!this.props.forked&&!this.props.changed},y.createElement(j,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),y.createElement(j,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[At,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};mt.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];mt.register("feaas-editor");function Ee(t){var e,r;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"picker",mode:t==null?void 0:t.getAttribute("mode"),dialog:t==null?void 0:t.getAttribute("dialog"),placeholder:(t==null?void 0:t.getAttribute("placeholder"))||"No theme",frontend:(e=t==null?void 0:t.getContextAttribute("frontend"))!==null&&e!==void 0?e:"https://components.sitecorecloud.io",src:(r=t==null?void 0:t.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,variant:t==null?void 0:t.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var vt=class extends C{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ee(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:e,context:r,mode:n,dialog:i,children:o,variant:s},{Picker:a,React:l,useContext:d,EnvironmentContext:c,useLibrary:h,useSDK:u,BYOC:p}){var m,v,g;let[E,D]=l.useReducer(A=>A+1,0),j=u(),rt=d(c),$t=h("collections"),k=h("components"),W=u("datasources"),O=h(),gt=((v=(m=O.stylesheets)===null||m===void 0?void 0:m.first)===null||v===void 0?void 0:v.rules)||((g=O==null?void 0:O.stylesheet)===null||g===void 0?void 0:g.styles),X=u("externalComponents");var b=r==null?void 0:r.getAttribute("data");if(b)try{b=JSON.parse(b)}catch(A){}if(r)var y=j.ExternalComponent.getDefinition(r),jt=y&&!y.getConfiguration(r),yt=(y==null?void 0:y.type)=="feaas"?k.find(A=>A.id==r.getAttribute("component")):p==null?void 0:p.getComponent(String(r.getAttribute("data-external-id")));return l.createElement(a,{cdn:rt.cdn,rules:gt,collections:$t,themeContext:r,placeholder:e,embed:yt,externalComponents:X,datasources:W,data:b,versionId:r==null?void 0:r.getAttribute("version"),mode:n||(jt?"library":yt?"context":null),setAttribute:(A,B,H)=>{B=="data"&&H&&(H=JSON.stringify(H)),this.props.setAttribute(A,B,H),D()},getAttribute:(A,B)=>r==null?void 0:r.getAttribute(B),dialog:i,context:r,variant:s,onModeChange:(A,B)=>{this.set({mode:A,dialog:B})}},o)}};vt.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];vt.register("feaas-picker");function xe(t){var e,r,n,i,o;return{library:t==null?void 0:t.getAttribute("library"),src:(e=t==null?void 0:t.getAttribute("src"))!==null&&e!==void 0?e:"/context.js",environment:(r=t==null?void 0:t.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(n=t==null?void 0:t.getAttribute("frontend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io",backend:(i=t==null?void 0:t.getAttribute("backend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io/api",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!==null&&o!==void 0?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(t==null?void 0:t.getAttribute("isolate"))==null||(t==null?void 0:t.getAttribute("isolate"))=="true"}}var K=class extends C{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(e,r)=>{e=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=F(e=>{this.sdk=e})}getProps(){return xe(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(e){return e}getRoot(){return this.getAttribute("isolate")==="false"?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach(e=>{this.getRoot().appendChild(e)}),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:e,library:r},{AppContext:n,Chakra:{Button:i,Tooltip:o},React:s}){let a={containerRef:{current:this.getPortalRoot()}};return o.defaultProps={hasArrow:!0,placement:"top",portalProps:a},s.createElement(n,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},e)}};K.observedAttributes=["library","component","version","revision","hostname","template"];K.register("feaas-context");K.prototype.clientside=we;var N=Et(require("@sitecore/byoc"),1),Se=Et(require("react"),1),ir=Et(require("react-dom"),1);var Re=N.getMergedComponentProperties;function Br(t){let e=N.objectKeysToCamelCase(Array.from(t.attributes).reduce((r,{name:n,value:i})=>(n=="data-external-id"&&(n="component-name"),Object.assign(r,{[n]:i})),{}));return Re(e).merged}var L=class extends C{load(){return Promise.resolve({React:Se.default,ReactDOM:ir.default})}connectedCallback(){this._setAttribute||(this._setAttribute=this.setAttribute,this.setAttribute=function(e,r){let n=this.getAttribute(r);this._setAttribute(e,r),this.attributeChangedCallback(e,n,r)}),super.connectedCallback()}update(){var e;if(!(!(!((e=N.getComponent(this.getComponentName()))===null||e===void 0)&&e.component)&&this.getAttribute("hydrate")=="false"))return super.update()}render(e,{React:r}){var n;let i=(n=N.getComponent(this.getComponentName()))===null||n===void 0?void 0:n.component;return i||console.warn(`FEAASExternal: \`${this.getComponentName()}\` is not registered`),r.createElement(r.Fragment,null,i&&r.createElement(i,{componentName:this.getComponentName(),...e}))}getComponentName(){return this.getAttribute("data-external-id")}getProps(){return Br(this)}static Preview(e){var r;let n=(e==null?void 0:e.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return n?Se.default.createElement(_e,{src:n,...e}):null}static linkComponents(e){return()=>e.map(r=>null)}};L.registered=N.registered;L.registerComponent=N.registerComponent;L.setRegistrationCallback=N.setRegistrationCallback;L.getComponent=N.getComponent;L.register("feaas-external");var{getComponent:or,linkComponents:sr,registerComponent:ar}=L;var Fe={};function Ir(t,e){Fe[t]=e}function Ne(t){return t==null||t===!0?["template","stylesheet","data"]:[].concat(t||[])}var lr=t=>("src"in t&&(t=U(t.src)),$.default.createElement("link",{rel:"stylesheet",href:Ht(t)})),cr=async({data:t,fetch:e,...r})=>{let n=await x.fetch(t||{});e=Ne(e!=null?e:["stylesheet"]);let i={...r};if(("src"in r||"component"in r)&&(r==null?void 0:r.template)==null){let o=await zt(r);i.template=o.template,i.lastModified=o.lastModified}else(r==null?void 0:r.template)==null&&!e.includes("template")&&e.push("template");return Oe({...i,data:t,fetch:e,fetchedData:n})};function Oe({data:t,lastModified:e,fetchedData:r,...n}){let i=null,o;"template"in n&&n.template&&(o=ae(n.template,r||t||{}).map((l,d)=>De(l,(c,h)=>{if(Fe[c.localName])return[Fe[c.localName],h];if(c.localName=="feaas-external"){let p={};for(var u in h){let m=u=="data-external-id"?"componentName":w.toCamelCase(u);p[m]=h[u]}return[w.Component,p]}},d))),"src"in n&&(n={...q(n.src),...n});let s=Ne(n.fetch),a=s.includes("data")?t:s.includes("template")?r||t:null;return $.default.createElement($.default.Fragment,null,"preload"in n&&i===!0&&"src"in n&&$.default.createElement($.default.Fragment,null,$.default.createElement("link",{rel:"preload",as:"fetch",href:ht(n.src),crossOrigin:"anonymous"}),$.default.createElement("link",{rel:"preload",as:"style",href:G(n.src),crossOrigin:"anonymous"})),$.default.createElement("feaas-component",{class:"-feaas",...n,"last-modified":e?String(e):null,fetch:n.fetch==null?n.fetch:[].concat(n.fetch).join(" "),suppressHydrationWarning:!0,template:null,data:typeof a=="string"?a:a?JSON.stringify(a):null},o))}function De(t,e,r){if(t.nodeType===3)return t.textContent;let n=Array.from(t.childNodes).map((l,d)=>De(l,e,d)),i={};for(let l=0;l<t.attributes.length;l++){let{name:d,value:c}=t.attributes[l];d=="style"?i[d]=String(c||"").trim().split(/\s*;\s*/).reduce((h,u)=>{let[p,m]=u.split(":");return{...h,[w.toCamelCase(p)]:m}},{}):d=="class"?i.className=c:i[d]=c}let o=e==null?void 0:e(t,i),s=(o==null?void 0:o[0])||t.nodeName.toLowerCase(),a=Object.assign({key:r,suppressHydrationWarning:!0},(o==null?void 0:o[1])||i);return $.default.createElement(s,a,["img","br","input"].includes(s)?null:n)}var Ur=w.enableNextClientsideComponents,Wr=w.setContextProperties,Hr=w.Bundle,zr=w.Component,Vr=w.RegularComponent,Jr=w.NextComponent,_e=Oe,Yr=cr,qr=lr;
76
+ `,s.contentWindow.document.head.appendChild(c),s.contentWindow.document.head.appendChild(h);let u=Jt({template:r,data:n});u.classList.add(...t,"-feaas--preview","-emulate--"+e.details.slug),s.contentWindow.document.body.appendChild(u)})}async function nr(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 be;typeof window!="undefined"&&(window.FEAASReactElement=lt,(be=window.FEAASLoading)!==null&&be!==void 0||(window.FEAASLoading=Promise.resolve()));function Ae(t){let e=[];if(t){let r=t.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let o=0;o<n.frames.length;o++)if(n.frames[o]===r){for(let s of n.document.getElementsByTagName("iframe"))if(s.contentWindow===r){i=s.getBoundingClientRect();let a=s.contentWindow.getComputedStyle(s);e.push({left:i.left+parseInt(a.borderLeftWidth),top:i.top+parseInt(a.borderTopWidth)})}r=n;break}}}return e.reduce((r,n)=>({left:r.left+n.left,top:r.top+n.top}),{left:0,top:0})}function Ce(t){var e;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(e=t==null?void 0:t.getAttribute("src"))!==null&&e!==void 0?e:"/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),instance:t==null?void 0:t.getAttribute("instance"),forked:t==null?void 0:t.getAttribute("forked"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for"),state:(t==null?void 0:t.getAttribute("state"))||"idle",changed:(t==null?void 0:t.getAttribute("changed"))!=null}}var mt=class extends C{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(e,r={component:e.getAttribute("component"),version:e.getAttribute("version"),revision:e.getAttribute("revision"),instance:e.getAttribute("instance")})=>{if(!this.closing&&(!this.target||e==null))return this.set(r),this.target=e,!0},this.onChromeMeasureElement=(e,r=e.getBoundingClientRect())=>e.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Ae(e.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:e,root:r})=>{!this.chrome||this.props.hidden||(e?(this.chrome.wrapper.style.width=e.width+16*2+"px",this.chrome.wrapper.style.height=e.height+16*1+64+"px",this.chrome.wrapper.style.left=e.left-16+"px",this.chrome.wrapper.style.top=e.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=e=>{var r;switch((r=e.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let n=this.getPlaceholder();this.setTarget(n.editable,e.data)&&(this.loader=n.loader,document.body.appendChild(n.clipper),this.editedUID=e.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=e.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var e;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!((e=this.target)===null||e===void 0)&&e.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(e,r)=>{this.versionContext=e,this.setVersionContext=r},this.onEditorStateChange=(e,r)=>{this.editorContext=e,this.setEditorContext=r,e.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Ce(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(e){this.iframe=e}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let e=this.iframe.clientWidth,r=this.iframe.clientHeight,n=this.iframe.getBoundingClientRect(),i=this.getPlaceholder(),o=document.body.getBoundingClientRect(),s=this.measurements[this.editedUID];s&&(Object.assign(i.clipper.style,{position:"absolute",top:n.top+this.iframe.clientTop-o.top+"px",left:n.left+this.iframe.clientLeft-o.left+"px",width:e+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(i.positionable.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(i.loader.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",height:s.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?this.placeholder:(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader),this.placeholder)}attributeChangedCallback(e,r,n){r!==n&&(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))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(e){return e.forkOriginId==null&&this.props.instance!=null}cleanup(){var e;this.placeholder&&((e=this.placeholder.clipper)===null||e===void 0||e.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(e){console.log("Editor is not ready")}setEditorContext(e){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}render({children:e,component:r,version:n,instance:i},{Editor:o,VersionStatusList:s,VersionStatusButton:a,Version:l,VersionMenu:d,EditorUIUndo:c,EditorUIMode:h,React:{useEffect:u,useMemo:p,useState:m,useContext:v},Chakra:{HStack:g,Box:E,Button:D,MenuItem:j},Chrome:rt,ReactDOM:$t,useSDK:k,useLibrary:W,useSlots:O,useModelObserver:gt,ConfirmationContext:X,VersionContext:b}){if(!this.payload)return;let{React:y}=this.payload,jt=k(),yt=W(),[A,I]=m(),{setConfirm:H}=v(X),bt=i||n;A&&(this.component=A),u(()=>{if(this.props.hidden)return;let S=yt.components.getItem(r).clone();return S.versions.search({ids:[n,i].filter(Boolean),componentIds:[r]}).then(Q=>{S.versions.setItems(Q);let P=S.findVersion(i,["staged","published"]),Ct=S.findVersion(n,["staged","published"]);if(P)P.deletedAt?(P.getDraft().changeAndNotify(Ct.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",P.id));else if(this.removeAttribute("forked"),this.shouldFork(Ct)){console.error("FEAAS Editor: Forking");let Yt=Ct.fork(i).id;this.setAttribute("instance",Yt)}else console.error("FEAAS Editor: Regular");I(S)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),I(null)},400)}},[n,this.props.hidden]);let ke=gt(A==null?void 0:A.versions,[]).filter(S=>S.id==bt),At=ke[0];At&&!this.props.hidden&&(this.version=At),u(()=>(this.unfork=()=>{H({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let S=A.findVersion(n,["staged","published"]);A.findVersion(i).unstage().unpublish().changeAndNotify(S.toProperties()),A.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(A.findVersion(bt).revert(),A.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{H({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{H({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{var S,Q;(Q=(S=A.findVersion(bt).commitData({view:this.editorContext.editor.getData({rootName:bt}),model:""}))===null||S===void 0?void 0:S.stage())===null||Q===void 0||Q.publish(),this.removeAttribute("changed"),this.setAttribute("forked",bt),A.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[A]);let dr=p(()=>this.target,[A]);return p(()=>A&&O(e,({picker:S,children:Q})=>y.createElement(E,{ref:P=>{this.chrome=P?{positionable:P,wrapper:P.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},y.createElement(E,{className:"editor-wrapper",position:"absolute",left:0,top:0},y.createElement(o,{datasources:jt.datasources,sdk:jt,library:yt,component:A,versions:ke,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:Q,chrome:({editor:P})=>P&&y.createElement(rt,null),children:({isArchivedDisplayed:P,editor:Ct,status:Yt})=>y.createElement(E,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},y.createElement(E,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(E,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),At&&y.createElement(l,{version:At,node:dr,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:y.createElement(g,{justifyContent:"space-between"},y.createElement(c,{size:"sm",editor:Yt=="ready"?Ct:null}),y.createElement(h,{size:"sm"})),middle:(Kr,Xr)=>[!1],right:y.createElement(y.Fragment,null,y.createElement(D,{variant:"secondary",size:"sm",onClick:this.close},"Close"),y.createElement(D,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),y.createElement(d,{isDisabled:!this.props.forked&&!this.props.changed},y.createElement(j,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),y.createElement(j,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[At,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};mt.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];mt.register("feaas-editor");function Ee(t){var e,r;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"picker",mode:t==null?void 0:t.getAttribute("mode"),dialog:t==null?void 0:t.getAttribute("dialog"),placeholder:(t==null?void 0:t.getAttribute("placeholder"))||"No theme",frontend:(e=t==null?void 0:t.getContextAttribute("frontend"))!==null&&e!==void 0?e:"https://components.sitecorecloud.io",src:(r=t==null?void 0:t.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,variant:t==null?void 0:t.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var vt=class extends C{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ee(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:e,context:r,mode:n,dialog:i,children:o,variant:s},{Picker:a,React:l,useContext:d,EnvironmentContext:c,useLibrary:h,useSDK:u,BYOC:p}){var m,v,g;let[E,D]=l.useReducer(A=>A+1,0),j=u(),rt=d(c),$t=h("collections"),k=h("components"),W=u("datasources"),O=h(),gt=((v=(m=O.stylesheets)===null||m===void 0?void 0:m.first)===null||v===void 0?void 0:v.rules)||((g=O==null?void 0:O.stylesheet)===null||g===void 0?void 0:g.styles),X=u("externalComponents");var b=r==null?void 0:r.getAttribute("data");if(b)try{b=JSON.parse(b)}catch(A){}if(r)var y=j.ExternalComponent.getDefinition(r),jt=y&&!y.getConfiguration(r),yt=(y==null?void 0:y.type)=="feaas"?k.find(A=>A.id==r.getAttribute("component")):p==null?void 0:p.getComponent(String(r.getAttribute("data-external-id")));return l.createElement(a,{cdn:rt.cdn,rules:gt,collections:$t,themeContext:r,placeholder:e,embed:yt,externalComponents:X,datasources:W,data:b,versionId:r==null?void 0:r.getAttribute("version"),mode:n||(jt?"library":yt?"context":null),setAttribute:(A,I,H)=>{I=="data"&&H&&(H=JSON.stringify(H)),this.props.setAttribute(A,I,H),D()},getAttribute:(A,I)=>r==null?void 0:r.getAttribute(I),dialog:i,context:r,variant:s,onModeChange:(A,I)=>{this.set({mode:A,dialog:I})}},o)}};vt.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];vt.register("feaas-picker");function xe(t){var e,r,n,i,o;return{library:t==null?void 0:t.getAttribute("library"),src:(e=t==null?void 0:t.getAttribute("src"))!==null&&e!==void 0?e:"/context.js",environment:(r=t==null?void 0:t.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(n=t==null?void 0:t.getAttribute("frontend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io",backend:(i=t==null?void 0:t.getAttribute("backend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io/api",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!==null&&o!==void 0?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(t==null?void 0:t.getAttribute("isolate"))==null||(t==null?void 0:t.getAttribute("isolate"))=="true"}}var K=class extends C{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(e,r)=>{e=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=F(e=>{this.sdk=e})}getProps(){return xe(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(e){return e}getRoot(){return this.getAttribute("isolate")==="false"?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach(e=>{this.getRoot().appendChild(e)}),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:e,library:r},{AppContext:n,Chakra:{Button:i,Tooltip:o},React:s}){let a={containerRef:{current:this.getPortalRoot()}};return o.defaultProps={hasArrow:!0,placement:"top",portalProps:a},s.createElement(n,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},e)}};K.observedAttributes=["library","component","version","revision","hostname","template"];K.register("feaas-context");K.prototype.clientside=we;var N=Et(require("@sitecore/byoc"),1),Se=Et(require("react"),1),ir=Et(require("react-dom"),1);var Re=N.getMergedComponentProperties;function Ir(t){let e=N.objectKeysToCamelCase(Array.from(t.attributes).reduce((r,{name:n,value:i})=>(n=="data-external-id"&&(n="component-name"),Object.assign(r,{[n]:i})),{}));return Re(e).merged}var L=class extends C{load(){return Promise.resolve({React:Se.default,ReactDOM:ir.default})}connectedCallback(){this._setAttribute||(this._setAttribute=this.setAttribute,this.setAttribute=function(e,r){let n=this.getAttribute(r);this._setAttribute(e,r),this.attributeChangedCallback(e,n,r)}),super.connectedCallback()}update(){var e;if(!(!(!((e=N.getComponent(this.getComponentName()))===null||e===void 0)&&e.component)&&this.getAttribute("hydrate")=="false"))return super.update()}render(e,{React:r}){var n;let i=(n=N.getComponent(this.getComponentName()))===null||n===void 0?void 0:n.component;return i||console.warn(`FEAASExternal: \`${this.getComponentName()}\` is not registered`),r.createElement(r.Fragment,null,i&&r.createElement(i,{componentName:this.getComponentName(),...e}))}getComponentName(){return this.getAttribute("data-external-id")}getProps(){return Ir(this)}static Preview(e){var r;let n=(e==null?void 0:e.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return n?Se.default.createElement(_e,{src:n,...e}):null}static linkComponents(e){return()=>e.map(r=>null)}};L.registered=N.registered;L.registerComponent=N.registerComponent;L.setRegistrationCallback=N.setRegistrationCallback;L.getComponent=N.getComponent;L.register("feaas-external");var{getComponent:or,linkComponents:sr,registerComponent:ar}=L;var Fe={};function Br(t,e){Fe[t]=e}function Ne(t){return t==null||t===!0?["template","stylesheet","data"]:[].concat(t||[])}var lr=t=>("src"in t&&(t=U(t.src)),$.default.createElement("link",{rel:"stylesheet",href:Ht(t)})),cr=async({data:t,fetch:e,...r})=>{let n=await x.fetch(t||{});e=Ne(e!=null?e:["stylesheet"]);let i={...r};if(("src"in r||"component"in r)&&(r==null?void 0:r.template)==null){let o=await zt(r);i.template=o.template,i.lastModified=o.lastModified}else(r==null?void 0:r.template)==null&&!e.includes("template")&&e.push("template");return Oe({...i,data:t,fetch:e,fetchedData:n})};function Oe({data:t,lastModified:e,fetchedData:r,...n}){let i=null,o;"template"in n&&n.template&&(o=ae(n.template,r||t||{}).map((l,d)=>De(l,(c,h)=>{if(Fe[c.localName])return[Fe[c.localName],h];if(c.localName=="feaas-external"){let p={};for(var u in h){let m=u=="data-external-id"?"componentName":w.toCamelCase(u);p[m]=h[u]}return[w.Component,p]}},d))),"src"in n&&(n={...q(n.src),...n});let s=Ne(n.fetch),a=s.includes("data")?t:s.includes("template")?r||t:null;return $.default.createElement($.default.Fragment,null,"preload"in n&&i===!0&&"src"in n&&$.default.createElement($.default.Fragment,null,$.default.createElement("link",{rel:"preload",as:"fetch",href:ht(n.src),crossOrigin:"anonymous"}),$.default.createElement("link",{rel:"preload",as:"style",href:G(n.src),crossOrigin:"anonymous"})),$.default.createElement("feaas-component",{class:"-feaas",...n,"last-modified":e?String(e):null,fetch:n.fetch==null?n.fetch:[].concat(n.fetch).join(" "),suppressHydrationWarning:!0,template:null,data:typeof a=="string"?a:a?JSON.stringify(a):null},o))}function De(t,e,r){if(t.nodeType===3)return t.textContent;let n=Array.from(t.childNodes).map((l,d)=>De(l,e,d)),i={};for(let l=0;l<t.attributes.length;l++){let{name:d,value:c}=t.attributes[l];d=="style"?i[d]=String(c||"").trim().split(/\s*;\s*/).reduce((h,u)=>{let[p,m]=u.split(":");return{...h,[w.toCamelCase(p)]:m}},{}):d=="class"?i.className=c:i[d]=c}let o=e==null?void 0:e(t,i),s=(o==null?void 0:o[0])||t.nodeName.toLowerCase();s=="style"&&(i.dangerouslySetInnerHTML={__html:n.join(`
77
+ `)});let a=Object.assign({key:r,suppressHydrationWarning:!0},(o==null?void 0:o[1])||i);return $.default.createElement(s,a,["img","br","input","style"].includes(s)?null:n)}var Ur=w.enableNextClientsideComponents,Wr=w.setContextProperties,Hr=w.Bundle,zr=w.Component,Vr=w.RegularComponent,Jr=w.NextComponent,_e=Oe,Yr=cr,qr=lr;
77
78
  //# sourceMappingURL=react.cjs.map