1import{mN as z}from"./index-Do2d937u.js";import"./mapbox-Dsi-_OTH.js";var _={exports:{}};var N;function L(){return N||(N=1,(function(x){(function(i,p){x.exports?x.exports=p():this[i]=p()})("$script",function(){var i=document,p=i.getElementsByTagName("head")[0],I=!1,h="push",S="readyState",A="onreadystatechange",s={},o={},d={},f,v;function m(e,t){for(var n=0,u=e.length;n<u;++n)if(!t(e[n]))return I;return 1}function g(e,t){m(e,function(n){return t(n),1})}function l(e,t,n){e=e[h]?e:[e];var u=t&&t.call,r=u?t:n,U=u?e.join(""):t,W=e.length;function w(c){return c.call?c():s[c]}function y(){if(!--W){s[U]=1,r&&r();for(var c in o)m(c.split("|"),w)&&!g(o[c],w)&&(o[c]=[])}}return setTimeout(function(){g(e,function c(a,j){if(a===null)return y();if(!j&&!/^https?:\/\//.test(a)&&f&&(a=a.indexOf(".js")===-1?f+a+".js":f+a),d[a])return d[a]==2?y():setTimeout(function(){c(a,!0)},0);d[a]=1,b(a,y)})},0),l}function b(e,t){var n=i.createElement("script"),u;n.onload=n.onerror=n[A]=function(){n[S]&&!/^c|loade/.test(n[S])||u||(n.onload=n[A]=null,u=1,d[e]=2,t())},n.async=1,n.src=v?e+(e.indexOf("?")===-1?"?":"&")+v:e,p.insertBefore(n,p.lastChild)}return l.get=b,l.order=function(e,t,n){(function u(r){r=e.shift(),e.length?l(r,u):l(r,t,n)})()},l.path=function(e){f=e},l.urlArgs=function(e){v=e},l.ready=function(e,t,n){e=e[h]?e:[e];var u=[];return!g(e,function(r){s[r]||u[h](r)})&&m(e,function(r){return s[r]})?t():(function(r){o[r]=o[r]||[],o[r][h](t),n&&n(u)})(e.join("|")),l},l.done=function(e){l([null],e)},l})})(_)),_.exports}var P=L();class E extends z{constructor(){super(...arguments),this.appleScriptUrl="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",this.isAppleScriptLoaded=!1}async authorize(i){return new Promise((p,I)=>{i?this.loadSignInWithAppleJS().then(h=>{var S,A,s;this.isAppleScriptLoaded=h,this.isAppleScriptLoaded?(AppleID.auth.init({clientId:i.clientId,redirectURI:i.redirectURI,scope:(S=i.scopes)!==null&&S!==void 0?S:void 0,state:(A=i.state)!==null&&A!==void 0?A:void 0,nonce:(s=i.nonce)!==null&&s!==void 0?s:void 0,usePopup:!0}),AppleID.auth.signIn().then(o=>{var d,f,v,m,g;const l={response:{user:null,email:(d=o.user)===null||d===void 0?void 0:d.email,givenName:(v=(f=o.user)===null||f===void 0?void 0:f.name)===null||v===void 0?void 0:v.firstName,familyName:(g=(m=o.user)===null||m===void 0?void 0:m.name)===null||g===void 0?void 0:g.lastName,identityToken:o.authorization.id_token,authorizationCode:o.authorization.code}};p(l)}).catch(o=>{I(o)})):I("Unable to load Sign in with Apple JS framework.")}):I("No options were provided.")})}loadSignInWithAppleJS(){return new Promise(i=>{this.isAppleScriptLoaded?i(!0):typeof window!==void 0?P.get(this.appleScriptUrl,()=>i(!0)):i(!1)})}}export{E as SignInWithAppleWeb};
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.