PageSourceSearch

https://www.portorocha.com/_nuxt/DvfuQnuM.js

js portorocha.com collected 2026-10-03 21:02:47 UTC 16,525 bytes, 39 lines download raw bytes

1import{R as B,r as x,o as V,f as G,S as g,C as J,n as Y,l as $,x as j,h as X,i as Q,N as W}from"./CV5amACt.js";import{g as K}from"./CqkleIqs.js";import{c as k}from"./DpnH6O_e.js";const E=(s,e=16)=>{let t=0,i=null;return function(...r){const n=Date.now(),o=n-t;o>=e?(s.apply(this,r),t=n):(i&&clearTimeout(i),i=setTimeout(()=>{s.apply(this,r),t=Date.now()},e-o))}};var _;(function(s){s.SetActiveSlice="setActiveSlice",s.SetSliceZoneSize="setSliceZoneSize"})(_||(_={}));var h;(function(s){s.Ping="ping",s.SetSliceZone="setSliceZone",s.ScrollToSlice="scrollToSlice"})(h||(h={}));var c;(function(s){s.Slices="slices",s.ActiveSlice="activeSlice",s.Message="message"})(c||(c={}));const ee={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
2 * statuses
3 * Copyright(c) 2014 Jonathan Ong
4 * Copyright(c) 2016 Douglas Christopher Wilson
5 * MIT Licensed
6 */var v,M;function te(){if(M)return v;M=1;var s=ee;v=n,n.message=s,n.code=e(s),n.codes=t(s),n.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},n.empty={204:!0,205:!0,304:!0},n.retry={502:!0,503:!0,504:!0};function e(o){var a={};return Object.keys(o).forEach(function(P){var U=o[P],H=Number(P);a[U.toLowerCase()]=H}),a}function t(o){return Object.keys(o).map(function(l){return Number(l)})}function i(o){var a=o.toLowerCase();if(!Object.prototype.hasOwnProperty.call(n.code,a))throw new Error('invalid status message: "'+o+'"');return n.code[a]}function r(o){if(!Object.prototype.hasOwnProperty.call(n.message,o))throw new Error("invalid status code: "+o);return n.message[o]}function n(o){if(typeof o=="number")return r(o);if(typeof o!="string")throw new TypeError("code must be a number or string");var a=parseInt(o,10);return isNaN(a)?i(o):r(a)}return v}var se=te();const A=K(se);var y;(function(s){s.Connect="connect"})(y||(y={}));var b;(function(s){s.Ready="ready"})(b||(b={}));var ie=Object.defineProperty,re=(s,e,t)=>e in s?ie(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,R=(s,e,t)=>(re(s,typeof e!="symbol"?e+"":e,t),t);class q extends Error{constructor(e){super(e.msg),R(this,"response"),this.response=e}}class oe extends Error{constructor(e){super("Too many concurrent requests"),R(this,"request"),this.request=e}}class ne extends Error{constructor(e){super(`Request \`${e.requestID}\` timed out`),R(this,"request"),this.request=e}}class ae extends Error{}class ce extends Error{constructor(){super("Port is not set")}}let le=0;const ue=(s,e,t="")=>({requestID:`${t}${le++}`,type:s,data:e}),C=(s,e,t=200)=>{var i;if(t>=400)throw new TypeError(`Invalid success status code, expected status to be within \`[100;400[\`, got \`${t}\``);return{requestID:s,status:t,msg:((i=A.message[t])==null?void 0:i.replace(/\.$/,"").toLowerCase())??"",data:e}},f=(s,e,t=400)=>{var i;if(t<400)throw new TypeError(`Invalid error status code, expected status to be within \`[500;600[\`, got \`${t}\``);return{requestID:s,status:t,msg:((i=A.message[t])==null?void 0:i.replace(/\.$/,"").toLowerCase())??"",error:e}},N=s=>{if(typeof s!="object"||s===null)throw new TypeError(`Invalid message received, expected message to be of type \`object\`, got \`${typeof s}\``);
6if(Object.keys(s).every(e=>["requestID","type","data","status","msg","error"].includes(e))){if(typeof s.requestID!="string")throw new TypeError(`Invalid message received, expected \`message.requestID\` to be of type \`string\`, got \`${typeof s.id}\``)}else throw new TypeError(`Invalid message received: ${JSON.stringify(s)}`);return s},O=s=>"type"in s,_e=s=>!("type"in s),de=s=>_e(s)&&!("error"in s);var he=Object.defineProperty,pe=(s,e,t)=>e in s?he(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,p=(s,e,t)=>(pe(s,typeof e!="symbol"?e+"":e,t),t);const fe={debug:!1,maximumRequestConcurrency:20,defaultTimeout:5e3,requestIDPrefix:"channel-"};class me{constructor(e,t){p(this,"requestHandlers"),p(this,"options"),p(this,"_port",null),p(this,"_pendingRequests",new Map),this.requestHandlers=e,this.options={...fe,...t}}get port(){if(!this._port)throw new ce;return this._port}set port(e){this._port&&(this._port.onmessage=null),this._port=e,this._port&&(this._port.onmessage=this.onMessage.bind(this))}createRequestMessage(e,t){return ue(e,t,this.options.requestIDPrefix)}async onMessage(e){this.options.debug&&console.debug(e.data);try{const t=N(e.data);if(O(t))if(!this.requestHandlers[t.type])this.postResponse(f(t.requestID,void 0,501));else try{const i=await this.requestHandlers[t.type](t,{success:C.bind(this,t.requestID),error:f.bind(this,t.requestID)});this.postResponse(i)}catch(i){this.postResponse(f(t.requestID,i,500))}else this._pendingRequests.has(t.requestID)?(this._pendingRequests.get(t.requestID)(t),this._pendingRequests.delete(t.requestID)):console.error(`Unknown request ID received in response: ${JSON.stringify(t)}`)}catch(t){if(t instanceof TypeError)console.warn(t.message);else throw t}}postRequest(e,t=r=>this.port.postMessage(r),i={}){if(this.options.debug&&console.debug(e),this._pendingRequests.size>=this.options.maximumRequestConcurrency)throw new oe(e);return new Promise((r,n)=>{const o=setTimeout(()=>{this._pendingRequests.has(e.requestID)&&this._pendingRequests.delete(e.requestID),n(new ne(e))},i.timeout||this.options.defaultTimeout);this._pendingRequests.set(e.requestID,a=>{clearTimeout(o),de(a)?r(a):n(new q(a))}),t(e)})}postResponse(e,t=i=>this.port.postMessage(i)){return this.options.debug&&console.debug(e),t(e),e}}var ge=Object.defineProperty,ve=(s,e,t)=>e in s?ge(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Se=(s,e,t)=>(ve(s,e+"",t),t);const we={readyTimeout:2e4,requestIDPrefix:"receiver-"};class ye extends me{constructor(e,t){super(e,{...we,...t}),Se(this,"_ready",!1),window.addEventListener("message",i=>{this._onPublicMessage(i)})}async ready(){if(window.parent===window)throw new Error("Receiver is currently not embedded as an iframe");this._ready=!1;const e=this.createRequestMessage(b.Ready,void 0),t=await this.postRequest(e,i=>{window.parent.postMessage(i,"*")},{timeout:this.options.readyTimeout});return this._ready=!0,t}_onPublicMessage(e){try{const t=N(e.data);if(O(t))switch(this.options.debug&&console.debug(e.data),t.type){case y.Connect:this.port=e.ports[0];const{data:i}=t;this.options={...this.options,...i,debug:this.options.debug,requestIDPrefix:this.options.requestIDPrefix,readyTimeout:this.options.readyTimeout};const r=C(t.requestID,void 0);this.postResponse(r);break;default:this.postResponse(f(t.requestID,void 0),n=>{e.source.postMessage(n,e.origin)});break}else this._ready||this.onMessage(e)}catch(t){if(!(t instanceof TypeError))throw t}}postFormattedRequest(e,t,i={}){if(!this._ready)throw new ae("Receiver is not ready, use `ChannelReceiver.ready()` first");return this.postRequest(this.createRequestMessage(e,t),void 0,i)}}var be=Object.defineProperty,qe=(s,e,t)=>e in s?be(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,D=(s,e,t)=>(qe(s,typeof e!="symbol"?e+"":e,t),t),z,F;const Re={requestIDPrefix:"api-",activeSliceAPI:!1,sliceZoneSizeAPI:!1};class Ie extends ye{constructor(e,t){var i,r;const n=(t==null?void 0:t.debug)||/[?&]debug=true/i.test(decodeURIComponent(window.location.search));super({[h.Ping]:(o,a)=>a.success("pong"),...e},{...Re,...t,debug:n}),D(this,z,async o=>await this.postFormattedRequest(_.SetActiveSlice,o)),D(this,F,async o=>await this.postFormattedRequest(_.SetSliceZoneSize,o)),n&&(window.prismic||(window.prismic={}),(i=window.prismic).sliceSimulator||(i.sliceSimulator={}),(r=window.prismic.sliceSimulator).api||(r.api=[]),window.prismic.sliceSimulator.api.push(this))}}z=_.SetActiveSlice,F=_.SetSliceZoneSize;var Pe=Object.defineProperty,xe=(s,e,t)=>e in s?Pe(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,$e=(s,e,t)=>(xe(s,e+"",t),t);class Me{constructor(){$e(this,"_listeners",{})}on(e,t,i=null){this._listeners[e]=[...this._listeners[e]??[],[t,i]]}off(e,t){this._listeners[e]=(this._listeners[e]??[]).filter(([i,r])=>typeof t=="function"?i!==t:r!==t)}
6emit(e,t){(this._listeners[e]??[]).forEach(i=>i[0](t))}}const m="slice-simulator",I="slice-simulator--root",De=()=>document.querySelector(`.${m}`),Te=()=>document.querySelector(`.${I}`),L=s=>{let e=document.querySelector(`.${m} [data-slice-zone]`);if(e)return e.children.length!==s&&console.warn(`Flagged SliceZone has an unexpected number of children, found ${e.children.length} but expected ${s}. This might lead to unexpected behaviors. Are you sure you tagged the right element?`),e;if(e=document.querySelector(`.${m} .${I}`),!e)return null;const t=5;for(let i=0;i<t;i++){if(e.children.length===s)return e;if(e.children.length)e=e.children[0];else break}return null},Ee=(s,e)=>{const t=document.elementsFromPoint(e.x,e.y).reverse(),i=t.indexOf(s);if(i===-1)return null;const r=t[i+1];return r||null},T=()=>({zIndex:100,background:"#ffffff"}),Z=()=>[],Ae=()=>"";var Ce=Object.defineProperty,Ne=(s,e,t)=>e in s?Ce(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,u=(s,e,t)=>(Ne(s,typeof e!="symbol"?e+"":e,t),t);class Oe extends Me{constructor(e){super(),u(this,"_slices"),u(this,"_activeSlice"),u(this,"_message"),u(this,"_mouse"),u(this,"_setActiveSlice",()=>
6{if(this.slices.length===0){this.activeSlice=null;return}const t=L(this.slices.length);if(!t){this.activeSlice=null;return}const i=Ee(t,this._mouse);if(!i){this.activeSlice=null;return}const r=Array.prototype.indexOf.call(t.children,i);this.activeSlice={rect:i.getBoundingClientRect(),sliceID:this.slices[r].slice_type,variationID:this.slices[r].variation,index:r}}),u(this,"setActiveSlice",E(this._setActiveSlice,16)),this._slices=(e==null?void 0:e.slices)||Z(),this._activeSlice=null,this._message="",this._mouse={x:0,y:0}}set slices(e){this._slices=e,this.message="",this.emit(c.Slices,e)}get slices(){return this._slices}set activeSlice(e){this._activeSlice=e,this.emit(c.ActiveSlice,e)}get activeSlice(){return this._activeSlice}set message(e){this._message=e,this.emit(c.Message,e)}get message(){return this._message}async init(){window.addEventListener("mousemove",e=>{this._mouse={x:e.clientX,y:e.clientY}})}setSliceZone(e){this.slices=e}}const ze=s=>`<div style="word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;">${s}</div>`,S=(s,e)=>`<a href="${s}" style="text-decoration: underline;">${s}<a>`,Fe=`   _____ ___          _____ _                 __      __            
7  / ___// (_)_______ / ___/(_)___ ___  __  __/ /___ _/ /_____  _____
8  \\__ \\/ / / ___/ _ \\\\__ \\/ / __ \`__ \\/ / / / / __ \`/ __/ __ \\/ ___/
9 ___/ / / / /__/  __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / /    
10/____/_/_/\\___/\\___/____/_/_/ /_/ /_/\\__,_/_/\\__,_/\\__/\\____/_/     
11                  / /_  __  __   / __ \\_____(_)________ ___  (_)____
12                 / __ \\/ / / /  / /_/ / ___/ / ___/ __ \`__ \\/ / ___/
13                / /_/ / /_/ /  / ____/ /  / (__  ) / / / / / / /__  
14               /_.___/\\__, /  /_/   /_/  /_/____/_/ /_/ /_/_/\\___/  
15                     /____/
16
17`,Le=`
18
19
20
21
22
23                                                - The Prismic team`,Ze=ze([Fe,`You're seeing this page because you're accessing Slice simulator
24directly, e.g:
25
26  - ${S("http://localhost:3000/slice-simulator")}
27
28
29
30The Slice simulator can only be accessed through Slice Machine or the
31Page Builder. To preview your Slices, head over to Slice Machine:
32
33  - ${S("http://localhost:9999")}
34
35
36
37If you believe this is an error, please reach out to us:
38
39  - ${S("https://github.com/prismicio/slice-machine/issues/new/choose")}`,Le].join(""));var Ue=Object.defineProperty,He=(s,e,t)=>e in s?Ue(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>(He(s,typeof e!="symbol"?e+"":e,t),t);class Be{constructor(e){w(this,"state"),w(this,"_api"),w(this,"_initialized"),this.state=new Oe(e),this._api=null,this._initialized=!1}
39async init(){if(!this._initialized){this._initialized=!0,await this.state.init();try{await this._initAPI()}catch(e){e instanceof Error&&e.message==="Receiver is currently not embedded as an iframe"&&!this.state.slices.length&&(this.state.message=Ze),console.error(e);return}this._initListeners()}}async _initAPI(){this._api=new Ie({[h.SetSliceZone]:(e,t)=>(this.state.setSliceZone(e.data),t.success()),[h.ScrollToSlice]:(e,t)=>{var i;if(e.data.sliceIndex<0)return t.error("`sliceIndex` must be > 0",400);if(e.data.sliceIndex>=this.state.slices.length)return t.error(`\`sliceIndex\` must be < ${this.state.slices.length} (\`<SliceZone />\` current length)`,400);const r=L(this.state.slices.length);if(!r)return t.error("Failed to find `<SliceZone />`",500);this.state.activeSlice=null;const n=r.children[e.data.sliceIndex];return n?(n.scrollIntoView({behavior:e.data.behavior,block:e.data.block,inline:e.data.inline}),(i=this._api)!=null&&i.options.activeSliceAPI&&setTimeout(this.state.setActiveSlice,750),t.success()):t.error("Failed fo find slice at index $`{req.data.sliceIndex}` in `<SliceZone />`",500)}}),await this._api.ready()}_initListeners(){var e,t;if((e=this._api)!=null&&e.options.activeSliceAPI&&(window.addEventListener("mousemove",()=>{this.state.setActiveSlice()}),window.addEventListener("resize",()=>{this.state.setActiveSlice()}),window.addEventListener("mousewheel",()=>{setTimeout(this.state.setActiveSlice,200)}),this.state.on(c.Slices,()=>{this.state.setActiveSlice()}),this.state.on(c.ActiveSlice,async i=>{if(this._api)try{await this._api.setActiveSlice(i)}catch(r){if(r instanceof q&&r.response.status===400)console.error(r.response);else throw r}})),(t=this._api)!=null&&t.options.sliceZoneSizeAPI){const i=new ResizeObserver(E(async o=>{const[a]=o;if(this._api&&a)try{await this._api.setSliceZoneSize({rect:a.contentRect})}catch(l){if(l instanceof q&&l.response.status===400)console.error(l.response);else throw l}},16)),r=()=>{const o=Te();i.disconnect(),o&&i.observe(o)};new MutationObserver(r).observe(De(),{subtree:!1,childList:!0})}}}const Ve=s=>{s.preventDefault(),s.stopPropagation()},Ge=s=>{s.path&&s.path.slice(0,5).some(e=>e instanceof HTMLAnchorElement)&&(s.preventDefault(),s.stopPropagation())},d=new Be,Je=B({name:"SliceSimulator",props:{zIndex:{type:Number,default:T().zIndex,required:!1},background:{type:String,default:T().background,required:!1}},setup(s,{slots:e}){const t=x(Z()),i=x(Ae());return V(()=>{d.state.on(c.Slices,r=>{t.value=r},"simulator-slices"),d.state.on(c.Message,r=>{i.value=r},"simulator-message"),d.init()}),G(()=>{d.state.off(c.Slices,"simulator-slices"),d.state.off(c.Message,"simulator-message")}),()=>{const r=[];return i.value?r.push(g("article",{innerHTML:i.value})):t.value.length&&e.default&&r.push(g("div",{id:"root",class:I,onClickCapture:Ge,onSubmitCapture:Ve},[e.default({slices:t.value})])),g("div",{class:m,style:{zIndex:s.zIndex,position:"fixed",top:0,left:0,width:"100%",height:"100vh",overflow:"auto",background:s.background}},r)}}}),Ye=Je,je={class:"case__study__list"},Ke={__name:"slice-simulator",setup(s){return(e,t)=>{const i=W;return j(),J($(Ye),null,{default:Y(({slices:r})=>[X("div",je,[Q(i,{slices:r,components:$(k)},null,8,["slices","components"])])]),_:1})}}};export{Ke as default};

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.