/*! * This source file is part of the Swift.org open source project * * Copyright (c) 2021 Apple Inc. and the Swift project authors * Licensed under Apache License v2.0 with Runtime Library Exception * * See https://swift.org/LICENSE.txt for license information * See https://swift.org/CONTRIBUTORS.txt for Swift project authors */(function(e){function t(t){for(var n,i,c=t[0],a=t[1],h=t[2],l=0,u=[];l])/g,i=/^-+/,r=/["'&<>]/g;function s(e){return e.trim().replace(n,"-").replace(i,"").toLowerCase()}function c(e){const t=e=>({'"':""","'":"'","&":"&","<":"<",">":">"}[e]||e);return e.replace(r,t)}const a={zero:"zero",one:"one",two:"two",few:"few",many:"many",other:"other"},h={cardinal:"cardinal",ordinal:"ordinal"};function l(e,t){const{cardinal:o}=h,{one:n,other:i}=a,r="en",s=1===t?n:i;if(!e[r]||!e[r][s])throw new Error("No default choices provided to pluralize using default locale "+r);let c=r,l=s;if("Intl"in window&&"PluralRules"in window.Intl){const n=navigator.languages?navigator.languages:[navigator.language],i=new Intl.PluralRules(n,{type:o}),r=i.select(t),s=i.resolvedOptions().locale;e[s]&&e[s][r]&&(c=s,l=r)}return e[c][l]}function u(e){return e.replace(/#(.*)/,(e,t)=>"#"+CSS.escape(t))}function d(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function g(e){let t,o;const n="\\s*",i=" ",r=e.trim(),s=r.length;if(!s)return i;const c=[];for(t=0;t{t=e});return requestAnimationFrame((function e(){o-=1,o<=0?t():requestAnimationFrame(e)})),n}function i(e){return new Promise(t=>{setTimeout(t,e)})}o.d(t,"b",(function(){return n})),o.d(t,"a",(function(){return i}))},4009:function(e,t,o){"use strict";o.d(t,"a",(function(){return n}));const n="app-top"},"48b1":function(e,t,o){"use strict";o("e487")},"5c0b":function(e,t,o){"use strict";o("9c0c")},"5d2d":function(e,t,o){"use strict";o.d(t,"a",(function(){return s})),o.d(t,"c",(function(){return a})),o.d(t,"b",(function(){return h}));const n="developer.setting.";function i(e=localStorage){return{getItem:t=>{try{return e.getItem(t)}catch(o){return null}},setItem:(t,o)=>{try{e.setItem(t,o)}catch(n){}},removeItem:t=>{try{e.removeItem(t)}catch(o){}}}}function r(e){return{get:(t,o)=>{const i=JSON.parse(e.getItem(n+t));return null!==i?i:o},set:(t,o)=>e.setItem(n+t,JSON.stringify(o)),remove:t=>e.removeItem(n+t)}}const s=i(window.localStorage),c=i(window.sessionStorage),a=r(s),h=r(c)},6131:function(e,t,o){"use strict";o("f8ba")},"613f":function(e,t,o){},"63b8":function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return i})),o.d(t,"a",(function(){return r})),o.d(t,"d",(function(){return c}));const n={large:"large",medium:"medium",small:"small"},i={default:"default",nav:"nav"},r={[i.default]:{[n.large]:{minWidth:1069,contentWidth:980},[n.medium]:{minWidth:736,maxWidth:1068,contentWidth:692},[n.small]:{minWidth:320,maxWidth:735,contentWidth:280}},[i.nav]:{[n.large]:{minWidth:1024},[n.medium]:{minWidth:768,maxWidth:1023},[n.small]:{minWidth:320,maxWidth:767}}},s={[n.small]:0,[n.medium]:1,[n.large]:2};function c(e,t){return s[e]>s[t]}},6842:function(e,t,o){"use strict";function n(e,t,o){let n,i=e,r=t;for("string"===typeof r&&(r=[r]),n=0;ne.json()).catch(()=>({}))}const c=(e,t)=>n(i,e,t)},7138:function(e,t,o){"use strict";o("813c")},"748c":function(e,t,o){"use strict";o.d(t,"e",(function(){return i})),o.d(t,"a",(function(){return r})),o.d(t,"d",(function(){return s})),o.d(t,"c",(function(){return c})),o.d(t,"f",(function(){return a})),o.d(t,"b",(function(){return h}));var n=o("6842");function i(e){return e.reduce((e,t)=>(t.traits.includes("dark")?e.dark.push(t):e.light.push(t),e),{light:[],dark:[]})}function r(e){const t=["1x","2x","3x"];return t.reduce((t,o)=>{const n=e.find(e=>e.traits.includes(o));return n?t.concat({density:o,src:n.url,size:n.size}):t},[])}function s(e){const t="/",o=new RegExp(t+"+","g");return e.join(t).replace(o,t)}function c(e){return e&&"string"===typeof e&&!e.startsWith(n["a"])&&e.startsWith("/")?s([n["a"],e]):e}function a(e){return e?`url('${c(e)}')`:void 0}function h(e){return new Promise((t,o)=>{const n=new Image;n.src=e,n.onerror=o,n.onload=()=>t({width:n.width,height:n.height})})}},"813c":function(e,t,o){},"821b":function(e,t,o){"use strict";t["a"]={auto:{label:"Auto",value:"auto"},dark:{label:"Dark",value:"dark"},light:{label:"Light",value:"light"}}},"942d":function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return i})),o.d(t,"e",(function(){return r})),o.d(t,"d",(function(){return s})),o.d(t,"a",(function(){return c}));const n=52,i=48,r="nav-sticky-anchor",s="nav-open-navigator",c={noClose:"noclose"}},9895:function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"a",(function(){return i}));const n="not-found",i="documentation-topic"},"9c0c":function(e,t,o){},a5c6:function(e,t,o){"use strict";o("613f")},d26a:function(e,t,o){"use strict";o.d(t,"c",(function(){return r})),o.d(t,"b",(function(){return s})),o.d(t,"a",(function(){return c})),o.d(t,"d",(function(){return a}));var n=o("748c"),i={input:"input",tags:"tags"};function r(e={}){return Object.entries(e).reduce((e,[t,o])=>o?e.concat(`${encodeURIComponent(t)}=${encodeURIComponent(o)}`):e,[]).join("&")}function s(e,{changes:t,language:o,context:n}={}){const[i,s]=e.split("#"),c=i.match(/\?.*/),a=r({changes:t,language:o,context:n}),h=c?"&":"?",l=s?i:e,u=a?`${h}${a}`:"",d=s?"#"+s:"";return`${l}${u}${d}`}function c(e,t){const{query:{changes:o,[i.input]:n,[i.tags]:r,...s}={}}=e,{query:{changes:c,[i.input]:a,[i.tags]:h,...l}={}}=t;return e.name===t.name&&JSON.stringify({path:e.path,query:s})===JSON.stringify({path:t.path,query:l})}function a(e,t=window.location.origin){return new URL(Object(n["c"])(e),t).href}},d369:function(e,t,o){"use strict";var n=o("5d2d");const i={preferredColorScheme:"developer.setting.preferredColorScheme",preferredLanguage:"docs.setting.preferredLanguage"},r={preferredColorScheme:"docs.setting.preferredColorScheme"};t["a"]=Object.defineProperties({},Object.keys(i).reduce((e,t)=>({...e,[t]:{get:()=>{const e=r[t],o=n["a"].getItem(i[t]);return e?o||n["a"].getItem(e):o},set:e=>n["a"].setItem(i[t],e)}}),{}))},dd18:function(e,t,o){"use strict";t["a"]={eager:"eager",lazy:"lazy"}},e425:function(e,t,o){"use strict";var n=o("821b"),i=o("dd18"),r=o("d369");const s="undefined"!==typeof window.matchMedia&&[n["a"].light.value,n["a"].dark.value,"no-preference"].some(e=>window.matchMedia(`(prefers-color-scheme: ${e})`).matches),c=s?n["a"].auto:n["a"].light;t["a"]={state:{imageLoadingStrategy:i["a"].lazy,preferredColorScheme:r["a"].preferredColorScheme||c.value,supportsAutoColorScheme:s,systemColorScheme:n["a"].light.value},setImageLoadingStrategy(e){this.state.imageLoadingStrategy=e},setPreferredColorScheme(e){this.state.preferredColorScheme=e,r["a"].preferredColorScheme=e},setSystemColorScheme(e){this.state.systemColorScheme=e},syncPreferredColorScheme(){r["a"].preferredColorScheme&&r["a"].preferredColorScheme!==this.state.preferredColorScheme&&(this.state.preferredColorScheme=r["a"].preferredColorScheme)}}},e487:function(e,t,o){},ed96:function(e,t,o){o.p=window.baseUrl},f161:function(e,t,o){"use strict";o.r(t);o("ed96");var n=o("2b0e"),i=o("8c4f"),r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{class:{fromkeyboard:e.fromKeyboard,hascustomheader:e.hasCustomHeader},attrs:{id:"app"}},[o("div",{attrs:{id:e.AppTopID}}),o("a",{attrs:{href:"#main",id:"skip-nav"}},[e._v("Skip Navigation")]),o("InitialLoadingPlaceholder"),e._t("header",(function(){return[e.hasCustomHeader?o("custom-header",{attrs:{"data-color-scheme":e.preferredColorScheme}}):e._e()]}),{isTargetIDE:e.isTargetIDE}),o("div",{attrs:{id:e.baseNavStickyAnchorId}}),e._t("default",(function(){return[o("router-view",{staticClass:"router-content"}),e.hasCustomFooter?o("custom-footer",{attrs:{"data-color-scheme":e.preferredColorScheme}}):e.isTargetIDE?e._e():o("Footer")]}),{isTargetIDE:e.isTargetIDE}),e._t("footer",null,{isTargetIDE:e.isTargetIDE})],2)},s=[],c=o("e425"),a=o("821b"),h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("footer",{staticClass:"footer"},[o("div",{staticClass:"row"},[o("ColorSchemeToggle")],1)])},l=[],u=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"color-scheme-toggle",attrs:{"aria-label":"Select a color scheme preference",role:"radiogroup"}},e._l(e.options,(function(t){return o("label",{key:t.value},[o("input",{attrs:{type:"radio"},domProps:{checked:t.value==e.preferredColorScheme,value:t.value},on:{input:e.setPreferredColorScheme}}),o("div",{staticClass:"text"},[e._v(e._s(t.label))])])})),0)},d=[],g={name:"ColorSchemeToggle",data:()=>({appState:c["a"].state}),computed:{options:({supportsAutoColorScheme:e})=>[a["a"].light,a["a"].dark,...e?[a["a"].auto]:[]],preferredColorScheme:({appState:e})=>e.preferredColorScheme,supportsAutoColorScheme:({appState:e})=>e.supportsAutoColorScheme},methods:{setPreferredColorScheme:e=>{c["a"].setPreferredColorScheme(e.target.value)}},watch:{preferredColorScheme:{immediate:!0,handler(e){document.body.dataset.colorScheme=e}}}},f=g,m=(o("6131"),o("2877")),p=Object(m["a"])(f,u,d,!1,null,"8890c4d6",null),j=p.exports,v={name:"Footer",components:{ColorSchemeToggle:j}},w=v,b=(o("2de0"),Object(m["a"])(w,h,l,!1,null,"72f2e2dc",null)),y=b.exports,S=function(){var e=this,t=e.$createElement,o=e._self._c||t;return e.loaded?e._e():o("div",{staticClass:"InitialLoadingPlaceholder",attrs:{id:"loading-placeholder"}})},E=[],C={name:"InitialLoadingPlaceholder",data(){return{loaded:!1}},created(){const e=()=>{this.loaded=!0};this.$router.onReady(e,e)}},_=C,P=(o("48b1"),Object(m["a"])(_,S,E,!1,null,"35c356b6",null)),T=P.exports,k=o("942d"),O=o("6842");function A(e,t){return e&&"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,t)&&"string"===typeof e[t]}function I(e,t,o,n){if(!t||"object"!==typeof t||n&&(A(t,"light")||A(t,"dark"))){let i=t;if(A(t,n)&&(i=t[n]),"object"===typeof i)return;o[e]=i}else Object.entries(t).forEach(([t,i])=>{const r=[e,t].join("-");I(r,i,o,n)})}function L(e,t="light"){const o={},n=e||{};return I("-",n,o,t),o}var x=o("4009"),D={name:"CoreApp",components:{Footer:y,InitialLoadingPlaceholder:T},provide(){return{isTargetIDE:this.isTargetIDE,performanceMetricsEnabled:"true"===Object({NODE_ENV:"production",VUE_APP_TITLE:"Documentation",BASE_URL:"{{BASE_PATH}}/"}).VUE_APP_PERFORMANCE_ENABLED}},data(){return{AppTopID:x["a"],appState:c["a"].state,fromKeyboard:!1,isTargetIDE:"ide"===Object({NODE_ENV:"production",VUE_APP_TITLE:"Documentation",BASE_URL:"{{BASE_PATH}}/"}).VUE_APP_TARGET,themeSettings:O["d"],baseNavStickyAnchorId:k["e"]}},computed:{currentColorScheme:({appState:e})=>e.systemColorScheme,preferredColorScheme:({appState:e})=>e.preferredColorScheme,CSSCustomProperties:({currentColorScheme:e,preferredColorScheme:t,themeSettings:o})=>L(o.theme,t===a["a"].auto.value?e:t),hasCustomHeader:()=>!!window.customElements.get("custom-header"),hasCustomFooter:()=>!!window.customElements.get("custom-footer")},props:{enableThemeSettings:{type:Boolean,default:!0}},watch:{CSSCustomProperties:{immediate:!0,handler(e){this.detachStylesFromRoot(e),this.attachStylesToRoot(e)}}},async created(){window.addEventListener("keydown",this.onKeyDown),this.$bridge.on("navigation",this.handleNavigationRequest),this.enableThemeSettings&&Object.assign(this.themeSettings,await Object(O["b"])()),window.addEventListener("pageshow",this.syncPreferredColorScheme),this.$once("hook:beforeDestroy",()=>{window.removeEventListener("pageshow",this.syncPreferredColorScheme)})},mounted(){(document.querySelector(".footer-current-year")||{}).innerText=(new Date).getFullYear(),this.attachColorSchemeListeners()},beforeDestroy(){this.fromKeyboard?window.removeEventListener("mousedown",this.onMouseDown):window.removeEventListener("keydown",this.onKeyDown),this.$bridge.off("navigation",this.handleNavigationRequest),this.detachStylesFromRoot(this.CSSCustomProperties)},methods:{onKeyDown(){this.fromKeyboard=!0,window.addEventListener("mousedown",this.onMouseDown),window.removeEventListener("keydown",this.onKeyDown)},onMouseDown(){this.fromKeyboard=!1,window.addEventListener("keydown",this.onKeyDown),window.removeEventListener("mousedown",this.onMouseDown)},handleNavigationRequest(e){this.$router.push(e)},attachColorSchemeListeners(){if(!window.matchMedia)return;const e=window.matchMedia("(prefers-color-scheme: dark)");e.addListener(this.onColorSchemePreferenceChange),this.$once("hook:beforeDestroy",()=>{e.removeListener(this.onColorSchemePreferenceChange)}),this.onColorSchemePreferenceChange(e)},onColorSchemePreferenceChange({matches:e}){const t=e?a["a"].dark:a["a"].light;c["a"].setSystemColorScheme(t.value)},attachStylesToRoot(e){const t=document.body;Object.entries(e).filter(([,e])=>Boolean(e)).forEach(([e,o])=>{t.style.setProperty(e,o)})},detachStylesFromRoot(e){const t=document.body;Object.entries(e).forEach(([e])=>{t.style.removeProperty(e)})},syncPreferredColorScheme(){c["a"].syncPreferredColorScheme()}}},$=D,N=(o("5c0b"),o("a5c6"),Object(m["a"])($,r,s,!1,null,"0a4c340a",null)),R=N.exports;class U{constructor(){this.$send=()=>{}}send(e){this.$send(e)}}class M{constructor(){const{webkit:{messageHandlers:{bridge:e={}}={}}={}}=window;this.bridge=e;const{postMessage:t=(()=>{})}=e;this.$send=t.bind(e)}send(e){this.$send(e)}}class B{constructor(e=new U){this.backend=e,this.listeners={}}send(e){this.backend.send(e)}receive(e){this.emit(e.type,e.data)}emit(e,t){this.listeners[e]&&this.listeners[e].forEach(e=>e(t))}on(e,t){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t)}off(e,t){this.listeners[e]&&this.listeners[e].delete(t)}}var W={install(e,t){let o;o=t.performanceMetricsEnabled||"ide"===t.appTarget?new M:new U,e.prototype.$bridge=new B(o)}};function V(e){return"custom-"+e}function q(e){return class extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),o=e.content.cloneNode(!0);t.appendChild(o)}}}function F(e){const t=V(e),o=document.getElementById(t);o&&window.customElements.define(t,q(o))}function H(e,t={names:["header","footer"]}){const{names:o}=t;e.config.ignoredElements=/^custom-/,o.forEach(F)}function K(e,t){const{value:o=!1}=t;e.style.display=o?"none":""}var G={hide:K};function z(e,{performanceMetrics:t=!1}={}){e.config.productionTip=!1,e.use(H),e.directive("hide",G.hide),e.use(W,{appTarget:Object({NODE_ENV:"production",VUE_APP_TITLE:"Documentation",BASE_URL:"{{BASE_PATH}}/"}).VUE_APP_TARGET,performanceMetricsEnabled:t}),window.bridge=e.prototype.$bridge,e.config.performance=t}var J=o("9895"),Y=o("63b8"),X=o("3908"),Q=o("002d"),Z=o("d26a");const ee=10;function te(e){const{name:t}=e,o=t.includes(J["a"]);return o?ee:0}function oe(){const{location:e}=window;return e.pathname+e.search+e.hash}function ne(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0);return ePromise.all([o.e("documentation-topic~topic~tutorials-overview"),o.e("tutorials-overview")]).then(o.bind(null,"f025"))},{path:"/tutorials/:id/*",name:"topic",component:()=>Promise.all([o.e("documentation-topic~topic~tutorials-overview"),o.e("documentation-topic~topic"),o.e("topic")]).then(o.bind(null,"3213"))},{path:"/documentation/*",name:J["a"],component:()=>Promise.all([o.e("documentation-topic~topic~tutorials-overview"),o.e("chunk-384ef189"),o.e("documentation-topic~topic"),o.e("documentation-topic")]).then(o.bind(null,"f8ac"))},{path:"*",name:J["b"],component:Ce},{path:"*",name:"server-error",component:ve}];function Pe(e={}){const t=new i["a"]({mode:"history",base:O["a"],scrollBehavior:ie,...e,routes:e.routes||_e});return t.onReady(()=>{"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual"),re()}),"ide"!==Object({NODE_ENV:"production",VUE_APP_TITLE:"Documentation",BASE_URL:"{{BASE_PATH}}/"}).VUE_APP_TARGET&&t.onError(e=>{const{route:o={path:"/"}}=e;t.replace({name:"server-error",params:[o.path]})}),window.addEventListener("unload",se),t}n["default"].use(z),n["default"].use(i["a"]),new n["default"]({router:Pe(),render:e=>e(R)}).$mount("#app")},f8ba:function(e,t,o){},fb1e:function(e,t,o){}});