(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[91496],{91496:G=>{function _(t){return t?typeof t=="string"?t:t.source:null}function p(t){return e("(?=",t,")")}function e(...t){return t.map(F=>_(F)).join("")}function Y(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function s(...t){return"("+(Y(t).capture?"":"?:")+t.map(c=>_(c)).join("|")+")"}const N=t=>e(/\b/,t,/\w$/.test(t)?/\b/:/\B/),j=["Protocol","Type"].map(N),C=["init","self"].map(N),z=["Any","Self"],T=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],O=["false","nil","true"],q=["assignment","associativity","higherThan","left","lowerThan","none","right"],V=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],g=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],D=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),S=s(D,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),y=e(D,S,"*"),v=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),m=s(v,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),a=e(v,m,"*"),w=e(/[A-Z]/,m,"*"),Z=["autoclosure",e(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",e(/objc\(/,a,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],H=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function X(t){const o={match:/\s+/,relevance:0},F=t.COMMENT("/\\*","\\*/",{contains:["self"]}),c=[t.C_LINE_COMMENT_MODE,F],J={match:[/\./,s(...j,...C)],className:{2:"keyword"}},Q={match:e(/\./,s(...T)),relevance:0},ee=T.filter(n=>typeof n=="string").concat(["_|0"]),te=T.filter(n=>typeof n!="string").concat(z).map(N),ne={variants:[{className:"keyword",match:s(...te,...C)}]},u={$pattern:s(/\b\w+/,/#\w+/),keyword:ee.concat(V),literal:O},r=[J,Q,ne],se={match:e(/\./,s(...g)),relevance:0},ae={className:"built_in",match:e(/\b/,s(...g),/(?=\()/)},I=[se,ae],B={match:/->/,relevance:0},oe={className:"operator",relevance:0,variants:[{match:y},{match:`\\.(\\.|${S})+`}]},E=[B,oe],b="([0-9]_*)+",M="([0-9a-fA-F]_*)+",d={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},P=(n="")=>({className:"subst",variants:[{match:e(/\\/,n,/[0\\tnr"']/)},{match:e(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ce=(n="")=>({className:"subst",match:e(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(n="")=>({className:"subst",label:"interpol",begin:e(/\\/,n,/\(/),end:/\)/}),f=(n="")=>({begin:e(n,/"""/),end:e(/"""/,n),contains:[P(n),ce(n),k(n)]}),A=(n="")=>({begin:e(n,/"/),end:e(/"/,n),contains:[P(n),k(n)]}),l={className:"string",variants:[f(),f("#"),f("##"),f("###"),A(),A("#"),A("##"),A("###")]},L={match:e(/`/,a,/`/)},ie={className:"variable",match:/\$\d+/},ue={className:"variable",match:`\\$${m}+`},R=[L,ie,ue],re={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:H,contains:[...E,d,l]}]}},le={className:"keyword",match:e(/@/,s(...Z))},Ee={className:"meta",match:e(/@/,a)},h=[re,le,Ee],i={match:p(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:e(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,m,"+")},{className:"type",match:w,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:e(/\s+&\s+/,p(w)),relevance:0}]},de={begin://,keywords:u,contains:[...c,...r,...h,B,i]};i.contains.push(de);const pe={match:e(a,/\s*:/),keywords:"_|0",relevance:0},U={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",pe,...c,...r,...I,...E,d,l,...R,...h,i]},K={begin://,contains:[...c,i]},me={begin:s(p(e(a,/\s*:/)),p(e(a,/\s+/,a,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:a}]},x={begin:/\(/,end:/\)/,keywords:u,contains:[me,...c,...r,...E,d,l,...h,i,U],endsParent:!0,illegal:/["']/},Fe={match:[/func/,/\s+/,s(L.match,a,y)],className:{1:"keyword",3:"title.function"},contains:[K,x,o],illegal:[/\[/,/%/]},be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[K,x,o],illegal:/\[|%/},fe={match:[/operator/,/\s+/,y],className:{1:"keyword",3:"title"}},Ae={begin:[/precedencegroup/,/\s+/,w],className:{1:"keyword",3:"title"},contains:[i],keywords:[...q,...O],end:/}/};for(const n of l.variants){const W=n.contains.find(he=>he.label==="interpol");W.keywords=u;const $=[...r,...I,...E,d,l,...R];W.contains=[...$,{begin:/\(/,end:/\)/,contains:["self",...$]}]}return{name:"Swift",keywords:u,contains:[...c,Fe,be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...r]},fe,Ae,{beginKeywords:"import",end:/$/,contains:[...c],relevance:0},...r,...I,...E,d,l,...R,...h,i,U]}}G.exports=X}}]);