PageSourceSearch

https://cdn.castle.xyz/_next/static/chunks/pages/d/script_editor-f7762149d523c0ec.js

js castle.xyz collected 2026-10-01 13:09:12 UTC 12,947 bytes, 1 lines download raw bytes

1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="515e6dbc-207b-4b0d-ada8-53fef07a0bd1",t._sentryDebugIdIdentifier="sentry-dbid-515e6dbc-207b-4b0d-ada8-53fef07a0bd1")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8169],{73798:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/d/script_editor",function(){return n(42872)}])},99979:function(t,e,n){"use strict";n.d(e,{AB:function(){return s},Wn:function(){return o},HO:function(){return r}});var a=n(85893);let o=(t,e)=>{let n=t=>JSON.stringify(t).replace(/</g,"\\u003c");return"(function(){try{\nvar c=".concat(n(t),",d=").concat(n(e),",p=location.pathname;\nif(p!==c&&p.indexOf(c+'/')!==0)return;\nif(p!==d){history.replaceState(history.state,'',d+location.search+location.hash);}\nwindow.__castleCanonicalPath=c;\nif(d===c)return;\nvar from=location.origin+d,to=location.origin+c;\nvar hit=/^https:\\/\\/([a-z0-9-]+\\.)*(google-analytics\\.com|google\\.[a-z]{2,3}(\\.[a-z]{2})?)\\/g\\/collect\\?/;\nvar fix=function(u){\nif(typeof u!=='string'||!hit.test(u))return u;\nreturn u.replace(/([?&])(dl|dr)=([^&#]*)/g,function(m,s,k,v){\nvar x=decodeURIComponent(v.replace(/\\+/g,' '));\nif(x!==from&&x.indexOf(from+'?')!==0&&x.indexOf(from+'#')!==0)return m;\nreturn s+k+'='+encodeURIComponent(to+x.slice(from.length));\n});\n};\nvar f=window.fetch;\nif(typeof f==='function'){window.fetch=function(i,o){try{i=fix(i);}catch(e){}return f.call(window,i,o);};}\nvar nav=window.navigator,b=nav&&nav.sendBeacon;\nif(typeof b==='function'){nav.sendBeacon=function(u,v){try{u=fix(u);}catch(e){}return b.call(nav,u,v);};}\nvar X=window.XMLHttpRequest,xo=X&&X.prototype&&X.prototype.open;\nif(typeof xo==='function'){X.prototype.open=function(){var a=Array.prototype.slice.call(arguments);try{a[1]=fix(a[1]);}catch(e){}return xo.apply(this,a);};}\n}catch(e){}})();")},i=(t,e)=>{let n=JSON.stringify(e||null).replace(/</g,"\\u003c");return"window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n  gtag('config', 'AW-416745668', {\n    'content_group': '".concat(t,"'\n  });\n  var ga4Config = {\n    'content_group': '").concat(t,"'\n  };\n  var ga4CanonicalPath = ").concat(n,";\n  if (ga4CanonicalPath) {\n    ga4Config['page_location'] = location.origin + ga4CanonicalPath + location.search + location.hash;\n  }\n  gtag('config', 'G-43XJ1KGSCB', ga4Config);\n\n\nfunction reportAndroidInstallConversion(callback) {\n  gtag('event', 'conversion', {\n      'send_to': 'AW-416745668/oEFtCJ2gp7IZEMSR3MYB',\n      'event_callback': callback\n  });\n  return false;\n}\n\nfunction reportIOSInstallConversion(callback) {\n  gtag('event', 'conversion', {\n      'send_to': 'AW-416745668/T0RPCJqgp7IZEMSR3MYB',\n      'event_callback': callback\n  });\n  return false;\n}\n\nfunction reportGA4Event(eventName, params) {\n  var p = params || {};\n  p['send_to'] = 'G-43XJ1KGSCB';\n  gtag('event', eventName, p);\n}\n  ")},r=(t,e)=>{try{"function"==typeof window.reportGA4Event&&window.reportGA4Event(t,e)}catch(t){}},s=t=>{let{contentGroup:e,canonicalPath:n=""}=t,o={__html:i(e,n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=AW-416745668"}),(0,a.jsx)("script",{dangerouslySetInnerHTML:o})]})}},32385:function(t,e,n){"use strict";n.d(e,{QM:function(){return c},ZQ:function(){return r},bm:function(){return i},ul:function(){return a},v:function(){return s},zZ:function(){return o}});let a="https://discord.gg/rQETB4H",o="https://testflight.apple.com/join/kqteP0IC",i="https://apps.apple.com/us/app/castle-make-and-play/id1529189247",r="https://play.google.com/apps/testing/xyz.castle",s="https://twitter.com/castlexyz",c="https://play.google.com/store/apps/details?id=xyz.castle&referrer=utm_source%3Dcastle.xyz%26utm_medium%3Dweb"},66760:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var a=n(85893),o=n(9008),i=n.n(o),r=n(99979),s=n(91543);let c=t=>t.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),l=()=>'\n    {\n      "@context": "http://schema.org",\n      "@type": "WebSite",\n      "name": "Castle",\n      "url": "https://castle.xyz"\n    }\n  '.replace(/\n/g,""),d=()=>{let t={__html:l()};return(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:t})},p=t=>{let{data:e}=t,n={__html:c(JSON.stringify(e))};return(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:n})},u="https://castle.xyz/icon.png";function f(t){let{title:e="Castle",description:n="Make and play cool stuff on your phone",image:o=u,url:c,disableZoom:l=!1,viewportFitCover:f=!1,contentGroup:g,jsonLd:m,largeImage:h=!1,noindex:x=!1,playerUrl:y,playerWidth:w,playerHe
1ight:b,playerAspectRatio:j,oembedUrl:v,ogVideoUrl:k,displayPath:_}=t,S=function(t){if(t)return t.startsWith("http://")||t.startsWith("https://")?t:"".concat("https://castle.xyz").concat(t.startsWith("/")?t:"/".concat(t))}(c),C=_&&(null==c?void 0:c.startsWith("/"))?c:null,z=C?(0,r.Wn)(C,_):null,E=o;if(E&&"/"==E.charAt(0)&&(E="https://castle.xyz".concat(E)),!g)try{g=location.pathname.split("/")[1],""==g&&(g="home")}catch(t){g="default"}return s.RH.getClientSideContext().setLogEventProperties({contentGroup:g}),(0,a.jsxs)(i(),{children:[z?(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:z}},"display-path"):null,(0,a.jsx)("meta",{charSet:"UTF-8"}),(0,a.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),l?(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no".concat(f?", viewport-fit=cover":"")}):(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1".concat(f?", viewport-fit=cover":"")}),(0,a.jsx)("meta",{name:"sourceApp",content:"mobileWeb"}),(0,a.jsx)("title",{children:e}),(0,a.jsx)("meta",{name:"description",content:n}),x?(0,a.jsx)("meta",{name:"robots",content:"noindex"}):null,S?(0,a.jsx)("link",{rel:"canonical",href:S}):null,(0,a.jsx)("link",{rel:"preconnect",href:"https://image.castle.xyz"}),(0,a.jsx)("link",{rel:"preconnect",href:"https://cdn.castle.xyz"}),(0,a.jsx)("link",{rel:"preload",href:"/Balto-Book.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),(0,a.jsx)("link",{rel:"preload",href:"/Balto-Medium.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),(0,a.jsx)("link",{rel:"preload",href:"/Basteleur-Bold.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),(0,a.jsx)("link",{rel:"preload",href:"/Basteleur-Moonlight.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),(0,a.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,a.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,a.jsx)("link",{rel:"apple-touch-icon",href:E}),(0,a.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),(0,a.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"}),(0,a.jsx)("link",{rel:"mask-icon",href:"/safari-pinned-tab.svg",color:"#333333"}),(0,a.jsx)("meta",{name:"msapplication-TileColor",content:"#000000"}),(0,a.jsx)("meta",{name:"theme-color",content:"#000000"}),(0,a.jsx)("meta",{name:"twitter:card",content:y?"player":h?"summary_large_image":"summary"}),(0,a.jsx)("meta",{name:"twitter:site",content:"@castlexyz"}),(0,a.jsx)("meta",{name:"twitter:title",content:e}),(0,a.jsx)("meta",{name:"twitter:description",content:n}),(0,a.jsx)("meta",{name:"twitter:image",content:E}),y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("meta",{name:"twitter:player",content:y}),(0,a.jsx)("meta",{name:"twitter:player:width",content:String(w)}),(0,a.jsx)("meta",{name:"twitter:player:height",content:String(b)})]}):null,v?(0,a.jsx)("link",{rel:"alternate",type:"application/json+oembed",href:v,title:e}):null,y&&j?(0,a.jsx)("link",{rel:"iframely player",href:y,media:"aspect-ratio: ".concat(j)}):null,(0,a.jsx)("meta",{property:"og:title",content:e}),(0,a.jsx)("meta",{property:"og:description",content:n}),(0,a.jsx)("meta",{property:"og:locale",content:"en_US"}),(0,a.jsx)("meta",{property:"og:type",content:"website"}),(0,a.jsx)("meta",{property:"og:site_name",content:"Castle"}),S?(0,a.jsx)("meta",{property:"og:url",content:S}):null,(0,a.jsx)("meta",{property:"og:image",content:o}),(0,a.jsx)("meta",{property:"og:image:url",content:o}),(0,a.jsx)("meta",{property:"og:image:secure_url",content:o}),o===u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("meta",{property:"og:image:width",content:"512"}),(0,a.jsx)("meta",{property:"og:image:height",content:"512"})]}):null,k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("meta",{property:"og:video",content:k}),(0,a.jsx)("meta",{property:"og:video:secure_url",content:k}),(0,a.jsx)("meta",{property:"og:video:type",content:"video/mp4"})]}):null,(0,a.jsx)(d,{}),m?(Array.isArray(m)?m:[m]).map((t,e)=>(0,a.jsx)(p,{data:t},e)):null,(0,a.jsx)(r.AB,{contentGroup:g,canonicalPath:C||""})]})}},42872:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return m},default:function(){return h}});var a=n(85893),o=n(83591),i=n.n(o),r=n(67294),s=n(60946),c=n.n(s),l=n(91543),d=n(66760),p=n(96486),u=n.n(p),f=n(97390),g=n(10385),m=!0;function h(t){let e,n,{cxshid:o,apiContextData:s,isEmbed:p,iframeId:m}=t,h=l.RH.deserialize(s),[x,y]=r.useState(null),[w,b]=r.useState(null),[j,v]=r.useState(null),[k,_]=r.useState(null),[S,C]=r.useState(null),z=r.useCallback(t=>{try{if(t.data&&t.data.startsWith("castlexyz:configuration:")){let e=t.data.substring(24);e!=w&&(b(e),y(JSON.parse(e)))}if(t.data&&t.data.startsWith("castlexyz:deck_json:")){let e=t.data.substring(20);e!=k&&_(e)}if(t.data&&t.data.startsWith("castlexyz:script_code:")){let e=t.data.substring(22);e!=S&&(C(e),window.newValue=e,window.lastSentScriptCode=e)}}catch(t){console.error("Error in castle message listener: ".concat(t))}},[k,_,S,C,w,b,y]);r.useEffect(()=>{if(x&&x.blueprintTitle&&S&&k){let t=JSON.parse(k);if(t.snapshot&&t.snapshot.library){let e=Object.keys(t.snapshot.library);for(let n=0;n<e.length;
1n++)t.snapshot.library[e[n]].title==x.blueprintTitle&&(t.snapshot.library[e[n]].actorBlueprint.components.Script={code:S,disabled:!1})}v(JSON.stringify(t))}},[x,S,k,v]),r.useEffect(()=>{window.addEventListener("message",z),window.top&&window.top.postMessage("castlexyz:iframe_ready:".concat(m),"*")},[m,z]);let[E,W]=r.useState({hasSet:!1});e=window.innerWidth,n=window.innerHeight;let I=r.useCallback(()=>{let t,e;if(!x||!x.editorWidthPercentage)return;let n=window.innerHeight-0;window.innerWidth>450&&n>630?(t=450,e=630):window.innerWidth/n<5/7?p?t=5/7*(e=n):e=1.4*(t=window.innerWidth):p?e=1.4*(t=window.innerWidth):t=5/7*(e=n),W({width:t*(1-x.editorWidthPercentage),editorWidth:t*x.editorWidthPercentage,height:e,hasSet:!0})},[W,x]),B=u().debounce(I,100);return r.useEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}),[e,n]),r.useEffect(()=>{I()},[x,I]),r.useEffect(()=>{window.sendUpdate=t=>{C(t)},window.autocompleteEnabled=!0,window.darkModeEnabled=!!(null==x?void 0:x.darkMode);let t=document.getElementById("editor");t&&((0,g.J)(t),window.newValue=window.lastSentScriptCode)},[x,C]),r.useEffect(()=>{setInterval(()=>{try{window.intervalFn&&window.intervalFn()}catch(t){console.error(t.toString())}},100)},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.Z,{title:"New deck on Castle",description:"Play this deck and make your own with Castle.",image:void 0,contentGroup:"deck",disableZoom:!0,noindex:!0}),(0,a.jsxs)("div",{style:{backgroundColor:"#000"},className:"jsx-f385f1909f91bdc5 "+(c().editorContainer||""),children:[(0,a.jsx)("div",{style:{width:E.width,visibility:E.hasSet?"visible":"hidden"},className:"jsx-f385f1909f91bdc5 "+(c().container||""),children:(0,a.jsx)(f.P,{deckJson:j,isUsingDeckJson:!0,isEmbed:p,token:h.getToken(),cxshid:o,cardDimensions:E,openInAppUrl:"/"})}),(0,a.jsx)("div",{id:"editor",style:{width:E.editorWidth,visibility:E.hasSet?"visible":"hidden"},className:"jsx-f385f1909f91bdc5 "+(c().container||"")})]}),(0,a.jsx)(i(),{id:"f385f1909f91bdc5",children:'html,body{background-color:#000;padding:0;margin:0;height:100%;font-family:"Balto",sans-serif}#__next{height:100%;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cm-editor{width:100%;height:100%}'})]})}}},function(t){t.O(0,[3662,5762,4059,6005,3339,7390,2888,9774,179],function(){return t(t.s=73798)}),_N_E=t.O()}]);

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.