PageSourceSearch

https://excamp.jp/_next/static/chunks/pages/host/dashboard/[id]/history-d9a311aa59a88ba8.js

js excamp.jp collected 2026-10-04 15:19:57 UTC 8,903 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2292],{93162:function(e,t,a){var n,c;void 0!==(c="function"==typeof(n=function(){"use strict";function t(e,t,a){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){s(n.response,t,a)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function c(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(a){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof a.g&&a.g.global===a.g?a.g:void 0,l=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(e,a,l){var s=o.URL||o.webkitURL,r=document.createElement("a");a=a||e.name||"download",r.download=a,r.rel="noopener","string"==typeof e?(r.href=e,r.origin===location.origin?c(r):n(r.href)?t(e,a,l):c(r,r.target="_blank")):(r.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(r.href)},4e4),setTimeout(function(){c(r)},0))}:"msSaveOrOpenBlob"in navigator?function(e,a,o){if(a=a||e.name||"download","string"!=typeof e){var l;navigator.msSaveOrOpenBlob((void 0===(l=o)?l={autoBom:!1}:"object"!=typeof l&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),a)}else if(n(e))t(e,a,o);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout(function(){c(s)})}}:function(e,a,n,c){if((c=c||open("","_blank"))&&(c.document.title=c.document.body.innerText="downloading..."),"string"==typeof e)return t(e,a,n);var s="application/octet-stream"===e.type,r=/constructor/i.test(o.HTMLElement)||o.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||s&&r||l)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=i?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),c?c.location.href=e:location=e,c=null},d.readAsDataURL(e)}else{var u=o.URL||o.webkitURL,m=u.createObjectURL(e);c?c.location=m:location.href=m,c=null,setTimeout(function(){u.revokeObjectURL(m)},4e4)}});o.saveAs=s.saveAs=s,e.exports=s})?n.apply(t,[]):n)&&(e.exports=c)},67480:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/host/dashboard/[id]/history",function(){return a(31935)}])},52514:function(e,t,a){"use strict";a.d(t,{M:function(){return s}});var n=a(85893),c=a(67294),o=a(9198),l=a.n(o);let s=(0,c.memo)(e=>{let[t,a]=(0,c.useState)(!1),o=(0,c.useCallback)(()=>{a(!1)},[]),s=(0,c.useCallback)(()=>{a(!0)},[]),r=(0,c.useCallback)(e=>{"Tab"===e.key&&o()},[]);return(0,n.jsx)(l(),{open:t,onFocus:s,onSelect:o,onBlur:o,onCalendarClose:o,onKeyDown:r,...e})})},31935:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return D}});var n=a(85893),c=a(55044),o=a(76743),l=a(67294),s=a(10682),r=a(34051),i=a(31555),d=a(28837),u=a(35005),m=a(83031),f=a.n(m),h=a(77349),p=a(97773),_=a(93162),v=a(52514),w=a(58284),g=e=>{var t;let a,{campsiteId:c}=e,{isAuthenticated:m}=(0,w.aC)(),[g,D]=(0,l.useState)({startDate:new Date,endDate:new Date}),{bookings:j}=(0,o.mk)(Number(c)),[b,x]=(0,l.useState)(void 0),{handleGetCampsite:y}=(0,o.m3)(),[k,N]=(0,l.useState)(void 0);(t=a||(a={})).None="none",t.Canceled="canceled",t.NotCanceled="not_canceled";let[C,E]=(0,l.useState)("none");(0,l.useEffect)(()=>{m&&(async()=>{let e=await y(c);e?N(e):alert("キャンプ場が見つかりませんでした。")})()},[m]);let M=(0,l.useCallback)(()=>{if(!b)return;let e={campsiteName:"キャンプサイト名",firstName:"FirstName",lastName:"LastName",createdAt:"予約日",checkinDate:"checkin_date",checkoutDate:"checkout_date",price:"販売価格",fee:"プラットフォーム手数料",rejectComment:"予約リクエスト",canceledAt:"キャンセル日",canceled:"キャンセル",numOfGuests:"人数"},t=b.map(e=>{let t=new Date(e.checkin_date),a=new Date(e.checkout_date),n=new Date(e.created_at),c=e.cancelled_at?new Date(e.cancelled_at):null;return{campsiteName:null==k?void 0:k.localized_name,firstName:e.user.first_name,lastName:e.user.last_name,createdAt:"".concat(n.getFullYear(),"/").concat(n.getMonth()+1,"/").concat(n.getDate()),checkinDate:"".concat(t.getFullYear(),"/").concat(t.getMonth()+1,"/").concat(t.getDate()),checkoutDate:"".concat(a.getFullYear(),"/").concat(a.getMonth()+1,"/").concat(a.getDate()),price:e.amount,fee:null==k?void 0:k.take_rate,rejectComment:e.reject_comment?e.reject_comment:"",canceledAt:c?"".concat(c.getFullYear(),"/").concat(c.getMonth()+1,"/").concat(c.getDate()):c,canceled:e.cancelled,numOfGuests:e.num_of_people}}),a=(e,t)=>null===t?"":t,n=Object.keys(e),c=t.map(e=>n.map(t=>JSON.stringify(e[t],a)).join(",")),o=Object.values(e);c.unshift(o.join(","));let l=new Blob([c.join("\r\n")],{type:"text/csv;charset=utf-8;"});(0,_.saveAs)(l,"booking_history.csv")},[b,k]),S=(0,l.useCallback)(()=>
1{if(g.startDate&&g.endDate){let e=j.filter(e=>{let t=new Date(e.checkin_date),a=new Date(e.checkout_date);return t>=g.startDate&&a<=g.endDate});"canceled"===C?e=e.filter(e=>!0===e.cancelled):"not_canceled"===C&&(e=e.filter(e=>!1===e.cancelled)),e.sort((e,t)=>new Date(e.checkin_date)>new Date(t.checkin_date)?1:-1),x(e)}},[g,C,j]);return(0,n.jsxs)(s.Z,{className:f().container,children:[(0,n.jsx)(r.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsx)("h3",{className:"mb-3",children:"支払い履歴"}),(0,n.jsx)("p",{children:"これまでの予約情報一覧を取得することができます。"})]})}),(0,n.jsx)(r.Z,{children:(0,n.jsx)(i.Z,{className:f().rangeSelector,children:(0,n.jsxs)(d.Z,{className:f().card,children:[(0,n.jsx)("p",{className:"mt-3",children:"集計開始期間"}),(0,n.jsx)(v.M,{className:"form-control rounded-0 mt-3",dateFormat:"yyyy-MM-dd",selected:g.startDate,placeholderText:"チェックイン日",autoComplete:"off",onChange:e=>{D(t=>t.endDate&&e>=t.endDate?{...t,startDate:e,endDate:(0,h.default)(e,1)}:{...g,startDate:e})},name:"startDate",selectsStart:!0,locale:"ja",startDate:g.startDate,endDate:g.endDate}),(0,n.jsx)("p",{className:"mt-3",children:"集計終了期間"}),(0,n.jsx)(v.M,{autoComplete:"off",className:"form-control rounded-0 mt-3",locale:"ja",name:"endDate",placeholderText:"チェックアウト日",dateFormat:"yyyy-MM-dd",selected:g.endDate,onChange:e=>D({...g,endDate:e}),selectsEnd:!0,startDate:g.startDate,endDate:g.endDate,minDate:(0,h.default)(g.startDate||new Date,1)}),(0,n.jsx)("p",{className:"mt-3",children:"キャンセル有無"}),(0,n.jsx)(p.ZP,{id:"long-value-select",instanceId:"long-value-select",options:[{value:"none",label:"未選択"},{value:"canceled",label:"キャンセル済み"},{value:"not_canceled",label:"未キャンセル"}],defaultValue:{value:"none",label:"未選択"},className:"mt-3",onChange:e=>{e&&("canceled"===e.value?E("canceled"):"not_canceled"===e.value?E("not_canceled"):E("none"))}})]})})}),(0,n.jsx)(r.Z,{children:(0,n.jsxs)(i.Z,{className:f().rangeSelector,children:[(0,n.jsx)(d.Z,{className:"".concat(f().card," mt-5 flex-row-reverse"),children:(0,n.jsx)(u.Z,{className:"".concat(f().btn," position-relative"),style:{width:"80px"},onClick:S,children:"検索"})}),(0,n.jsx)(d.Z,{className:"".concat(f().card," mt-4 flex-row-reverse"),children:(0,n.jsx)(u.Z,{className:"".concat(f().btn," position-relative"),style:{width:"120px"},onClick:M,children:"CSV出力"})})]})}),(0,n.jsx)(r.Z,{children:(0,n.jsx)(i.Z,{className:f().resultsCol,children:b&&b.length>0?b.map((e,t)=>{let a=new Date(e.checkin_date),c=new Date(e.checkout_date);return(0,n.jsx)(d.Z,{className:"".concat(f().resultCard," mt-3"),children:(0,n.jsxs)(r.Z,{children:[(0,n.jsxs)("p",{children:["予約ID:",e.uuid]}),(0,n.jsxs)("p",{children:[a.getFullYear(),"年",a.getMonth()+1,"月",a.getDate(),"日 -"," ",c.getFullYear(),"年",c.getMonth()+1,"月",c.getDate(),"日"]}),(0,n.jsx)("p",{children:null==k?void 0:k.localized_name})]})},t)}):(0,n.jsx)(d.Z,{className:"".concat(f().resultCard," mt-5"),children:(0,n.jsx)("p",{className:"m-0",children:"予約がありません。"})})})})]})},D=(0,c.t)(e=>{let{campsiteId:t}=e;return(0,n.jsx)(g,{campsiteId:t})})},83031:function(e){e.exports={container:"styles_container__bAb2k",rangeSelector:"styles_rangeSelector__QyQWO",card:"styles_card__Zbs_8",btn:"styles_btn__NEnkZ",resultsCol:"styles_resultsCol__an7pM",resultCard:"styles_resultCard__4XSWN"}}},function(e){e.O(0,[4617,8043,6646,3958,3058,2298,5260,7773,9198,5044,9774,2888,179],function(){return e(e.s=67480)}),_N_E=e.O()}]);

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.