/*! For license information please see 2448.e07924a28f4c0813.js.LICENSE.txt */
export const __webpack_ids__=["2448"];export const __webpack_modules__={76629:function(e,t,s){e.exports=s.p+"survey.aa219aee52f606e2.svg"},2211:function(e,t,s){s.r(t),s.d(t,{MDNSurvey:()=>MDNSurvey});var r=s(14703),i=s(13566),a=s(51968);s(50272);var _=s(69535),o=s(34071),n=s(62264);Object.freeze({BLOG_FEEDBACK_2023:"BLOG_FEEDBACK_2023",BROWSER_SURVEY_OCT_2022:"BROWSER_SURVEY_OCT_2022",CONTENT_DISCOVERY_2023:"CONTENT_DISCOVERY_2023",CSS_CASCADE_2022:"CSS_CASCADE_2022",DE_LOCALE_2024:"DE_LOCALE_2024",DE_LOCALE_2024_EVAL:"DE_LOCALE_2024_EVAL",FIREFOX_WEB_COMPAT_2023:"FIREFOX_WEB_COMPAT_2023",INTEROP_2023:"INTEROP_2023",IT_LOCALE_2025:"IT_LOCALE_2025",WEB_COMPONENTS_2023:"WEB_COMPONENTS_2023",DISCOVERABILITY_2023:"DISCOVERABILITY_2023",WEB_SECURITY_2023:"WEB_SECURITY_2023",DISCOVERABILITY_AUG_2023:"DISCOVERABILITY_AUG_2023",WEB_APP_AUGUST_2024:"WEB_APP_AUGUST_2024",HOMEPAGE_FEEDBACK_2024:"HOMEPAGE_FEEDBACK_2024",WEBDX_EDITING_2024:"WEBDX_EDITING_2024",HOUSE_SURVEY_2025:"HOUSE_SURVEY_2025",JS_PROPOSALS_2025:"JS_PROPOSALS_2025",FIRST_FRED_2025:"FIRST_FRED_2025"});let u=[];function h(e){let t,s=`survey.${e}`;try{t=JSON.parse(localStorage?.getItem(s)??"{}")}catch{t={}}return 0===Object.keys(t).length&&d(e,t={random:Math.random(),seen_at:null,dismissed_at:null,submitted_at:null,opened_at:null}),t}function d(e,t){let s=`survey.${e}`;try{localStorage?.setItem(s,JSON.stringify(t))}catch{}}let MDNSurvey=class MDNSurvey extends(0,_.q)(r.oi){static styles=n.Z;static ssr=!1;constructor(){super(),this._survey=void 0,this._surveyState=void 0,this._isOpen=!1,this._force=!1,this._source=void 0,this._detailsRef=(0,a.V)()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#s()}#e(){void 0!==globalThis.window&&(this._force=globalThis.location.hash.startsWith("#FORCE_SURVEY="),this._survey=this.#r(),this._survey&&(this._surveyState=h(this._survey.bucket),this._source="function"==typeof this._survey.src?this._survey.src(globalThis.location.pathname):this._survey.src,this.#i()))}#r(){return u.find(e=>{if(this._force)return e.key===globalThis.location.hash.slice(14);if(void 0===globalThis.window||!e.show(globalThis.location.pathname))return!1;let t=Date.now();if(t<e.start||e.end<t)return!1;let s=h(e.bucket);return s.random>=e.rateFrom&&s.random<e.rateTill})}#i(){this._survey&&this._surveyState&&!this._surveyState.seen_at&&(this._surveyState={...this._surveyState,seen_at:Date.now()},d(this._survey.bucket,this._surveyState),this.#a("seen"))}#_(){this._survey&&this._surveyState&&(this._surveyState={...this._surveyState,dismissed_at:Date.now()},d(this._survey.bucket,this._surveyState),this.#a("dismissed"),this.requestUpdate())}#o(){if(!this._survey||!this._surveyState||this._isOpen)return;let e=this._detailsRef.value;e&&e.open&&(this._surveyState={...this._surveyState,opened_at:Date.now()},d(this._survey.bucket,this._surveyState),this.#a("opened"),this._isOpen=!0,this.requestUpdate())}#n(){this._survey&&this._surveyState&&(this._surveyState={...this._surveyState,submitted_at:Date.now()},d(this._survey.bucket,this._surveyState),this.#a("submitted"),this.requestUpdate())}#a(e){this._survey&&console.log(`Survey: ${e} ${this._survey.bucket}`)}#t(){this._messageListener=e=>{"https://survey.alchemer.com"===e.origin&&"submit"===e.data&&this.#n()},window.addEventListener("message",this._messageListener,!1)}#s(){this._messageListener&&window.removeEventListener("message",this._messageListener,!1)}render(){if(!this._survey||!this._surveyState||!this._force&&(this._surveyState.dismissed_at||this._surveyState?.submitted_at))return r.Ld;let e=this.l10n`Hide this survey`;return(0,r.dy)`
      <div class="survey">
        <header>
          <p>${this._survey.teaser}</p>
          <mdn-button
            variant="plain"
            .icon=${o.Z}
            icon-only
            title=${e}
            aria-label=${e}
            @click=${this.#_}
          ></mdn-button>
        </header>
        <details ${(0,a.i)(this._detailsRef)} @toggle=${this.#o}>
          <summary>${this._survey.question}</summary>
          ${this._isOpen&&this._source?(0,r.dy)`
                <iframe
                  title=${(0,i.o)(this._survey.question)}
                  src=${this._source}
                ></iframe>
              `:r.Ld}
        </details>
        ${this._survey.footnote?(0,r.dy)` <footer>(${this._survey.footnote})</footer> `:r.Ld}
      </div>
    `}};customElements.define("mdn-survey",MDNSurvey)},13566:function(e,t,s){s.d(t,{o:()=>i});var r=s(32529);let i=e=>e??r.Ld},62264:function(e,t,s){s.d(t,{Z:()=>c});var r=s(14703),i=s(8081),a=s.n(i),_=s(23645),o=s.n(_),n=s(61667),u=s.n(n),h=new s.U(s(76629)),d=o()(a()),l=u()(h);d.push([e.id,`:host{display:block}.survey{background-color:var(--color-background-purple);border-radius:.5rem;display:grid;padding:1rem 1rem 1rem 5rem;row-gap:.75rem}header{align-items:center;display:flex;justify-content:space-between}header:before{background:url(${l});background-size:cover;content:"";height:49px;margin-left:calc(-53px - .5rem);margin-top:1rem;position:absolute;width:53px}p{margin:0}mdn-button::part(button):hover{background-color:initial;border:1px solid var(--color-text-purple)}mdn-button::part(icon){color:var(--color-text-purple)}summary{color:var(--color-text-purple);cursor:pointer}iframe{border:none;border-radius:.5rem;height:500px;overflow:hidden;width:100%}footer{font-size:var(--font-size-small);font-style:italic}`,""]);let c=(0,r.iv)([d.toString()])}};
//# sourceMappingURL=2448.e07924a28f4c0813.js.map