@storyblok/vue 9.1.0 → 9.1.2

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.
@@ -4,5 +4,5 @@
4
4
  * description: SDK to integrate Storyblok into your project using Vue.
5
5
  * author: Storyblok
6
6
  */
7
- (function(v,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(v=typeof globalThis<"u"?globalThis:v||self,f(v.storyblokVue={},v.Vue))})(this,function(v,f){"use strict";function te(s,e){if(!e)return{src:s,attrs:{}};let t=0,o=0;const r={},n=[];function a(i,u,m,y,E){typeof i!="number"||i<=u||i>=m?console.warn(`[StoryblokRichText] - ${y.charAt(0).toUpperCase()+y.slice(1)} value must be a number between ${u} and ${m} (inclusive)`):E.push(`${y}(${i})`)}if(typeof e=="object"){if(typeof e.width=="number"&&e.width>0?(r.width=e.width,t=e.width):console.warn("[StoryblokRichText] - Width value must be a number greater than 0"),e.height&&typeof e.height=="number"&&e.height>0?(r.height=e.height,o=e.height):console.warn("[StoryblokRichText] - Height value must be a number greater than 0"),e.loading&&["lazy","eager"].includes(e.loading)&&(r.loading=e.loading),e.class&&(r.class=e.class),e.filters){const{filters:i}=e||{},{blur:u,brightness:m,fill:y,format:E,grayscale:$,quality:L,rotate:P}=i||{};u&&a(u,0,100,"blur",n),L&&a(L,0,100,"quality",n),m&&a(m,0,100,"brightness",n),y&&n.push(`fill(${y})`),$&&n.push("grayscale()"),P&&[0,90,180,270].includes(e.filters.rotate||0)&&n.push(`rotate(${P})`),E&&["webp","png","jpeg"].includes(E)&&n.push(`format(${E})`)}e.srcset&&(r.srcset=e.srcset.map(i=>{if(typeof i=="number")return`${s}/m/${i}x0/${n.length>0?`filters:${n.join(":")}`:""} ${i}w`;if(Array.isArray(i)&&i.length===2){const[u,m]=i;return`${s}/m/${u}x${m}/${n.length>0?`filters:${n.join(":")}`:""} ${u}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),e.sizes&&(r.sizes=e.sizes.join(", "))}let c=`${s}/m/`;return t>0&&o>0&&(c=`${c}${t}x${o}/`),n.length>0&&(c=`${c}filters:${n.join(":")}`),{src:c,attrs:r}}var k=(s=>(s.DOCUMENT="doc",s.HEADING="heading",s.PARAGRAPH="paragraph",s.QUOTE="blockquote",s.OL_LIST="ordered_list",s.UL_LIST="bullet_list",s.LIST_ITEM="list_item",s.CODE_BLOCK="code_block",s.HR="horizontal_rule",s.BR="hard_break",s.IMAGE="image",s.EMOJI="emoji",s.COMPONENT="blok",s.TABLE="table",s.TABLE_ROW="tableRow",s.TABLE_CELL="tableCell",s.TABLE_HEADER="tableHeader",s))(k||{}),R=(s=>(s.BOLD="bold",s.STRONG="strong",s.STRIKE="strike",s.UNDERLINE="underline",s.ITALIC="italic",s.CODE="code",s.LINK="link",s.ANCHOR="anchor",s.STYLED="styled",s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",s.TEXT_STYLE="textStyle",s.HIGHLIGHT="highlight",s))(R||{}),x=(s=>(s.TEXT="text",s))(x||{}),C=(s=>(s.URL="url",s.STORY="story",s.ASSET="asset",s.EMAIL="email",s))(C||{});const se=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],re=(s={})=>Object.keys(s).map(e=>`${e}="${s[e]}"`).join(" "),oe=(s={})=>Object.keys(s).map(e=>`${e}: ${s[e]}`).join("; ");function ne(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const O=s=>Object.fromEntries(Object.entries(s).filter(([e,t])=>t!==void 0));function F(s,e={},t){const o=re(e),r=o?`${s} ${o}`:s,n=Array.isArray(t)?t.join(""):t||"";if(s){if(se.includes(s))return`<${r}>`}else return n;return`<${r}>${n}</${s}>`}function D(s={}){const e=new Map,{renderFn:t=F,textFn:o=ne,resolvers:r={},optimizeImages:n=!1,keyedResolvers:a=!1}=s,c=t!==F,i=l=>(h,d)=>{const p=h.attrs||{};return d.render(l,p,h.children||null)},u=(l,h)=>{const{src:d,alt:p,title:g,srcset:T,sizes:_}=l.attrs||{};let w=d,A={};if(n){const{src:Ue,attrs:Me}=te(d,n);w=Ue,A=Me}const He={src:w,alt:p,title:g,srcset:T,sizes:_,...A};return h.render("img",O(He))},m=(l,h)=>{const{level:d,...p}=l.attrs||{};return h.render(`h${d}`,p,l.children)},y=(l,h)=>{var d,p,g,T;const _=h.render("img",{src:(d=l.attrs)==null?void 0:d.fallbackImage,alt:(p=l.attrs)==null?void 0:p.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return h.render("span",{"data-type":"emoji","data-name":(g=l.attrs)==null?void 0:g.name,"data-emoji":(T=l.attrs)==null?void 0:T.emoji},_)},E=(l,h)=>h.render("pre",l.attrs||{},h.render("code",{},l.children||"")),$=(l,h=!1)=>({text:d,attrs:p},g)=>{const{class:T,id:_,...w}=p||{},A=h?{class:T,id:_,style:oe(w)||void 0}:p||{};return g.render(l,O(A),d)},L=l=>M(l),P=l=>{const{marks:h,...d}=l;if("text"in l){if(h)return h.reduce((g,T)=>L({...T,text:g}),L({...d,children:d.children}));const p=l.attrs||{};if(a){const g=e.get("txt")||0;e.set("txt",g+1),p.key=`txt-${g}`}return o(d.text,p)}return""},Q=(l,h)=>{const{linktype:d,href:p,anchor:g,...T}=l.attrs||{};let _="";switch(d){case C.ASSET:case C.URL:_=p;break;case C.EMAIL:_=`mailto:${p}`;break;case C.STORY:_=p,g&&(_=`${_}#${g}`);break;default:_=p;break}const w={...T};return _&&(w.href=_),h.render("a",w,l.text)},je=(l,h)=>{var d,p;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),h.render("span",{blok:(d=l==null?void 0:l.attrs)==null?void 0:d.body[0],id:(p=l.attrs)==null?void 0:p.id,style:"display: none"})},Pe=(l,h)=>{const d={},p=h.render("tbody",{},l.children);return h.render("table",d,p)},Ne=(l,h)=>{const d={};return h.render("tr",d,l.children)},xe=(l,h)=>{const{colspan:d,rowspan:p,colwidth:g,backgroundColor:T,..._}=l.attrs||{},w={..._};d>1&&(w.colspan=d),p>1&&(w.rowspan=p);const A=[];return g&&A.push(`width: ${g}px;`),T&&A.push(`background-color: ${T};`),A.length>0&&(w.style=A.join(" ")),h.render("td",O(w),l.children)},De=(l,h)=>{const{colspan:d,rowspan:p,colwidth:g,backgroundColor:T,..._}=l.attrs||{},w={..._};d>1&&(w.colspan=d),p>1&&(w.rowspan=p);const A=[];return g&&A.push(`width: ${g}px;`),T&&A.push(`background-color: ${T};`),A.length>0&&(w.style=A.join(" ")),h.render("th",O(w),l.children)},Z=new Map([[k.DOCUMENT,i("")],[k.HEADING,m],[k.PARAGRAPH,i("p")],[k.UL_LIST,i("ul")],[k.OL_LIST,i("ol")],[k.LIST_ITEM,i("li")],[k.IMAGE,u],[k.EMOJI,y],[k.CODE_BLOCK,E],[k.HR,i("hr")],[k.BR,i("br")],[k.QUOTE,i("blockquote")],[k.COMPONENT,je],[x.TEXT,P],[R.LINK,Q],[R.ANCHOR,Q],[R.STYLED,$("span",!0)],[R.BOLD,$("strong")],[R.TEXT_STYLE,$("span",!0)],[R.ITALIC,$("em")],[R.UNDERLINE,$("u")],[R.STRIKE,$("s")],[R.CODE,$("code")],[R.SUPERSCRIPT,$("sup")],[R.SUBSCRIPT,$("sub")],[R.HIGHLIGHT,$("mark")],[k.TABLE,Pe],[k.TABLE_ROW,Ne],[k.TABLE_CELL,xe],[k.TABLE_HEADER,De]]),ee=new Map([...Z,...Object.entries(r).map(([l,h])=>[l,h])]),Be=()=>({render:(l,h={},d)=>{if(a&&l){const p=e.get(l)||0;e.set(l,p+1),h.key=`${l}-${p}`}return t(l,h,d)},originalResolvers:Z,mergedResolvers:ee});function N(l){const h=ee.get(l.type);if(!h)return console.error("<Storyblok>",`No resolver found for node type ${l.type}`),"";const d=Be();if(l.type==="text")return h(l,d);const p=l.content?l.content.map(M):void 0;return h({...l,children:p},d)}function M(l){return l.type==="doc"?c?l.content.map(N):l.content.map(N).join(""):Array.isArray(l)?l.map(N):N(l)}return{render:M}}let V=!1;const z=[],ie=s=>new Promise((e,t)=>{if(typeof window>"u"){t(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=r=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}V?r():z.push(r)},document.getElementById("storyblok-javascript-bridge")){e(void 0);return}const o=document.createElement("script");o.async=!0,o.src=s,o.id="storyblok-javascript-bridge",o.onerror=r=>t(r),o.onload=r=>{z.forEach(n=>n()),V=!0,e(r)},document.getElementsByTagName("head")[0].appendChild(o)});var ae=Object.defineProperty,le=(s,e,t)=>e in s?ae(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,b=(s,e,t)=>le(s,typeof e!="symbol"?e+"":e,t);class ce extends Error{constructor(e){super(e),this.name="AbortError"}}function ue(s,e,t){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");const o=[];let r=[],n=0,a=!1;const c=async()=>{n++;const u=o.shift();if(u)try{const y=await s(...u.args);u.resolve(y)}catch(y){u.reject(y)}const m=setTimeout(()=>{n--,o.length>0&&c(),r=r.filter(y=>y!==m)},t);r.includes(m)||r.push(m)},i=(...u)=>a?Promise.reject(new Error("Throttled function is already aborted and not accepting new promises")):new Promise((m,y)=>{o.push({resolve:m,reject:y,args:u}),n<e&&c()});return i.abort=()=>{a=!0,r.forEach(clearTimeout),r=[],o.forEach(u=>u.reject(()=>new ce("Throttle function aborted"))),o.length=0},i}const he=(s="")=>s.includes("/cdn/"),de=(s,e=25,t=1)=>({...s,per_page:e,page:t}),pe=s=>new Promise(e=>setTimeout(e,s)),fe=(s=0,e)=>Array.from({length:s},e),me=(s=0,e=s)=>{const t=Math.abs(e-s)||0,o=s<e?1:-1;return fe(t,(r,n)=>n*o+s)},ye=async(s,e)=>Promise.all(s.map(e)),be=(s=[],e)=>s.map(e).reduce((t,o)=>[...t,...o],[]),B=(s,e,t)=>{const o=[];for(const r in s){if(!Object.prototype.hasOwnProperty.call(s,r))continue;const n=s[r];if(n==null)continue;const a=t?"":encodeURIComponent(r);let c;typeof n=="object"?c=B(n,e?e+encodeURIComponent(`[${a}]`):a,Array.isArray(n)):c=`${e?e+encodeURIComponent(`[${a}]`):a}=${encodeURIComponent(n)}`,o.push(c)}return o.join("&")},q=s=>{const e={eu:"api.storyblok.com",us:"api-us.storyblok.com",cn:"app.storyblokchina.cn",ap:"api-ap.storyblok.com",ca:"api-ca.storyblok.com"};return e[s]??e.eu};class ke{constructor(e){b(this,"baseURL"),b(this,"timeout"),b(this,"headers"),b(this,"responseInterceptor"),b(this,"fetch"),b(this,"ejectInterceptor"),b(this,"url"),b(this,"parameters"),b(this,"fetchOptions"),this.baseURL=e.baseURL,this.headers=e.headers||new Headers,this.timeout=e!=null&&e.timeout?e.timeout*1e3:0,this.responseInterceptor=e.responseInterceptor,this.fetch=(...t)=>e.fetch?e.fetch(...t):fetch(...t),this.ejectInterceptor=!1,this.url="",this.parameters={},this.fetchOptions={}}get(e,t){return this.url=e,this.parameters=t,this._methodHandler("get")}post(e,t){return this.url=e,this.parameters=t,this._methodHandler("post")}put(e,t){return this.url=e,this.parameters=t,this._methodHandler("put")}delete(e,t){return this.url=e,this.parameters=t??{},this._methodHandler("delete")}async _responseHandler(e){const t=[],o={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(r=>{o.data=r});for(const r of e.headers.entries())t[r[0]]=r[1];return o.headers={...t},o.status=e.status,o.statusText=e.statusText,o}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,o=null;e==="get"?t=`${this.baseURL}${this.url}?${B(this.parameters)}`:o=JSON.stringify(this.parameters);const r=new URL(t),n=new AbortController,{signal:a}=n;let c;this.timeout&&(c=setTimeout(()=>n.abort(),this.timeout));try{const i=await this.fetch(`${r}`,{method:e,headers:this.headers,body:o,signal:a,...this.fetchOptions});this.timeout&&clearTimeout(c);const u=await this._responseHandler(i);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(u)):this._statusHandler(u)}catch(i){return{message:i}}}setFetchOptions(e={}){Object.keys(e).length>0&&"method"in e&&delete e.method,this.fetchOptions={...e}}eject(){this.ejectInterceptor=!0}_normalizeErrorMessage(e){if(Array.isArray(e))return e[0]||"Unknown error";if(e&&typeof e=="object"){if(e.error)return e.error;for(const t in e){if(Array.isArray(e[t]))return`${t}: ${e[t][0]}`;if(typeof e[t]=="string")return`${t}: ${e[t]}`}if(e.slug)return e.slug}return"Unknown error"}_statusHandler(e){const t=/20[0-6]/g;return new Promise((o,r)=>{if(t.test(`${e.status}`))return o(e);const n={message:this._normalizeErrorMessage(e.data),status:e.status,response:e};r(n)})}}const G="SB-Agent",H={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:"6.0.0"},ge={DRAFT:"draft"};let j={};const S={};class ve{constructor(e,t){b(this,"client"),b(this,"maxRetries"),b(this,"retriesDelay"),b(this,"throttle"),b(this,"accessToken"),b(this,"cache"),b(this,"resolveCounter"),b(this,"relations"),b(this,"links"),b(this,"version"),b(this,"richTextResolver"),b(this,"resolveNestedRelations"),b(this,"stringifiedStoriesCache"),b(this,"inlineAssets");let o=e.endpoint||t;if(!o){const a=e.https===!1?"http":"https";e.oauthToken?o=`${a}://${q(e.region)}/v1`:o=`${a}://${q(e.region)}/v2`}const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json"),e.headers&&(e.headers.constructor.name==="Headers"?e.headers.entries().toArray():Object.entries(e.headers)).forEach(([a,c])=>{r.set(a,c)}),r.has(G)||(r.set(G,H.defaultAgentName),r.set(H.defaultAgentVersion,H.packageVersion));let n=5;e.oauthToken&&(r.set("Authorization",e.oauthToken),n=3),e.rateLimit&&(n=e.rateLimit),this.maxRetries=e.maxRetries||10,this.retriesDelay=300,this.throttle=ue(this.throttledRequest.bind(this),n,1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.stringifiedStoriesCache={},this.version=e.version||ge.DRAFT,this.inlineAssets=e.inlineAssets||!1,this.client=new ke({baseURL:o,timeout:e.timeout||0,headers:r,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}parseParams(e){return e.token||(e.token=this.getToken()),e.cv||(e.cv=S[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),typeof e.resolve_relations<"u"&&(e.resolve_level=2),e}factoryParamOptions(e,t){return he(e)?this.parseParams(t):t}makeRequest(e,t,o,r,n){const a=this.factoryParamOptions(e,de(t,o,r));return this.cacheResponse(e,a,void 0,n)}get(e,t={},o){t||(t={});const r=`/${e}`;t.version=t.version||this.version;const n=this.factoryParamOptions(r,t);return this.cacheResponse(r,n,void 0,o)}async getAll(e,t={},o,r){const n=(t==null?void 0:t.per_page)||25,a=`/${e}`.replace(/\/$/,""),c=o??a.substring(a.lastIndexOf("/")+1);t.version=t.version||this.version;const i=1,u=await this.makeRequest(a,t,n,i,r),m=u.total?Math.ceil(u.total/n):1,y=await ye(me(i,m),E=>this.makeRequest(a,t,n,E+1,r));return be([u,...y],E=>Object.values(E.data[c]))}post(e,t={},o){const r=`/${e}`;return this.throttle("post",r,t,o)}put(e,t={},o){const r=`/${e}`;return this.throttle("put",r,t,o)}delete(e,t={},o){t||(t={});const r=`/${e}`;return this.throttle("delete",r,t,o)}getStories(e={},t){return this._addResolveLevel(e),this.get("cdn/stories",e,t)}getStory(e,t={},o){return this._addResolveLevel(t),this.get(`cdn/stories/${e}`,t,o)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_addResolveLevel(e){typeof e.resolve_relations<"u"&&(e.resolve_level=2)}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,o){const r=e[t];r&&r.fieldtype==="multilink"&&r.linktype==="story"&&typeof r.id=="string"&&this.links[o][r.id]?r.story=this._cleanCopy(this.links[o][r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[o][r.uuid]&&(r.story=this._cleanCopy(this.links[o][r.uuid]))}getStoryReference(e,t){return this.relations[e][t]?JSON.parse(this.stringifiedStoriesCache[t]||JSON.stringify(this.relations[e][t])):t}_resolveField(e,t,o){const r=e[t];typeof r=="string"?e[t]=this.getStoryReference(o,r):Array.isArray(r)&&(e[t]=r.map(n=>this.getStoryReference(o,n)).filter(Boolean))}_insertRelations(e,t,o,r){if(Array.isArray(o)?o.find(a=>a.endsWith(`.${t}`)):o.endsWith(`.${t}`)){this._resolveField(e,t,r);return}const n=e.component?`${e.component}.${t}`:t;(Array.isArray(o)?o.includes(n):o===n)&&this._resolveField(e,t,r)}iterateTree(e,t,o){const r=(n,a="")=>{if(!(!n||n._stopResolving)){if(Array.isArray(n))n.forEach((c,i)=>r(c,`${a}[${i}]`));else if(typeof n=="object")for(const c in n){const i=a?`${a}.${c}`:c;(n.component&&n._uid||n.type==="link")&&(this._insertRelations(n,c,t,o),this._insertLinks(n,c,o)),r(n[c],i)}}};r(e.content)}async resolveLinks(e,t,o){let r=[];if(e.link_uuids){const n=e.link_uuids.length,a=[],c=50;for(let i=0;i<n;i+=c){const u=Math.min(n,i+c);a.push(e.link_uuids.slice(i,u))}for(let i=0;i<a.length;i++)(await this.getStories({per_page:c,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:a[i].join(",")})).data.stories.forEach(u=>{r.push(u)})}else r=e.links;r.forEach(n=>{this.links[o][n.uuid]={...n,_stopResolving:!0}})}async resolveRelations(e,t,o){let r=[];if(e.rel_uuids){const n=e.rel_uuids.length,a=[],c=50;for(let i=0;i<n;i+=c){const u=Math.min(n,i+c);a.push(e.rel_uuids.slice(i,u))}for(let i=0;i<a.length;i++)(await this.getStories({per_page:c,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:a[i].join(","),excluding_fields:t.excluding_fields})).data.stories.forEach(u=>{r.push(u)});r.length>0&&(e.rels=r,delete e.rel_uuids)}else r=e.rels;r&&r.length>0&&r.forEach(n=>{this.relations[o][n.uuid]={...n,_stopResolving:!0}})}async resolveStories(e,t,o){var r,n;let a=[];if(this.links[o]={},this.relations[o]={},typeof t.resolve_relations<"u"&&t.resolve_relations.length>0&&(typeof t.resolve_relations=="string"&&(a=t.resolve_relations.split(",")),await this.resolveRelations(e,t,o)),t.resolve_links&&["1","story","url","link"].includes(t.resolve_links)&&((r=e.links)!=null&&r.length||(n=e.link_uuids)!=null&&n.length)&&await this.resolveLinks(e,t,o),this.resolveNestedRelations)for(const c in this.relations[o])this.iterateTree(this.relations[o][c],a,o);e.story?this.iterateTree(e.story,a,o):e.stories.forEach(c=>{this.iterateTree(c,a,o)}),this.stringifiedStoriesCache={},delete this.links[o],delete this.relations[o]}async cacheResponse(e,t,o,r){const n=B({url:e,params:t}),a=this.cacheProvider();if(t.version==="published"&&e!=="/cdn/spaces/me"){const c=await a.get(n);if(c)return Promise.resolve(c)}return new Promise(async(c,i)=>{var u;try{const m=await this.throttle("get",e,t,r);if(m.status!==200)return i(m);let y={data:m.data,headers:m.headers};if((u=m.headers)!=null&&u["per-page"]&&(y=Object.assign({},y,{perPage:m.headers["per-page"]?Number.parseInt(m.headers["per-page"]):0,total:m.headers["per-page"]?Number.parseInt(m.headers.total):0})),y.data.story||y.data.stories){const $=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(y.data,t,`${$}`),y=await this.processInlineAssets(y)}t.version==="published"&&e!=="/cdn/spaces/me"&&await a.set(n,y);const E=this.cache.clear==="onpreview"&&t.version==="draft"||this.cache.clear==="auto";return t.token&&y.data.cv&&(E&&S[t.token]&&S[t.token]!==y.data.cv&&await this.flushCache(),S[t.token]=y.data.cv),c(y)}catch(m){if(m.response&&m.status===429&&(o=typeof o>"u"?0:o+1,o<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${this.retriesDelay/1e3} seconds.`),await pe(this.retriesDelay),this.cacheResponse(e,t,o).then(c).catch(i);i(m)}})}throttledRequest(e,t,o,r){return this.client.setFetchOptions(r),this.client[e](t,o)}cacheVersions(){return S}cacheVersion(){return S[this.accessToken]}setCacheVersion(e){this.accessToken&&(S[this.accessToken]=e)}clearCacheVersion(){this.accessToken&&(S[this.accessToken]=0)}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(j[e])},getAll(){return Promise.resolve(j)},set(e,t){return j[e]=t,Promise.resolve(void 0)},flush(){return j={},Promise.resolve(void 0)}};case"custom":if(this.cache.custom)return this.cache.custom;default:return{get(){return Promise.resolve()},getAll(){return Promise.resolve(void 0)},set(){return Promise.resolve(void 0)},flush(){return Promise.resolve(void 0)}}}}async flushCache(){return await this.cacheProvider().flush(),this.clearCacheVersion(),this}async processInlineAssets(e){if(!this.inlineAssets)return e;const t=o=>{if(!o||typeof o!="object")return o;if(Array.isArray(o))return o.map(n=>t(n));let r={...o};r.fieldtype==="asset"&&Array.isArray(e.data.assets)&&(r={...r,...e.data.assets.find(n=>n.id===r.id)});for(const n in r)typeof r[n]=="object"&&(r[n]=t(r[n]));return r};return e.data.story&&(e.data.story.content=t(e.data.story.content)),e.data.stories&&(e.data.stories=e.data.stories.map(o=>(o.content=t(o.content),o))),e}}const _e=(s={})=>{const{apiOptions:e}=s;if(!e||!e.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new ve(e)}},we=s=>{if(typeof s!="object"||typeof s._editable>"u")return{};try{const e=JSON.parse(s._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return e?{"data-blok-c":JSON.stringify(e),"data-blok-uid":`${e.id}-${e.uid}`}:{}}catch{return{}}};let J="https://app.storyblok.com/f/storyblok-v2-latest.js";const K=(s,e,t={})=>{var o;const r=!(typeof window>"u")&&typeof window.storyblokRegisterEvent<"u",n=new URL((o=window.location)==null?void 0:o.href).searchParams.get("_storyblok"),a=n!==null&&+n===s;if(!(!r||!a)){if(!s){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(t).on(["input","published","change"],c=>{var i;c&&(c.action==="input"&&((i=c.story)==null?void 0:i.id)===s?e(c.story):(c.action==="change"||c.action==="published")&&c.storyId===s&&window.location.reload())})})}},Te=(s={})=>{var e,t;const{bridge:o,accessToken:r,use:n=[],apiOptions:a={},bridgeUrl:c}=s;a.accessToken=a.accessToken||r;const i={bridge:o,apiOptions:a};let u={};n.forEach(y=>{u={...u,...y(i)}}),c&&(J=c);const m=!(typeof window>"u")&&((t=(e=window.location)==null?void 0:e.search)==null?void 0:t.includes("_storyblok_tk"));return o!==!1&&m&&ie(J),u};function Re(s,e){return D(e).render(s)}const U=f.defineComponent({__name:"StoryblokComponent",props:{blok:{}},setup(s,{expose:e}){const t=s,o=f.ref();e({value:o});const r=typeof f.resolveDynamicComponent(t.blok.component)!="string",n=f.inject("VueSDKOptions"),a=f.ref(t.blok.component);return!r&&n&&(n.enableFallbackComponent?(a.value=n.customFallbackComponent??"FallbackComponent",typeof f.resolveDynamicComponent(a.value)=="string"&&console.error(`Is the Fallback component "${a.value}" registered properly?`)):console.error(`Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`)),(c,i)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value),f.mergeProps({ref_key:"blokRef",ref:o},{...c.$props,...c.$attrs}),null,16))}}),$e=s=>{var e,t;return f.h(U,{blok:(e=s==null?void 0:s.attrs)==null?void 0:e.body[0],id:(t=s.attrs)==null?void 0:t.id},s.children)};function Y(s){const e={renderFn:f.h,textFn:f.createTextVNode,keyedResolvers:!0,resolvers:{[k.COMPONENT]:$e,...s.resolvers}};return D(e)}const W=f.defineComponent({__name:"StoryblokRichText",props:{doc:{},resolvers:{}},setup(s){const e=s,t=f.ref(),o=()=>t.value;return f.watch([()=>e.doc,()=>e.resolvers],([r,n])=>{const{render:a}=Y({resolvers:n??{}});t.value=a(r)},{immediate:!0,deep:!0}),(r,n)=>(f.openBlock(),f.createBlock(o))}}),Ae={beforeMount(s,e){if(e.value){const t=we(e.value);Object.keys(t).length>0&&(s.setAttribute("data-blok-c",t["data-blok-c"]),s.setAttribute("data-blok-uid",t["data-blok-uid"]),s.classList.add("storyblok__outline"))}}},X=s=>{console.error(`You can't use ${s} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
8
- `)};let I=null;const Ee=()=>(I||X("useStoryblokApi"),I),Se=async(s,e={},t={})=>{const o=f.ref(null);if(t.resolveRelations=t.resolveRelations??e.resolve_relations,t.resolveLinks=t.resolveLinks??e.resolve_links,f.onMounted(()=>{o.value&&o.value.id&&K(o.value.id,r=>o.value=r,t)}),I){const{data:r}=await I.get(`cdn/stories/${s}`,e);o.value=r.story}else X("useStoryblok");return o},Ce={install(s,e={}){s.directive("editable",Ae),s.component("StoryblokComponent",U),s.component("StoryblokRichText",W),e.enableFallbackComponent&&!e.customFallbackComponent&&s.component("FallbackComponent",f.defineAsyncComponent(()=>Promise.resolve().then(()=>Oe)));const{storyblokApi:t}=Te(e);I=t||null,s.provide("VueSDKOptions",e)}},Ie={class:"fallback-component"},Le={class:"component"},Oe=Object.freeze(Object.defineProperty({__proto__:null,default:((s,e)=>{const t=s.__vccOpts||s;for(const[o,r]of e)t[o]=r;return t})(f.defineComponent({__name:"FallbackComponent",props:{blok:{}},setup(s){return(e,t)=>(f.openBlock(),f.createElementBlock("div",Ie,[f.createElementVNode("p",null,[t[0]||(t[0]=f.createTextVNode(" Component could not be found for blok ")),f.createElementVNode("span",Le,f.toDisplayString(e.blok.component),1),t[1]||(t[1]=f.createTextVNode("! Is it configured correctly? "))])]))}}),[["__scopeId","data-v-9abcd1f2"]])},Symbol.toStringTag,{value:"Module"}));v.BlockTypes=k,v.MarkTypes=R,v.StoryblokComponent=U,v.StoryblokRichText=W,v.StoryblokVue=Ce,v.TextTypes=x,v.apiPlugin=_e,v.renderRichText=Re,v.richTextResolver=D,v.useStoryblok=Se,v.useStoryblokApi=Ee,v.useStoryblokBridge=K,v.useStoryblokRichText=Y,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
7
+ (function(v,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(v=typeof globalThis<"u"?globalThis:v||self,f(v.storyblokVue={},v.Vue))})(this,function(v,f){"use strict";function se(s,e){if(!e)return{src:s,attrs:{}};let t=0,o=0;const r={},n=[];function a(i,u,m,y,S){typeof i!="number"||i<=u||i>=m?console.warn(`[StoryblokRichText] - ${y.charAt(0).toUpperCase()+y.slice(1)} value must be a number between ${u} and ${m} (inclusive)`):S.push(`${y}(${i})`)}if(typeof e=="object"){if(typeof e.width=="number"&&e.width>0?(r.width=e.width,t=e.width):console.warn("[StoryblokRichText] - Width value must be a number greater than 0"),e.height&&typeof e.height=="number"&&e.height>0?(r.height=e.height,o=e.height):console.warn("[StoryblokRichText] - Height value must be a number greater than 0"),e.loading&&["lazy","eager"].includes(e.loading)&&(r.loading=e.loading),e.class&&(r.class=e.class),e.filters){const{filters:i}=e||{},{blur:u,brightness:m,fill:y,format:S,grayscale:R,quality:L,rotate:P}=i||{};u&&a(u,0,100,"blur",n),L&&a(L,0,100,"quality",n),m&&a(m,0,100,"brightness",n),y&&n.push(`fill(${y})`),R&&n.push("grayscale()"),P&&[0,90,180,270].includes(e.filters.rotate||0)&&n.push(`rotate(${P})`),S&&["webp","png","jpeg"].includes(S)&&n.push(`format(${S})`)}e.srcset&&(r.srcset=e.srcset.map(i=>{if(typeof i=="number")return`${s}/m/${i}x0/${n.length>0?`filters:${n.join(":")}`:""} ${i}w`;if(Array.isArray(i)&&i.length===2){const[u,m]=i;return`${s}/m/${u}x${m}/${n.length>0?`filters:${n.join(":")}`:""} ${u}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),e.sizes&&(r.sizes=e.sizes.join(", "))}let c=`${s}/m/`;return t>0&&o>0&&(c=`${c}${t}x${o}/`),n.length>0&&(c=`${c}filters:${n.join(":")}`),{src:c,attrs:r}}var k=(s=>(s.DOCUMENT="doc",s.HEADING="heading",s.PARAGRAPH="paragraph",s.QUOTE="blockquote",s.OL_LIST="ordered_list",s.UL_LIST="bullet_list",s.LIST_ITEM="list_item",s.CODE_BLOCK="code_block",s.HR="horizontal_rule",s.BR="hard_break",s.IMAGE="image",s.EMOJI="emoji",s.COMPONENT="blok",s.TABLE="table",s.TABLE_ROW="tableRow",s.TABLE_CELL="tableCell",s.TABLE_HEADER="tableHeader",s))(k||{}),$=(s=>(s.BOLD="bold",s.STRONG="strong",s.STRIKE="strike",s.UNDERLINE="underline",s.ITALIC="italic",s.CODE="code",s.LINK="link",s.ANCHOR="anchor",s.STYLED="styled",s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",s.TEXT_STYLE="textStyle",s.HIGHLIGHT="highlight",s))($||{}),x=(s=>(s.TEXT="text",s))(x||{}),C=(s=>(s.URL="url",s.STORY="story",s.ASSET="asset",s.EMAIL="email",s))(C||{});const re=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],oe=(s={})=>Object.keys(s).map(e=>`${e}="${s[e]}"`).join(" "),ne=(s={})=>Object.keys(s).map(e=>`${e}: ${s[e]}`).join("; ");function ie(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const O=s=>Object.fromEntries(Object.entries(s).filter(([e,t])=>t!==void 0));function V(s,e={},t){const o=oe(e),r=o?`${s} ${o}`:s,n=Array.isArray(t)?t.join(""):t||"";if(s){if(re.includes(s))return`<${r}>`}else return n;return`<${r}>${n}</${s}>`}function B(s={}){const e=new Map,{renderFn:t=V,textFn:o=ie,resolvers:r={},optimizeImages:n=!1,keyedResolvers:a=!1}=s,c=t!==V,i=l=>(h,d)=>{const p=h.attrs||{};return d.render(l,p,h.children||null)},u=(l,h)=>{const{src:d,alt:p,title:g,srcset:T,sizes:_}=l.attrs||{};let w=d,E={};if(n){const{src:Ue,attrs:Me}=se(d,n);w=Ue,E=Me}const He={src:w,alt:p,title:g,srcset:T,sizes:_,...E};return h.render("img",O(He))},m=(l,h)=>{const{level:d,...p}=l.attrs||{};return h.render(`h${d}`,p,l.children)},y=(l,h)=>{var d,p,g,T;const _=h.render("img",{src:(d=l.attrs)==null?void 0:d.fallbackImage,alt:(p=l.attrs)==null?void 0:p.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return h.render("span",{"data-type":"emoji","data-name":(g=l.attrs)==null?void 0:g.name,"data-emoji":(T=l.attrs)==null?void 0:T.emoji},_)},S=(l,h)=>h.render("pre",l.attrs||{},h.render("code",{},l.children||"")),R=(l,h=!1)=>({text:d,attrs:p},g)=>{const{class:T,id:_,...w}=p||{},E=h?{class:T,id:_,style:ne(w)||void 0}:p||{};return g.render(l,O(E),d)},L=l=>M(l),P=l=>{const{marks:h,...d}=l;if("text"in l){if(h)return h.reduce((g,T)=>L({...T,text:g}),L({...d,children:d.children}));const p=l.attrs||{};if(a){const g=e.get("txt")||0;e.set("txt",g+1),p.key=`txt-${g}`}return o(d.text,p)}return""},Z=(l,h)=>{const{linktype:d,href:p,anchor:g,...T}=l.attrs||{};let _="";switch(d){case C.ASSET:case C.URL:_=p;break;case C.EMAIL:_=`mailto:${p}`;break;case C.STORY:_=p,g&&(_=`${_}#${g}`);break;default:_=p;break}const w={...T};return _&&(w.href=_),h.render("a",w,l.text)},je=(l,h)=>{var d,p;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),h.render("span",{blok:(d=l==null?void 0:l.attrs)==null?void 0:d.body[0],id:(p=l.attrs)==null?void 0:p.id,style:"display: none"})},Pe=(l,h)=>{const d={},p=h.render("tbody",{},l.children);return h.render("table",d,p)},Ne=(l,h)=>{const d={};return h.render("tr",d,l.children)},xe=(l,h)=>{const{colspan:d,rowspan:p,colwidth:g,backgroundColor:T,..._}=l.attrs||{},w={..._};d>1&&(w.colspan=d),p>1&&(w.rowspan=p);const E=[];return g&&E.push(`width: ${g}px;`),T&&E.push(`background-color: ${T};`),E.length>0&&(w.style=E.join(" ")),h.render("td",O(w),l.children)},Be=(l,h)=>{const{colspan:d,rowspan:p,colwidth:g,backgroundColor:T,..._}=l.attrs||{},w={..._};d>1&&(w.colspan=d),p>1&&(w.rowspan=p);const E=[];return g&&E.push(`width: ${g}px;`),T&&E.push(`background-color: ${T};`),E.length>0&&(w.style=E.join(" ")),h.render("th",O(w),l.children)},ee=new Map([[k.DOCUMENT,i("")],[k.HEADING,m],[k.PARAGRAPH,i("p")],[k.UL_LIST,i("ul")],[k.OL_LIST,i("ol")],[k.LIST_ITEM,i("li")],[k.IMAGE,u],[k.EMOJI,y],[k.CODE_BLOCK,S],[k.HR,i("hr")],[k.BR,i("br")],[k.QUOTE,i("blockquote")],[k.COMPONENT,je],[x.TEXT,P],[$.LINK,Z],[$.ANCHOR,Z],[$.STYLED,R("span",!0)],[$.BOLD,R("strong")],[$.TEXT_STYLE,R("span",!0)],[$.ITALIC,R("em")],[$.UNDERLINE,R("u")],[$.STRIKE,R("s")],[$.CODE,R("code")],[$.SUPERSCRIPT,R("sup")],[$.SUBSCRIPT,R("sub")],[$.HIGHLIGHT,R("mark")],[k.TABLE,Pe],[k.TABLE_ROW,Ne],[k.TABLE_CELL,xe],[k.TABLE_HEADER,Be]]),te=new Map([...ee,...Object.entries(r).map(([l,h])=>[l,h])]),De=()=>({render:(l,h={},d)=>{if(a&&l){const p=e.get(l)||0;e.set(l,p+1),h.key=`${l}-${p}`}return t(l,h,d)},originalResolvers:ee,mergedResolvers:te});function N(l){const h=te.get(l.type);if(!h)return console.error("<Storyblok>",`No resolver found for node type ${l.type}`),"";const d=De();if(l.type==="text")return h(l,d);const p=l.content?l.content.map(M):void 0;return h({...l,children:p},d)}function M(l){return l.type==="doc"?c?l.content.map(N):l.content.map(N).join(""):Array.isArray(l)?l.map(N):N(l)}return{render:M}}let F=!1;const z=[],ae=s=>new Promise((e,t)=>{if(typeof window>"u"){t(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=r=>{if(!window.location.search.includes("_storyblok")){console.warn("You are not in Draft Mode or in the Visual Editor.");return}F?r():z.push(r)},document.getElementById("storyblok-javascript-bridge")){e(void 0);return}const o=document.createElement("script");o.async=!0,o.src=s,o.id="storyblok-javascript-bridge",o.onerror=r=>t(r),o.onload=r=>{z.forEach(n=>n()),F=!0,e(r)},document.getElementsByTagName("head")[0].appendChild(o)});var le=Object.defineProperty,ce=(s,e,t)=>e in s?le(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,b=(s,e,t)=>ce(s,typeof e!="symbol"?e+"":e,t);class ue extends Error{constructor(e){super(e),this.name="AbortError"}}function he(s,e,t){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");const o=[];let r=[],n=0,a=!1;const c=async()=>{n++;const u=o.shift();if(u)try{const y=await s(...u.args);u.resolve(y)}catch(y){u.reject(y)}const m=setTimeout(()=>{n--,o.length>0&&c(),r=r.filter(y=>y!==m)},t);r.includes(m)||r.push(m)},i=(...u)=>a?Promise.reject(new Error("Throttled function is already aborted and not accepting new promises")):new Promise((m,y)=>{o.push({resolve:m,reject:y,args:u}),n<e&&c()});return i.abort=()=>{a=!0,r.forEach(clearTimeout),r=[],o.forEach(u=>u.reject(()=>new ue("Throttle function aborted"))),o.length=0},i}const q=(s="")=>s.includes("/cdn/"),de=(s,e=25,t=1)=>({...s,per_page:e,page:t}),pe=s=>new Promise(e=>setTimeout(e,s)),fe=(s=0,e)=>Array.from({length:s},e),me=(s=0,e=s)=>{const t=Math.abs(e-s)||0,o=s<e?1:-1;return fe(t,(r,n)=>n*o+s)},ye=async(s,e)=>Promise.all(s.map(e)),be=(s=[],e)=>s.map(e).reduce((t,o)=>[...t,...o],[]),D=(s,e,t)=>{const o=[];for(const r in s){if(!Object.prototype.hasOwnProperty.call(s,r))continue;const n=s[r];if(n==null)continue;const a=t?"":encodeURIComponent(r);let c;typeof n=="object"?c=D(n,e?e+encodeURIComponent(`[${a}]`):a,Array.isArray(n)):c=`${e?e+encodeURIComponent(`[${a}]`):a}=${encodeURIComponent(n)}`,o.push(c)}return o.join("&")},G=s=>{const e={eu:"api.storyblok.com",us:"api-us.storyblok.com",cn:"app.storyblokchina.cn",ap:"api-ap.storyblok.com",ca:"api-ca.storyblok.com"};return e[s]??e.eu};class ke{constructor(e){b(this,"baseURL"),b(this,"timeout"),b(this,"headers"),b(this,"responseInterceptor"),b(this,"fetch"),b(this,"ejectInterceptor"),b(this,"url"),b(this,"parameters"),b(this,"fetchOptions"),this.baseURL=e.baseURL,this.headers=e.headers||new Headers,this.timeout=e!=null&&e.timeout?e.timeout*1e3:0,this.responseInterceptor=e.responseInterceptor,this.fetch=(...t)=>e.fetch?e.fetch(...t):fetch(...t),this.ejectInterceptor=!1,this.url="",this.parameters={},this.fetchOptions={}}get(e,t){return this.url=e,this.parameters=t,this._methodHandler("get")}post(e,t){return this.url=e,this.parameters=t,this._methodHandler("post")}put(e,t){return this.url=e,this.parameters=t,this._methodHandler("put")}delete(e,t){return this.url=e,this.parameters=t??{},this._methodHandler("delete")}async _responseHandler(e){const t=[],o={data:{},headers:{},status:0,statusText:""};e.status!==204&&await e.json().then(r=>{o.data=r});for(const r of e.headers.entries())t[r[0]]=r[1];return o.headers={...t},o.status=e.status,o.statusText=e.statusText,o}async _methodHandler(e){let t=`${this.baseURL}${this.url}`,o=null;e==="get"?t=`${this.baseURL}${this.url}?${D(this.parameters)}`:o=JSON.stringify(this.parameters);const r=new URL(t),n=new AbortController,{signal:a}=n;let c;this.timeout&&(c=setTimeout(()=>n.abort(),this.timeout));try{const i=await this.fetch(`${r}`,{method:e,headers:this.headers,body:o,signal:a,...this.fetchOptions});this.timeout&&clearTimeout(c);const u=await this._responseHandler(i);return this.responseInterceptor&&!this.ejectInterceptor?this._statusHandler(this.responseInterceptor(u)):this._statusHandler(u)}catch(i){return{message:i}}}setFetchOptions(e={}){Object.keys(e).length>0&&"method"in e&&delete e.method,this.fetchOptions={...e}}eject(){this.ejectInterceptor=!0}_normalizeErrorMessage(e){if(Array.isArray(e))return e[0]||"Unknown error";if(e&&typeof e=="object"){if(e.error)return e.error;for(const t in e){if(Array.isArray(e[t]))return`${t}: ${e[t][0]}`;if(typeof e[t]=="string")return`${t}: ${e[t]}`}if(e.slug)return e.slug}return"Unknown error"}_statusHandler(e){const t=/20[0-6]/g;return new Promise((o,r)=>{if(t.test(`${e.status}`))return o(e);const n={message:this._normalizeErrorMessage(e.data),status:e.status,response:e};r(n)})}}const J="SB-Agent",H={defaultAgentName:"SB-JS-CLIENT",defaultAgentVersion:"SB-Agent-Version",packageVersion:"7.0.0"},ge={PUBLISHED:"published"};let j={};const A={};class ve{constructor(e,t){b(this,"client"),b(this,"maxRetries"),b(this,"retriesDelay"),b(this,"throttle"),b(this,"accessToken"),b(this,"cache"),b(this,"resolveCounter"),b(this,"relations"),b(this,"links"),b(this,"version"),b(this,"richTextResolver"),b(this,"resolveNestedRelations"),b(this,"stringifiedStoriesCache"),b(this,"inlineAssets");let o=e.endpoint||t;if(!o){const a=e.https===!1?"http":"https";e.oauthToken?o=`${a}://${G(e.region)}/v1`:o=`${a}://${G(e.region)}/v2`}const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json"),e.headers&&(e.headers.constructor.name==="Headers"?e.headers.entries().toArray():Object.entries(e.headers)).forEach(([a,c])=>{r.set(a,c)}),r.has(J)||(r.set(J,H.defaultAgentName),r.set(H.defaultAgentVersion,H.packageVersion));let n=5;e.oauthToken&&(r.set("Authorization",e.oauthToken),n=3),e.rateLimit&&(n=e.rateLimit),this.maxRetries=e.maxRetries||10,this.retriesDelay=300,this.throttle=he(this.throttledRequest.bind(this),n,1e3),this.accessToken=e.accessToken||"",this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.resolveCounter=0,this.resolveNestedRelations=e.resolveNestedRelations||!0,this.stringifiedStoriesCache={},this.version=e.version||ge.PUBLISHED,this.inlineAssets=e.inlineAssets||!1,this.client=new ke({baseURL:o,timeout:e.timeout||0,headers:r,responseInterceptor:e.responseInterceptor,fetch:e.fetch})}parseParams(e){return e.token||(e.token=this.getToken()),e.cv||(e.cv=A[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),typeof e.resolve_relations<"u"&&(e.resolve_level=2),e}factoryParamOptions(e,t){return q(e)?this.parseParams(t):t}makeRequest(e,t,o,r,n){const a=this.factoryParamOptions(e,de(t,o,r));return this.cacheResponse(e,a,void 0,n)}get(e,t={},o){t||(t={});const r=`/${e}`;q(r)&&(t.version=t.version||this.version);const n=this.factoryParamOptions(r,t);return this.cacheResponse(r,n,void 0,o)}async getAll(e,t={},o,r){const n=(t==null?void 0:t.per_page)||25,a=`/${e}`.replace(/\/$/,""),c=o??a.substring(a.lastIndexOf("/")+1);t.version=t.version||this.version;const i=1,u=await this.makeRequest(a,t,n,i,r),m=u.total?Math.ceil(u.total/n):1,y=await ye(me(i,m),S=>this.makeRequest(a,t,n,S+1,r));return be([u,...y],S=>Object.values(S.data[c]))}post(e,t={},o){const r=`/${e}`;return this.throttle("post",r,t,o)}put(e,t={},o){const r=`/${e}`;return this.throttle("put",r,t,o)}delete(e,t={},o){t||(t={});const r=`/${e}`;return this.throttle("delete",r,t,o)}getStories(e={},t){return this._addResolveLevel(e),this.get("cdn/stories",e,t)}getStory(e,t={},o){return this._addResolveLevel(t),this.get(`cdn/stories/${e}`,t,o)}getToken(){return this.accessToken}ejectInterceptor(){this.client.eject()}_addResolveLevel(e){typeof e.resolve_relations<"u"&&(e.resolve_level=2)}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t,o){const r=e[t];r&&r.fieldtype==="multilink"&&r.linktype==="story"&&typeof r.id=="string"&&this.links[o][r.id]?r.story=this._cleanCopy(this.links[o][r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[o][r.uuid]&&(r.story=this._cleanCopy(this.links[o][r.uuid]))}getStoryReference(e,t){return this.relations[e][t]?JSON.parse(this.stringifiedStoriesCache[t]||JSON.stringify(this.relations[e][t])):t}_resolveField(e,t,o){const r=e[t];typeof r=="string"?e[t]=this.getStoryReference(o,r):Array.isArray(r)&&(e[t]=r.map(n=>this.getStoryReference(o,n)).filter(Boolean))}_insertRelations(e,t,o,r){if(Array.isArray(o)?o.find(a=>a.endsWith(`.${t}`)):o.endsWith(`.${t}`)){this._resolveField(e,t,r);return}const n=e.component?`${e.component}.${t}`:t;(Array.isArray(o)?o.includes(n):o===n)&&this._resolveField(e,t,r)}iterateTree(e,t,o){const r=(n,a="")=>{if(!(!n||n._stopResolving)){if(Array.isArray(n))n.forEach((c,i)=>r(c,`${a}[${i}]`));else if(typeof n=="object")for(const c in n){const i=a?`${a}.${c}`:c;(n.component&&n._uid||n.type==="link")&&(this._insertRelations(n,c,t,o),this._insertLinks(n,c,o)),r(n[c],i)}}};r(e.content)}async resolveLinks(e,t,o){let r=[];if(e.link_uuids){const n=e.link_uuids.length,a=[],c=50;for(let i=0;i<n;i+=c){const u=Math.min(n,i+c);a.push(e.link_uuids.slice(i,u))}for(let i=0;i<a.length;i++)(await this.getStories({per_page:c,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:a[i].join(",")})).data.stories.forEach(u=>{r.push(u)})}else r=e.links;r.forEach(n=>{this.links[o][n.uuid]={...n,_stopResolving:!0}})}async resolveRelations(e,t,o){let r=[];if(e.rel_uuids){const n=e.rel_uuids.length,a=[],c=50;for(let i=0;i<n;i+=c){const u=Math.min(n,i+c);a.push(e.rel_uuids.slice(i,u))}for(let i=0;i<a.length;i++)(await this.getStories({per_page:c,language:t.language,version:t.version,starts_with:t.starts_with,by_uuids:a[i].join(","),excluding_fields:t.excluding_fields})).data.stories.forEach(u=>{r.push(u)});r.length>0&&(e.rels=r,delete e.rel_uuids)}else r=e.rels;r&&r.length>0&&r.forEach(n=>{this.relations[o][n.uuid]={...n,_stopResolving:!0}})}async resolveStories(e,t,o){var r,n;let a=[];if(this.links[o]={},this.relations[o]={},typeof t.resolve_relations<"u"&&t.resolve_relations.length>0&&(typeof t.resolve_relations=="string"&&(a=t.resolve_relations.split(",")),await this.resolveRelations(e,t,o)),t.resolve_links&&["1","story","url","link"].includes(t.resolve_links)&&((r=e.links)!=null&&r.length||(n=e.link_uuids)!=null&&n.length)&&await this.resolveLinks(e,t,o),this.resolveNestedRelations)for(const c in this.relations[o])this.iterateTree(this.relations[o][c],a,o);e.story?this.iterateTree(e.story,a,o):e.stories.forEach(c=>{this.iterateTree(c,a,o)}),this.stringifiedStoriesCache={},delete this.links[o],delete this.relations[o]}async cacheResponse(e,t,o,r){const n=D({url:e,params:t}),a=this.cacheProvider();if(t.version==="published"&&e!=="/cdn/spaces/me"){const c=await a.get(n);if(c)return Promise.resolve(c)}return new Promise(async(c,i)=>{var u;try{const m=await this.throttle("get",e,t,r);if(m.status!==200)return i(m);let y={data:m.data,headers:m.headers};if((u=m.headers)!=null&&u["per-page"]&&(y=Object.assign({},y,{perPage:m.headers["per-page"]?Number.parseInt(m.headers["per-page"]):0,total:m.headers["per-page"]?Number.parseInt(m.headers.total):0})),y.data.story||y.data.stories){const R=this.resolveCounter=++this.resolveCounter%1e3;await this.resolveStories(y.data,t,`${R}`),y=await this.processInlineAssets(y)}t.version==="published"&&e!=="/cdn/spaces/me"&&await a.set(n,y);const S=this.cache.clear==="onpreview"&&t.version==="draft"||this.cache.clear==="auto";return t.token&&y.data.cv&&(S&&A[t.token]&&A[t.token]!==y.data.cv&&await this.flushCache(),A[t.token]=y.data.cv),c(y)}catch(m){if(m.response&&m.status===429&&(o=typeof o>"u"?0:o+1,o<this.maxRetries))return console.log(`Hit rate limit. Retrying in ${this.retriesDelay/1e3} seconds.`),await pe(this.retriesDelay),this.cacheResponse(e,t,o).then(c).catch(i);i(m)}})}throttledRequest(e,t,o,r){return this.client.setFetchOptions(r),this.client[e](t,o)}cacheVersions(){return A}cacheVersion(){return A[this.accessToken]}setCacheVersion(e){this.accessToken&&(A[this.accessToken]=e)}clearCacheVersion(){this.accessToken&&(A[this.accessToken]=0)}cacheProvider(){switch(this.cache.type){case"memory":return{get(e){return Promise.resolve(j[e])},getAll(){return Promise.resolve(j)},set(e,t){return j[e]=t,Promise.resolve(void 0)},flush(){return j={},Promise.resolve(void 0)}};case"custom":if(this.cache.custom)return this.cache.custom;default:return{get(){return Promise.resolve()},getAll(){return Promise.resolve(void 0)},set(){return Promise.resolve(void 0)},flush(){return Promise.resolve(void 0)}}}}async flushCache(){return await this.cacheProvider().flush(),this.clearCacheVersion(),this}async processInlineAssets(e){if(!this.inlineAssets)return e;const t=o=>{if(!o||typeof o!="object")return o;if(Array.isArray(o))return o.map(n=>t(n));let r={...o};r.fieldtype==="asset"&&Array.isArray(e.data.assets)&&(r={...r,...e.data.assets.find(n=>n.id===r.id)});for(const n in r)typeof r[n]=="object"&&(r[n]=t(r[n]));return r};return e.data.story&&(e.data.story.content=t(e.data.story.content)),e.data.stories&&(e.data.stories=e.data.stories.map(o=>(o.content=t(o.content),o))),e}}const _e=(s={})=>{const{apiOptions:e}=s;if(!e||!e.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new ve(e)}},we=s=>{if(typeof s!="object"||typeof s._editable>"u")return{};try{const e=JSON.parse(s._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return e?{"data-blok-c":JSON.stringify(e),"data-blok-uid":`${e.id}-${e.uid}`}:{}}catch{return{}}};let K="https://app.storyblok.com/f/storyblok-v2-latest.js";const Y=(s,e,t={})=>{var o;const r=!(typeof window>"u")&&typeof window.storyblokRegisterEvent<"u",n=new URL((o=window.location)==null?void 0:o.href).searchParams.get("_storyblok"),a=n!==null&&+n===s;if(!(!r||!a)){if(!s){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(t).on(["input","published","change"],c=>{var i;c&&(c.action==="input"&&((i=c.story)==null?void 0:i.id)===s?e(c.story):(c.action==="change"||c.action==="published")&&c.storyId===s&&window.location.reload())})})}},Te=(s={})=>{var e,t;const{bridge:o,accessToken:r,use:n=[],apiOptions:a={},bridgeUrl:c}=s;a.accessToken=a.accessToken||r;const i={bridge:o,apiOptions:a};let u={};n.forEach(y=>{u={...u,...y(i)}}),c&&(K=c);const m=!(typeof window>"u")&&((t=(e=window.location)==null?void 0:e.search)==null?void 0:t.includes("_storyblok_tk"));return o!==!1&&m&&ae(K),u};function $e(s,e){return B(e).render(s)}const U=f.defineComponent({__name:"StoryblokComponent",props:{blok:{}},setup(s,{expose:e}){const t=s,o=f.ref();e({value:o});const r=typeof f.resolveDynamicComponent(t.blok.component)!="string",n=f.inject("VueSDKOptions"),a=f.ref(t.blok.component);return!r&&n&&(n.enableFallbackComponent?(a.value=n.customFallbackComponent??"FallbackComponent",typeof f.resolveDynamicComponent(a.value)=="string"&&console.error(`Is the Fallback component "${a.value}" registered properly?`)):console.error(`Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`)),(c,i)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value),f.mergeProps({ref_key:"blokRef",ref:o},{...c.$props,...c.$attrs}),null,16))}}),Re=s=>{var e,t;return f.h(U,{blok:(e=s==null?void 0:s.attrs)==null?void 0:e.body[0],id:(t=s.attrs)==null?void 0:t.id},s.children)};function W(s){const e={renderFn:f.h,textFn:f.createTextVNode,keyedResolvers:!0,resolvers:{[k.COMPONENT]:Re,...s.resolvers}};return B(e)}const X=f.defineComponent({__name:"StoryblokRichText",props:{doc:{},resolvers:{}},setup(s){const e=s,t=f.ref(),o=()=>t.value;return f.watch([()=>e.doc,()=>e.resolvers],([r,n])=>{const{render:a}=W({resolvers:n??{}});t.value=a(r)},{immediate:!0,deep:!0}),(r,n)=>(f.openBlock(),f.createBlock(o))}}),Ee={beforeMount(s,e){if(e.value){const t=we(e.value);Object.keys(t).length>0&&(s.setAttribute("data-blok-c",t["data-blok-c"]),s.setAttribute("data-blok-uid",t["data-blok-uid"]),s.classList.add("storyblok__outline"))}}},Q=s=>{console.error(`You can't use ${s} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
8
+ `)};let I=null;const Se=()=>(I||Q("useStoryblokApi"),I),Ae=async(s,e={},t={})=>{const o=f.ref(null);if(t.resolveRelations=t.resolveRelations??e.resolve_relations,t.resolveLinks=t.resolveLinks??e.resolve_links,f.onMounted(()=>{o.value&&o.value.id&&Y(o.value.id,r=>o.value=r,t)}),I){const{data:r}=await I.get(`cdn/stories/${s}`,e);o.value=r.story}else Q("useStoryblok");return o},Ce={install(s,e={}){s.directive("editable",Ee),s.component("StoryblokComponent",U),s.component("StoryblokRichText",X),e.enableFallbackComponent&&!e.customFallbackComponent&&s.component("FallbackComponent",f.defineAsyncComponent(()=>Promise.resolve().then(()=>Oe)));const{storyblokApi:t}=Te(e);I=t||null,s.provide("VueSDKOptions",e)}},Ie={class:"fallback-component"},Le={class:"component"},Oe=Object.freeze(Object.defineProperty({__proto__:null,default:((s,e)=>{const t=s.__vccOpts||s;for(const[o,r]of e)t[o]=r;return t})(f.defineComponent({__name:"FallbackComponent",props:{blok:{}},setup(s){return(e,t)=>(f.openBlock(),f.createElementBlock("div",Ie,[f.createElementVNode("p",null,[t[0]||(t[0]=f.createTextVNode(" Component could not be found for blok ")),f.createElementVNode("span",Le,f.toDisplayString(e.blok.component),1),t[1]||(t[1]=f.createTextVNode("! Is it configured correctly? "))])]))}}),[["__scopeId","data-v-9abcd1f2"]])},Symbol.toStringTag,{value:"Module"}));v.BlockTypes=k,v.MarkTypes=$,v.StoryblokComponent=U,v.StoryblokRichText=X,v.StoryblokVue=Ce,v.TextTypes=x,v.apiPlugin=_e,v.renderRichText=$e,v.richTextResolver=B,v.useStoryblok=Ae,v.useStoryblokApi=Se,v.useStoryblokBridge=Y,v.useStoryblokRichText=W,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
@@ -4,8 +4,8 @@
4
4
  * description: SDK to integrate Storyblok into your project using Vue.
5
5
  * author: Storyblok
6
6
  */
7
- import { defineComponent as K, ref as x, resolveDynamicComponent as N, inject as he, createBlock as Y, openBlock as W, mergeProps as de, h as X, createTextVNode as pe, watch as fe, onMounted as ye, defineAsyncComponent as me } from "vue";
8
- function be(s, e) {
7
+ import { defineComponent as Y, ref as P, resolveDynamicComponent as N, inject as de, createBlock as W, openBlock as X, mergeProps as pe, h as Q, createTextVNode as fe, watch as ye, onMounted as me, defineAsyncComponent as be } from "vue";
8
+ function ge(s, e) {
9
9
  if (!e)
10
10
  return { src: s, attrs: {} };
11
11
  let t = 0, o = 0;
@@ -15,8 +15,8 @@ function be(s, e) {
15
15
  }
16
16
  if (typeof e == "object") {
17
17
  if (typeof e.width == "number" && e.width > 0 ? (r.width = e.width, t = e.width) : console.warn("[StoryblokRichText] - Width value must be a number greater than 0"), e.height && typeof e.height == "number" && e.height > 0 ? (r.height = e.height, o = e.height) : console.warn("[StoryblokRichText] - Height value must be a number greater than 0"), e.loading && ["lazy", "eager"].includes(e.loading) && (r.loading = e.loading), e.class && (r.class = e.class), e.filters) {
18
- const { filters: i } = e || {}, { blur: u, brightness: f, fill: y, format: R, grayscale: T, quality: E, rotate: L } = i || {};
19
- u && a(u, 0, 100, "blur", n), E && a(E, 0, 100, "quality", n), f && a(f, 0, 100, "brightness", n), y && n.push(`fill(${y})`), T && n.push("grayscale()"), L && [0, 90, 180, 270].includes(e.filters.rotate || 0) && n.push(`rotate(${L})`), R && ["webp", "png", "jpeg"].includes(R) && n.push(`format(${R})`);
18
+ const { filters: i } = e || {}, { blur: u, brightness: f, fill: y, format: R, grayscale: _, quality: A, rotate: L } = i || {};
19
+ u && a(u, 0, 100, "blur", n), A && a(A, 0, 100, "quality", n), f && a(f, 0, 100, "brightness", n), y && n.push(`fill(${y})`), _ && n.push("grayscale()"), L && [0, 90, 180, 270].includes(e.filters.rotate || 0) && n.push(`rotate(${L})`), R && ["webp", "png", "jpeg"].includes(R) && n.push(`format(${R})`);
20
20
  }
21
21
  e.srcset && (r.srcset = e.srcset.map((i) => {
22
22
  if (typeof i == "number")
@@ -36,8 +36,8 @@ function be(s, e) {
36
36
  attrs: r
37
37
  };
38
38
  }
39
- var g = /* @__PURE__ */ ((s) => (s.DOCUMENT = "doc", s.HEADING = "heading", s.PARAGRAPH = "paragraph", s.QUOTE = "blockquote", s.OL_LIST = "ordered_list", s.UL_LIST = "bullet_list", s.LIST_ITEM = "list_item", s.CODE_BLOCK = "code_block", s.HR = "horizontal_rule", s.BR = "hard_break", s.IMAGE = "image", s.EMOJI = "emoji", s.COMPONENT = "blok", s.TABLE = "table", s.TABLE_ROW = "tableRow", s.TABLE_CELL = "tableCell", s.TABLE_HEADER = "tableHeader", s))(g || {}), $ = /* @__PURE__ */ ((s) => (s.BOLD = "bold", s.STRONG = "strong", s.STRIKE = "strike", s.UNDERLINE = "underline", s.ITALIC = "italic", s.CODE = "code", s.LINK = "link", s.ANCHOR = "anchor", s.STYLED = "styled", s.SUPERSCRIPT = "superscript", s.SUBSCRIPT = "subscript", s.TEXT_STYLE = "textStyle", s.HIGHLIGHT = "highlight", s))($ || {}), Q = /* @__PURE__ */ ((s) => (s.TEXT = "text", s))(Q || {}), S = /* @__PURE__ */ ((s) => (s.URL = "url", s.STORY = "story", s.ASSET = "asset", s.EMAIL = "email", s))(S || {});
40
- const ge = [
39
+ var g = /* @__PURE__ */ ((s) => (s.DOCUMENT = "doc", s.HEADING = "heading", s.PARAGRAPH = "paragraph", s.QUOTE = "blockquote", s.OL_LIST = "ordered_list", s.UL_LIST = "bullet_list", s.LIST_ITEM = "list_item", s.CODE_BLOCK = "code_block", s.HR = "horizontal_rule", s.BR = "hard_break", s.IMAGE = "image", s.EMOJI = "emoji", s.COMPONENT = "blok", s.TABLE = "table", s.TABLE_ROW = "tableRow", s.TABLE_CELL = "tableCell", s.TABLE_HEADER = "tableHeader", s))(g || {}), $ = /* @__PURE__ */ ((s) => (s.BOLD = "bold", s.STRONG = "strong", s.STRIKE = "strike", s.UNDERLINE = "underline", s.ITALIC = "italic", s.CODE = "code", s.LINK = "link", s.ANCHOR = "anchor", s.STYLED = "styled", s.SUPERSCRIPT = "superscript", s.SUBSCRIPT = "subscript", s.TEXT_STYLE = "textStyle", s.HIGHLIGHT = "highlight", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.TEXT = "text", s))(Z || {}), S = /* @__PURE__ */ ((s) => (s.URL = "url", s.STORY = "story", s.ASSET = "asset", s.EMAIL = "email", s))(S || {});
40
+ const ve = [
41
41
  "area",
42
42
  "base",
43
43
  "br",
@@ -52,23 +52,23 @@ const ge = [
52
52
  "source",
53
53
  "track",
54
54
  "wbr"
55
- ], ve = (s = {}) => Object.keys(s).map((e) => `${e}="${s[e]}"`).join(" "), ke = (s = {}) => Object.keys(s).map((e) => `${e}: ${s[e]}`).join("; ");
56
- function we(s) {
55
+ ], ke = (s = {}) => Object.keys(s).map((e) => `${e}="${s[e]}"`).join(" "), we = (s = {}) => Object.keys(s).map((e) => `${e}: ${s[e]}`).join("; ");
56
+ function _e(s) {
57
57
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
58
58
  }
59
59
  const O = (s) => Object.fromEntries(Object.entries(s).filter(([e, t]) => t !== void 0));
60
60
  function F(s, e = {}, t) {
61
- const o = ve(e), r = o ? `${s} ${o}` : s, n = Array.isArray(t) ? t.join("") : t || "";
61
+ const o = ke(e), r = o ? `${s} ${o}` : s, n = Array.isArray(t) ? t.join("") : t || "";
62
62
  if (s) {
63
- if (ge.includes(s))
63
+ if (ve.includes(s))
64
64
  return `<${r}>`;
65
65
  } else return n;
66
66
  return `<${r}>${n}</${s}>`;
67
67
  }
68
- function Z(s = {}) {
68
+ function ee(s = {}) {
69
69
  const e = /* @__PURE__ */ new Map(), {
70
70
  renderFn: t = F,
71
- textFn: o = we,
71
+ textFn: o = _e,
72
72
  resolvers: r = {},
73
73
  optimizeImages: n = !1,
74
74
  keyedResolvers: a = !1
@@ -77,20 +77,20 @@ function Z(s = {}) {
77
77
  return d.render(l, p, h.children || null);
78
78
  }, u = (l, h) => {
79
79
  const { src: d, alt: p, title: b, srcset: w, sizes: v } = l.attrs || {};
80
- let k = d, _ = {};
80
+ let k = d, T = {};
81
81
  if (n) {
82
- const { src: ce, attrs: ue } = be(d, n);
83
- k = ce, _ = ue;
82
+ const { src: ue, attrs: he } = ge(d, n);
83
+ k = ue, T = he;
84
84
  }
85
- const le = {
85
+ const ce = {
86
86
  src: k,
87
87
  alt: p,
88
88
  title: b,
89
89
  srcset: w,
90
90
  sizes: v,
91
- ..._
91
+ ...T
92
92
  };
93
- return h.render("img", O(le));
93
+ return h.render("img", O(ce));
94
94
  }, f = (l, h) => {
95
95
  const { level: d, ...p } = l.attrs || {};
96
96
  return h.render(`h${d}`, p, l.children);
@@ -112,20 +112,20 @@ function Z(s = {}) {
112
112
  "pre",
113
113
  l.attrs || {},
114
114
  h.render("code", {}, l.children || "")
115
- ), T = (l, h = !1) => ({ text: d, attrs: p }, b) => {
116
- const { class: w, id: v, ...k } = p || {}, _ = h ? {
115
+ ), _ = (l, h = !1) => ({ text: d, attrs: p }, b) => {
116
+ const { class: w, id: v, ...k } = p || {}, T = h ? {
117
117
  class: w,
118
118
  id: v,
119
- style: ke(k) || void 0
119
+ style: we(k) || void 0
120
120
  } : p || {};
121
- return b.render(l, O(_), d);
122
- }, E = (l) => P(l), L = (l) => {
121
+ return b.render(l, O(T), d);
122
+ }, A = (l) => x(l), L = (l) => {
123
123
  const { marks: h, ...d } = l;
124
124
  if ("text" in l) {
125
125
  if (h)
126
126
  return h.reduce(
127
- (b, w) => E({ ...w, text: b }),
128
- E({ ...d, children: d.children })
127
+ (b, w) => A({ ...w, text: b }),
128
+ A({ ...d, children: d.children })
129
129
  );
130
130
  const p = l.attrs || {};
131
131
  if (a) {
@@ -135,7 +135,7 @@ function Z(s = {}) {
135
135
  return o(d.text, p);
136
136
  }
137
137
  return "";
138
- }, U = (l, h) => {
138
+ }, D = (l, h) => {
139
139
  const { linktype: d, href: p, anchor: b, ...w } = l.attrs || {};
140
140
  let v = "";
141
141
  switch (d) {
@@ -155,33 +155,33 @@ function Z(s = {}) {
155
155
  }
156
156
  const k = { ...w };
157
157
  return v && (k.href = v), h.render("a", k, l.text);
158
- }, se = (l, h) => {
158
+ }, re = (l, h) => {
159
159
  var d, p;
160
160
  return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"), h.render("span", {
161
161
  blok: (d = l == null ? void 0 : l.attrs) == null ? void 0 : d.body[0],
162
162
  id: (p = l.attrs) == null ? void 0 : p.id,
163
163
  style: "display: none"
164
164
  });
165
- }, re = (l, h) => {
165
+ }, oe = (l, h) => {
166
166
  const d = {}, p = h.render("tbody", {}, l.children);
167
167
  return h.render("table", d, p);
168
- }, oe = (l, h) => {
168
+ }, ne = (l, h) => {
169
169
  const d = {};
170
170
  return h.render("tr", d, l.children);
171
- }, ne = (l, h) => {
171
+ }, ie = (l, h) => {
172
172
  const { colspan: d, rowspan: p, colwidth: b, backgroundColor: w, ...v } = l.attrs || {}, k = {
173
173
  ...v
174
174
  };
175
175
  d > 1 && (k.colspan = d), p > 1 && (k.rowspan = p);
176
- const _ = [];
177
- return b && _.push(`width: ${b}px;`), w && _.push(`background-color: ${w};`), _.length > 0 && (k.style = _.join(" ")), h.render("td", O(k), l.children);
178
- }, ie = (l, h) => {
176
+ const T = [];
177
+ return b && T.push(`width: ${b}px;`), w && T.push(`background-color: ${w};`), T.length > 0 && (k.style = T.join(" ")), h.render("td", O(k), l.children);
178
+ }, ae = (l, h) => {
179
179
  const { colspan: d, rowspan: p, colwidth: b, backgroundColor: w, ...v } = l.attrs || {}, k = {
180
180
  ...v
181
181
  };
182
182
  d > 1 && (k.colspan = d), p > 1 && (k.rowspan = p);
183
- const _ = [];
184
- return b && _.push(`width: ${b}px;`), w && _.push(`background-color: ${w};`), _.length > 0 && (k.style = _.join(" ")), h.render("th", O(k), l.children);
183
+ const T = [];
184
+ return b && T.push(`width: ${b}px;`), w && T.push(`background-color: ${w};`), T.length > 0 && (k.style = T.join(" ")), h.render("th", O(k), l.children);
185
185
  }, B = /* @__PURE__ */ new Map([
186
186
  [g.DOCUMENT, i("")],
187
187
  [g.HEADING, f],
@@ -195,28 +195,28 @@ function Z(s = {}) {
195
195
  [g.HR, i("hr")],
196
196
  [g.BR, i("br")],
197
197
  [g.QUOTE, i("blockquote")],
198
- [g.COMPONENT, se],
199
- [Q.TEXT, L],
200
- [$.LINK, U],
201
- [$.ANCHOR, U],
202
- [$.STYLED, T("span", !0)],
203
- [$.BOLD, T("strong")],
204
- [$.TEXT_STYLE, T("span", !0)],
205
- [$.ITALIC, T("em")],
206
- [$.UNDERLINE, T("u")],
207
- [$.STRIKE, T("s")],
208
- [$.CODE, T("code")],
209
- [$.SUPERSCRIPT, T("sup")],
210
- [$.SUBSCRIPT, T("sub")],
211
- [$.HIGHLIGHT, T("mark")],
212
- [g.TABLE, re],
213
- [g.TABLE_ROW, oe],
214
- [g.TABLE_CELL, ne],
215
- [g.TABLE_HEADER, ie]
198
+ [g.COMPONENT, re],
199
+ [Z.TEXT, L],
200
+ [$.LINK, D],
201
+ [$.ANCHOR, D],
202
+ [$.STYLED, _("span", !0)],
203
+ [$.BOLD, _("strong")],
204
+ [$.TEXT_STYLE, _("span", !0)],
205
+ [$.ITALIC, _("em")],
206
+ [$.UNDERLINE, _("u")],
207
+ [$.STRIKE, _("s")],
208
+ [$.CODE, _("code")],
209
+ [$.SUPERSCRIPT, _("sup")],
210
+ [$.SUBSCRIPT, _("sub")],
211
+ [$.HIGHLIGHT, _("mark")],
212
+ [g.TABLE, oe],
213
+ [g.TABLE_ROW, ne],
214
+ [g.TABLE_CELL, ie],
215
+ [g.TABLE_HEADER, ae]
216
216
  ]), M = new Map([
217
217
  ...B,
218
218
  ...Object.entries(r).map(([l, h]) => [l, h])
219
- ]), ae = () => ({
219
+ ]), le = () => ({
220
220
  render: (l, h = {}, d) => {
221
221
  if (a && l) {
222
222
  const p = e.get(l) || 0;
@@ -231,20 +231,20 @@ function Z(s = {}) {
231
231
  const h = M.get(l.type);
232
232
  if (!h)
233
233
  return console.error("<Storyblok>", `No resolver found for node type ${l.type}`), "";
234
- const d = ae();
234
+ const d = le();
235
235
  if (l.type === "text")
236
236
  return h(l, d);
237
- const p = l.content ? l.content.map(P) : void 0;
237
+ const p = l.content ? l.content.map(x) : void 0;
238
238
  return h({
239
239
  ...l,
240
240
  children: p
241
241
  }, d);
242
242
  }
243
- function P(l) {
243
+ function x(l) {
244
244
  return l.type === "doc" ? c ? l.content.map(C) : l.content.map(C).join("") : Array.isArray(l) ? l.map(C) : C(l);
245
245
  }
246
246
  return {
247
- render: P
247
+ render: x
248
248
  };
249
249
  }
250
250
  let V = !1;
@@ -254,7 +254,7 @@ const z = [], Te = (s) => new Promise((e, t) => {
254
254
  return;
255
255
  }
256
256
  if (window.storyblokRegisterEvent = (r) => {
257
- if (window.location === window.parent.location) {
257
+ if (!window.location.search.includes("_storyblok")) {
258
258
  console.warn("You are not in Draft Mode or in the Visual Editor.");
259
259
  return;
260
260
  }
@@ -268,8 +268,8 @@ const z = [], Te = (s) => new Promise((e, t) => {
268
268
  z.forEach((n) => n()), V = !0, e(r);
269
269
  }, document.getElementsByTagName("head")[0].appendChild(o);
270
270
  });
271
- var _e = Object.defineProperty, Re = (s, e, t) => e in s ? _e(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e, t) => Re(s, typeof e != "symbol" ? e + "" : e, t);
272
- class $e extends Error {
271
+ var Re = Object.defineProperty, $e = (s, e, t) => e in s ? Re(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e, t) => $e(s, typeof e != "symbol" ? e + "" : e, t);
272
+ class Ee extends Error {
273
273
  constructor(e) {
274
274
  super(e), this.name = "AbortError";
275
275
  }
@@ -308,18 +308,18 @@ function Ae(s, e, t) {
308
308
  });
309
309
  return i.abort = () => {
310
310
  a = !0, r.forEach(clearTimeout), r = [], o.forEach(
311
- (u) => u.reject(() => new $e("Throttle function aborted"))
311
+ (u) => u.reject(() => new Ee("Throttle function aborted"))
312
312
  ), o.length = 0;
313
313
  }, i;
314
314
  }
315
- const Ee = (s = "") => s.includes("/cdn/"), Se = (s, e = 25, t = 1) => ({
315
+ const G = (s = "") => s.includes("/cdn/"), Se = (s, e = 25, t = 1) => ({
316
316
  ...s,
317
317
  per_page: e,
318
318
  page: t
319
319
  }), Ie = (s) => new Promise((e) => setTimeout(e, s)), Le = (s = 0, e) => Array.from({ length: s }, e), Ce = (s = 0, e = s) => {
320
320
  const t = Math.abs(e - s) || 0, o = s < e ? 1 : -1;
321
321
  return Le(t, (r, n) => n * o + s);
322
- }, Oe = async (s, e) => Promise.all(s.map(e)), je = (s = [], e) => s.map(e).reduce((t, o) => [...t, ...o], []), D = (s, e, t) => {
322
+ }, Oe = async (s, e) => Promise.all(s.map(e)), je = (s = [], e) => s.map(e).reduce((t, o) => [...t, ...o], []), U = (s, e, t) => {
323
323
  const o = [];
324
324
  for (const r in s) {
325
325
  if (!Object.prototype.hasOwnProperty.call(s, r))
@@ -329,14 +329,14 @@ const Ee = (s = "") => s.includes("/cdn/"), Se = (s, e = 25, t = 1) => ({
329
329
  continue;
330
330
  const a = t ? "" : encodeURIComponent(r);
331
331
  let c;
332
- typeof n == "object" ? c = D(
332
+ typeof n == "object" ? c = U(
333
333
  n,
334
334
  e ? e + encodeURIComponent(`[${a}]`) : a,
335
335
  Array.isArray(n)
336
336
  ) : c = `${e ? e + encodeURIComponent(`[${a}]`) : a}=${encodeURIComponent(n)}`, o.push(c);
337
337
  }
338
338
  return o.join("&");
339
- }, G = (s) => {
339
+ }, q = (s) => {
340
340
  const e = {
341
341
  eu: "api.storyblok.com",
342
342
  us: "api-us.storyblok.com",
@@ -346,7 +346,7 @@ const Ee = (s = "") => s.includes("/cdn/"), Se = (s, e = 25, t = 1) => ({
346
346
  };
347
347
  return e[s] ?? e.eu;
348
348
  };
349
- class xe {
349
+ class Pe {
350
350
  constructor(e) {
351
351
  m(this, "baseURL"), m(this, "timeout"), m(this, "headers"), m(this, "responseInterceptor"), m(this, "fetch"), m(this, "ejectInterceptor"), m(this, "url"), m(this, "parameters"), m(this, "fetchOptions"), this.baseURL = e.baseURL, this.headers = e.headers || new Headers(), this.timeout = e != null && e.timeout ? e.timeout * 1e3 : 0, this.responseInterceptor = e.responseInterceptor, this.fetch = (...t) => e.fetch ? e.fetch(...t) : fetch(...t), this.ejectInterceptor = !1, this.url = "", this.parameters = {}, this.fetchOptions = {};
352
352
  }
@@ -384,7 +384,7 @@ class xe {
384
384
  }
385
385
  async _methodHandler(e) {
386
386
  let t = `${this.baseURL}${this.url}`, o = null;
387
- e === "get" ? t = `${this.baseURL}${this.url}?${D(this.parameters)}` : o = JSON.stringify(this.parameters);
387
+ e === "get" ? t = `${this.baseURL}${this.url}?${U(this.parameters)}` : o = JSON.stringify(this.parameters);
388
388
  const r = new URL(t), n = new AbortController(), { signal: a } = n;
389
389
  let c;
390
390
  this.timeout && (c = setTimeout(() => n.abort(), this.timeout));
@@ -449,15 +449,15 @@ class xe {
449
449
  });
450
450
  }
451
451
  }
452
- const q = "SB-Agent", H = {
452
+ const J = "SB-Agent", H = {
453
453
  defaultAgentName: "SB-JS-CLIENT",
454
454
  defaultAgentVersion: "SB-Agent-Version",
455
- packageVersion: "6.0.0"
456
- }, Pe = {
457
- DRAFT: "draft"
455
+ packageVersion: "7.0.0"
456
+ }, xe = {
457
+ PUBLISHED: "published"
458
458
  };
459
459
  let j = {};
460
- const A = {};
460
+ const E = {};
461
461
  class Ne {
462
462
  /**
463
463
  *
@@ -469,12 +469,12 @@ class Ne {
469
469
  let o = e.endpoint || t;
470
470
  if (!o) {
471
471
  const a = e.https === !1 ? "http" : "https";
472
- e.oauthToken ? o = `${a}://${G(e.region)}/v1` : o = `${a}://${G(e.region)}/v2`;
472
+ e.oauthToken ? o = `${a}://${q(e.region)}/v1` : o = `${a}://${q(e.region)}/v2`;
473
473
  }
474
474
  const r = new Headers();
475
475
  r.set("Content-Type", "application/json"), r.set("Accept", "application/json"), e.headers && (e.headers.constructor.name === "Headers" ? e.headers.entries().toArray() : Object.entries(e.headers)).forEach(([a, c]) => {
476
476
  r.set(a, c);
477
- }), r.has(q) || (r.set(q, H.defaultAgentName), r.set(
477
+ }), r.has(J) || (r.set(J, H.defaultAgentName), r.set(
478
478
  H.defaultAgentVersion,
479
479
  H.packageVersion
480
480
  ));
@@ -483,7 +483,7 @@ class Ne {
483
483
  this.throttledRequest.bind(this),
484
484
  n,
485
485
  1e3
486
- ), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.stringifiedStoriesCache = {}, this.version = e.version || Pe.DRAFT, this.inlineAssets = e.inlineAssets || !1, this.client = new xe({
486
+ ), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.stringifiedStoriesCache = {}, this.version = e.version || xe.PUBLISHED, this.inlineAssets = e.inlineAssets || !1, this.client = new Pe({
487
487
  baseURL: o,
488
488
  timeout: e.timeout || 0,
489
489
  headers: r,
@@ -492,10 +492,10 @@ class Ne {
492
492
  });
493
493
  }
494
494
  parseParams(e) {
495
- return e.token || (e.token = this.getToken()), e.cv || (e.cv = A[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), typeof e.resolve_relations < "u" && (e.resolve_level = 2), e;
495
+ return e.token || (e.token = this.getToken()), e.cv || (e.cv = E[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), typeof e.resolve_relations < "u" && (e.resolve_level = 2), e;
496
496
  }
497
497
  factoryParamOptions(e, t) {
498
- return Ee(e) ? this.parseParams(t) : t;
498
+ return G(e) ? this.parseParams(t) : t;
499
499
  }
500
500
  makeRequest(e, t, o, r, n) {
501
501
  const a = this.factoryParamOptions(
@@ -507,7 +507,7 @@ class Ne {
507
507
  get(e, t = {}, o) {
508
508
  t || (t = {});
509
509
  const r = `/${e}`;
510
- t.version = t.version || this.version;
510
+ G(r) && (t.version = t.version || this.version);
511
511
  const n = this.factoryParamOptions(r, t);
512
512
  return this.cacheResponse(r, n, void 0, o);
513
513
  }
@@ -713,7 +713,7 @@ class Ne {
713
713
  }), this.stringifiedStoriesCache = {}, delete this.links[o], delete this.relations[o];
714
714
  }
715
715
  async cacheResponse(e, t, o, r) {
716
- const n = D({ url: e, params: t }), a = this.cacheProvider();
716
+ const n = U({ url: e, params: t }), a = this.cacheProvider();
717
717
  if (t.version === "published" && e !== "/cdn/spaces/me") {
718
718
  const c = await a.get(n);
719
719
  if (c)
@@ -735,12 +735,12 @@ class Ne {
735
735
  perPage: f.headers["per-page"] ? Number.parseInt(f.headers["per-page"]) : 0,
736
736
  total: f.headers["per-page"] ? Number.parseInt(f.headers.total) : 0
737
737
  })), y.data.story || y.data.stories) {
738
- const T = this.resolveCounter = ++this.resolveCounter % 1e3;
739
- await this.resolveStories(y.data, t, `${T}`), y = await this.processInlineAssets(y);
738
+ const _ = this.resolveCounter = ++this.resolveCounter % 1e3;
739
+ await this.resolveStories(y.data, t, `${_}`), y = await this.processInlineAssets(y);
740
740
  }
741
741
  t.version === "published" && e !== "/cdn/spaces/me" && await a.set(n, y);
742
742
  const R = this.cache.clear === "onpreview" && t.version === "draft" || this.cache.clear === "auto";
743
- return t.token && y.data.cv && (R && A[t.token] && A[t.token] !== y.data.cv && await this.flushCache(), A[t.token] = y.data.cv), c(y);
743
+ return t.token && y.data.cv && (R && E[t.token] && E[t.token] !== y.data.cv && await this.flushCache(), E[t.token] = y.data.cv), c(y);
744
744
  } catch (f) {
745
745
  if (f.response && f.status === 429 && (o = typeof o > "u" ? 0 : o + 1, o < this.maxRetries))
746
746
  return console.log(
@@ -754,16 +754,16 @@ class Ne {
754
754
  return this.client.setFetchOptions(r), this.client[e](t, o);
755
755
  }
756
756
  cacheVersions() {
757
- return A;
757
+ return E;
758
758
  }
759
759
  cacheVersion() {
760
- return A[this.accessToken];
760
+ return E[this.accessToken];
761
761
  }
762
762
  setCacheVersion(e) {
763
- this.accessToken && (A[this.accessToken] = e);
763
+ this.accessToken && (E[this.accessToken] = e);
764
764
  }
765
765
  clearCacheVersion() {
766
- this.accessToken && (A[this.accessToken] = 0);
766
+ this.accessToken && (E[this.accessToken] = 0);
767
767
  }
768
768
  cacheProvider() {
769
769
  switch (this.cache.type) {
@@ -850,8 +850,8 @@ const Ge = (s = {}) => {
850
850
  return {};
851
851
  }
852
852
  };
853
- let J = "https://app.storyblok.com/f/storyblok-v2-latest.js";
854
- const De = (s, e, t = {}) => {
853
+ let K = "https://app.storyblok.com/f/storyblok-v2-latest.js";
854
+ const Ue = (s, e, t = {}) => {
855
855
  var o;
856
856
  const r = !(typeof window > "u") && typeof window.storyblokRegisterEvent < "u", n = new URL((o = window.location) == null ? void 0 : o.href).searchParams.get(
857
857
  "_storyblok"
@@ -868,7 +868,7 @@ const De = (s, e, t = {}) => {
868
868
  });
869
869
  });
870
870
  }
871
- }, Ue = (s = {}) => {
871
+ }, De = (s = {}) => {
872
872
  var e, t;
873
873
  const {
874
874
  bridge: o,
@@ -882,37 +882,37 @@ const De = (s, e, t = {}) => {
882
882
  let u = {};
883
883
  n.forEach((y) => {
884
884
  u = { ...u, ...y(i) };
885
- }), c && (J = c);
885
+ }), c && (K = c);
886
886
  const f = !(typeof window > "u") && ((t = (e = window.location) == null ? void 0 : e.search) == null ? void 0 : t.includes("_storyblok_tk"));
887
- return o !== !1 && f && Te(J), u;
887
+ return o !== !1 && f && Te(K), u;
888
888
  };
889
889
  function qe(s, e) {
890
- return Z(e).render(s);
890
+ return ee(e).render(s);
891
891
  }
892
- const ee = /* @__PURE__ */ K({
892
+ const te = /* @__PURE__ */ Y({
893
893
  __name: "StoryblokComponent",
894
894
  props: {
895
895
  blok: {}
896
896
  },
897
897
  setup(s, { expose: e }) {
898
- const t = s, o = x();
898
+ const t = s, o = P();
899
899
  e({
900
900
  value: o
901
901
  });
902
- const r = typeof N(t.blok.component) != "string", n = he("VueSDKOptions"), a = x(t.blok.component);
902
+ const r = typeof N(t.blok.component) != "string", n = de("VueSDKOptions"), a = P(t.blok.component);
903
903
  return !r && n && (n.enableFallbackComponent ? (a.value = n.customFallbackComponent ?? "FallbackComponent", typeof N(a.value) == "string" && console.error(
904
904
  `Is the Fallback component "${a.value}" registered properly?`
905
905
  )) : console.error(
906
906
  `Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`
907
- )), (c, i) => (W(), Y(N(a.value), de({
907
+ )), (c, i) => (X(), W(N(a.value), pe({
908
908
  ref_key: "blokRef",
909
909
  ref: o
910
910
  }, { ...c.$props, ...c.$attrs }), null, 16));
911
911
  }
912
912
  }), Be = (s) => {
913
913
  var e, t;
914
- return X(
915
- ee,
914
+ return Q(
915
+ te,
916
916
  {
917
917
  blok: (e = s == null ? void 0 : s.attrs) == null ? void 0 : e.body[0],
918
918
  id: (t = s.attrs) == null ? void 0 : t.id
@@ -922,27 +922,27 @@ const ee = /* @__PURE__ */ K({
922
922
  };
923
923
  function Me(s) {
924
924
  const e = {
925
- renderFn: X,
925
+ renderFn: Q,
926
926
  // TODO: Check why this changed.
927
927
  // @ts-expect-error - createTextVNode types has been recently changed.
928
- textFn: pe,
928
+ textFn: fe,
929
929
  keyedResolvers: !0,
930
930
  resolvers: {
931
931
  [g.COMPONENT]: Be,
932
932
  ...s.resolvers
933
933
  }
934
934
  };
935
- return Z(e);
935
+ return ee(e);
936
936
  }
937
- const Fe = /* @__PURE__ */ K({
937
+ const Fe = /* @__PURE__ */ Y({
938
938
  __name: "StoryblokRichText",
939
939
  props: {
940
940
  doc: {},
941
941
  resolvers: {}
942
942
  },
943
943
  setup(s) {
944
- const e = s, t = x(), o = () => t.value;
945
- return fe([() => e.doc, () => e.resolvers], ([r, n]) => {
944
+ const e = s, t = P(), o = () => t.value;
945
+ return ye([() => e.doc, () => e.resolvers], ([r, n]) => {
946
946
  const { render: a } = Me({
947
947
  resolvers: n ?? {}
948
948
  });
@@ -950,7 +950,7 @@ const Fe = /* @__PURE__ */ K({
950
950
  }, {
951
951
  immediate: !0,
952
952
  deep: !0
953
- }), (r, n) => (W(), Y(o));
953
+ }), (r, n) => (X(), W(o));
954
954
  }
955
955
  }), Ve = {
956
956
  beforeMount(s, e) {
@@ -959,15 +959,15 @@ const Fe = /* @__PURE__ */ K({
959
959
  Object.keys(t).length > 0 && (s.setAttribute("data-blok-c", t["data-blok-c"]), s.setAttribute("data-blok-uid", t["data-blok-uid"]), s.classList.add("storyblok__outline"));
960
960
  }
961
961
  }
962
- }, te = (s) => {
962
+ }, se = (s) => {
963
963
  console.error(`You can't use ${s} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
964
964
  `);
965
965
  };
966
966
  let I = null;
967
- const Je = () => (I || te("useStoryblokApi"), I), Ke = async (s, e = {}, t = {}) => {
968
- const o = x(null);
969
- if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links, ye(() => {
970
- o.value && o.value.id && De(
967
+ const Je = () => (I || se("useStoryblokApi"), I), Ke = async (s, e = {}, t = {}) => {
968
+ const o = P(null);
969
+ if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links, me(() => {
970
+ o.value && o.value.id && Ue(
971
971
  o.value.id,
972
972
  (r) => o.value = r,
973
973
  t
@@ -979,30 +979,30 @@ const Je = () => (I || te("useStoryblokApi"), I), Ke = async (s, e = {}, t = {})
979
979
  );
980
980
  o.value = r.story;
981
981
  } else
982
- te("useStoryblok");
982
+ se("useStoryblok");
983
983
  return o;
984
984
  }, Ye = {
985
985
  install(s, e = {}) {
986
- s.directive("editable", Ve), s.component("StoryblokComponent", ee), s.component("StoryblokRichText", Fe), e.enableFallbackComponent && !e.customFallbackComponent && s.component(
986
+ s.directive("editable", Ve), s.component("StoryblokComponent", te), s.component("StoryblokRichText", Fe), e.enableFallbackComponent && !e.customFallbackComponent && s.component(
987
987
  "FallbackComponent",
988
- me(() => import("./FallbackComponent-Dky11gEu.js"))
988
+ be(() => import("./FallbackComponent-Dky11gEu.js"))
989
989
  );
990
- const { storyblokApi: t } = Ue(e);
990
+ const { storyblokApi: t } = De(e);
991
991
  I = t || null, s.provide("VueSDKOptions", e);
992
992
  }
993
993
  };
994
994
  export {
995
995
  g as BlockTypes,
996
996
  $ as MarkTypes,
997
- ee as StoryblokComponent,
997
+ te as StoryblokComponent,
998
998
  Fe as StoryblokRichText,
999
999
  Ye as StoryblokVue,
1000
- Q as TextTypes,
1000
+ Z as TextTypes,
1001
1001
  Ge as apiPlugin,
1002
1002
  qe as renderRichText,
1003
- Z as richTextResolver,
1003
+ ee as richTextResolver,
1004
1004
  Ke as useStoryblok,
1005
1005
  Je as useStoryblokApi,
1006
- De as useStoryblokBridge,
1006
+ Ue as useStoryblokBridge,
1007
1007
  Me as useStoryblokRichText
1008
1008
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storyblok/vue",
3
3
  "type": "module",
4
- "version": "9.1.0",
4
+ "version": "9.1.2",
5
5
  "description": "SDK to integrate Storyblok into your project using Vue.",
6
6
  "author": "Storyblok",
7
7
  "license": "MIT",
@@ -31,11 +31,10 @@
31
31
  "vue": ">=3.4"
32
32
  },
33
33
  "dependencies": {
34
- "@storyblok/js": "4.1.0"
34
+ "@storyblok/js": "4.1.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rollup/plugin-typescript": "^12.1.2",
38
- "@storyblok/eslint-config": "^0.3.0",
39
38
  "@types/node": "^22.15.18",
40
39
  "@typescript-eslint/parser": "^8.23.0",
41
40
  "@vitejs/plugin-vue": "^5.2.1",
@@ -51,7 +50,8 @@
51
50
  "vitest": "^3.1.3",
52
51
  "vue": "^3.5.13",
53
52
  "vue-router": "^4.5.0",
54
- "vue-tsc": "^2.2.0"
53
+ "vue-tsc": "^2.2.0",
54
+ "@storyblok/eslint-config": "0.3.0"
55
55
  },
56
56
  "release": {
57
57
  "branches": [