PageSourceSearch

https://explore.aircorsica.com/_nuxt/usePayloadLivePreview.BKjrj_6l.js

js aircorsica.com collected 2026-09-24 21:41:35 UTC 4,412 bytes, 1 lines download raw bytes

1import{x as T,K as R,X as N,M as U}from"./entry.CTpwKgbi.js";function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D=function(r){return L(r)&&!_(r)};function L(e){return!!e&&typeof e=="object"}function _(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||I(e)}var K=typeof Symbol=="function"&&Symbol.for,B=K?Symbol.for("react.element"):60103;function I(e){return e.$$typeof===B}function F(e){return Array.isArray(e)?[]:{}}function y(e,r){return r.clone!==!1&&r.isMergeableObject(e)?s(F(e),e,r):e}function J(e,r,t){return e.concat(r).map(function(a){return y(a,t)})}function V(e,r){if(!r.customMerge)return s;var t=r.customMerge(e);return typeof t=="function"?t:s}function z(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function m(e){return Object.keys(e).concat(z(e))}function M(e,r){try{return r in e}catch{return!1}}function W(e,r){return M(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function X(e,r,t){var a={};return t.isMergeableObject(e)&&m(e).forEach(function(n){a[n]=y(e[n],t)}),m(r).forEach(function(n){W(e,n)||(M(e,n)&&t.isMergeableObject(r[n])?a[n]=V(n,t)(e[n],r[n],t):a[n]=y(r[n],t))}),a}function s(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||J,t.isMergeableObject=t.isMergeableObject||D,t.cloneUnlessOtherwiseSpecified=y;var a=Array.isArray(r),n=Array.isArray(e),c=a===n;return c?a?t.arrayMerge(e,r,t):X(e,r,t):y(r,t)}s.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(a,n){return s(a,n,t)},{})};var Y=s,q=Y;const j=C(q);function re(e,r={immediate:!1}){const t=T(!1);function a(){{const{serverURL:o}=e,l=(window==null?void 0:window.opener)||(window==null?void 0:window.parent);window!==l&&(l==null||l.postMessage({ready:!0,type:"payload-live-preview"},o),t.value=!0)}}function n(){window.addEventListener("message",i)}function c(){window.removeEventListener("message",i)}async function i(o){const{serverURL:l,apiKey:p,fields:d,depth:P=3,callback:$}=e,O=U(e.initialData)?e.initialData.value:e.initialData;if(t.value&&o.origin===l&&o.data&&typeof o.data=="object"&&o.data.type==="payload-live-preview"){const{data:u}=o.data;if(d&&d.length>0)for(let b of d){const h=E(u,b),g=Z(O,u,h);if(g.length>0){for(let w of g)try{const f=G(w);if(f!=null&&f.collection&&(f!=null&&f.id)){const v=await(await fetch(`${l}/api/${f.collection}/${f.id}?depth=${P}`,{headers:{"Content-Type":"application/json",authorization:`users API-Key ${p}`}})).json();v&&(w.value=v)}}catch(f){console.log(f)}x(u,g)}}const S=j(O,u,{arrayMerge:(b,h)=>A(b,h,["id","text"])});$(S,u)}}return r!=null&&r.immediate&&(R(()=>{n(),a()}),N(()=>{c()})),{ready:a,subscribe:n,unsubscribe:c}}function E(e,r,t=""){let a=[];for(const n in e)if(e.hasOwnProperty(n)){const c=Array.isArray(e)?`${t}[${n}]`:`${t}${t?".":""}${n}`;n===r&&a.push({path:c,value:e[n]}),typeof e[n]=="object"&&e[n]!==null&&(a=a.concat(E(e[n],r,c)))}return a}function G(e){if(typeof e.value=="object"&&e.value!==null)return{id:e.value.value,collection:e.value.relationTo};const r=e.path.match(/\.?(\w+)(?:\[\d+\])?$/);let t=r?r[1]:"";return t&&t!=="media"&&(t+="s"),{id:e.value,collection:t}}function H(e,r){const t=r.split(/\.|\[|\]\.?/).filter(n=>n);let a=e;for(const n of t){if(a[n]===void 0)return;a=a[n]}return a}function Q(e,r,t){const a=r.split(/\.|\[|\]\.?/).filter(c=>c);let n=e;for(let c=0;c<a.length;c++){const i=a[c];if(c===a.length-1){n[i]=t;return}(typeof n[i]!="object"||n[i]===null)&&(n[i]=/^\d+$/.test(a[c+1])?[]:{}),n=n[i]}}function Z(e,r,t){const a=[];for(let n=0;n<t.length;n++){const c=H(e,t[n].path);JSON.stringify(c==null?void 0:c.id)===JSON.stringify(t[n].value)?Q(r,t[n].path,c):a.push(t[n])}return a}function x(e,r){return r.forEach(t=>{const a=t.path.split(/\.|\[|\]\.?/).filter(c=>c),n=(c,i)=>{const o=a[i];if(i===a.length-1){c[o]=t.value;return}isNaN(a[i+1])?c[o]=c[o]||{}:c[o]=c[o]||[],n(c[o],i+1)};n(e,0)}),e}function A(e,r,t){const a=[],n=new Map,c=(i,o)=>{for(const l of o)if(i.hasOwnProperty(l))return l;return null};return e.forEach(i=>
1{if(i&&typeof i=="object"){const o=c(i,t);o&&n.set(i[o],i)}}),r.forEach(i=>{if(i&&typeof i=="object"){const o=c(i,t);o&&n.has(i[o])?a.push(j(n.get(i[o]),i,{arrayMerge:(l,p)=>A(l,p,t)})):a.push(i)}}),a}export{re as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.