UNPKG

contentstack

Version:
2 lines 89.4 kB
/*! For license information please see contentstack.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Contentstack=e():t.Contentstack=e()}(self,()=>(()=>{"use strict";var t={241(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/",taxonomies:"/taxonomies/entries"},live_preview:{enable:!1,host:"rest-preview.contentstack.com"}}},444(){},215(t,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var o,i=['"',"'",">","<","/","="];function a(t){return{text:t["#text"],itemUid:t["data-sys-entry-uid"]||t["data-sys-asset-uid"],itemType:t.type,styleType:t["sys-style-type"],attributes:t,contentTypeUid:t["data-sys-content-type-uid"]}}!function(t){t.BLOCK="block",t.INLINE="inline",t.LINK="link",t.DISPLAY="display",t.DOWNLOAD="download"}(o||(o={}));var c=o,s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},l.apply(this,arguments)};function p(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function f(t){for(var e={},n=0;n<t.attributes.length;n++)e[t.attributes.item(n).name]=t.attributes.item(n).value;return t.childNodes.forEach(function(t){var n=t;e=l(l({},e),function(t){var e={};return 3===t.nodeType?e["#text"]=t.textContent:1===t.nodeType&&(e[t.nodeName.toLowerCase()]=f(t)),e}(n))}),e}"function"==typeof SuppressedError&&SuppressedError;var d,h="documentfragmentcontainer";function y(t,e,n){return void 0===e&&(e=["p","a","strong","em","ul","ol","li","h1","h2","h3","h4","h5","h6","sub","u","table","thead","tbody","tr","th","td","span","fragment","sup","strike","br","img","colgroup","col","div"]),void 0===n&&(n=["href","title","target","alt","src","class","id","style","colspan","rowspan","content-type-uid","data-sys-asset-uid","sys-style-type","data-type","data-width","data-rows","data-cols","data-mtec"]),(t=t.replace(/\n/g,"<br />")).replace(/<\/?([a-z][a-z0-9]*)\b[^<>]*>/gi,function(t,n){return e.includes(n.toLowerCase())?t:""}).replace(/<([a-z][a-z0-9]*)\b[^<>]*>/gi,function(t,r){return e.includes(r.toLowerCase())?t.replace(/\s([a-z\-]+)=['"][^'"]*['"]/gi,function(t,e){return n.includes(e.toLowerCase())?t:""}):t})}String.prototype.forEachEmbeddedItem=function(t){var e="<".concat(h,">").concat(this.toString(),"</").concat(h,">"),n=(new DOMParser).parseFromString(e,"text/html");n.querySelectorAll(".embedded-entry").forEach(function(e){t(e.outerHTML,a(f(e)))}),n.querySelectorAll(".embedded-asset").forEach(function(e){t(e.outerHTML,a(f(e)))})};var v,_=((d={})[c.BLOCK]=function(t){var e=y(t.title||t.uid),n=y(t._content_type_uid||(t.system?t.system.content_type_uid:""));return"<div><p>".concat(e,"</p><p>Content type: <span>").concat(n,"</span></p></div>")},d[c.INLINE]=function(t){var e=y(t.title||t.uid);return"<span>".concat(e,"</span>")},d[c.LINK]=function(t,e){var n=t.url?encodeURI(y(t.url)):null,r=y(e.text||t.title||t.uid||(t.system?t.system.uid:"")),o=n?' href="'.concat(n,'"'):"";return"<a".concat(o,">").concat(r,"</a>")},d[c.DISPLAY]=function(t,e){var n=t.url?encodeURI(y(t.url)):null,r=y(e.attributes.alt||t.title||t.filename||t.uid||(t.system?t.system.uid:"")),o=n?' src="'.concat(n,'"'):"";return"<img".concat(o,' alt="').concat(r,'" />')},d[c.DOWNLOAD]=function(t,e){var n=t.url?encodeURI(y(t.url)):null,r=y(e.text||t.title||t.uid||(t.system?t.system.content_type_uid:"")),o=n?' href="'.concat(n,'"'):"";return"<a".concat(o,">").concat(r,"</a>")},d);function m(t,e){return t&&e?"entry"===t.itemType?(n=t.itemUid,r=t.contentTypeUid,void 0===(o=e)&&(o=[]),o.filter(function(t){return!!t&&(t.uid&&t.uid===n&&t._content_type_uid===r||t.system&&t.system.uid===n&&t.system.content_type_uid===r)})):function(t,e){return void 0===e&&(e=[]),e.filter(function(e){return!!e&&(e.uid&&e.uid===t||e.system&&e.system.uid===t)})}(t.itemUid,e):[];var n,r,o}function g(t,e){if(t&&void 0!==t&&e&&void 0!==e&&void 0!==e._embedded_items){var n=e;return m(t,Object.values(n._embedded_items||[]).reduce(function(t,e){return t.concat(e)},[]))}return[]}function b(t,e,n){if(!t&&void 0===t||!e&&void 0===e)return"";if(n&&void 0!==n[e.styleType]){var r=n[e.styleType];if(void 0!==e.attributes["data-sys-content-type-uid"]&&"function"!=typeof r&&void 0!==r[e.attributes["data-sys-content-type-uid"]])return r[e.attributes["data-sys-content-type-uid"]](t,e);if(void 0!==e.attributes["data-sys-content-type-uid"]&&"function"!=typeof r&&void 0!==r.$default)return r.$default(t,e);if(void 0!==e.contentTypeUid&&"function"!=typeof r&&void 0!==r[e.contentTypeUid])return r[e.contentTypeUid](t,e);if(void 0!==e.contentTypeUid&&"function"!=typeof r&&void 0!==r.$default)return r.$default(t,e);if("function"==typeof r)return r(t,e)}return(0,_[e.styleType])(t,e)}function O(t,e,n){w(t.split("."),e,n)}function w(t,e,r){if(t){var o=t[0];if(1===t.length&&e[o])e[o]=r(e[o]);else if(t.length>0&&e[o]){var i=t.slice(1);if(Array.isArray(e[o]))for(var a=0,c=e[o];a<c.length;a++)w(i,c[a],r);else"object"===n(e[o])&&w(i,e[o],r)}}}function k(t,e){if(!t||void 0===t)return"";if("string"==typeof t){var n=t;return t.forEachEmbeddedItem(function(t,r){n=function(t,e,n,r){var o=b(g(n,r.entry)[0],n,r.renderOption);return t.replace(e,o)}(n,t,r,e)}),n}var r=[];return t.forEach(function(t){r.push(k(t,e))}),r}!function(t){t.DOCUMENT="doc",t.PARAGRAPH="p",t.LINK="a",t.IMAGE="img",t.EMBED="embed",t.HEADING_1="h1",t.HEADING_2="h2",t.HEADING_3="h3",t.HEADING_4="h4",t.HEADING_5="h5",t.HEADING_6="h6",t.ORDER_LIST="ol",t.UNORDER_LIST="ul",t.LIST_ITEM="li",t.FRAGMENT="fragment",t.HR="hr",t.TABLE="table",t.TABLE_HEADER="thead",t.TABLE_BODY="tbody",t.TABLE_FOOTER="tfoot",t.TABLE_ROW="tr",t.TABLE_HEAD="th",t.TABLE_DATA="td",t.COL_GROUP="colgroup",t.COL="col",t.BLOCK_QUOTE="blockquote",t.CODE="code",t.TEXT="text",t.REFERENCE="reference"}(v||(v={}));var A,E=v;!function(t){t.BOLD="bold",t.ITALIC="italic",t.UNDERLINE="underline",t.CLASSNAME_OR_ID="classnameOrId",t.STRIKE_THROUGH="strikethrough",t.INLINE_CODE="inlineCode",t.SUBSCRIPT="subscript",t.SUPERSCRIPT="superscript",t.BREAK="break"}(A||(A={}));var P,S=A,q=function(){},T=function(t){function e(){var e=t.call(this)||this;return e.type=E.DOCUMENT,e}return u(e,t),e}(q),j=function(t){function e(e){var n=t.call(this)||this;return n.text=e,n}return u(e,t),e}(q);function I(t,e){var n;return null===(n=t.attrs)||void 0===n?void 0:n[e]}function D(t,e){var n,r=null===(n=t.attrs)||void 0===n?void 0:n[e];return"string"==typeof r?r:void 0}function R(t){if(!t.attrs)return"";var e=[];return t.attrs.style&&e.push(' style="'.concat(t.attrs.style,'"')),t.attrs["class-name"]&&e.push(' class="'.concat(t.attrs["class-name"],'"')),t.attrs.id&&e.push(' id="'.concat(t.attrs.id,'"')),e.join("")}function N(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],o=r&&(r.type===E.ORDER_LIST||r.type===E.UNORDER_LIST),i=e[e.length-1],a=i&&i.type===E.LIST_ITEM;o&&a&&i?e[e.length-1]=l(l({},i),{children:p(p([],i.children||[],!0),[r],!1)}):e.push(t[n])}return e}var C=((P={})[E.DOCUMENT]=function(){return""},P[E.PARAGRAPH]=function(t,e){return"<p".concat(R(t),">").concat(y(e(t.children)),"</p>")},P[E.LINK]=function(t,e){var n=y(D(t,"href")||D(t,"url")||""),r=D(t,"target"),o=r?' target="'.concat(r,'"'):"";return"<a".concat(R(t)).concat(n?' href="'.concat(n,'"'):"").concat(o,">").concat(y(e(t.children)),"</a>")},P[E.IMAGE]=function(t,e){var n=D(t,"src")||D(t,"url"),r=n?encodeURI(y(n)):"";return"<img".concat(R(t)).concat(r?' src="'.concat(r,'"'):""," />").concat(y(e(t.children)))},P[E.EMBED]=function(t,e){var n=D(t,"src")||D(t,"url"),r=n?encodeURI(y(n)):"";return"<iframe".concat(R(t)).concat(r?' src="'.concat(r,'"'):"",">").concat(y(e(t.children)),"</iframe>")},P[E.HEADING_1]=function(t,e){return"<h1".concat(R(t),">").concat(y(e(t.children)),"</h1>")},P[E.HEADING_2]=function(t,e){return"<h2".concat(R(t),">").concat(y(e(t.children)),"</h2>")},P[E.HEADING_3]=function(t,e){return"<h3".concat(R(t),">").concat(y(e(t.children)),"</h3>")},P[E.HEADING_4]=function(t,e){return"<h4".concat(R(t),">").concat(y(e(t.children)),"</h4>")},P[E.HEADING_5]=function(t,e){return"<h5".concat(R(t),">").concat(y(e(t.children)),"</h5>")},P[E.HEADING_6]=function(t,e){return"<h6".concat(R(t),">").concat(y(e(t.children)),"</h6>")},P[E.ORDER_LIST]=function(t,e){var n=N(t.children);return"<ol".concat(R(t),">").concat(y(e(n)),"</ol>")},P[E.FRAGMENT]=function(t,e){return"<fragment>".concat(y(e(t.children)),"</fragment>")},P[E.UNORDER_LIST]=function(t,e){var n=N(t.children);return"<ul".concat(R(t),">").concat(y(e(n)),"</ul>")},P[E.LIST_ITEM]=function(t,e){return"<li".concat(R(t),">").concat(y(e(t.children)),"</li>")},P[E.HR]=function(){return"<hr>"},P[E.TABLE]=function(t,e){var n="",r=I(t,"colWidths");if(r&&Array.isArray(r)){var o=r.reduce(function(t,e){return t+e},0);n="<".concat(E.COL_GROUP,' data-width="').concat(o,'">'),r.forEach(function(t){var e=t/o*100;n+="<".concat(E.COL,' style="width:').concat(e.toFixed(2),'%"/>')}),n+="</".concat(E.COL_GROUP,">")}return"<table".concat(R(t),">").concat(n).concat(y(e(t.children)),"</table>")},P[E.TABLE_HEADER]=function(t,e){return"<thead".concat(R(t),">").concat(y(e(t.children)),"</thead>")},P[E.TABLE_BODY]=function(t,e){return"<tbody".concat(R(t),">").concat(y(e(t.children)),"</tbody>")},P[E.TABLE_FOOTER]=function(t,e){return"<tfoot".concat(R(t),">").concat(y(e(t.children)),"</tfoot>")},P[E.TABLE_ROW]=function(t,e){return"<tr".concat(R(t),">").concat(y(e(t.children)),"</tr>")},P[E.TABLE_HEAD]=function(t,e){if(I(t,"void"))return"";var n=I(t,"rowSpan"),r=I(t,"colSpan"),o=n?' rowspan="'.concat(n,'"'):"",i=r?' colspan="'.concat(r,'"'):"";return"<th".concat(o).concat(i).concat(R(t),">").concat(y(e(t.children)),"</th>")},P[E.TABLE_DATA]=function(t,e){if(I(t,"void"))return"";var n=I(t,"rowSpan"),r=I(t,"colSpan"),o=n?' rowspan="'.concat(n,'"'):"",i=r?' colspan="'.concat(r,'"'):"";return"<td".concat(o).concat(i).concat(R(t),">").concat(y(e(t.children)),"</td>")},P[E.BLOCK_QUOTE]=function(t,e){return"<blockquote".concat(R(t),">").concat(y(e(t.children)),"</blockquote>")},P[E.CODE]=function(t,e){return"<code".concat(R(t),">").concat(y(e(t.children)),"</code>")},P.reference=function(t,e){var n=I(t,"type"),r=I(t,"display-type");if(("entry"===n||"asset"===n)&&"link"===r){var o=D(t,"href")||D(t,"url")||"",i=D(t,"target"),a=D(t,"asset-uid"),c=R(t);return o&&(c+=' href="'.concat(o,'"')),i&&(c+=' target="'.concat(i,'"')),"asset"===n&&(c+=' type="asset" content-type-uid="sys_assets"',a&&(c+=' data-sys-asset-uid="'.concat(a,'"')),c+=' sys-style-type="download"'),"<a".concat(c,">").concat(y(e(t.children)),"</a>")}if("asset"===n){var s=D(t,"asset-link"),u=s?encodeURI(s):"",l=I(t,"redactor-attributes"),p=null==l?void 0:l.alt,f=D(t,"link"),d=(i=D(t,"target")||"",(null==l?void 0:l["asset-caption"])||D(t,"asset-caption")||""),h=D(t,"style"),v=(a=D(t,"asset-uid"),D(t,"class-name")),_=a?' asset_uid="'.concat(a,'"'):"",m=v?' class="'.concat(y(v),'"'):"",g=u?' src="'.concat(y(u),'"'):"",b=p?' alt="'.concat(p,'"'):"",O="_blank"===i?' target="_blank"':"",w=h?' style="'.concat(h,'"'):"",k="<img".concat(_).concat(m).concat(g).concat(b).concat(O).concat(w," />"),A=h?' style="'.concat(h,'"'):"";return"<figure".concat(A,">")+(f?'<a href="'.concat(f,'" target="').concat(i||"",'">'):"")+k+(f?"</a>":"")+(d?"<figcaption>".concat(d,"</figcaption>"):"")+"</figure>"}return""},P.default=function(t,e){return y(e(t.children))},P[S.BOLD]=function(t){return"<strong>".concat(y(t),"</strong>")},P[S.ITALIC]=function(t){return"<em>".concat(y(t),"</em>")},P[S.UNDERLINE]=function(t){return"<u>".concat(y(t),"</u>")},P[S.STRIKE_THROUGH]=function(t){return"<strike>".concat(y(t),"</strike>")},P[S.INLINE_CODE]=function(t){return"<span data-type='inlineCode'>".concat(y(t),"</span>")},P[S.SUBSCRIPT]=function(t){return"<sub>".concat(y(t),"</sub>")},P[S.SUPERSCRIPT]=function(t){return"<sup>".concat(y(t),"</sup>")},P[S.BREAK]=function(t){return/^\n+$/.test(t)?y(t):"<br />".concat(y(t))},P[S.CLASSNAME_OR_ID]=function(t,e,n){return"<span".concat(e?' class="'.concat(e,'"'):"").concat(n?' id="'.concat(n,'"'):"",">").concat(y(t),"</span>")},P);function L(t,e){for(var n=0,r=t;n<r.length;n++)e(r[n])}function M(t,e,n){if(!(t instanceof Array)&&"doc"!==t.type)return t;if(t instanceof Array){var r=[];return t.forEach(function(t){r.push(M(t,e,n))}),r}var o=l(l({},C),e);return U(t.children,o,n)}function U(t,e,n){return t.map(function(t){return function(t,e,n){var o;if((null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.style)&&(t.attrs.style=function(t){if(!t)return"";if("string"==typeof t)return t;var e="";for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e+="".concat(n,":").concat(r,";")}return e}(t.attrs.style)),t.type){if("reference"===t.type)return function(t,e,n){var r;function o(t){return e[t.type](t,function(t){return U(t,e,n)})}if(("entry"===t.attrs.type||"asset"===t.attrs.type)&&"link"===t.attrs["display-type"]){var i=t.children?U(t.children,e,n):"";if(void 0!==e[t.type])return o(t);var a=t.attrs.href||t.attrs.url,c="".concat(t.attrs.style?' style="'.concat(t.attrs.style,'"'):"").concat(t.attrs["class-name"]?' class="'.concat(t.attrs["class-name"],'"'):"").concat(t.attrs.id?' id="'.concat(t.attrs.id,'"'):"").concat(a?' href="'.concat(a,'"'):"");return t.attrs.target&&(c+=' target="'.concat(t.attrs.target,'"')),"asset"==t.attrs.type&&(c+=' type="asset" content-type-uid="sys_assets" '.concat(t.attrs["asset-uid"]?'data-sys-asset-uid="'.concat(t.attrs["asset-uid"],'"'):"",' sys-style-type="download"')),"<a".concat(c,">").concat(i,"</a>")}if(!n&&void 0!==e[t.type])return o(t);if(!n)return"";var s,u=(s=t.attrs,{text:((null===(r=t.children)||void 0===r?void 0:r.length)>0?t.children[0]:{}).text,itemUid:s["entry-uid"]||s["asset-uid"],itemType:s.type,styleType:s["display-type"],attributes:s,contentTypeUid:s["content-type-uid"]}),l=n(u);return l||void 0===e[t.type]?b(l,u,e):o(t)}(t,e,n);var i=function(t){return U(t,e,n)};return void 0!==e[t.type]?e[t.type](t,i):e.default(t,i)}return function(t,e){var n=r(t.text),o=!1;return(t.classname||t.id)&&(n=e[S.CLASSNAME_OR_ID](n,t.classname,t.id),o=!0),t.break&&(n=e[S.BREAK](n),o=!0),t.superscript&&(n=e[S.SUPERSCRIPT](n),o=!0),t.subscript&&(n=e[S.SUBSCRIPT](n),o=!0),t.inlineCode&&(n=e[S.INLINE_CODE](n),o=!0),t.strikethrough&&(n=e[S.STRIKE_THROUGH](n),o=!0),t.underline&&(n=e[S.UNDERLINE](n),o=!0),t.italic&&(n=e[S.ITALIC](n),o=!0),t.bold&&(n=e[S.BOLD](n),o=!0),!o&&n.includes("\n")&&(n=n.replace(/\n/g,"<br />")),n}(t,e)}(t,e,n)}).join("")}var H={jsonToHTML:function t(e){e.entry instanceof Array?L(e.entry,function(n){t({entry:n,paths:e.paths,renderOption:e.renderOption})}):function(t){for(var e=0,n=t.paths;e<n.length;e++)O(n[e],t.entry,function(e){if(null==e?void 0:e.json){var n=e.embedded_itemsConnection?e.embedded_itemsConnection.edges:[],r=Object.values(n||[]).reduce(function(t,e){return t.concat(e.node)},[]);return M(e.json,t.renderOption,function(t){return m(t,r)[0]})}return e})}({entry:e.entry,paths:e.paths,renderOption:e.renderOption})}};function z(t,e,r,o,i){if(null==t)return{};var a={},c=i.shouldApplyVariant,s=i._applied_variants;return Object.entries(t).forEach(function(t){var u,l,p=t[0],f=t[1];if("$"!==p){var d=null!==(l=null===(u=null==f?void 0:f._metadata)||void 0===u?void 0:u.uid)&&void 0!==l?l:"",h=i.metaKey?i.metaKey+".":"",y=i.shouldApplyVariant?"".concat(h).concat(p):"";d&&y&&(y=y+"."+d),"object"===n(f)?(Array.isArray(f)?f.forEach(function(t,u){var l,v,_,m;if(null!=t){var g="".concat(p,"__").concat(u),b="".concat(p,"__parent");if(d=null!==(v=null===(l=null==t?void 0:t._metadata)||void 0===l?void 0:l.uid)&&void 0!==v?v:"",y=i.shouldApplyVariant?"".concat(h).concat(p):"",d&&y&&(y=y+"."+d),a[g]=r?G("".concat(e,".").concat(p,".").concat(u),{_applied_variants:s,shouldApplyVariant:c,metaKey:y}):x("".concat(e,".").concat(p,".").concat(u),{_applied_variants:s,shouldApplyVariant:c,metaKey:y}),a[b]=r?{"data-cslp-parent-field":"".concat(e,".").concat(p)}:(m="".concat(e,".").concat(p),"data-cslp-parent-field=".concat(m)),void 0!==(null==t?void 0:t._content_type_uid)&&void 0!==(null==t?void 0:t.uid)){var O=t._applied_variants||(null===(_=null==t?void 0:t.system)||void 0===_?void 0:_.applied_variants)||null,w=!!O;f[u].$=z(t,"".concat(t._content_type_uid,".").concat(t.uid,".").concat(t.locale||o),r,o,{_applied_variants:O,shouldApplyVariant:w,metaKey:""})}else"object"===n(t)&&(t.$=z(t,"".concat(e,".").concat(p,".").concat(u),r,o,{_applied_variants:s,shouldApplyVariant:c,metaKey:y}))}}):f&&(f.$=z(f,"".concat(e,".").concat(p),r,o,{_applied_variants:s,shouldApplyVariant:c,metaKey:y})),a[p]=r?G("".concat(e,".").concat(p),{_applied_variants:s,shouldApplyVariant:c,metaKey:y}):x("".concat(e,".").concat(p),{_applied_variants:s,shouldApplyVariant:c,metaKey:y})):a[p]=r?G("".concat(e,".").concat(p),{_applied_variants:s,shouldApplyVariant:c,metaKey:y}):x("".concat(e,".").concat(p),{_applied_variants:s,shouldApplyVariant:c,metaKey:y})}}),a}function K(t,e){if((null==e?void 0:e.shouldApplyVariant)&&(null==e?void 0:e._applied_variants)){if(e._applied_variants[e.metaKey]){var n=e._applied_variants[e.metaKey];return(r=("v2:"+t).split("."))[1]=r[1]+"_"+n,r.join(".")}var r,o=function(t){var e;try{if(!t._applied_variants)return"";var n=Object.keys(t._applied_variants).sort(function(t,e){return e.length-t.length}),r=t.metaKey.split(".");return 0===r.length||0===n.length?"":null!==(e=n.find(function(t){var e=t.split(".");return!(e.length>r.length)&&e.every(function(t,e){return r[e]===t})}))&&void 0!==e?e:""}catch(t){return""}}(e);if(o)return n=e._applied_variants[o],(r=("v2:"+t).split("."))[1]=r[1]+"_"+n,r.join(".")}return t}function G(t,e){return{"data-cslp":K(t,e)}}function x(t,e){var n=K(t,e);return"data-cslp=".concat(n)}function B(t){for(var e in t){var r=t[e];r instanceof Array?r.forEach(function(t){W(t)}):r&&"object"===n(r)&&W(r)}}function W(t){var e,n=V(t);n&&(null===(e=null==n?void 0:n.embedded_itemsConnection)||void 0===e?void 0:e.edges).forEach(function(t){var e,r,o,i=t.node;if((null==i?void 0:i.url)&&(null==i?void 0:i.filename)){if(!(null===(e=null==i?void 0:i.system)||void 0===e?void 0:e.uid))throw new Error("Asset UID not found in the response");(null===(o=null===(r=null==n?void 0:n.json)||void 0===r?void 0:r.children)||void 0===o?void 0:o.find(function(t){return t.attrs["asset-uid"]===i.system.uid})).attrs["asset-link"]=i.url}})}function V(t){if(null==t?void 0:t.embedded_itemsConnection)return t;for(var e in t)if(t[e]&&"object"===n(t[e])){var r=V(t[e]);if(r)return r}}var F={regions:[{id:"na",name:"AWS North America",cloudProvider:"AWS",location:"North America",alias:["na","us","aws-na","aws_na","NA","US","AWS-NA","AWS_NA"],isDefault:!0,endpoints:{application:"https://app.contentstack.com",contentDelivery:"https://cdn.contentstack.io",contentManagement:"https://api.contentstack.io",auth:"https://auth-api.contentstack.com",graphqlDelivery:"https://graphql.contentstack.com",preview:"https://rest-preview.contentstack.com",graphqlPreview:"https://graphql-preview.contentstack.com",images:"https://images.contentstack.io",assets:"https://assets.contentstack.io",automate:"https://automations-api.contentstack.com",launch:"https://launch-api.contentstack.com",developerHub:"https://developerhub-api.contentstack.com",brandKit:"https://brand-kits-api.contentstack.com",genAI:"https://ai.contentstack.com/brand-kits",personalizeManagement:"https://personalize-api.contentstack.com",personalizeEdge:"https://personalize-edge.contentstack.com",composableStudio:"https://composable-studio-api.contentstack.com"}},{id:"eu",name:"AWS Europe",cloudProvider:"AWS",location:"Europe",alias:["eu","aws-eu","aws_eu","EU","AWS-EU","AWS_EU"],isDefault:!1,endpoints:{application:"https://eu-app.contentstack.com",contentDelivery:"https://eu-cdn.contentstack.com",contentManagement:"https://eu-api.contentstack.com",auth:"https://eu-auth-api.contentstack.com",graphqlDelivery:"https://eu-graphql.contentstack.com",preview:"https://eu-rest-preview.contentstack.com",graphqlPreview:"https://eu-graphql-preview.contentstack.com",images:"https://eu-images.contentstack.com",assets:"https://eu-assets.contentstack.com",automate:"https://eu-prod-automations-api.contentstack.com",launch:"https://eu-launch-api.contentstack.com",developerHub:"https://eu-developerhub-api.contentstack.com",brandKit:"https://eu-brand-kits-api.contentstack.com",genAI:"https://eu-ai.contentstack.com/brand-kits",personalizeManagement:"https://eu-personalize-api.contentstack.com",personalizeEdge:"https://eu-personalize-edge.contentstack.com",composableStudio:"https://eu-composable-studio-api.contentstack.com"}},{id:"au",name:"AWS Australia",cloudProvider:"AWS",location:"Australia",alias:["au","aws-au","aws_au","AU","AWS-AU","AWS_AU"],isDefault:!1,endpoints:{application:"https://au-app.contentstack.com",contentDelivery:"https://au-cdn.contentstack.com",contentManagement:"https://au-api.contentstack.com",auth:"https://au-auth-api.contentstack.com",graphqlDelivery:"https://au-graphql.contentstack.com",preview:"https://au-rest-preview.contentstack.com",graphqlPreview:"https://au-graphql-preview.contentstack.com",images:"https://au-images.contentstack.com",assets:"https://au-assets.contentstack.com",automate:"https://au-prod-automations-api.contentstack.com",launch:"https://au-launch-api.contentstack.com",developerHub:"https://au-developerhub-api.contentstack.com",brandKit:"https://au-brand-kits-api.contentstack.com",genAI:"https://au-ai.contentstack.com/brand-kits",personalizeManagement:"https://au-personalize-api.contentstack.com",personalizeEdge:"https://au-personalize-edge.contentstack.com",composableStudio:"https://au-composable-studio-api.contentstack.com"}},{id:"azure-na",name:"Azure North America",cloudProvider:"Azure",location:"North America",alias:["azure-na","azure_na","AZURE-NA","AZURE_NA"],isDefault:!1,endpoints:{application:"https://azure-na-app.contentstack.com",contentDelivery:"https://azure-na-cdn.contentstack.com",contentManagement:"https://azure-na-api.contentstack.com",auth:"https://azure-na-auth-api.contentstack.com",graphqlDelivery:"https://azure-na-graphql.contentstack.com",preview:"https://azure-na-rest-preview.contentstack.com",graphqlPreview:"https://azure-na-graphql-preview.contentstack.com",images:"https://azure-na-images.contentstack.com",assets:"https://azure-na-assets.contentstack.com",automate:"https://azure-na-automations-api.contentstack.com",launch:"https://azure-na-launch-api.contentstack.com",developerHub:"https://azure-na-developerhub-api.contentstack.com",brandKit:"https://azure-na-brand-kits-api.contentstack.com",genAI:"https://azure-na-ai.contentstack.com/brand-kits",personalizeManagement:"https://azure-na-personalize-api.contentstack.com",personalizeEdge:"https://azure-na-personalize-edge.contentstack.com",composableStudio:"https://azure-na-composable-studio-api.contentstack.com"}},{id:"azure-eu",name:"Azure Europe",cloudProvider:"Azure",location:"Europe",alias:["azure-eu","azure_eu","AZURE-EU","AZURE_EU"],isDefault:!1,endpoints:{application:"https://azure-eu-app.contentstack.com",contentDelivery:"https://azure-eu-cdn.contentstack.com",contentManagement:"https://azure-eu-api.contentstack.com",auth:"https://azure-eu-auth-api.contentstack.com",graphqlDelivery:"https://azure-eu-graphql.contentstack.com",preview:"https://azure-eu-rest-preview.contentstack.com",graphqlPreview:"https://azure-eu-graphql-preview.contentstack.com",images:"https://azure-eu-images.contentstack.com",assets:"https://azure-eu-assets.contentstack.com",automate:"https://azure-eu-automations-api.contentstack.com",launch:"https://azure-eu-launch-api.contentstack.com",developerHub:"https://azure-eu-developerhub-api.contentstack.com",brandKit:"https://azure-eu-brand-kits-api.contentstack.com",genAI:"https://azure-eu-ai.contentstack.com/brand-kits",personalizeManagement:"https://azure-eu-personalize-api.contentstack.com",personalizeEdge:"https://azure-eu-personalize-edge.contentstack.com",composableStudio:"https://azure-eu-composable-studio-api.contentstack.com"}},{id:"gcp-na",name:"GCP North America",cloudProvider:"GCP",location:"North America",alias:["gcp-na","gcp_na","GCP-NA","GCP_NA"],isDefault:!1,endpoints:{application:"https://gcp-na-app.contentstack.com",contentDelivery:"https://gcp-na-cdn.contentstack.com",contentManagement:"https://gcp-na-api.contentstack.com",auth:"https://gcp-na-auth-api.contentstack.com",graphqlDelivery:"https://gcp-na-graphql.contentstack.com",preview:"https://gcp-na-rest-preview.contentstack.com",graphqlPreview:"https://gcp-na-graphql-preview.contentstack.com",images:"https://gcp-na-images.contentstack.com",assets:"https://gcp-na-assets.contentstack.com",automate:"https://gcp-na-automations-api.contentstack.com",launch:"https://gcp-na-launch-api.contentstack.com",developerHub:"https://gcp-na-developerhub-api.contentstack.com",brandKit:"https://gcp-na-brand-kits-api.contentstack.com",genAI:"https://gcp-na-ai.contentstack.com/brand-kits",personalizeManagement:"https://gcp-na-personalize-api.contentstack.com",personalizeEdge:"https://gcp-na-personalize-edge.contentstack.com",composableStudio:"https://gcp-na-composable-studio-api.contentstack.com"}},{id:"gcp-eu",name:"GCP Europe",cloudProvider:"GCP",location:"Europe",alias:["gcp-eu","gcp_eu","GCP-EU","GCP_EU"],isDefault:!1,endpoints:{application:"https://gcp-eu-app.contentstack.com",contentDelivery:"https://gcp-eu-cdn.contentstack.com",contentManagement:"https://gcp-eu-api.contentstack.com",auth:"https://gcp-eu-auth-api.contentstack.com",graphqlDelivery:"https://gcp-eu-graphql.contentstack.com",preview:"https://gcp-eu-rest-preview.contentstack.com",graphqlPreview:"https://gcp-eu-graphql-preview.contentstack.com",images:"https://gcp-eu-images.contentstack.com",assets:"https://gcp-eu-assets.contentstack.com",automate:"https://gcp-eu-automations-api.contentstack.com",launch:"https://gcp-eu-launch-api.contentstack.com",developerHub:"https://gcp-eu-developerhub-api.contentstack.com",brandKit:"https://gcp-eu-brand-kits-api.contentstack.com",genAI:"https://gcp-eu-ai.contentstack.com/brand-kits",personalizeManagement:"https://gcp-eu-personalize-api.contentstack.com",personalizeEdge:"https://gcp-eu-personalize-edge.contentstack.com",composableStudio:"https://gcp-eu-composable-studio-api.contentstack.com"}}]};function $(t){if("string"==typeof t)return t.replace(/^https?:\/\//,"");var e={};for(var n in t)e[n]=$(t[n]);return e}e.Document=T,e.GQL=H,e.MarkType=S,e.Node=q,e.NodeType=E,e.StyleType=c,e.TextNode=j,e.addEditableTags=function(t,e,n,r,o){var i;void 0===r&&(r="en-us");var a=(o||{}).useLowerCaseLocale,c=void 0===a||a;if(t){e=e.toLowerCase(),r=c?r.toLowerCase():r;var s=t._applied_variants||(null===(i=null==t?void 0:t.system)||void 0===i?void 0:i.applied_variants)||null;t.$=z(t,"".concat(e,".").concat(t.uid,".").concat(r),n,r,{_applied_variants:s,shouldApplyVariant:!!s,metaKey:""})}},e.attributeToString=function(t){var e="",o=function(o){if(Object.prototype.hasOwnProperty.call(t,o)){if(i.some(function(t){return o.includes(t)}))return"continue";var a=t[o];if(Array.isArray(a))a=a.join(", ");else if("object"===n(a)){var c="";for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s)){var u=a[s];null!=u&&""!==u&&(c+="".concat(s,":").concat(u,"; "))}a=c}e+=" ".concat(o,'="').concat(r(String(a)),'"')}};for(var a in t)o(a);return e},e.getContentstackEndpoint=function(t,e,n){if(void 0===t&&(t="us"),void 0===e&&(e=""),void 0===n&&(n=!1),""===t)throw new Error("Empty region provided. Please put valid region.");var r=F,o=t.toLowerCase().trim()||"us";if(!Array.isArray(r.regions))throw new Error("Invalid Regions file. Please install the SDK again to fix this issue.");var i=function(t,e){var n=t.find(function(t){return t.id===e});return n||((n=t.find(function(t){return t.alias.some(function(t){return t.toLowerCase()===e.toLowerCase()})}))||null)}(r.regions,o);if(!i)throw new Error("Invalid region: ".concat(t));if(e){var a=i.endpoints[e];if(!a)throw new Error('Service "'.concat(e,'" not found for region "').concat(i.id,'"'));return n?$(a):a}return n?$(i.endpoints):i.endpoints},e.jsonToHTML=function t(e){e.entry instanceof Array?L(e.entry,function(n){t({entry:n,paths:e.paths,renderOption:e.renderOption})}):function(t){for(var e=0,n=t.paths;e<n.length;e++)O(n[e],t.entry,function(e){return M(e,t.renderOption,function(e){return g(e,t.entry)[0]})})}({entry:e.entry,paths:e.paths,renderOption:e.renderOption})},e.render=function(t){function e(e,n){O(e,n,function(e){return k(e,{entry:n,renderOption:t.renderOption})})}function n(n){t.paths&&0!==t.paths.length?t.paths.forEach(function(t){e(t,n)}):Object.keys(l({},n._embedded_items)).forEach(function(t){e(t,n)})}t.entry instanceof Array?t.entry.forEach(function(t){n(t)}):n(t.entry)},e.renderContent=k,e.updateAssetURLForGQL=function(t){try{var e=null==t?void 0:t.data;for(var n in e)"items"in e[n]?e[n].items.forEach(function(t){B(t)}):B(e[n])}catch(t){console.error("Error in updating asset URL for GQL response",t)}}},154(t,e,n){var r,o,i,a=n(444);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}i=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,r=void 0,o=void 0,i=function(t,e){h[n]=t,h[n+1]=e,2===(n+=2)&&(o?o(y):b())},s="undefined"!=typeof window?window:void 0,u=s||{},l=u.MutationObserver||u.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(y,1)}}var h=new Array(1e3);function y(){for(var t=0;t<n;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;n=0}var v,_,m,g,b=void 0;function O(t,e){var n=this,r=new this.constructor(A);void 0===r[k]&&M(r);var o=n._state;if(o){var a=arguments[o-1];i(function(){return C(o,r,a,n._result)})}else R(n,r,t,e);return r}function w(t){if(t&&"object"===c(t)&&t.constructor===this)return t;var e=new this(A);return T(e,t),e}p?b=function(){return process.nextTick(y)}:l?(_=0,m=new l(y),g=document.createTextNode(""),m.observe(g,{characterData:!0}),b=function(){g.data=_=++_%2}):f?((v=new MessageChannel).port1.onmessage=y,b=function(){return v.port2.postMessage(0)}):b=void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(y)}:d()}catch(t){return d()}}():d();var k=Math.random().toString(36).substring(2);function A(){}var E=void 0,P=1,S=2;function q(e,n,r){n.constructor===e.constructor&&r===O&&n.constructor.resolve===w?function(t,e){e._state===P?I(t,e._result):e._state===S?D(t,e._result):R(e,void 0,function(e){return T(t,e)},function(e){return D(t,e)})}(e,n):void 0===r?I(e,n):t(r)?function(t,e,n){i(function(t){var r=!1,o=function(n,o){try{n.call(o,function(n){r||(r=!0,e!==n?T(t,n):I(t,n))},function(e){r||(r=!0,D(t,e))})}catch(t){return t}}(n,e,0,0,t._label);!r&&o&&(r=!0,D(t,o))},t)}(e,n,r):I(e,n)}function T(t,e){if(t===e)D(t,new TypeError("You cannot resolve a promise with itself"));else if(o=c(r=e),null===r||"object"!==o&&"function"!==o)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void D(t,e)}q(t,e,n)}var r,o}function j(t){t._onerror&&t._onerror(t._result),N(t)}function I(t,e){t._state===E&&(t._result=e,t._state=P,0!==t._subscribers.length&&i(N,t))}function D(t,e){t._state===E&&(t._state=S,t._result=e,i(j,t))}function R(t,e,n,r){var o=t._subscribers,a=o.length;t._onerror=null,o[a]=e,o[a+P]=n,o[a+S]=r,0===a&&t._state&&i(N,t)}function N(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,a=0;a<e.length;a+=3)r=e[a],o=e[a+n],r?C(n,r,o,i):o(i);t._subscribers.length=0}}function C(e,n,r,o){var i=t(r),a=void 0,c=void 0,s=!0;if(i){try{a=r(o)}catch(t){s=!1,c=t}if(n===a)return void D(n,new TypeError("A promises callback cannot return that same promise."))}else a=o;n._state!==E||(i&&s?T(n,a):!1===s?D(n,c):e===P?I(n,a):e===S&&D(n,a))}var L=0;function M(t){t[k]=L++,t._state=void 0,t._result=void 0,t._subscribers=[]}var U=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(A),this.promise[k]||M(this.promise),e(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&I(this.promise,this._result))):D(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===E&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===w){var o=void 0,i=void 0,a=!1;try{o=t.then}catch(t){a=!0,i=t}if(o===O&&t._state!==E)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===H){var c=new n(A);a?D(c,i):q(c,t,o),this._willSettleAt(c,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===E&&(this._remaining--,t===S?D(r,n):this._result[e]=n),0===this._remaining&&I(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;R(t,void 0,function(t){return n._settledAt(P,e,t)},function(t){return n._settledAt(S,e,t)})},t}(),H=function(){function e(t){this[k]=L++,this._result=this._state=void 0,this._subscribers=[],A!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e(function(e){T(t,e)},function(e){D(t,e)})}catch(e){D(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,r=n.constructor;return t(e)?n.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):n.then(e,e)},e}();return H.prototype.then=O,H.all=function(t){return new U(this,t).promise},H.race=function(t){var n=this;return e(t)?new n(function(e,r){for(var o=t.length,i=0;i<o;i++)n.resolve(t[i]).then(e,r)}):new n(function(t,e){return e(new TypeError("You must pass an array to race."))})},H.resolve=w,H.reject=function(t){var e=new this(A);return D(e,t),e},H._setScheduler=function(t){o=t},H._setAsap=function(t){i=t},H._asap=i,H.polyfill=function(){var t=void 0;if(void 0!==a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=H},H.Promise=H,H},"object"===c(e)?t.exports=i():void 0===(o="function"==typeof(r=i)?r.call(e,n,e,t):r)||(t.exports=o)},285(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(n(641)),o=i(n(174));function i(t){return t&&t.__esModule?t:{default:t}}var a={providers:function(t){if(t)return r.default;console.error(o.default.CACHE_PROVIDER_MISSING)},policies:{IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3}};e.default=a},641(t,e,n){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(t){if("function"==typeof WeakMap){var e=new WeakMap;new WeakMap}return function(t){if(t&&t.__esModule)return t;var n,o,i={__proto__:null,default:t};if(null===t||"object"!=r(t)&&"function"!=typeof t)return i;if(n=e){if(n.has(t))return n.get(t);n.set(t,i)}for(var a in t)"default"!==a&&{}.hasOwnProperty.call(t,a)&&((o=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,a))&&(o.get||o.set)?n(i,a,o):i[a]=t[a]);return i}(t)}(n(94)),i={};function a(t,e){var n;!e&&t&&t.length&&t.push("");var r=o.getKeys(),i=o.getStorage();if(t&&t.length){n=t.join(".");for(var a=0,c=r.length;a<c;a++)r[a]&&0===r[a].indexOf(n)&&delete i[r[a]]}else for(var s=0,u=r.length;s<u;s++)delete i[r[s]]}i.get=function(t,e){try{e(null,o.get(t))}catch(t){e(t)}},i.set=function(t,e,n){try{t&&e&&o.set(t,e),n()}catch(t){n(t)}},i.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var t=Array.prototype.slice.call(arguments),e=t.splice(-1,1).pop(),n=[];n.push.apply(n,t),a(n),e()}}catch(t){callback(t)}},i.clearByQuery=function(t,e){try{for(var n=o.getKeys(),r=o.getStorage(),i=0,a=n.length;i<a;i++)n[i]&&~n[i].indexOf(t)&&delete r[n[i]];e()}catch(t){e(t)}},i.clearAll=function(t){try{a(),t()}catch(e){t(e)}},e.default=i},94(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.get=function(t){var e=o.default.getItem(t);try{e=JSON.parse(e)}catch(t){return e}return e||null},e.getKeys=function(){return o.default?Object.keys(o.default):[]},e.getStorage=function(){return o.default||null},e.set=function(t,e){try{"object"===i(e)?o.default.setItem(t,JSON.stringify(e)):o.default.setItem(t,e)}catch(t){}};var r,o=(r=n(514))&&r.__esModule?r:{default:r};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}},949(t,e,n){var r=a(n(348)),o=a(n(285)),i=a(n(697));function a(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function p(t,e,n){return(e=v(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t,e,n){if(h())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&d(o,n.prototype),o}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(h=function(){return!!t})()}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,v(r.key),r)}}function v(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}var _=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.CachePolicy=o.default.policies,this.Region=i.default,this.Utils=n(215)},e=[{key:"Stack",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return f(r.default,e)}},{key:"updateAssetURL",value:function(t){if(null==t._embedded_items)throw new Error("_embedded_items not present in entry. Call includeEmbeddedItems() before fetching entry.");var e=function(e){var n=t._embedded_items[e];Array.isArray(n)&&n.forEach(function(n){if("sys_assets"==n._content_type_uid&&n.filename){var r,o,i=function(t){for(var e=0;e<t.length;e++)if(t[e].children&&t[e].children.length&&i(t[e].children),t[e].attrs&&t[e].attrs["asset-uid"]===n.uid)return void(r=t[e].attrs)},a=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach(function(e){p(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t),u=e.split("."),f=new Set(["__proto__","constructor","prototype"]),d=s(u);try{for(d.s();!(o=d.n()).done;){var h=o.value;if(!f.has(h))if(a&&"object"===c(a)&&null!==a&&Object.prototype.hasOwnProperty.call(a,h)){var y=a[h];"object"===c(y)&&null!==y&&(a=y)}else if(Array.isArray(a)){var v,_=s(a);try{for(_.s();!(v=_.n()).done;){var m=v.value;m&&"object"===c(m)&&Object.prototype.hasOwnProperty.call(m,h)&&(a=m[h])}}catch(t){_.e(t)}finally{_.f()}}}}catch(t){d.e(t)}finally{d.f()}a.children&&i(a.children),r&&(r.href=n.url)}})};for(var n in t._embedded_items)e(n)}}],e&&y(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();t.exports=new _},697(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={EU:"eu",US:"us",AU:"au",AZURE_NA:"azure-na",AZURE_EU:"azure-eu",GCP_NA:"gcp-na",GCP_EU:"gcp-eu"}},185(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=t.requestParams;return new Promise(function(r,o){var i,s=new URLSearchParams,u=function(t,e){if("object"===a(t)&&void 0!==t.length)for(var n=0,r=t.length;n<r;n++)s.append(e+"[]",t[n]);else for(var o in t){var i=e?e+"["+o+"]":o,c=t[o];null!==c&&"object"===a(c)&&"query"!==o?u(c,i):s.append(i,"query"!==o?c:JSON.stringify(c))}return s.toString()};return n.headers["Content-Type"]="application/json; charset=UTF-8",n.headers["X-User-Agent"]="contentstack-delivery-javascript-web/3.27.0",n.body&&"object"===a(n.body)&&(delete n.body._method,"object"===a(n.body.query)&&0===Object.keys(n.body.query).length&&delete n.body.query,i=u(n.body)),c(t,i,e,r,o,e.retryDelay,e.retryLimit)})};var r,o=function(t){if("function"==typeof WeakMap){var e=new WeakMap;new WeakMap}return function(t){if(t&&t.__esModule)return t;var n,r,o={__proto__:null,default:t};if(null===t||"object"!=a(t)&&"function"!=typeof t)return o;if(n=e){if(n.has(t))return n.get(t);n.set(t,o)}for(var i in t)"default"!==i&&{}.hasOwnProperty.call(t,i)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,i))&&(r.get||r.set)?n(o,i,r):o[i]=t[i]);return o}(t)}(n(925)),i=(r=n(54))&&r.__esModule?r:{default:r};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e,n,r,a){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:300,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5,l=t.requestParams,p=l.url+"?"+e,f=l.headers,d=o.mergeDeep({method:"GET",headers:f,timeout:3e4},n);function h(o){if(0===u)n.debug&&n.logHandler("error",o),a(o);else{var i=s;u-=1;var l=n.retryLimit-u;n.retryDelayOptions&&(n.retryDelayOptions.base?i=n.retryDelayOptions.base*l:n.retryDelayOptions.customBackoff&&(i=n.retryDelayOptions.customBackoff(l,o))),function(t){return new Promise(function(e){setTimeout(e,t)})}(i).then(function(){return c(t,e,n,r,a,s,u)}).catch(function(){return c(t,e,n,r,a,s,u)})}}n.debug&&n.logHandler("info",{url:p,option:d});var y={url:p,option:d},v=t.plugins;if(v&&void 0!==v)for(var _=0;_<v.length;_++)"function"==typeof v[_].onRequest&&(y=v[_].onRequest(t,y));(0,i.default)(y.url,y.option).then(function(e){n.debug&&n.logHandler("info",e);var o=e.json();if(e.ok&&200===e.status)o.then(function(n){for(var o=0;o<v.length&&"function"==typeof v[o].onResponse;o++)n=v[o].onResponse(t,y,e,n);r(n)}).catch(function(t){n.debug&&n.logHandler("error",t),t&&("terminated"===t.message||t.cause&&("UND_ERR_SOCKET"===t.cause.code||"UND_ERR_ABORTED"===t.cause.code))&&u>0?h(t):a(t)});else{var i=e.status,c=e.statusText;o.then(function(t){var r={error_message:t.error_message,error_code:t.error_code,errors:t.errors,status:i,statusText:c};n.retryCondition&&n.retryCondition(e)?h(r):(n.debug&&n.logHandler("error",r),a(r))}).catch(function(t){n.debug&&n.logHandler("error",t),t&&("terminated"===t.message||t.cause&&("UND_ERR_SOCKET"===t.cause.code||"UND_ERR_ABORTED"===t.cause.code))&&u>0?h(t):a(t||{status:i,statusText:c})})}}).catch(function(t){n.debug&&n.logHandler("error",t),t&&("terminated"===t.message||t.cause&&("UND_ERR_SOCKET"===t.cause.code||"UND_ERR_ABORTED"===t.cause.code))&&u>0?h(t):a(t)})}},925(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e._type=function(t){var e=p(t);return"object"===e&&Array.isArray(t)&&(e="array"),e},e.generateHash=y,e.getHash=h,e.isBrowser=function(){return"undefined"!=typeof window},e.merge=f,e.mergeDeep=function(t,e){var n=this,r=function(t,e){for(var o in e)"object"==n._type(e[o])&&n._type(t[o])==n._type(e[o])?r(t[o],e[o]):"array"==n._type(e[o])&&n._type(t[o])==n._type(e[o])?t[o]=t[o].concat(e[o]):t[o]=e[o]};return r(t,e),t},e.parseQueryFromParams=d,e.resultWrapper=v,e.sendRequest=function(t,e){var n=t.environment_uid;n?t._query.environment_uid=n:(t._query||(t._query={}),t._query.environment=t.environment);var o=t,i=void 0!==o.queryCachePolicy?o.queryCachePolicy:o.cachePolicy,a=void 0!==o.tojson&&o.tojson,s=!!(o.entry_uid||o.singleEntry||o.asset_uid),u=h(d(o,s,a));if(t&&t.requestParams&&t.requestParams.body&&t.requestParams.body.query){var y=JSON.parse(JSON.stringify(t.requestParams.body.query));"object"!==p(y)&&(y=JSON.parse(y)),delete t.requestParams.body.query,t.requestParams.body=f(t.requestParams.body,y),t.live_preview&&!0===t.live_preview.enable&&t.live_preview.live_preview&&"init"!==t.live_preview.live_preview&&(t.requestParams.body=f(t.requestParams.body,{live_preview:t.live_preview.live_preview||"init"}),i=2,t.requestParams.body.environment&&delete t.requestParams.body.environment,t.requestParams.headers.access_token&&delete t.requestParams.headers.access_token,delete t.requestParams.headers.authorization,delete t.requestParams.headers.preview_token,t.live_preview.preview_token?(t.requestParams.headers.preview_token=t.live_preview.preview_token,t.requestParams.headers.live_preview=t.live_preview.live_preview):t.live_preview.management_token&&(t.requestParams.headers.authorization=t.live_preview.management_token))}var m=function(t,e){return function(n,r){try{if(n)return e(n);a||(r=v(r)),t(_(r))}catch(t){e(t)}}},g=function(n,c,s){n&&(0,r.default)(t,e).then(function(e){try{o.entry_uid=o.asset_uid=o.tojson=o.queryCachePolicy=void 0;var n={},r={};if(t.singleEntry)if(t.singleEntry=!1,e.schema&&(n.schema=e.schema),e.content_type&&(n.content_type=e.content_type,delete n.schema),e.entries&&e.entries.length)n.entry=e.entries[0];else{if(!e.assets||!e.assets.length)return 2===i&&null!==o.provider?void o.provider.get(u,function(t,e){if(t||!e||0===e.entries.length&&0===e.assets.length)return s({error_code:141,error_message:"The requested entry doesn't exist."});m(c,s)(t,e)}):s({error_code:141,error_message:"The requested entry doesn't exist."});n.assets=e.assets[0]}else e.items?r={items:e.items,pagination_token:e.pagination_token,sync_token:e.sync_token,total_count:e.total_count}:n=e;return-1!==i&&null!==o.provider?(o.provider.set(u,n,function(t){try{return t&&s(t),a||(n=v(n)),c(_(n))}catch(t){return s(t)}}),c(_(n))):Object.keys(r).length?c(r):(a||(n=v(n)),c(_(n)))}catch(t){return s({message:t.message})}}).catch(function(t){t?s(t):2===i&&null!==o.provider&&o.provider.get(u,m(c,s))})};switch(i){case 1:return new Promise(function(){var t=l(c().m(function t(e,n){r