@sitecore-feaas/clientside 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var V=Object.defineProperty,Dt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var pt=(t,e,r)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))yt.call(e,r)&&pt(t,r,e[r]);if(dt)for(var r of dt(e))kt.call(e,r)&&pt(t,r,e[r]);return t},H=(t,e)=>Dt(t,Pt(e));var Z=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},Lt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mt(e))!yt.call(t,i)&&i!==r&&V(t,i,{get:()=>e[i],enumerable:!(n=Ct(e,i))||n.enumerable});return t};var Ot=t=>Lt(V({},"__esModule",{value:!0}),t);var w=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(t,e)).next())});var Kt={};Z(Kt,{HTMLFeaasComponent:()=>N,HTMLFeaasStylesheet:()=>z,autoloadScripts:()=>at,cleanCollectionBit:()=>rt,default:()=>Gt,fetchAndRevalidate:()=>W,loadScript:()=>I,normalizeCollectionScope:()=>nt,observeDOMElement:()=>it,queryScopes:()=>G,renderComponent:()=>wt,renderComponentElement:()=>Ft,renderComponentPromise:()=>ot,renderDOMContent:()=>T,renderDOMElement:()=>E,renderStylesheet:()=>At,renderStylesheetPromise:()=>st,setDOMAttribute:()=>S});module.exports=Ot(Kt);var ut={};Z(ut,{autoloadScripts:()=>at,cleanCollectionBit:()=>rt,loadScript:()=>I,normalizeCollectionScope:()=>nt,observeDOMElement:()=>it,queryScopes:()=>G,renderComponent:()=>wt,renderComponentElement:()=>Ft,renderComponentPromise:()=>ot,renderDOMContent:()=>T,renderDOMElement:()=>E,renderStylesheet:()=>At,renderStylesheetPromise:()=>st,setDOMAttribute:()=>S});function g(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(e){return typeof e}:g=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function xt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ht(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}}),e&&B(t,e)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R(t)}function B(t,e){return B=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},B(t,e)}function bt(){if(typeof Reflect=="undefined"||!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(t){return!1}}function j(t,e,r){return bt()?j=Reflect.construct:j=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&B(h,s.prototype),h},j.apply(null,arguments)}function $t(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function tt(t){var e=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!$t(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return j(n,arguments,R(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},tt(t)}function jt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:jt(t)}function Bt(t){var e=bt();return function(){var n=R(t),i;if(e){var a=R(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Rt(this,i)}}function mt(t){return It(t)||Nt(t)||gt(t)||zt()}function It(t){if(Array.isArray(t))return et(t)}function Nt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gt(t,e){if(!!t){if(typeof t=="string")return et(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 et(t,e)}}function et(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 zt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var V=Object.defineProperty,Dt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var pt=(t,e,r)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))yt.call(e,r)&&pt(t,r,e[r]);if(dt)for(var r of dt(e))kt.call(e,r)&&pt(t,r,e[r]);return t},H=(t,e)=>Dt(t,Pt(e));var Z=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},Ot=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mt(e))!yt.call(t,i)&&i!==r&&V(t,i,{get:()=>e[i],enumerable:!(n=Ct(e,i))||n.enumerable});return t};var Lt=t=>Ot(V({},"__esModule",{value:!0}),t);var w=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(t,e)).next())});var Kt={};Z(Kt,{HTMLFeaasComponent:()=>N,HTMLFeaasStylesheet:()=>z,autoloadScripts:()=>at,cleanCollectionBit:()=>rt,default:()=>Gt,fetchAndRevalidate:()=>W,loadScript:()=>I,normalizeCollectionScope:()=>nt,observeDOMElement:()=>it,queryScopes:()=>G,renderComponent:()=>wt,renderComponentElement:()=>Ft,renderComponentPromise:()=>ot,renderDOMContent:()=>T,renderDOMElement:()=>E,renderStylesheet:()=>At,renderStylesheetPromise:()=>st,setDOMAttribute:()=>S});module.exports=Lt(Kt);var ut={};Z(ut,{autoloadScripts:()=>at,cleanCollectionBit:()=>rt,loadScript:()=>I,normalizeCollectionScope:()=>nt,observeDOMElement:()=>it,queryScopes:()=>G,renderComponent:()=>wt,renderComponentElement:()=>Ft,renderComponentPromise:()=>ot,renderDOMContent:()=>T,renderDOMElement:()=>E,renderStylesheet:()=>At,renderStylesheetPromise:()=>st,setDOMAttribute:()=>S});function g(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(e){return typeof e}:g=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function xt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ht(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}}),e&&B(t,e)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R(t)}function B(t,e){return B=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},B(t,e)}function bt(){if(typeof Reflect=="undefined"||!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(t){return!1}}function j(t,e,r){return bt()?j=Reflect.construct:j=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&B(h,s.prototype),h},j.apply(null,arguments)}function $t(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function tt(t){var e=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!$t(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return j(n,arguments,R(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},tt(t)}function jt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:jt(t)}function Bt(t){var e=bt();return function(){var n=R(t),i;if(e){var a=R(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Rt(this,i)}}function mt(t){return It(t)||Nt(t)||gt(t)||zt()}function It(t){if(Array.isArray(t))return et(t)}function Nt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gt(t,e){if(!!t){if(typeof t=="string")return et(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 et(t,e)}}function et(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 zt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jt(t,e){var r=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=gt(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function $(t,e){return t=t.slice(),t.push(e),t}function P(t,e){return e=e.slice(),e.unshift(t),e}var qt=function(t){Ht(r,t);var e=Bt(r);function r(n){var i;return xt(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 r}(tt(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var a=t&&g(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.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:a?t.path:e};a?"json"in t&&(s.json=t.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new qt(o);return o}}d.prototype.evaluate=function(t,e,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&g(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,a=b.call(t,"parent")?t.parent:a,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(a=a||null,s=s||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var l=d.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,e,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,a,s,o){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=t[0],c=t.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(D){f.push(D)}):f.push(m)}if((typeof l!="string"||o)&&e&&b.call(e,l))p(this._trace(c,e[l],$(r,l),e,l,a,s));else if(l==="*")this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,L,O,x){p(u._trace(P(m,k),v,C,L,O,x,!0,!0))});else if(l==="..")p(this._trace(c,e,r,n,i,a,s)),this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,L,O,x){g(v[m])==="object"&&p(u._trace(P(D,k),v[m],$(C,m),v,m,x,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:$(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,e,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,e,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,L,O,x){u._eval(D.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),v[m],m,C,L,O)&&p(u._trace(P(m,k),v,C,L,O,x,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(P(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),c),e,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,_=l.slice(1,-2);switch(_){case"scalar":(!e||!["object","function"].includes(g(e)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===_&&(y=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(y=!0);break;case"number":Number.isFinite(e)&&(y=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(y=!0);break;case"object":e&&g(e)===_&&(y=!0);break;case"array":Array.isArray(e)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+_)}if(y)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&e&&b.call(e,l.slice(1))){var X=l.slice(1);p(this._trace(c,e[X],$(r,X),e,X,a,s,!0))}else if(l.includes(",")){var St=l.split(","),J=Jt(St),ft;try{for(J.s();!(ft=J.n()).done;){var Tt=ft.value;p(this._trace(P(Tt,c),e,r,n,i,a,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&e&&b.call(e,l)&&p(this._trace(c,e[l],$(r,l),e,l,a,s,!0))}if(this._hasParentSelector)for(var A=0;A<f.length;A++){var q=f[A];if(q&&q.isParentSelector){var M=this._trace(q.expr,e,q.path,n,i,a,s);if(Array.isArray(M)){f[A]=M[0];for(var _t=M.length,Q=1;Q<_t;Q++)A++,f.splice(A,0,M[Q])}else f[A]=M}}return f};d.prototype._walk=function(t,e,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,t,e,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,t,e,r,n,i,a,s)})};d.prototype._slice=function(t,e,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(P(p,e),r,n,i,a,s,!0);y.forEach(function(_){f.push(_)})}return f}};d.prototype._eval=function(t,e,r,n,i,a){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=i,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=r,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=e,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return e[t]=i,e[t].concat()};var Vt=function(e,r,n){for(var i=e.length,a=0;a<i;a++){var s=e[a];n(s)&&r.push(e.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(e,r){var n=Object.keys(r),i=[];Vt(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");e=s+e,!/(["'])use strict\1/.test(e)&&!n.includes("arguments")&&(e="var arguments = undefined;"+e),e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=e.lastIndexOf(";"),u=o>-1?e.slice(0,o+1)+" return "+e.slice(o+1):" return "+e;return j(Function,mt(n).concat([u])).apply(void 0,mt(a))}};function W(t,e,r,n){return w(this,null,function*(){let i=new Date,a=yield fetch(t,e);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(t+"?"+Math.random(),H(F({},e),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(t,H(F({},e),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function Wt({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,component:r,version:n,revision:i="published"}){return`${t}/components/${e}/${r}/${n}/${i}.html`}function Ut({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,revision:r="published"}){return`${t}/styles/${e}/${r}.css`}function U(t,e){return w(this,null,function*(){return W(Wt(t),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(e)})})}function Y(t,e){return w(this,null,function*(){return W(Ut(t),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})})}function Ft(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,e),r}function rt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function nt(t){return rt(t)+".*"}function Et(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 Yt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=Et(t);if(i!=0)return;let a=t.parentElement;if(a!=null){e==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=i+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<e;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,e);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function G(t,e,r=!1,n=t){var i=e;let a=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of a)if(e.startsWith(o)){if(o==e){if(r)return t[o];continue}i=e.substring(o.length+1),n=t[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function S(t,e,r,n){var l;if(!!t){var i=t;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")i=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")i=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")i=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")I(t,r);else if(e=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];S(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&S(t,c[u],null,n);S(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(t.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function it(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&I(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&at(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function at(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];I(i,i.getAttribute("data-embed-src"))}if(e)return it(t)}function I(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=e,r.appendChild(a);break}}var vt=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(t,e,r,n){var s,o,u;let i=t;if(n||(e=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,e))||e),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=Et(i),f=G(e,h,!1)||[];c==0&&Yt(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),e=H(F({},e),{[nt(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>vt.indexOf(c.name)-vt.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&S(i,c,G(e,f,!0),r),c=="data-embed-src"&&S(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],e,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,e),i}function T(t,e,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,t,e,r))||e;return t.innerHTML=i,t.classList.add("-feaas"),E(t,r,n)}function At(t,e){return st(t,e||(e=document.createElement("style"))),e}function st(t,e){return e||(e=document.createElement("style")),Y(t,r=>{e.textContent=r}).then(()=>e)}function wt(t,e){return ot(t,e||(e=document.createElement("div"))),e}function ot(t,e){return w(this,null,function*(){return e||(e=document.createElement("div")),e.childNodes.length?E(e,t.data,t):"template"in t?T(e,t.template,t.data,t):U(t,r=>T(e,r,t.data,t)).then(()=>e)})}var ht={};Z(ht,{HTMLFeaasComponent:()=>N,HTMLFeaasStylesheet:()=>z});var K=typeof HTMLElement=="undefined"?class{}:HTMLElement,N=class extends K{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,U(r,n=>{this.template=n,this.isFetching=!1,T(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):T(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},z=class extends K{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();Y(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},lt=class extends K{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?(this.removeAttribute(i),this.load()):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},ct=class extends K{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function $(t,e){return t=t.slice(),t.push(e),t}function P(t,e){return e=e.slice(),e.unshift(t),e}var qt=function(t){Ht(r,t);var e=Bt(r);function r(n){var i;return xt(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 r}(tt(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var a=t&&g(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.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:a?t.path:e};a?"json"in t&&(s.json=t.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new qt(o);return o}}d.prototype.evaluate=function(t,e,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&g(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,a=b.call(t,"parent")?t.parent:a,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(a=a||null,s=s||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var l=d.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,e,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,a,s,o){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=t[0],c=t.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(D){f.push(D)}):f.push(m)}if((typeof l!="string"||o)&&e&&b.call(e,l))p(this._trace(c,e[l],$(r,l),e,l,a,s));else if(l==="*")this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,O,L,x){p(u._trace(P(m,k),v,C,O,L,x,!0,!0))});else if(l==="..")p(this._trace(c,e,r,n,i,a,s)),this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,O,L,x){g(v[m])==="object"&&p(u._trace(P(D,k),v[m],$(C,m),v,m,x,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:$(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,e,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,e,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,e,r,n,i,a,function(m,D,k,v,C,O,L,x){u._eval(D.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),v[m],m,C,O,L)&&p(u._trace(P(m,k),v,C,O,L,x,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(P(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),c),e,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,_=l.slice(1,-2);switch(_){case"scalar":(!e||!["object","function"].includes(g(e)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===_&&(y=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(y=!0);break;case"number":Number.isFinite(e)&&(y=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(y=!0);break;case"object":e&&g(e)===_&&(y=!0);break;case"array":Array.isArray(e)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+_)}if(y)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&e&&b.call(e,l.slice(1))){var X=l.slice(1);p(this._trace(c,e[X],$(r,X),e,X,a,s,!0))}else if(l.includes(",")){var St=l.split(","),J=Jt(St),ft;try{for(J.s();!(ft=J.n()).done;){var Tt=ft.value;p(this._trace(P(Tt,c),e,r,n,i,a,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&e&&b.call(e,l)&&p(this._trace(c,e[l],$(r,l),e,l,a,s,!0))}if(this._hasParentSelector)for(var A=0;A<f.length;A++){var q=f[A];if(q&&q.isParentSelector){var M=this._trace(q.expr,e,q.path,n,i,a,s);if(Array.isArray(M)){f[A]=M[0];for(var _t=M.length,Q=1;Q<_t;Q++)A++,f.splice(A,0,M[Q])}else f[A]=M}}return f};d.prototype._walk=function(t,e,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,t,e,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,t,e,r,n,i,a,s)})};d.prototype._slice=function(t,e,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(P(p,e),r,n,i,a,s,!0);y.forEach(function(_){f.push(_)})}return f}};d.prototype._eval=function(t,e,r,n,i,a){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=i,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=r,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=e,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return e[t]=i,e[t].concat()};var Vt=function(e,r,n){for(var i=e.length,a=0;a<i;a++){var s=e[a];n(s)&&r.push(e.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(e,r){var n=Object.keys(r),i=[];Vt(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");e=s+e,!/(["'])use strict\1/.test(e)&&!n.includes("arguments")&&(e="var arguments = undefined;"+e),e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=e.lastIndexOf(";"),u=o>-1?e.slice(0,o+1)+" return "+e.slice(o+1):" return "+e;return j(Function,mt(n).concat([u])).apply(void 0,mt(a))}};function W(t,e,r,n){return w(this,null,function*(){let i=new Date,a=yield fetch(t,e);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(t+"?"+Math.random(),H(F({},e),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(t,H(F({},e),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function Wt({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,component:r,version:n,revision:i="published"}){return`${t}/components/${e}/${r}/${n}/${i}.html`}function Ut({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,revision:r="published"}){return`${t}/styles/${e}/${r}.css`}function U(t,e){return w(this,null,function*(){return W(Wt(t),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(e)})})}function Y(t,e){return w(this,null,function*(){return W(Ut(t),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})})}function Ft(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,e),r}function rt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function nt(t){return rt(t)+".*"}function Et(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 Yt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=Et(t);if(i!=0)return;let a=t.parentElement;if(a!=null){e==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=i+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<e;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,e);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function G(t,e,r=!1,n=t){var i=e;let a=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of a)if(e.startsWith(o)){if(o==e){if(r)return t[o];continue}i=e.substring(o.length+1),n=t[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function S(t,e,r,n){var l;if(!!t){var i=t;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")i=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")i=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")i=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")I(t,r);else if(e=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];S(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&S(t,c[u],null,n);S(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(t.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function it(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&I(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&at(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function at(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];I(i,i.getAttribute("data-embed-src"))}if(e)return it(t)}function I(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=e,r.appendChild(a);break}}var vt=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(t,e,r,n){var s,o,u;let i=t;if(n||(e=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,e))||e),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=Et(i),f=G(e,h,!1)||[];c==0&&Yt(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),e=H(F({},e),{[nt(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>vt.indexOf(c.name)-vt.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&S(i,c,G(e,f,!0),r),c=="data-embed-src"&&S(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],e,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,e),i}function T(t,e,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,t,e,r))||e;return t.innerHTML=i,t.classList.add("-feaas"),E(t,r,n)}function At(t,e){return st(t,e||(e=document.createElement("style"))),e}function st(t,e){return e||(e=document.createElement("style")),Y(t,r=>{e.textContent=r}).then(()=>e)}function wt(t,e){return ot(t,e||(e=document.createElement("div"))),e}function ot(t,e){return w(this,null,function*(){return e||(e=document.createElement("div")),e.childNodes.length?E(e,t.data,t):"template"in t?T(e,t.template,t.data,t):U(t,r=>T(e,r,t.data,t)).then(()=>e)})}var ht={};Z(ht,{HTMLFeaasComponent:()=>N,HTMLFeaasStylesheet:()=>z});var K=typeof HTMLElement=="undefined"?class{}:HTMLElement,N=class extends K{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,U(r,n=>{this.template=n,this.isFetching=!1,T(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):T(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},z=class extends K{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();Y(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},lt=class extends K{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.script.crossOrigin="anonymous",this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?this.removeAttribute(i):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.mode&&!this.hidden&&this.load(),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},ct=class extends K{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -1,6 +1,6 @@
1
- var ot=Object.defineProperty,wt=Object.defineProperties;var St=Object.getOwnPropertyDescriptors;var at=Object.getOwnPropertySymbols;var Tt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var st=(t,e,r)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))Tt.call(e,r)&&st(t,r,e[r]);if(at)for(var r of at(e))_t.call(e,r)&&st(t,r,e[r]);return t},H=(t,e)=>wt(t,St(e));var ut=(t,e)=>{for(var r in e)ot(t,r,{get:e[r],enumerable:!0})};var A=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(t,e)).next())});var tt={};ut(tt,{autoloadScripts:()=>bt,cleanCollectionBit:()=>dt,loadScript:()=>q,normalizeCollectionScope:()=>pt,observeDOMElement:()=>mt,queryScopes:()=>Z,renderComponent:()=>qt,renderComponentElement:()=>Nt,renderComponentPromise:()=>vt,renderDOMContent:()=>P,renderDOMElement:()=>w,renderStylesheet:()=>Jt,renderStylesheetPromise:()=>gt,setDOMAttribute:()=>C});function g(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(e){return typeof e}:g=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function Dt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ct(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}}),e&&B(t,e)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R(t)}function B(t,e){return B=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},B(t,e)}function ct(){if(typeof Reflect=="undefined"||!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(t){return!1}}function j(t,e,r){return ct()?j=Reflect.construct:j=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&B(h,s.prototype),h},j.apply(null,arguments)}function Pt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K(t){var e=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!Pt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return j(n,arguments,R(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},K(t)}function Mt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kt(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:Mt(t)}function Lt(t){var e=ct();return function(){var n=R(t),i;if(e){var a=R(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kt(this,i)}}function lt(t){return Ot(t)||xt(t)||ht(t)||Ht()}function Ot(t){if(Array.isArray(t))return X(t)}function xt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ht(t,e){if(!!t){if(typeof t=="string")return X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(t,e)}}function X(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ht(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var ot=Object.defineProperty,wt=Object.defineProperties;var St=Object.getOwnPropertyDescriptors;var at=Object.getOwnPropertySymbols;var Tt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var st=(t,e,r)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))Tt.call(e,r)&&st(t,r,e[r]);if(at)for(var r of at(e))_t.call(e,r)&&st(t,r,e[r]);return t},H=(t,e)=>wt(t,St(e));var ut=(t,e)=>{for(var r in e)ot(t,r,{get:e[r],enumerable:!0})};var A=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(t,e)).next())});var tt={};ut(tt,{autoloadScripts:()=>bt,cleanCollectionBit:()=>dt,loadScript:()=>q,normalizeCollectionScope:()=>pt,observeDOMElement:()=>mt,queryScopes:()=>Z,renderComponent:()=>qt,renderComponentElement:()=>Nt,renderComponentPromise:()=>vt,renderDOMContent:()=>P,renderDOMElement:()=>w,renderStylesheet:()=>Jt,renderStylesheetPromise:()=>gt,setDOMAttribute:()=>C});function g(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(e){return typeof e}:g=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(t)}function Dt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ct(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}}),e&&B(t,e)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R(t)}function B(t,e){return B=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},B(t,e)}function ct(){if(typeof Reflect=="undefined"||!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(t){return!1}}function j(t,e,r){return ct()?j=Reflect.construct:j=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&B(h,s.prototype),h},j.apply(null,arguments)}function Pt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K(t){var e=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!Pt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return j(n,arguments,R(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},K(t)}function Mt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kt(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:Mt(t)}function Ot(t){var e=ct();return function(){var n=R(t),i;if(e){var a=R(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kt(this,i)}}function lt(t){return Lt(t)||xt(t)||ht(t)||Ht()}function Lt(t){if(Array.isArray(t))return X(t)}function xt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ht(t,e){if(!!t){if(typeof t=="string")return X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(t,e)}}function X(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ht(){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 $t(t,e){var r=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ht(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function $(t,e){return t=t.slice(),t.push(e),t}function D(t,e){return e=e.slice(),e.unshift(t),e}var jt=function(t){Ct(r,t);var e=Lt(r);function r(n){var i;return Dt(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 r}(K(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var a=t&&g(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.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:a?t.path:e};a?"json"in t&&(s.json=t.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new jt(o);return o}}d.prototype.evaluate=function(t,e,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&g(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,a=b.call(t,"parent")?t.parent:a,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(a=a||null,s=s||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var l=d.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,e,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,a,s,o){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=t[0],c=t.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(T){f.push(T)}):f.push(m)}if((typeof l!="string"||o)&&e&&b.call(e,l))p(this._trace(c,e[l],$(r,l),e,l,a,s));else if(l==="*")this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,L,O,x){p(u._trace(D(m,k),v,_,L,O,x,!0,!0))});else if(l==="..")p(this._trace(c,e,r,n,i,a,s)),this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,L,O,x){g(v[m])==="object"&&p(u._trace(D(T,k),v[m],$(_,m),v,m,x,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:$(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,e,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,e,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,L,O,x){u._eval(T.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),v[m],m,_,L,O)&&p(u._trace(D(m,k),v,_,L,O,x,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(D(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),c),e,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,S=l.slice(1,-2);switch(S){case"scalar":(!e||!["object","function"].includes(g(e)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===S&&(y=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(y=!0);break;case"number":Number.isFinite(e)&&(y=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(y=!0);break;case"object":e&&g(e)===S&&(y=!0);break;case"array":Array.isArray(e)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+S)}if(y)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&e&&b.call(e,l.slice(1))){var Y=l.slice(1);p(this._trace(c,e[Y],$(r,Y),e,Y,a,s,!0))}else if(l.includes(",")){var Ft=l.split(","),I=$t(Ft),it;try{for(I.s();!(it=I.n()).done;){var Et=it.value;p(this._trace(D(Et,c),e,r,n,i,a,!0))}}catch(m){I.e(m)}finally{I.f()}}else!o&&e&&b.call(e,l)&&p(this._trace(c,e[l],$(r,l),e,l,a,s,!0))}if(this._hasParentSelector)for(var E=0;E<f.length;E++){var N=f[E];if(N&&N.isParentSelector){var M=this._trace(N.expr,e,N.path,n,i,a,s);if(Array.isArray(M)){f[E]=M[0];for(var At=M.length,G=1;G<At;G++)E++,f.splice(E,0,M[G])}else f[E]=M}}return f};d.prototype._walk=function(t,e,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,t,e,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,t,e,r,n,i,a,s)})};d.prototype._slice=function(t,e,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(D(p,e),r,n,i,a,s,!0);y.forEach(function(S){f.push(S)})}return f}};d.prototype._eval=function(t,e,r,n,i,a){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=i,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=r,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=e,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return e[t]=i,e[t].concat()};var Rt=function(e,r,n){for(var i=e.length,a=0;a<i;a++){var s=e[a];n(s)&&r.push(e.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(e,r){var n=Object.keys(r),i=[];Rt(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");e=s+e,!/(["'])use strict\1/.test(e)&&!n.includes("arguments")&&(e="var arguments = undefined;"+e),e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=e.lastIndexOf(";"),u=o>-1?e.slice(0,o+1)+" return "+e.slice(o+1):" return "+e;return j(Function,lt(n).concat([u])).apply(void 0,lt(a))}};function Q(t,e,r,n){return A(this,null,function*(){let i=new Date,a=yield fetch(t,e);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(t+"?"+Math.random(),H(F({},e),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(t,H(F({},e),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function Bt({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,component:r,version:n,revision:i="published"}){return`${t}/components/${e}/${r}/${n}/${i}.html`}function It({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,revision:r="published"}){return`${t}/styles/${e}/${r}.css`}function z(t,e){return A(this,null,function*(){return Q(Bt(t),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(e)})})}function J(t,e){return A(this,null,function*(){return Q(It(t),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})})}function Nt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return w(n,e),r}function dt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function pt(t){return dt(t)+".*"}function yt(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 zt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=yt(t);if(i!=0)return;let a=t.parentElement;if(a!=null){e==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=i+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<e;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,e);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function Z(t,e,r=!1,n=t){var i=e;let a=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of a)if(e.startsWith(o)){if(o==e){if(r)return t[o];continue}i=e.substring(o.length+1),n=t[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function C(t,e,r,n){var l;if(!!t){var i=t;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")i=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")i=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")i=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")q(t,r);else if(e=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];C(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&C(t,c[u],null,n);C(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(t.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function mt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&q(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&bt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function bt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];q(i,i.getAttribute("data-embed-src"))}if(e)return mt(t)}function q(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 a=r.ownerDocument.createElement("script");a.type="module",a.src=e,r.appendChild(a);break}}var ft=["data-attributes-keys","data-path-attributes","data-path-scope"];function w(t,e,r,n){var s,o,u;let i=t;if(n||(e=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,e))||e),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=yt(i),f=Z(e,h,!1)||[];c==0&&zt(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),e=H(F({},e),{[pt(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>ft.indexOf(c.name)-ft.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&C(i,c,Z(e,f,!0),r),c=="data-embed-src"&&C(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)w(i.children[a],e,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,e),i}function P(t,e,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,t,e,r))||e;return t.innerHTML=i,t.classList.add("-feaas"),w(t,r,n)}function Jt(t,e){return gt(t,e||(e=document.createElement("style"))),e}function gt(t,e){return e||(e=document.createElement("style")),J(t,r=>{e.textContent=r}).then(()=>e)}function qt(t,e){return vt(t,e||(e=document.createElement("div"))),e}function vt(t,e){return A(this,null,function*(){return e||(e=document.createElement("div")),e.childNodes.length?w(e,t.data,t):"template"in t?P(e,t.template,t.data,t):z(t,r=>P(e,r,t.data,t)).then(()=>e)})}var nt={};ut(nt,{HTMLFeaasComponent:()=>V,HTMLFeaasStylesheet:()=>W});var U=typeof HTMLElement=="undefined"?class{}:HTMLElement,V=class extends U{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){w(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,z(r,n=>{this.template=n,this.isFetching=!1,P(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):P(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},W=class extends U{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();J(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},et=class extends U{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?(this.removeAttribute(i),this.load()):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},rt=class extends U{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function $(t,e){return t=t.slice(),t.push(e),t}function D(t,e){return e=e.slice(),e.unshift(t),e}var jt=function(t){Ct(r,t);var e=Ot(r);function r(n){var i;return Dt(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 r}(K(Error));function d(t,e,r,n,i){if(!(this instanceof d))try{return new d(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var a=t&&g(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.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:a?t.path:e};a?"json"in t&&(s.json=t.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new jt(o);return o}}d.prototype.evaluate=function(t,e,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&g(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;e=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,a=b.call(t,"parent")?t.parent:a,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(a=a||null,s=s||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!e)){var l=d.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,e,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(r),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return d.toPathString(t[e]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),e(n,r,t)}};d.prototype._trace=function(t,e,r,n,i,a,s,o){var u=this,h;if(!t.length)return h={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=t[0],c=t.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(T){f.push(T)}):f.push(m)}if((typeof l!="string"||o)&&e&&b.call(e,l))p(this._trace(c,e[l],$(r,l),e,l,a,s));else if(l==="*")this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,O,L,x){p(u._trace(D(m,k),v,_,O,L,x,!0,!0))});else if(l==="..")p(this._trace(c,e,r,n,i,a,s)),this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,O,L,x){g(v[m])==="object"&&p(u._trace(D(T,k),v[m],$(_,m),v,m,x,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:$(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,e,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,e,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,e,r,n,i,a,function(m,T,k,v,_,O,L,x){u._eval(T.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),v[m],m,_,O,L)&&p(u._trace(D(m,k),v,_,O,L,x,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(D(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),c),e,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,S=l.slice(1,-2);switch(S){case"scalar":(!e||!["object","function"].includes(g(e)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(e)===S&&(y=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(y=!0);break;case"number":Number.isFinite(e)&&(y=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(y=!0);break;case"object":e&&g(e)===S&&(y=!0);break;case"array":Array.isArray(e)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+S)}if(y)return h={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&e&&b.call(e,l.slice(1))){var Y=l.slice(1);p(this._trace(c,e[Y],$(r,Y),e,Y,a,s,!0))}else if(l.includes(",")){var Ft=l.split(","),I=$t(Ft),it;try{for(I.s();!(it=I.n()).done;){var Et=it.value;p(this._trace(D(Et,c),e,r,n,i,a,!0))}}catch(m){I.e(m)}finally{I.f()}}else!o&&e&&b.call(e,l)&&p(this._trace(c,e[l],$(r,l),e,l,a,s,!0))}if(this._hasParentSelector)for(var E=0;E<f.length;E++){var N=f[E];if(N&&N.isParentSelector){var M=this._trace(N.expr,e,N.path,n,i,a,s);if(Array.isArray(M)){f[E]=M[0];for(var At=M.length,G=1;G<At;G++)E++,f.splice(E,0,M[G])}else f[E]=M}}return f};d.prototype._walk=function(t,e,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,t,e,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,t,e,r,n,i,a,s)})};d.prototype._slice=function(t,e,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(D(p,e),r,n,i,a,s,!0);y.forEach(function(S){f.push(S)})}return f}};d.prototype._eval=function(t,e,r,n,i,a){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=i,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=r,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=e,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};d.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var e=d.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return e[t]=i,e[t].concat()};var Rt=function(e,r,n){for(var i=e.length,a=0;a<i;a++){var s=e[a];n(s)&&r.push(e.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(e,r){var n=Object.keys(r),i=[];Rt(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");e=s+e,!/(["'])use strict\1/.test(e)&&!n.includes("arguments")&&(e="var arguments = undefined;"+e),e=e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=e.lastIndexOf(";"),u=o>-1?e.slice(0,o+1)+" return "+e.slice(o+1):" return "+e;return j(Function,lt(n).concat([u])).apply(void 0,lt(a))}};function Q(t,e,r,n){return A(this,null,function*(){let i=new Date,a=yield fetch(t,e);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(t+"?"+Math.random(),H(F({},e),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(t,H(F({},e),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function Bt({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,component:r,version:n,revision:i="published"}){return`${t}/components/${e}/${r}/${n}/${i}.html`}function It({hostname:t="https://feaascomponentsapidev.blob.core.windows.net",library:e,revision:r="published"}){return`${t}/styles/${e}/${r}.css`}function z(t,e){return A(this,null,function*(){return Q(Bt(t),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(e)})})}function J(t,e){return A(this,null,function*(){return Q(It(t),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(e)})})}function Nt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return w(n,e),r}function dt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function pt(t){return dt(t)+".*"}function yt(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 zt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=yt(t);if(i!=0)return;let a=t.parentElement;if(a!=null){e==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=i+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<e;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,e);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function Z(t,e,r=!1,n=t){var i=e;let a=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of a)if(e.startsWith(o)){if(o==e){if(r)return t[o];continue}i=e.substring(o.length+1),n=t[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function C(t,e,r,n){var l;if(!!t){var i=t;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src")i=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")i=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")i=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")q(t,r);else if(e=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];C(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&C(t,c[u],null,n);C(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(t.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function mt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&q(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&bt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function bt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];q(i,i.getAttribute("data-embed-src"))}if(e)return mt(t)}function q(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 a=r.ownerDocument.createElement("script");a.type="module",a.src=e,r.appendChild(a);break}}var ft=["data-attributes-keys","data-path-attributes","data-path-scope"];function w(t,e,r,n){var s,o,u;let i=t;if(n||(e=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,e))||e),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=yt(i),f=Z(e,h,!1)||[];c==0&&zt(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),e=H(F({},e),{[pt(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>ft.indexOf(c.name)-ft.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&C(i,c,Z(e,f,!0),r),c=="data-embed-src"&&C(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)w(i.children[a],e,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,e),i}function P(t,e,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,t,e,r))||e;return t.innerHTML=i,t.classList.add("-feaas"),w(t,r,n)}function Jt(t,e){return gt(t,e||(e=document.createElement("style"))),e}function gt(t,e){return e||(e=document.createElement("style")),J(t,r=>{e.textContent=r}).then(()=>e)}function qt(t,e){return vt(t,e||(e=document.createElement("div"))),e}function vt(t,e){return A(this,null,function*(){return e||(e=document.createElement("div")),e.childNodes.length?w(e,t.data,t):"template"in t?P(e,t.template,t.data,t):z(t,r=>P(e,r,t.data,t)).then(()=>e)})}var nt={};ut(nt,{HTMLFeaasComponent:()=>V,HTMLFeaasStylesheet:()=>W});var U=typeof HTMLElement=="undefined"?class{}:HTMLElement,V=class extends U{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){w(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,z(r,n=>{this.template=n,this.isFetching=!1,P(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):P(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},W=class extends U{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();J(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},et=class extends U{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.script.crossOrigin="anonymous",this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?this.removeAttribute(i):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.mode&&!this.hidden&&this.load(),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},rt=class extends U{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -1,6 +1,6 @@
1
1
  var Oe=Object.create;var B=Object.defineProperty,xe=Object.defineProperties,He=Object.getOwnPropertyDescriptor,$e=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertyNames,pe=Object.getOwnPropertySymbols,je=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t)=>{for(var r in t||(t={}))me.call(t,r)&&ye(e,r,t[r]);if(pe)for(var r of pe(t))Be.call(t,r)&&ye(e,r,t[r]);return e},w=(e,t)=>xe(e,$e(t));var Z=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},be=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Re(t))!me.call(e,i)&&i!==r&&B(e,i,{get:()=>t[i],enumerable:!(n=He(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?Oe(je(e)):{},be(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>be(B({},"__esModule",{value:!0}),e);var T=(e,t,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(e,t)).next())});var rt={};Z(rt,{Component:()=>De,HTMLFeaasComponent:()=>V,HTMLFeaasStylesheet:()=>W,Stylesheet:()=>Pe,autoloadScripts:()=>se,cleanCollectionBit:()=>ne,default:()=>tt,fetchComponent:()=>C,fetchStylesheet:()=>_,getComponentURL:()=>ge,getStylesheetURL:()=>ve,loadScript:()=>q,normalizeCollectionScope:()=>ie,observeDOMElement:()=>ae,queryScopes:()=>G,renderComponent:()=>_e,renderComponentElement:()=>we,renderComponentPromise:()=>ue,renderDOMContent:()=>P,renderDOMElement:()=>E,renderStylesheet:()=>Ce,renderStylesheetPromise:()=>oe,setDOMAttribute:()=>D});module.exports=Ie(rt);var v=Ne(require("react"),1);function ee(e,t,r,n){return T(this,null,function*(){let i=new Date,a=yield fetch(e,t);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(e+"?"+Math.random(),w(A({},t),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(e,w(A({},t),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function ge({hostname:e="https://feaascomponentsapidev.blob.core.windows.net",library:t,component:r,version:n,revision:i="published"}){return`${e}/components/${t}/${r}/${n}/${i}.html`}function ve({hostname:e="https://feaascomponentsapidev.blob.core.windows.net",library:t,revision:r="published"}){return`${e}/styles/${t}/${r}.css`}function C(e,t){return T(this,null,function*(){return ee(ge(e),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(t)})})}function _(e,t){return T(this,null,function*(){return ee(ve(e),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(t)})})}var le={};Z(le,{autoloadScripts:()=>se,cleanCollectionBit:()=>ne,loadScript:()=>q,normalizeCollectionScope:()=>ie,observeDOMElement:()=>ae,queryScopes:()=>G,renderComponent:()=>_e,renderComponentElement:()=>we,renderComponentPromise:()=>ue,renderDOMContent:()=>P,renderDOMElement:()=>E,renderStylesheet:()=>Ce,renderStylesheetPromise:()=>oe,setDOMAttribute:()=>D});function g(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(t){return typeof t}:g=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(e)}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Je(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},z(e)}function J(e,t){return J=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},J(e,t)}function Fe(){if(typeof Reflect=="undefined"||!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(e){return!1}}function I(e,t,r){return Fe()?I=Reflect.construct:I=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&J(h,s.prototype),h},I.apply(null,arguments)}function qe(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function te(e){var t=typeof Map=="function"?new Map:void 0;return te=function(n){if(n===null||!qe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return I(n,arguments,z(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),J(i,n)},te(e)}function Ve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function We(e,t){return t&&(typeof t=="object"||typeof t=="function")?t:Ve(e)}function Ue(e){var t=Fe();return function(){var n=z(e),i;if(t){var a=z(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return We(this,i)}}function Ee(e){return Ye(e)||Ge(e)||Ae(e)||Ke()}function Ye(e){if(Array.isArray(e))return re(e)}function Ge(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ae(e,t){if(!!e){if(typeof e=="string")return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return re(e,t)}}function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ke(){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 Xe(e,t){var r=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ae(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function N(e,t){return e=e.slice(),e.push(t),e}function O(e,t){return t=t.slice(),t.unshift(e),t}var Qe=function(e){Je(r,e);var t=Ue(r);function r(n){var i;return ze(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return r}(te(Error));function d(e,t,r,n,i){if(!(this instanceof d))try{return new d(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&g(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=b.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:a?e.path:t};a?"json"in e&&(s.json=e.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new Qe(o);return o}}d.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&g(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=e;t=h.json,o=b.call(e,"flatten")?e.flatten:o,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,u=b.call(e,"wrap")?e.wrap:u,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=b.call(e,"parent")?e.parent:a,s=b.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(a=a||null,s=s||null,Array.isArray(e)&&(e=d.toPathString(e)),!(!e&&e!==""||!t)){var l=d.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,t,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(r),e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),t(n,r,e)}};d.prototype._trace=function(e,t,r,n,i,a,s,o){var u=this,h;if(!e.length)return h={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=e[0],c=e.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(k){f.push(k)}):f.push(m)}if((typeof l!="string"||o)&&t&&b.call(t,l))p(this._trace(c,t[l],N(r,l),t,l,a,s));else if(l==="*")this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){p(u._trace(O(m,H),F,L,$,R,j,!0,!0))});else if(l==="..")p(this._trace(c,t,r,n,i,a,s)),this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){g(F[m])==="object"&&p(u._trace(O(k,H),F[m],N(L,m),F,m,j,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:N(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,t,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){u._eval(k.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),F[m],m,L,$,R)&&p(u._trace(O(m,H),F,L,$,R,j,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(O(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),c),t,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,M=l.slice(1,-2);switch(M){case"scalar":(!t||!["object","function"].includes(g(t)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===M&&(y=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(y=!0);break;case"number":Number.isFinite(t)&&(y=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(y=!0);break;case"object":t&&g(t)===M&&(y=!0);break;case"array":Array.isArray(t)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+M)}if(y)return h={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&t&&b.call(t,l.slice(1))){var X=l.slice(1);p(this._trace(c,t[X],N(r,X),t,X,a,s,!0))}else if(l.includes(",")){var Me=l.split(","),U=Xe(Me),de;try{for(U.s();!(de=U.n()).done;){var ke=de.value;p(this._trace(O(ke,c),t,r,n,i,a,!0))}}catch(m){U.e(m)}finally{U.f()}}else!o&&t&&b.call(t,l)&&p(this._trace(c,t[l],N(r,l),t,l,a,s,!0))}if(this._hasParentSelector)for(var S=0;S<f.length;S++){var Y=f[S];if(Y&&Y.isParentSelector){var x=this._trace(Y.expr,t,Y.path,n,i,a,s);if(Array.isArray(x)){f[S]=x[0];for(var Le=x.length,Q=1;Q<Le;Q++)S++,f.splice(S,0,x[Q])}else f[S]=x}}return f};d.prototype._walk=function(e,t,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,e,t,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,e,t,r,n,i,a,s)})};d.prototype._slice=function(e,t,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=e.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(O(p,t),r,n,i,a,s,!0);y.forEach(function(M){f.push(M)})}return f}};d.prototype._eval=function(e,t,r,n,i,a){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=i,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=r,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+e)}};d.cache={};d.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};d.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(e){var t=d.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return t[e]=i,t[e].concat()};var Ze=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var s=t[a];n(s)&&r.push(t.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(t,r){var n=Object.keys(r),i=[];Ze(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");t=s+t,!/(["'])use strict\1/.test(t)&&!n.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=t.lastIndexOf(";"),u=o>-1?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return I(Function,Ee(n).concat([u])).apply(void 0,Ee(a))}};function we(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,t),r}function ne(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ie(e){return ne(e)+".*"}function Te(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function et(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Te(e);if(i!=0)return;let a=e.parentElement;if(a!=null){t==0?e.style.display="none":e.style.display&&(e.style.display="",e.getAttribute("style")==""&&e.removeAttribute("style"));for(var s=i+1,o=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<t;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,t);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function G(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((o,u)=>u.length-o.length);for(let o of a)if(t.startsWith(o)){if(o==t){if(r)return e[o];continue}i=t.substring(o.length+1),n=e[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function D(e,t,r,n){var l;if(!!e){var i=e;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src")i=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")i=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")i=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")q(e,r);else if(t=="data-path-attributes"){let c=((l=e.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];D(e,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&D(e,c[u],null,n);D(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(e.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function ae(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&q(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&se(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function se(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];q(i,i.getAttribute("data-embed-src"))}if(t)return ae(e)}function q(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=t,r.appendChild(a);break}}var Se=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(e,t,r,n){var s,o,u;let i=e;if(n||(t=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,t))||t),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=Te(i),f=G(t,h,!1)||[];c==0&&et(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),t=w(A({},t),{[ie(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>Se.indexOf(c.name)-Se.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&D(i,c,G(t,f,!0),r),c=="data-embed-src"&&D(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],t,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,t),i}function P(e,t,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,e,t,r))||t;return e.innerHTML=i,e.classList.add("-feaas"),E(e,r,n)}function Ce(e,t){return oe(e,t||(t=document.createElement("style"))),t}function oe(e,t){return t||(t=document.createElement("style")),_(e,r=>{t.textContent=r}).then(()=>t)}function _e(e,t){return ue(e,t||(t=document.createElement("div"))),t}function ue(e,t){return T(this,null,function*(){return t||(t=document.createElement("div")),t.childNodes.length?E(t,e.data,e):"template"in e?P(t,e.template,e.data,e):C(e,r=>P(t,r,e.data,e)).then(()=>t)})}var fe={};Z(fe,{HTMLFeaasComponent:()=>V,HTMLFeaasStylesheet:()=>W});var K=typeof HTMLElement=="undefined"?class{}:HTMLElement,V=class extends K{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,C(r,n=>{this.template=n,this.isFetching=!1,P(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):P(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},W=class extends K{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();_(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},ce=class extends K{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?(this.removeAttribute(i),this.load()):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},he=class extends K{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function N(e,t){return e=e.slice(),e.push(t),e}function O(e,t){return t=t.slice(),t.unshift(e),t}var Qe=function(e){Je(r,e);var t=Ue(r);function r(n){var i;return ze(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return r}(te(Error));function d(e,t,r,n,i){if(!(this instanceof d))try{return new d(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&g(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=b.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:a?e.path:t};a?"json"in e&&(s.json=e.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new Qe(o);return o}}d.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&g(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=e;t=h.json,o=b.call(e,"flatten")?e.flatten:o,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,u=b.call(e,"wrap")?e.wrap:u,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=b.call(e,"parent")?e.parent:a,s=b.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(a=a||null,s=s||null,Array.isArray(e)&&(e=d.toPathString(e)),!(!e&&e!==""||!t)){var l=d.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,t,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(r),e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),t(n,r,e)}};d.prototype._trace=function(e,t,r,n,i,a,s,o){var u=this,h;if(!e.length)return h={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=e[0],c=e.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(k){f.push(k)}):f.push(m)}if((typeof l!="string"||o)&&t&&b.call(t,l))p(this._trace(c,t[l],N(r,l),t,l,a,s));else if(l==="*")this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){p(u._trace(O(m,H),F,L,$,R,j,!0,!0))});else if(l==="..")p(this._trace(c,t,r,n,i,a,s)),this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){g(F[m])==="object"&&p(u._trace(O(k,H),F[m],N(L,m),F,m,j,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:N(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,t,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,t,r,n,i,a,function(m,k,H,F,L,$,R,j){u._eval(k.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),F[m],m,L,$,R)&&p(u._trace(O(m,H),F,L,$,R,j,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(O(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),c),t,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,M=l.slice(1,-2);switch(M){case"scalar":(!t||!["object","function"].includes(g(t)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===M&&(y=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(y=!0);break;case"number":Number.isFinite(t)&&(y=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(y=!0);break;case"object":t&&g(t)===M&&(y=!0);break;case"array":Array.isArray(t)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+M)}if(y)return h={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&t&&b.call(t,l.slice(1))){var X=l.slice(1);p(this._trace(c,t[X],N(r,X),t,X,a,s,!0))}else if(l.includes(",")){var Me=l.split(","),U=Xe(Me),de;try{for(U.s();!(de=U.n()).done;){var ke=de.value;p(this._trace(O(ke,c),t,r,n,i,a,!0))}}catch(m){U.e(m)}finally{U.f()}}else!o&&t&&b.call(t,l)&&p(this._trace(c,t[l],N(r,l),t,l,a,s,!0))}if(this._hasParentSelector)for(var S=0;S<f.length;S++){var Y=f[S];if(Y&&Y.isParentSelector){var x=this._trace(Y.expr,t,Y.path,n,i,a,s);if(Array.isArray(x)){f[S]=x[0];for(var Le=x.length,Q=1;Q<Le;Q++)S++,f.splice(S,0,x[Q])}else f[S]=x}}return f};d.prototype._walk=function(e,t,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,e,t,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,e,t,r,n,i,a,s)})};d.prototype._slice=function(e,t,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=e.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(O(p,t),r,n,i,a,s,!0);y.forEach(function(M){f.push(M)})}return f}};d.prototype._eval=function(e,t,r,n,i,a){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=i,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=r,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+e)}};d.cache={};d.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};d.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(e){var t=d.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return t[e]=i,t[e].concat()};var Ze=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var s=t[a];n(s)&&r.push(t.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(t,r){var n=Object.keys(r),i=[];Ze(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");t=s+t,!/(["'])use strict\1/.test(t)&&!n.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=t.lastIndexOf(";"),u=o>-1?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return I(Function,Ee(n).concat([u])).apply(void 0,Ee(a))}};function we(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,t),r}function ne(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ie(e){return ne(e)+".*"}function Te(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function et(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Te(e);if(i!=0)return;let a=e.parentElement;if(a!=null){t==0?e.style.display="none":e.style.display&&(e.style.display="",e.getAttribute("style")==""&&e.removeAttribute("style"));for(var s=i+1,o=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<t;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,t);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function G(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((o,u)=>u.length-o.length);for(let o of a)if(t.startsWith(o)){if(o==t){if(r)return e[o];continue}i=t.substring(o.length+1),n=e[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function D(e,t,r,n){var l;if(!!e){var i=e;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src")i=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")i=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")i=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")q(e,r);else if(t=="data-path-attributes"){let c=((l=e.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];D(e,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&D(e,c[u],null,n);D(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(e.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function ae(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&q(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&se(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function se(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];q(i,i.getAttribute("data-embed-src"))}if(t)return ae(e)}function q(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=t,r.appendChild(a);break}}var Se=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(e,t,r,n){var s,o,u;let i=e;if(n||(t=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,t))||t),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=Te(i),f=G(t,h,!1)||[];c==0&&et(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),t=w(A({},t),{[ie(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>Se.indexOf(c.name)-Se.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&D(i,c,G(t,f,!0),r),c=="data-embed-src"&&D(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],t,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,t),i}function P(e,t,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,e,t,r))||t;return e.innerHTML=i,e.classList.add("-feaas"),E(e,r,n)}function Ce(e,t){return oe(e,t||(t=document.createElement("style"))),t}function oe(e,t){return t||(t=document.createElement("style")),_(e,r=>{t.textContent=r}).then(()=>t)}function _e(e,t){return ue(e,t||(t=document.createElement("div"))),t}function ue(e,t){return T(this,null,function*(){return t||(t=document.createElement("div")),t.childNodes.length?E(t,e.data,e):"template"in e?P(t,e.template,e.data,e):C(e,r=>P(t,r,e.data,e)).then(()=>t)})}var fe={};Z(fe,{HTMLFeaasComponent:()=>V,HTMLFeaasStylesheet:()=>W});var K=typeof HTMLElement=="undefined"?class{}:HTMLElement,V=class extends K{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,C(r,n=>{this.template=n,this.isFetching=!1,P(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):P(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},W=class extends K{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();_(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},ce=class extends K{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.script.crossOrigin="anonymous",this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?this.removeAttribute(i):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.mode&&!this.hidden&&this.load(),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},he=class extends K{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -1,6 +1,6 @@
1
1
  var ue=Object.defineProperty,we=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var oe=(e,t,r)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t)=>{for(var r in t||(t={}))Ce.call(t,r)&&oe(e,r,t[r]);if(se)for(var r of se(t))_e.call(t,r)&&oe(e,r,t[r]);return e},w=(e,t)=>we(e,Te(t));var le=(e,t)=>{for(var r in t)ue(e,r,{get:t[r],enumerable:!0})};var T=(e,t,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(h){i(h)}},s=u=>{try{o(r.throw(u))}catch(h){i(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(e,t)).next())});import v from"react";function X(e,t,r,n){return T(this,null,function*(){let i=new Date,a=yield fetch(e,t);if(!a.ok)throw new Error("Fetch failed");let s=new Date(a.headers.get("date"));var o=a;if(n(a,"cached"),s<i){let u=yield fetch(e+"?"+Math.random(),w(A({},t),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=a.headers.get("last-modified")){if(r(u)===!1)throw new Error("Response is stale");o=yield fetch(e,w(A({},t),{cache:"reload"}))}}if(r(o)===!1)throw new Error("Response is not valid");return a!==o&&n(o,"valid"),o})}function De({hostname:e="https://feaascomponentsapidev.blob.core.windows.net",library:t,component:r,version:n,revision:i="published"}){return`${e}/components/${t}/${r}/${n}/${i}.html`}function Pe({hostname:e="https://feaascomponentsapidev.blob.core.windows.net",library:t,revision:r="published"}){return`${e}/styles/${t}/${r}.css`}function P(e,t){return T(this,null,function*(){return X(De(e),{},r=>r.headers.get("x-ms-meta-versionDeletedAt")==null,r=>{r.text().then(t)})})}function M(e,t){return T(this,null,function*(){return X(Pe(e),{},r=>r.headers.get("x-ms-meta-deletedAt")==null,r=>{r.text().then(t)})})}var te={};le(te,{autoloadScripts:()=>ge,cleanCollectionBit:()=>pe,loadScript:()=>V,normalizeCollectionScope:()=>ye,observeDOMElement:()=>be,queryScopes:()=>ee,renderComponent:()=>Ve,renderComponentElement:()=>ze,renderComponentPromise:()=>Ee,renderDOMContent:()=>O,renderDOMElement:()=>E,renderStylesheet:()=>qe,renderStylesheetPromise:()=>ve,setDOMAttribute:()=>L});function g(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g=function(t){return typeof t}:g=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ke(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},I(e)}function z(e,t){return z=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},z(e,t)}function he(){if(typeof Reflect=="undefined"||!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(e){return!1}}function N(e,t,r){return he()?N=Reflect.construct:N=function(i,a,s){var o=[null];o.push.apply(o,a);var u=Function.bind.apply(i,o),h=new u;return s&&z(h,s.prototype),h},N.apply(null,arguments)}function Le(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Q(e){var t=typeof Map=="function"?new Map:void 0;return Q=function(n){if(n===null||!Le(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return N(n,arguments,I(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),z(i,n)},Q(e)}function Oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e,t){return t&&(typeof t=="object"||typeof t=="function")?t:Oe(e)}function He(e){var t=he();return function(){var n=I(e),i;if(t){var a=I(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return xe(this,i)}}function ce(e){return $e(e)||Re(e)||fe(e)||je()}function $e(e){if(Array.isArray(e))return Z(e)}function Re(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fe(e,t){if(!!e){if(typeof e=="string")return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(e,t)}}function Z(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function je(){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 Be(e,t){var r=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=fe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function B(e,t){return e=e.slice(),e.push(t),e}function k(e,t){return t=t.slice(),t.unshift(e),t}var Ne=function(e){ke(r,e);var t=He(r);function r(n){var i;return Me(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return r}(Q(Error));function d(e,t,r,n,i){if(!(this instanceof d))try{return new d(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&g(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=b.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:a?e.path:t};a?"json"in e&&(s.json=e.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new Ne(o);return o}}d.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&g(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=e;t=h.json,o=b.call(e,"flatten")?e.flatten:o,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,u=b.call(e,"wrap")?e.wrap:u,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=b.call(e,"parent")?e.parent:a,s=b.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(a=a||null,s=s||null,Array.isArray(e)&&(e=d.toPathString(e)),!(!e&&e!==""||!t)){var l=d.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,t,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(r),e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),t(n,r,e)}};d.prototype._trace=function(e,t,r,n,i,a,s,o){var u=this,h;if(!e.length)return h={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=e[0],c=e.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(_){f.push(_)}):f.push(m)}if((typeof l!="string"||o)&&t&&b.call(t,l))p(this._trace(c,t[l],B(r,l),t,l,a,s));else if(l==="*")this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){p(u._trace(k(m,H),F,D,$,R,j,!0,!0))});else if(l==="..")p(this._trace(c,t,r,n,i,a,s)),this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){g(F[m])==="object"&&p(u._trace(k(_,H),F[m],B(D,m),F,m,j,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:B(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,t,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){u._eval(_.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),F[m],m,D,$,R)&&p(u._trace(k(m,H),F,D,$,R,j,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(k(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),c),t,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,C=l.slice(1,-2);switch(C){case"scalar":(!t||!["object","function"].includes(g(t)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===C&&(y=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(y=!0);break;case"number":Number.isFinite(t)&&(y=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(y=!0);break;case"object":t&&g(t)===C&&(y=!0);break;case"array":Array.isArray(t)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+C)}if(y)return h={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&t&&b.call(t,l.slice(1))){var G=l.slice(1);p(this._trace(c,t[G],B(r,G),t,G,a,s,!0))}else if(l.includes(",")){var Fe=l.split(","),J=Be(Fe),ae;try{for(J.s();!(ae=J.n()).done;){var Ae=ae.value;p(this._trace(k(Ae,c),t,r,n,i,a,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&t&&b.call(t,l)&&p(this._trace(c,t[l],B(r,l),t,l,a,s,!0))}if(this._hasParentSelector)for(var S=0;S<f.length;S++){var q=f[S];if(q&&q.isParentSelector){var x=this._trace(q.expr,t,q.path,n,i,a,s);if(Array.isArray(x)){f[S]=x[0];for(var Se=x.length,K=1;K<Se;K++)S++,f.splice(S,0,x[K])}else f[S]=x}}return f};d.prototype._walk=function(e,t,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,e,t,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,e,t,r,n,i,a,s)})};d.prototype._slice=function(e,t,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=e.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(k(p,t),r,n,i,a,s,!0);y.forEach(function(C){f.push(C)})}return f}};d.prototype._eval=function(e,t,r,n,i,a){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=i,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=r,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+e)}};d.cache={};d.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};d.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(e){var t=d.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return t[e]=i,t[e].concat()};var Ie=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var s=t[a];n(s)&&r.push(t.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(t,r){var n=Object.keys(r),i=[];Ie(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");t=s+t,!/(["'])use strict\1/.test(t)&&!n.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=t.lastIndexOf(";"),u=o>-1?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return N(Function,ce(n).concat([u])).apply(void 0,ce(a))}};function ze(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,t),r}function pe(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ye(e){return pe(e)+".*"}function me(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Je(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=me(e);if(i!=0)return;let a=e.parentElement;if(a!=null){t==0?e.style.display="none":e.style.display&&(e.style.display="",e.getAttribute("style")==""&&e.removeAttribute("style"));for(var s=i+1,o=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<t;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,t);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function ee(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((o,u)=>u.length-o.length);for(let o of a)if(t.startsWith(o)){if(o==t){if(r)return e[o];continue}i=t.substring(o.length+1),n=e[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function L(e,t,r,n){var l;if(!!e){var i=e;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src")i=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")i=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")i=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")V(e,r);else if(t=="data-path-attributes"){let c=((l=e.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];L(e,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&L(e,c[u],null,n);L(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(e.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function be(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&V(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&ge(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function ge(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];V(i,i.getAttribute("data-embed-src"))}if(t)return be(e)}function V(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=t,r.appendChild(a);break}}var de=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(e,t,r,n){var s,o,u;let i=e;if(n||(t=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,t))||t),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=me(i),f=ee(t,h,!1)||[];c==0&&Je(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),t=w(A({},t),{[ye(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>de.indexOf(c.name)-de.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&L(i,c,ee(t,f,!0),r),c=="data-embed-src"&&L(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],t,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,t),i}function O(e,t,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,e,t,r))||t;return e.innerHTML=i,e.classList.add("-feaas"),E(e,r,n)}function qe(e,t){return ve(e,t||(t=document.createElement("style"))),t}function ve(e,t){return t||(t=document.createElement("style")),M(e,r=>{t.textContent=r}).then(()=>t)}function Ve(e,t){return Ee(e,t||(t=document.createElement("div"))),t}function Ee(e,t){return T(this,null,function*(){return t||(t=document.createElement("div")),t.childNodes.length?E(t,e.data,e):"template"in e?O(t,e.template,e.data,e):P(e,r=>O(t,r,e.data,e)).then(()=>t)})}var ie={};le(ie,{HTMLFeaasComponent:()=>W,HTMLFeaasStylesheet:()=>U});var Y=typeof HTMLElement=="undefined"?class{}:HTMLElement,W=class extends Y{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,P(r,n=>{this.template=n,this.isFetching=!1,O(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):O(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},U=class extends Y{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();M(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},re=class extends Y{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?(this.removeAttribute(i),this.load()):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},ne=class extends Y{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function B(e,t){return e=e.slice(),e.push(t),e}function k(e,t){return t=t.slice(),t.unshift(e),t}var Ne=function(e){ke(r,e);var t=He(r);function r(n){var i;return Me(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return r}(Q(Error));function d(e,t,r,n,i){if(!(this instanceof d))try{return new d(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&g(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=b.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:a?e.path:t};a?"json"in e&&(s.json=e.json):s.json=r;var o=this.evaluate(s);if(!o||g(o)!=="object")throw new Ne(o);return o}}d.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,s=this.parentProperty,o=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&g(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=e;t=h.json,o=b.call(e,"flatten")?e.flatten:o,this.currResultType=b.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=b.call(e,"sandbox")?e.sandbox:this.currSandbox,u=b.call(e,"wrap")?e.wrap:u,this.currPreventEval=b.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=b.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=b.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=b.call(e,"parent")?e.parent:a,s=b.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(a=a||null,s=s||null,Array.isArray(e)&&(e=d.toPathString(e)),!(!e&&e!==""||!t)){var l=d.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,t,["$"],a,s,r).filter(function(f){return f&&!f.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(f,p){var y=i._getPreferredOutput(p);return o&&Array.isArray(y)?f=f.concat(y):f.push(y),f},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(r),e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:d.toPathString(e.path),t(n,r,e)}};d.prototype._trace=function(e,t,r,n,i,a,s,o){var u=this,h;if(!e.length)return h={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(h,a,"value"),h;var l=e[0],c=e.slice(1),f=[];function p(m){Array.isArray(m)?m.forEach(function(_){f.push(_)}):f.push(m)}if((typeof l!="string"||o)&&t&&b.call(t,l))p(this._trace(c,t[l],B(r,l),t,l,a,s));else if(l==="*")this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){p(u._trace(k(m,H),F,D,$,R,j,!0,!0))});else if(l==="..")p(this._trace(c,t,r,n,i,a,s)),this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){g(F[m])==="object"&&p(u._trace(k(_,H),F[m],B(D,m),F,m,j,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:B(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(h,a,"property"),h;if(l==="$")p(this._trace(c,t,r,null,null,a,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,c,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,t,r,n,i,a,function(m,_,H,F,D,$,R,j){u._eval(_.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),F[m],m,D,$,R)&&p(u._trace(k(m,H),F,D,$,R,j,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(k(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),c),t,r,n,i,a,s))}else if(l[0]==="@"){var y=!1,C=l.slice(1,-2);switch(C){case"scalar":(!t||!["object","function"].includes(g(t)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===C&&(y=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(y=!0);break;case"number":Number.isFinite(t)&&(y=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(y=!0);break;case"object":t&&g(t)===C&&(y=!0);break;case"array":Array.isArray(t)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+C)}if(y)return h={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(h,a,"value"),h}else if(l[0]==="`"&&t&&b.call(t,l.slice(1))){var G=l.slice(1);p(this._trace(c,t[G],B(r,G),t,G,a,s,!0))}else if(l.includes(",")){var Fe=l.split(","),J=Be(Fe),ae;try{for(J.s();!(ae=J.n()).done;){var Ae=ae.value;p(this._trace(k(Ae,c),t,r,n,i,a,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&t&&b.call(t,l)&&p(this._trace(c,t[l],B(r,l),t,l,a,s,!0))}if(this._hasParentSelector)for(var S=0;S<f.length;S++){var q=f[S];if(q&&q.isParentSelector){var x=this._trace(q.expr,t,q.path,n,i,a,s);if(Array.isArray(x)){f[S]=x[0];for(var Se=x.length,K=1;K<Se;K++)S++,f.splice(S,0,x[K])}else f[S]=x}}return f};d.prototype._walk=function(e,t,r,n,i,a,s,o){if(Array.isArray(r))for(var u=r.length,h=0;h<u;h++)o(h,e,t,r,n,i,a,s);else r&&g(r)==="object"&&Object.keys(r).forEach(function(l){o(l,e,t,r,n,i,a,s)})};d.prototype._slice=function(e,t,r,n,i,a,s){if(!!Array.isArray(r)){var o=r.length,u=e.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var f=[],p=l;p<c;p+=h){var y=this._trace(k(p,t),r,n,i,a,s,!0);y.forEach(function(C){f.push(C)})}return f}};d.prototype._eval=function(e,t,r,n,i,a){e.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=a,e=e.replace(/@parentProperty/g,"_$_parentProperty")),e.includes("@parent")&&(this.currSandbox._$_parent=i,e=e.replace(/@parent/g,"_$_parent")),e.includes("@property")&&(this.currSandbox._$_property=r,e=e.replace(/@property/g,"_$_property")),e.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([r])),e=e.replace(/@path/g,"_$_path")),e.includes("@root")&&(this.currSandbox._$_root=this.json,e=e.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e)&&(this.currSandbox._$_v=t,e=e.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(e,this.currSandbox)}catch(s){throw console.log(s),new Error("jsonPath: "+s.message+": "+e)}};d.cache={};d.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};d.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(e){var t=d.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(a,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var s=a.match(/#([0-9]+)/);return!s||!s[1]?a:r[s[1]]});return t[e]=i,t[e].concat()};var Ie=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var s=t[a];n(s)&&r.push(t.splice(a--,1)[0])}};d.prototype.vm={runInNewContext:function(t,r){var n=Object.keys(r),i=[];Ie(n,i,function(h){return typeof r[h]=="function"});var a=n.map(function(h,l){return r[h]}),s=i.reduce(function(h,l){var c=r[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");t=s+t,!/(["'])use strict\1/.test(t)&&!n.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var o=t.lastIndexOf(";"),u=o>-1?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return N(Function,ce(n).concat([u])).apply(void 0,ce(a))}};function ze(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,t),r}function pe(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ye(e){return pe(e)+".*"}function me(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Je(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=me(e);if(i!=0)return;let a=e.parentElement;if(a!=null){t==0?e.style.display="none":e.style.display&&(e.style.display="",e.getAttribute("style")==""&&e.removeAttribute("style"));for(var s=i+1,o=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<t;h++)a.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,t);h<s;h++)o=o.previousElementSibling,a.removeChild(o.nextElementSibling)}}function ee(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((o,u)=>u.length-o.length);for(let o of a)if(t.startsWith(o)){if(o==t){if(r)return e[o];continue}i=t.substring(o.length+1),n=e[o];break}let s=d({path:i,json:n});return r&&s&&Array.isArray(s)?s[0]:s}function L(e,t,r,n){var l;if(!!e){var i=e;n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src")i=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")i=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")i=e.querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")V(e,r);else if(t=="data-path-attributes"){let c=((l=e.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in r){var o=r[s];L(e,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(r==null||!(c[u]in r))&&L(e,c[u],null,n);L(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!i){var h=String(e.getAttribute("data-path-placeholder")||i[a]);r!=null?a=="innerHTML"?i.innerHTML!=r&&(i.innerHTML=r):i.getAttribute(a)!=r&&i.setAttribute(a,r):a=="innerHTML"?i.innerHTML=h:i.removeAttribute(a)}}}function be(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&V(i,a),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&ge(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function ge(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];V(i,i.getAttribute("data-embed-src"))}if(t)return be(e)}function V(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.type="module",a.src=t,r.appendChild(a);break}}var de=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(e,t,r,n){var s,o,u;let i=e;if(n||(t=((s=r==null?void 0:r.processData)==null?void 0:s.call(r,i,t))||t),i.nodeType==1){let h=i.getAttribute("data-path-scope");if(h){let c=me(i),f=ee(t,h,!1)||[];c==0&&Je(i,((o=r==null?void 0:r.shouldRepeat)==null?void 0:o.call(r,i,f))===!1?1:f.length,r),t=w(A({},t),{[ye(h)]:f[c]})}let l=Array.prototype.slice.call(i.attributes).sort((c,f)=>de.indexOf(c.name)-de.indexOf(f.name));for(var a=0;a<l.length;a++){let{name:c,value:f}=l[a];c.startsWith("data-path")&&c!="data-path-scope"&&L(i,c,ee(t,f,!0),r),c=="data-embed-src"&&L(i,c,i.getAttribute(c),r)}}for(var a=0;a<i.children.length;a++)E(i.children[a],t,r,!0);return n||(u=r==null?void 0:r.onRender)==null||u.call(r,i,t),i}function O(e,t,r,n){var a;let i=((a=n==null?void 0:n.processTemplate)==null?void 0:a.call(n,e,t,r))||t;return e.innerHTML=i,e.classList.add("-feaas"),E(e,r,n)}function qe(e,t){return ve(e,t||(t=document.createElement("style"))),t}function ve(e,t){return t||(t=document.createElement("style")),M(e,r=>{t.textContent=r}).then(()=>t)}function Ve(e,t){return Ee(e,t||(t=document.createElement("div"))),t}function Ee(e,t){return T(this,null,function*(){return t||(t=document.createElement("div")),t.childNodes.length?E(t,e.data,e):"template"in e?O(t,e.template,e.data,e):P(e,r=>O(t,r,e.data,e)).then(()=>t)})}var ie={};le(ie,{HTMLFeaasComponent:()=>W,HTMLFeaasStylesheet:()=>U});var Y=typeof HTMLElement=="undefined"?class{}:HTMLElement,W=class extends Y{constructor(){super(...arguments);this.connected=!1;this.template=null;this.data=void 0;this.isFetching=!1}static get observedAttributes(){return["data","library","component","version","revision","hostname","template"]}connectedCallback(){this.connected=!0,this.render()}disconnectedCallback(){}attributeChangedCallback(r,n,i){!this.connected||(r=="template"?this.template=i:r!="date"&&(this.template=null),r=="data"&&this.children.length>0?this.update():(cancelAnimationFrame(this.rendering),this.rendering=requestAnimationFrame(()=>{this.render()})))}update(){E(this,this.getProps().data)}setData(r){this.data=r,this.children.length>0?this.update():this.render()}getOriginal(){let r=this.getAttribute("data-path-scope");if(!!r){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==r;)var i=n;return i}}getData(){var r;if(this.data)return this.data;if(this.getAttribute("data")){let n=this.getAttribute("data");return typeof n=="string"?JSON.parse(n):{}}return((r=this.getOriginal())==null?void 0:r.getData())||{}}render(){if(this.getOriginal())return;let r=this.getProps();this.template==null?this.isFetching||r.component!=null&&r.version!=null&&(this.isFetching=!0,P(r,n=>{this.template=n,this.isFetching=!1,O(this,this.template,r.data)}).catch(()=>{console.error(`FEAAS: Could not fetch component: ${r.component}/${r.version}/${r.revision}`)})):O(this,this.template,r.data)}getProps(){return{data:this.getData(),library:this.getAttribute("library")||void 0,component:this.getAttribute("component")||void 0,version:this.getAttribute("version")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},U=class extends Y{constructor(){super(...arguments);this.connected=!1}static get observedAttributes(){return["library","revision","hostname"]}connectedCallback(){this.connected=!0,this.render()}attributeChangedCallback(){this.connected&&this.render()}render(){let r=this.getProps();M(r,n=>{this.innerHTML="<style>"+n+"</style>"}).catch(n=>{console.error(`FEAAS: Could not fetch stylesheet for library ${r.library}`)})}getProps(){return{library:this.getAttribute("library")||void 0,revision:this.getAttribute("revision")||void 0,hostname:this.getAttribute("hostname")||void 0}}},re=class extends Y{constructor(){super(...arguments);this.src="https://components.sitecorecloud.io/assets/picker.js";this.onClose=()=>{this.set({mode:null})};this.onScriptLoaded=()=>{this.element=document.createElement("feaas-picker"),this.element.style.cssText="border: 0; width: 100%; height: 100%; display: block",this.appendChild(this.element),this.set(this.getProps())}}static get observedAttributes(){return["library","mode","hidden","src"]}connectedCallback(){this.loader=document.createElement("feaas-loader"),this.loader.style.cssText="position: absolute; top: 0; left: 0; right: 0;bottom: 0; ",this.appendChild(this.loader)}load(){this.script||(this.script=document.createElement("script"),this.script.type="module",this.script.onload=this.onScriptLoaded,this.script.src=this.src,this.script.crossOrigin="anonymous",this.appendChild(this.script))}getProps(){return{mode:this.getAttribute("mode"),library:this.getAttribute("library"),src:this.getAttribute("src")}}attributeChangedCallback(r,n,i){this.set(this.getProps())}set(r){Object.assign(this,r);let n=Object.keys(this.getProps());for(var i of n){let a=this[i];a==null?this.removeAttribute(i):this.getAttribute(i)!=String(a)&&this.setAttribute(i,String(a))}this.mode?this.removeAttribute("hidden"):this.getAttribute("hidden")==null&&this.setAttribute("hidden","hidden"),this.mode&&!this.hidden&&this.load(),this.element&&this.element.set&&(this.element.onClose=this.onClose,this.element.set(r))}},ne=class extends Y{static get observedAttributes(){return["hidden"]}connectedCallback(){this.style.opacity="1",this.style.transition="opacity 0.2s 0.6s",this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -1329,6 +1329,7 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1329
1329
  this.script.type = "module";
1330
1330
  this.script.onload = this.onScriptLoaded;
1331
1331
  this.script.src = this.src;
1332
+ this.script.crossOrigin = "anonymous";
1332
1333
  this.appendChild(this.script);
1333
1334
  }
1334
1335
  }
@@ -1349,7 +1350,6 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1349
1350
  const value = this[key];
1350
1351
  if (value == null) {
1351
1352
  this.removeAttribute(key);
1352
- this.load();
1353
1353
  } else if (this.getAttribute(key) != String(value)) {
1354
1354
  this.setAttribute(key, String(value));
1355
1355
  }
@@ -1359,6 +1359,9 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1359
1359
  } else if (this.getAttribute("hidden") == null) {
1360
1360
  this.setAttribute("hidden", "hidden");
1361
1361
  }
1362
+ if (this.mode && !this.hidden) {
1363
+ this.load();
1364
+ }
1362
1365
  if (this.element && this.element.set) {
1363
1366
  this.element.onClose = this.onClose;
1364
1367
  this.element.set(options);
@@ -1294,6 +1294,7 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1294
1294
  this.script.type = "module";
1295
1295
  this.script.onload = this.onScriptLoaded;
1296
1296
  this.script.src = this.src;
1297
+ this.script.crossOrigin = "anonymous";
1297
1298
  this.appendChild(this.script);
1298
1299
  }
1299
1300
  }
@@ -1314,7 +1315,6 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1314
1315
  const value = this[key];
1315
1316
  if (value == null) {
1316
1317
  this.removeAttribute(key);
1317
- this.load();
1318
1318
  } else if (this.getAttribute(key) != String(value)) {
1319
1319
  this.setAttribute(key, String(value));
1320
1320
  }
@@ -1324,6 +1324,9 @@ var HTMLFeaasPickerLazy = class extends WebComponent {
1324
1324
  } else if (this.getAttribute("hidden") == null) {
1325
1325
  this.setAttribute("hidden", "hidden");
1326
1326
  }
1327
+ if (this.mode && !this.hidden) {
1328
+ this.load();
1329
+ }
1327
1330
  if (this.element && this.element.set) {
1328
1331
  this.element.onClose = this.onClose;
1329
1332
  this.element.set(options);