티스토리 수익 글 보기
“use strict”;(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[“marketplace”],{4559:(e,t,n)=>{n.d(t,{C:()=>a,i:()=>s});var r=n(71315),i=n(69599),o=n(46493);function a(e,t){(0,i.G7)(“arianotify_comprehensive_migration”)?s(l(e),{…t,element:t?.element??e}):(0,i.G7)(“primer_live_region_element”)&&t?.element===void 0?(0,o.Cj)(e,{politeness:t?.assertive?”assertive”:”polite”}):s(l(e),t)}function s(e,t){var n,a;let s,{assertive:l,element:c}=t??{};(0,i.G7)(“arianotify_comprehensive_migration”)&&”ariaNotify”in Element.prototype&&c?c.ariaNotify(e):(0,i.G7)(“arianotify_comprehensive_migration”)&&”ariaNotify”in Document.prototype?document.ariaNotify(e):(0,i.G7)(“primer_live_region_element”)&&void 0===c?(0,o.iP)(e,{politeness:l?”assertive”:”polite”}):(n=e,a=l,(s=c??r.XC?.querySelector(a?”#js-global-screen-reader-notice-assertive”:”#js-global-screen-reader-notice”))&&(s.textContent===n?s.textContent=`${n}\u00A0`:s.textContent=n))}function l(e){return(e.getAttribute(“aria-label”)||e.innerText||””).trim()}},6923:(e,t,n)=>{n.d(t,{KJ:()=>o,X3:()=>i,g5:()=>a});var r=n(56038);let i=void 0===r.XC,o=!i;function a(){return!!i||!r.XC||!!(r.XC.querySelector(‘react-app[data-ssr=”true”]’)||r.XC.querySelector(‘react-partial[data-ssr=”true”][partial-name=”repos-overview”]’))}},13523:(e,t,n)=>{n.d(t,{$r:()=>a,M1:()=>s,li:()=>i,pS:()=>c,wE:()=>l});var r=n(71315);let i=”X-Fetch-Nonce”,o=new Set;function a(e){o.add(e)}function s(){return o.values().next().value||””}function l(e){let t={};return void 0!==e&&(t[“X-Fetch-Nonce-To-Validate”]=e),void 0===e?t[i]=s():o.has(e)?t[i]=e:t[i]=Array.from(o).join(“,”),t}function c(){let e=r.XC?.head?.querySelector(‘meta[name=”fetch-nonce”]’)?.content||””;e&&a(e)}},21067:(e,t,n)=>{let r;function i(){if(!r)throw Error(“Client env was requested before it was loaded. This likely means you are attempting to use client env at the module level in SSR, which is not supported. Please move your client env usage into a function.”);return r}function o(){return r?.locale??”en-US”}function a(){return!!i().login}function s(){return i().login}if(n.d(t,{JK:()=>o,M3:()=>a,_$:()=>i,cj:()=>s}),”undefined”!=typeof document){let e=document.getElementById(“client-env”);if(e)try{r=JSON.parse(e.textContent||””)}catch(e){console.error(“Error parsing client-env”,e)}}},30923:(e,t,n)=>{n.d(t,{Ee:()=>l,b4:()=>c,Ts:()=>s});var r=n(50467);let i=class ResponseError extends Error{constructor(e,t){super(`${e} for HTTP ${t.status}`),(0,r._)(this,”response”,void 0),this.response=t,this.name=”ResponseError”}};var o=n(69759),a=n(51987);async function s(e,t,n){let r=new Request(t,n);(0,a.tV)(r.headers);let s=await self.fetch(r);if(s.status<200||s.status>=300)throw Error(`HTTP ${s.status}${s.statusText||””}`);return!function(e,t,n=!1){let r=t.headers.get(“content-type”)||””;if(!n&&!r.startsWith(“text/html”))throw new i(`expected response with text/html, but was ${r}`,t);if(n&&!(r.startsWith(“text/html”)||r.startsWith(“application/json”)))throw new i(`expected response with text/html or application/json, but was ${r}`,t);let o=t.headers.get(“x-html-safe”);if(o){if(!e.includes(o))throw new i(“response X-HTML-Safe nonce did not match”,t)}else throw new i(“missing X-HTML-Safe nonce”,t)}(function(e){let t=[…e.querySelectorAll(“meta[name=html-safe-nonce]”)].map(e=>e.content);if(t.length<1)throw Error("could not find html-safe-nonce on document");return t}(e),s),(0,o.B)(e,await s.text())}function l(e,t,n=1e3,r=[200],i=[202]){return async function n(o){let s=new Request(e,t);(0,a.tV)(s.headers);let l=await self.fetch(s);if(i.includes(l.status))return await new Promise(e=>setTimeout(e,o)),n(1.5*o);if(r.includes(l.status))return l;if(l.status<200||l.status>=300)throw Error(`HTTP ${l.status}${l.statusText||””}`);throw Error(`Unexpected ${l.status} response status from poll endpoint`)}(n)}async function c(e,t,n){let{wait:r=500,acceptedStatusCodes:i=[200],max:o=3,attempt:s=0}=n||{},l=async()=>new Promise((n,l)=>{setTimeout(async()=>{try{let r=new Request(e,t);(0,a.tV)(r.headers);let l=await self.fetch(r);if(i.includes(l.status)||s+1===o)return n(l);n(“retry”)}catch(e){l(e)}},r*s)}),u=await l();return”retry”!==u?u:c(e,t,{wait:r,acceptedStatusCodes:i,max:o,attempt:s+1})}},46865:(e,t,n)=>{n.d(t,{Cy:()=>s,K3:()=>u,Z8:()=>l,k_:()=>o,lK:()=>d,m$:()=>a});var r=n(88578);function i(e,t,n){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:n}))}function o(e,t){t&&(function(e,t){if(!(e instanceof HTMLFormElement))throw TypeError(“The specified element is not of type HTMLFormElement.”);if(!(t instanceof HTMLElement))throw TypeError(“The specified element is not of type HTMLElement.”);if(“submit”!==t.type)throw TypeError(“The specified element is not a submit button.”);if(!e||e!==t.form)throw Error(“The specified element is not owned by the form element.”)}(e,t),(0,r.A)(t)),i(e,”submit”,!0)&&e.submit()}function a(e,t){if(“boolean”==typeof t)if(e instanceof HTMLInputElement)e.checked=t;else throw TypeError(“only checkboxes can be set to boolean value”);else if(“checkbox”===e.type)throw TypeError(“checkbox can’t be set to string value”);else e.value=t;i(e,”change”,!1)}function s(e,t){for(let n in t){let r=t[n],i=e.elements.namedItem(n);i instanceof HTMLInputElement?i.value=r:i instanceof HTMLTextAreaElement&&(i.value=r)}}function l(e){if(!(e instanceof HTMLElement))return!1;let t=e.nodeName.toLowerCase(),n=(e.getAttribute(“type”)||””).toLowerCase();return”select”===t||”textarea”===t||”input”===t&&”submit”!==n&&”reset”!==n||e.isContentEditable}function c(e){return new URLSearchParams(e)}function u(e,t){let n=new URLSearchParams(e.search);for(let[e,r]of c(t))n.append(e,r);return n.toString()}function d(e){return c(new FormData(e)).toString()}},51987:(e,t,n)=>{n.d(t,{jC:()=>l,kt:()=>a,tV:()=>s});var r=n(87057),i=n(69599),o=n(13523);function a(e){let t={“X-Requested-With”:”XMLHttpRequest”,…(0,o.wE)(e)};return(0,i.G7)(“client_version_header”)&&(t={…t,[r.S]:(0,r.O)()}),t}function s(e,t){for(let[n,r]of Object.entries(a(t)))e.set(n,r)}function l(e){return{“X-GitHub-App-Type”:e}}},56038:(e,t,n)=>{n.d(t,{Kn:()=>a,XC:()=>i,cg:()=>o,fV:()=>s});let r=”undefined”!=typeof FORCE_SERVER_ENV&&FORCE_SERVER_ENV,i=”undefined”==typeof document||r?void 0:document,o=”undefined”==typeof window||r?void 0:window,a=”undefined”==typeof history||r?void 0:history,s=”undefined”==typeof location||r?{pathname:””,origin:””,search:””,hash:””,href:””}:location},58371:(e,t,n)=>{n.d(t,{Ax:()=>i.Ax,JW:()=>o,ZV:()=>i.ZV});var r=n(51987),i=n(13937);function o(e,t){(0,i.JW)(e,async(e,n,i)=>((0,r.tV)(i.headers),t(e,n,i)))}},69599:(e,t,n)=>{n.d(t,{G7:()=>l,XY:()=>c,fQ:()=>s});var r=n(5225),i=n(21067);function o(){return new Set((0,i._$)().featureFlags)}let a=n(71315).X3||function(){try{return process?.env?.STORYBOOK===”true”}catch{return!1}}()?o:(0,r.A)(o);function s(){return Array.from(a())}function l(e){return a().has(e)}let c={isFeatureEnabled:l}},69759:(e,t,n)=>{n.d(t,{B:()=>r});function r(e,t){let n=e.createElement(“template”);return n.innerHTML=t,e.importNode(n.content,!0)}},71315:(e,t,n)=>{n.d(t,{KJ:()=>r.KJ,Kn:()=>i.Kn,X3:()=>r.X3,XC:()=>i.XC,cg:()=>i.cg,fV:()=>i.fV,g5:()=>r.g5});var r=n(6923),i=n(56038)},73855:(e,t,n)=>{n.d(t,{CN:()=>SearchItem,P$:()=>QueryEvent,VJ:()=>c,dS:()=>FetchDataEvent,k8:()=>o,m4:()=>s,nM:()=>a,o7:()=>i,qi:()=>FilterItem,yk:()=>l});var r=n(50467);let i={DIRECTORY:”Search in this directory”,ORG:”Search in this organization”,OWNER:”Search in this owner”,REPO:”Search in this repository”,ENTERPRISE:”Search in this enterprise”,GITHUB:”Search all of GitHub”,GENERAL:”Submit search”,COMMAND:”Run command”,COPILOT_CHAT:”Start a new Copilot thread”,COPILOT_SEARCH:”Search with Copilot”,EXPLORE:”Learn More”,DEFAULT:”Jump to”},o=”Autocomplete”;let FilterItem=class FilterItem extends Event{constructor({filter:e,value:t,name:n=””,description:i=””,inlineDescription:o=!1,priority:a=1/0,icon:s,avatar:l,action:c}){super(“filter-item”),(0,r._)(this,”name”,void 0),(0,r._)(this,”filter”,void 0),(0,r._)(this,”value”,void 0),(0,r._)(this,”description”,void 0),(0,r._)(this,”inlineDescription”,!1),(0,r._)(this,”action”,void 0),(0,r._)(this,”priority”,void 0),(0,r._)(this,”icon”,void 0),(0,r._)(this,”avatar”,void 0),this.filter=e,this.value=t,this.name=n,this.description=i,this.inlineDescription=o,this.priority=a,this.icon=s,this.avatar=l,this.action=c}};function a(e){return e instanceof Object}let s={Apps:”apps”,Archived:”archived”,Book:”book”,Bookmark:”bookmark”,Branch:”branch”,Calendar:”calendar”,Circle:”circle”,Code:”code”,CodeReview:”code-review”,CodeSquare:”code-square”,Comment:”comment”,CommentDiscussion:”comment-discussion”,Copilot:”copilot”,CopilotError:”copilot-error”,Codespaces:”codespaces”,CreditCard:”credit-card”,Default:”default”,DeviceDesktop:”device-desktop”,DeviceMobile:”device-mobile”,Discussion:”discussion”,Draft:”draft”,FileCode:”file-code”,Filter:”filter”,Forbidden:”forbidden”,Gift:”gift”,Globe:”globe”,Heart:”heart”,History:”history”,Issue:”issue”,IssueOpened:”issue-opened”,IssueClosed:”issueClosed”,Iterations:”iterations”,Mention:”mention”,Merged:”merged”,Milestone:”milestone”,No:”no”,Not:”not”,Organization:”organization”,Package:”package”,Pencil:”pencil”,Person:”person”,Play:”play”,PlusCircle:”plus-circle”,Project:”project”,PullRequest:”pullRequest”,Question:”question”,Reaction:”reaction”,Repo:”repo”,Rocket:”rocket”,Search:”search”,Server:”server”,ShieldCheck:”shield-check”,SingleSelect:”single-select”,Sort:”sort”,Tag:”tag”,Team:”team”,Telescope:”telescope”,Trash:”trash”,Workflow:”workflow”},l={Entity:”–color-prettylights-syntax-entity”,Constant:”–color-prettylights-syntax-constant”,Keyword:”–color-prettylights-syntax-keyword”,Variable:”–color-prettylights-syntax-variable”,String:”–color-prettylights-syntax-string”};let SearchItem=class SearchItem extends Event{constructor({id:e,priority:t,value:n,action:i,description:o=””,icon:a,scope:s=”DEFAULT”,prefixText:l,prefixColor:c,isFallbackSuggestion:u,isUpdate:d}){super(d?”update-item”:”search-item”),(0,r._)(this,”id”,void 0),(0,r._)(this,”priority”,void 0),(0,r._)(this,”value”,void 0),(0,r._)(this,”action”,void 0),(0,r._)(this,”description”,void 0),(0,r._)(this,”icon”,void 0),(0,r._)(this,”scope”,void 0),(0,r._)(this,”prefixText”,void 0),(0,r._)(this,”prefixColor”,void 0),(0,r._)(this,”isFallbackSuggestion”,void 0),this.id=e,this.priority=t,this.value=n,this.prefixText=l,this.prefixColor=c,this.action=i,this.description=o,this.icon=a,this.scope=s,this.isFallbackSuggestion=u||!1}};let c={Normal:”normal”,Entity:”entity”,Constant:”constant”,FilterValue:”filter-value”};let FetchDataEvent=class FetchDataEvent extends Event{constructor(e){super(“fetch-data”),(0,r._)(this,”fetchPromise”,void 0),this.fetchPromise=e}};let QueryEvent=class QueryEvent extends Event{toString(){return this.rawQuery}constructor(e,t,n){super(“query”),(0,r._)(this,”parsedQuery”,void 0),(0,r._)(this,”rawQuery”,void 0),(0,r._)(this,”parsedMetadata”,void 0),this.parsedQuery=e,this.rawQuery=t,this.parsedMetadata=n}};Event},87057:(e,t,n)=>{n.d(t,{O:()=>a,S:()=>o});var r=n(71315);let i=r.cg?.document?.head?.querySelector(‘meta[name=”release”]’)?.content||””,o=”X-GitHub-Client-Version”;function a(){return i}},87363:(e,t,n)=>{n.d(t,{Ff:()=>l,eC:()=>c,uE:()=>s});var r=n(6986);let i=!1,o=new r.A;function a(e){let t=e.target;if(t instanceof HTMLElement&&t.nodeType!==Node.DOCUMENT_NODE)for(let e of o.matches(t))e.data.call(null,t)}function s(e,t){i||(i=!0,document.addEventListener(“focus”,a,!0)),o.add(e,t),document.activeElement instanceof HTMLElement&&document.activeElement.matches(e)&&t(document.activeElement)}function l(e,t,n){function r(t){let i=t.currentTarget;i&&(i.removeEventListener(e,n),i.removeEventListener(“blur”,r))}s(t,function(t){t.addEventListener(e,n),t.addEventListener(“blur”,r)})}function c(e,t){function n(e){let{currentTarget:r}=e;r&&(r.removeEventListener(“input”,t),r.removeEventListener(“blur”,n))}s(e,function(e){e.addEventListener(“input”,t),e.addEventListener(“blur”,n)})}},88578:(e,t,n)=>{function r(e){let t=e.closest(“form”);if(!(t instanceof HTMLFormElement))return;let n=i(t);if(e.name){let r=e.matches(“input[type=submit]”)?”Submit”:””,i=e.value||r;n||((n=document.createElement(“input”)).type=”hidden”,n.classList.add(“js-submit-button-value”),t.prepend(n)),n.name=e.name,n.value=i}else n&&n.remove()}function i(e){let t=e.querySelector(“input.js-submit-button-value”);return t instanceof HTMLInputElement?t:null}n.d(t,{A:()=>r,C:()=>i})},94156:(e,t,n)=>{var r=n(95439),i=n(21403),o=n(97797),a=n(87363),s=n(58371),l=n(46865),c=n(4559);function u(e){e.closest(“.js-marketplace-listing-form-container”).querySelector(“.js-marketplace-listing-error-container”).hidden=!0}function d(e,t){let n=e.closest(“.js-marketplace-listing-form-container”).querySelector(“.js-marketplace-listing-error-container”);n.hidden=!1;let r=n.querySelector(“.js-marketplace-listing-error”);r.textContent=t,(0,c.C)(r,{assertive:!0})}function p(e){let t=e.querySelector(“.js-marketplace-listing-save-notice”);t&&(t.classList.add(“visible”),setTimeout(()=>t.classList.remove(“visible”),1500))}function m(e,t){for(let n of e.closest(“.js-marketplace-listing-form-container”).querySelectorAll(“.js-marketplace-listing-bgcolor”))n instanceof HTMLElement&&(n.style.backgroundColor=`#${t}`)}function h(e){let t=document.querySelector(“.js-hero-listing-container .js-hero-listing-bgcolor”);t instanceof HTMLElement&&(t.style.backgroundColor=`#${e}`)}function f(e,t,n){let i=n.closest(“.js-listing-characters-remaining-container”).querySelector(“.js-listing-characters-remaining”),o=String(i.getAttribute(“data-suffix”)),a=t-(0,r.bV)(e);i.textContent=`${a} ${o}`,i.classList.toggle(“color-fg-danger”,a<=5),a<=5&&(0,c.C)(i,{assertive:!0})}function g(e){let t=e.item,n=t.querySelector(".js-marketplace-listing-screenshot-resequence-form"),r=n.elements.namedItem("marketplace_listing_screenshot[previousScreenshotId]"),i=t.previousElementSibling;i instanceof HTMLElement?r.value=i.getAttribute("data-screenshot-id"):r.value="",(0,l.k_)(n)}function v(e){return["FLAT_RATE","PER_UNIT"].includes(e)}function y(e){return"PER_UNIT"===e}function b(e,t){for(let n of e)n.disabled=!t}(0,a.eC)(".js-marketplace-short-description-field",function(e){let t=e.target,n=t.closest(".form-group");t.validity.patternMismatch?n.classList.add("errored"):n.classList.remove("errored")}),(0,o.on)("change",".js-marketplace-listing-light-text",function(e){var t;let n;t=e.target.value,(n=document.querySelector(".js-hero-listing-name"))&&("true"===t?(n.classList.add("color-text-white"),n.classList.remove("color-fg-default")):(n.classList.remove("color-text-white"),n.classList.add("color-fg-default")))}),(0,o.on)("change",".js-marketplace-listing-logo-background-color",function(e){let t=e.target;m(t.closest("form"),t.value),h(t.value)}),(0,s.JW)(".js-marketplace-listing-form",async function(e,t){var n;let r,i;u(e);try{r=await t.json()}catch(t){if(!t.response)throw t;d(e,t.response.json.error);return}if(r.json.path){let e=window.location.pathname,t=r.json.path;if(e!==t){window.location.href=t;return}}r.json.bgcolor&&(m(e,r.json.bgcolor),h(r.json.bgcolor)),r.json.short_description&&(n=r.json.short_description,(i=document.querySelector(".js-hero-listing-description"))&&(i.textContent=n)),p(e)}),(0,s.JW)(".js-marketplace-listing-screenshot-update-form",async function(e,t){try{await t.text()}catch{let t;(t=e.querySelector(".js-marketplace-listing-save-error"))&&(t.classList.add("visible"),setTimeout(()=>t.classList.remove(“visible”),1500));return}let n=e.querySelector(“.js-marketplace-listing-screenshot-caption-field”),r=e.querySelector(“.js-marketplace-listing-screenshot-caption-present”),i=e.querySelector(“.js-marketplace-listing-screenshot-caption-empty”);r.textContent=n.value,n.value.trim().length<1?(r.classList.add("d-none"),i.classList.remove("d-none")):(r.classList.remove("d-none"),i.classList.add("d-none")),p(e)}),(0,s.JW)(".js-marketplace-listing-screenshot-delete-form",async function(e,t){u(e);let n=e.querySelector(".js-marketplace-listing-screenshot-delete-button");n.disabled=!0;try{await t.text()}catch(t){if(t.response){try{d(e,t.response.json.error)}catch{throw t}finally{n.disabled=!1}return}throw t}e.closest(".js-marketplace-listing-screenshot-container").remove()}),(0,a.eC)("textarea.js-listing-characters-remaining-field",function(e){let t=e.target,n=parseInt(t.getAttribute("data-character-limit")||"",10);f(t.value,n,t)}),(0,a.eC)("input.js-listing-characters-remaining-field",function(e){let t=e.target,n=t.maxLength;f(t.value,n,t)}),(0,o.on)("details-menu-selected",".js-languages-menu",function(e){let t=e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]');document.querySelector(".js-language-selection").textContent=Array.from(t).map(e=>(e.textContent||””).trim()).sort().join(“, “)},{capture:!0}),(0,i.lB)(“.js-draggable-screenshots-container”,{async add(e){let{Sortable:t}=await n.e(“app_assets_modules_github_sortable-behavior_ts”).then(n.bind(n,35011));t.create(e,{animation:150,draggable:”.js-draggable-screenshot”,onUpdate:g})}}),(0,i.lB)(“.js-listing-plan-option:checked”,{constructor:HTMLInputElement,add(e){let t=e.value,n=e.closest(“.js-marketplace-edit-plan-editor”),r=n.querySelectorAll(“.js-marketplace-plan-price-field-group”),i=n.querySelectorAll(“.js-marketplace-plan-free-trial-field-group”),o=n.querySelectorAll(“.js-marketplace-plan-unit-field-group”);(function(e){for(let t of document.querySelectorAll(“.js-marketplace-plan-edit-unit”))t instanceof HTMLElement&&(t.hidden=!y(e));for(let t of document.querySelectorAll(“.js-marketplace-plan-edit-price, .js-marketplace-plan-enable-free-trial”))t instanceof HTMLElement&&(t.hidden=!v(e))})(t),b(r,[“FLAT_RATE”,”PER_UNIT”].includes(t)),b(i,v(t)),b(o,y(t)),n.querySelector(“.js-marketplace-plan-unit-name-field”).required=y(t)}}),(0,o.on)(“click”,”.js-marketplace-plan-preview-toggle”,function(e){let t=e.currentTarget.closest(“.js-marketplace-edit-plan-container”),n=t.querySelector(“.js-marketplace-plan-editor-toggle”),r=t.querySelector(“.js-marketplace-edit-plan-editor”),i=t.querySelector(“.js-marketplace-edit-plan-preview”);i.classList.contains(“d-none”)&&(e.currentTarget.classList.add(“selected”),n.classList.remove(“selected”),i.classList.remove(“d-none”),r.classList.add(“d-none”),function(e,t){t.querySelector(“.js-marketplace-plan-name”).textContent=e.querySelector(“.js-marketplace-plan-name-field”).value;let n=t.querySelector(“.js-marketplace-free-trial-container”),r=t.querySelector(“.js-marketplace-no-trial-container”),i=t.querySelector(“.js-marketplace-direct-billing-container”);e.querySelector(“.js-marketplace-free-trial-field”).checked?(n.classList.remove(“d-none”),i.classList.add(“d-none”),r.classList.add(“d-none”)):(r.classList.remove(“d-none”),n.classList.add(“d-none”),i.classList.add(“d-none”));let o=e.querySelector(“.js-listing-plan-option:checked”).value,a=t.querySelectorAll(“.js-marketplace-plan-unit-name”),s=t.querySelector(“.js-marketplace-plan-per-unit-info”);if(“PER_UNIT”===o){let t=e.querySelector(“.js-marketplace-plan-unit-name-field”).value;for(let e of a)e.textContent=t,e.classList.remove(“d-none”);s.classList.remove(“d-none”)}else{for(let e of a)e.classList.add(“d-none”);s.classList.add(“d-none”)}if(“FREE”===o||”DIRECT_BILLING”===o)for(let e of t.querySelectorAll(“.js-marketplace-plan-dollars-container”))e.classList.add(“d-none”);else{let n=t.querySelector(“.js-marketplace-plan-monthly-dollars”);n.textContent=e.querySelector(“.js-marketplace-plan-monthly-price-field”).value,n.closest(“.js-marketplace-plan-dollars-container”).classList.remove(“d-none”);let r=t.querySelector(“.js-marketplace-plan-yearly-dollars”);r.textContent=e.querySelector(“.js-marketplace-plan-yearly-price-field”).value,r.closest(“.js-marketplace-plan-dollars-container”).classList.remove(“d-none”)}”DIRECT_BILLING”===o&&(r.classList.add(“d-none”),n.classList.add(“d-none”),i.classList.remove(“d-none”));let l=t.querySelector(“.js-marketplace-plan-bullets”);l.textContent=””;let c=e.querySelectorAll(“.js-marketplace-plan-bullet-field”),u=t.querySelector(“.js-marketplace-plan-bullet-template”);for(let e of c){let t=e.value;if(t.trim().length<1)continue;let n=u.content.cloneNode(!0);if(!(n instanceof DocumentFragment))return;n.querySelector(".js-marketplace-plan-bullet").textContent=t,l.appendChild(n)}t.querySelector(".js-marketplace-plan-description").textContent=e.querySelector(".js-marketplace-plan-description-field").value,t.querySelector(".js-marketplace-plan-for-account-type").textContent=(e.querySelector(".js-plan-for-account-type").textContent||"").toLowerCase()}(r,i))}),(0,o.on)("click",".js-marketplace-plan-editor-toggle",function(e){let t=e.currentTarget.closest(".js-marketplace-edit-plan-container"),n=t.querySelector(".js-marketplace-plan-preview-toggle"),r=t.querySelector(".js-marketplace-edit-plan-editor"),i=t.querySelector(".js-marketplace-edit-plan-preview");r.classList.contains("d-none")&&(e.currentTarget.classList.add("selected"),n.classList.remove("selected"),i.classList.add("d-none"),r.classList.remove("d-none"))}),(0,o.on)("change",".js-marketplace-plan-dollar-field",function(e){let t=e.currentTarget;t.closest(".js-marketplace-plan-dollar-field-container").classList.toggle("is-errored",!t.checkValidity())});var E=n(30923);async function k(e){let t=e.target,n=parseInt(t.value,10).toFixed(),r=new URL(t.getAttribute("data-url"),window.location.origin),i=new URLSearchParams(r.search.slice(1));i.set("quantity",n),r.search=i.toString();let o=await (0,E.Ts)(document,r.toString()),a=document.querySelector(".js-marketplace-order-preview");a.textContent="",a.appendChild(o)}(0,i.lB)(".js-marketplace-order-quantity",function(e){e.addEventListener("input",k)}),(0,o.on)("change","input.js-grant-oap-checkbox",function(e){let t=e.currentTarget,n=document.querySelector(".js-marketplace-complete-order");n&&(n.disabled=!t.checked)}),(0,o.on)("click",".js-marketplace-complete-order",function(e){e.preventDefault();let t=e.currentTarget,n=t.form,r=document.querySelector(".js-marketplace-billing-modal");"true"===t.getAttribute("data-show-billing-modal")&&r?r.setAttribute("open","true"):n&&n.submit()}),(0,o.on)("upload:setup",".js-upload-marketplace-listing-hero-card-background",function(e){let{form:t}=e.detail,n=e.currentTarget.getAttribute("data-marketplace-listing-id");n&&t.append("marketplace_listing_id",n)}),(0,o.on)("upload:complete",".js-upload-marketplace-listing-hero-card-background",function(e){let{attachment:t}=e.detail;document.querySelector(".js-marketplace-listing-hero-card-background-id").value=t.id,document.querySelector(".js-hero-listing-container").style.backgroundImage=`url(${t.href})`}),(0,o.on)("upload:setup",".js-upload-marketplace-listing-screenshot",function(e){let{form:t}=e.detail,n=e.currentTarget.getAttribute("data-marketplace-listing-id");n&&t.append("marketplace_listing_id",n)}),(0,o.on)("upload:complete",".js-upload-marketplace-listing-screenshot",async function(e){let t=e.currentTarget.getAttribute("data-screenshots-url"),n=document.querySelector(".js-marketplace-listing-screenshots-container"),r=await (0,E.Ts)(document,t);n.textContent="",n.appendChild(r)});var S=n(50467),j=n(5225),w=n(91385),_=n(73855);async function q(e){let t=await fetch(e,{headers:{Accept:"application/json"}});return t.ok?await t.json():void 0}let L=new Map,C=(0,j.A)(q,{cache:L}),T="query-builder-marketplace-search-box";async function x(){return C(document.querySelector(`query-builder#${T}`).getAttribute("data-suggestable-publishers-path"))}async function A(){let e=await x(),t=document.getElementById("type"),n=t?.value;return"apps"===n?e.apps:"actions"===n?e.actions:"stacks"===n?e.stacks:e.all}let I=[{name:"Best Match",value:"match-desc"},{name:"Recently added",value:"created-desc"},{name:"Popularity",value:"popularity-desc"}],R=document.querySelector("#marketplace-search-combobox-form")?.getAttribute("action")||"",M=(e,t)=>e.filter(e=>{if(t&&(0,w.qA)(t,e)||””===t)return e}),N=class SearchItemProvider extends EventTarget{handleEvent(e){“”!==String(e)&&this.dispatchEvent(new _.CN({priority:1,value:e.toString(),icon:_.m4.Search,scope:”GENERAL”,action:{url:`${R}?query=${e.toString()}`}}))}constructor(e){super(),(0,S._)(this,”priority”,1),(0,S._)(this,”name”,”Search”),(0,S._)(this,”singularItemName”,”search item”),(0,S._)(this,”value”,”search”),(0,S._)(this,”type”,”search”),(0,S._)(this,”queryBuilder”,void 0),this.queryBuilder=e,this.queryBuilder.addEventListener(“query”,this),this.queryBuilder.attachProvider(this)}},P=class PublisherProvider extends EventTarget{async handleEvent(e){let t=e.parsedQuery.at(-1),n=t?.value||””,r=t?.type,i=t?.filter||””;if(“filter”!==r&&((0,w.qA)(n,this.value)||””===n)&&this.dispatchEvent(new Event(“show”)),”filter”===r&&i===this.value)for(let e of M((await A()).map(e=>e.login),n).slice(0,30))this.dispatchEvent(new _.qi({filter:”publisher”,value:e}))}constructor(e){super(),(0,S._)(this,”name”,”Publishers”),(0,S._)(this,”singularItemName”,”publisher”),(0,S._)(this,”value”,”publisher”),(0,S._)(this,”priority”,2),(0,S._)(this,”type”,”filter”),(0,S._)(this,”queryBuilder”,void 0),this.queryBuilder=e,this.queryBuilder.addEventListener(“query”,this),this.queryBuilder.attachProvider(this)}},B=class SortProvider extends EventTarget{handleEvent(e){let t=e.parsedQuery.at(-1),n=t?.value||””,r=t?.type,i=t?.filter||””,o=M(I.map(e=>e.name),n);if(“filter”!==r&&((0,w.qA)(n,this.value)||””===n)&&this.dispatchEvent(new Event(“show”)),”filter”===r&&i===this.value)for(let e of o){let t=I.findIndex(t=>t.name===e),n=I[t]?.value||””;this.dispatchEvent(new _.qi({filter:”sort”,name:e,value:n}))}}constructor(e){super(),(0,S._)(this,”name”,”Sort by”),(0,S._)(this,”singularItemName”,”sort”),(0,S._)(this,”value”,”sort”),(0,S._)(this,”priority”,3),(0,S._)(this,”type”,”filter”),(0,S._)(this,”queryBuilder”,void 0),this.queryBuilder=e,this.queryBuilder.addEventListener(“query”,this),this.queryBuilder.attachProvider(this)}};document.addEventListener(“query-builder:request-provider”,e=>{let t=e.target;t&&t.id===T&&(new N(e.target),new P(e.target),new B(e.target))}),(0,o.on)(“click”,”.js-listing-delist-button”,function({currentTarget:e}){let t=e.getAttribute(“data-show-dialog-id”),n=document.getElementById(t);n.addEventListener(“cancel”,()=>{H(“1”)},{once:!0}),n.addEventListener(“close”,()=>{H(“1”)},{once:!0})}),(0,o.on)(“click”,”.js-listing-delist-proceed-button”,function({currentTarget:e}){let t=e.getAttribute(“data-next-stage”);t&&H(t)}),(0,a.eC)(“.js-listing-delist-proceed-confirmation”,function({currentTarget:e}){let t=e.getAttribute(“data-repo-nwo”);if(t){let o=document.getElementById(“listing-delist-proceed-button”),a=e.value===t;if(o&&a){var n,r,i;let a,s=e.closest(“form”);s&&(n=s,r=”verify”,i=t,(a=document.createElement(“input”)).setAttribute(“type”,”hidden”),a.setAttribute(“name”,r),a.setAttribute(“value”,i),n.appendChild(a),o.disabled=!1)}else o.disabled=!0}});function H(e){let t=document.getElementById(`delist-listing-step-${e}`),n=document.getElementById(`proceed-button-delist-step-${e}`);if(t&&n){let e=n.content.cloneNode(!0),r=t.content.cloneNode(!0),i=document.getElementById(“listing-delist-warning-container”),o=document.getElementById(“listing-delist-proceed-button-container”);i&&o&&(i.textContent=””,o.textContent=””,i.appendChild(r),o.appendChild(e))}}},95439:(e,t,n)=>{function r(e){let t=e.split(“\u200D”),n=0;for(let e of t)n+=Array.from(e.split(/[\ufe00-\ufe0f]/).join(“”)).length;return n/t.length}function i(e,t,n,r=!0){let o=e.value.substring(0,e.selectionEnd||0),a=e.value.substring(e.selectionEnd||0);return s(e,(o=o.replace(t,n))+(a=a.replace(t,n)),o.length,r),n}function o(e,t,n){if(null===e.selectionStart||null===e.selectionEnd)return i(e,t,n);let r=e.value.substring(0,e.selectionStart),o=e.value.substring(e.selectionEnd);return s(e,r+n+o,r.length),n}function a(e,t,n={}){let r=e.selectionEnd||0,i=e.value.substring(0,r),o=e.value.substring(r),s=(“”===e.value||i.match(/\n$/)?””:`
`)+t+(n.appendNewline?`
`:””);e.value=i+s+o;let l=r+s.length;return e.selectionStart=l,e.selectionEnd=l,e.dispatchEvent(new CustomEvent(“change”,{bubbles:!0,cancelable:!1})),e.focus(),s}function s(e,t,n,r=!0){e.value=t,r&&(e.selectionStart=n,e.selectionEnd=n),e.dispatchEvent(new CustomEvent(“change”,{bubbles:!0,cancelable:!1}))}function l(e,t){let n=[…e],r=new TextEncoder,i=new Uint8Array(4);for(let e=0;e=t))break}return t}n.d(t,{bV:()=>r,bc:()=>a,ee:()=>i,kN:()=>l,tJ:()=>o})}},e=>{e.O(0,[“vendors-node_modules_github_selector-observer_dist_index_esm_js”,”vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-9dc033″],()=>e(e.s=94156)),e.O()}]);
//# sourceMappingURL=marketplace-e6e14e73736c.js.map